Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 31 Jul 2010 02:01:11 +0000 (19:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 31 Jul 2010 02:01:11 +0000 (19:01 -0700)
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/edid: Fix the HDTV hack sync adjustment
  drm/radeon/kms: fix radeon mid power profile reporting

38 files changed:
Documentation/credentials.txt
MAINTAINERS
arch/arm/mach-davinci/board-da850-evm.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry64.S
arch/s390/kernel/time.c
arch/x86/kernel/kgdb.c
drivers/regulator/ab3100.c
drivers/regulator/tps6507x-regulator.c
drivers/regulator/wm8350-regulator.c
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_qdio.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ipr.c
drivers/scsi/ipr.h
fs/ceph/Kconfig
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mon_client.c
fs/ceph/osd_client.c
fs/ceph/osdmap.c
fs/cifs/dns_resolve.c
fs/cifs/dns_resolve.h
fs/ecryptfs/messaging.c
fs/gfs2/dir.c
fs/proc/array.c
include/linux/cred.h
include/linux/regulator/tps6507x.h [new file with mode: 0644]
include/linux/sched.h
kernel/cred.c
mm/memory.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_nvhdmi.c
sound/pci/hda/patch_realtek.c

index a2db352870036ba062aa177ce450d0d491f7d8c8..995baf379c076770962a84268fde19b527caa0be 100644 (file)
@@ -417,6 +417,9 @@ reference on them using:
 This does all the RCU magic inside of it.  The caller must call put_cred() on
 the credentials so obtained when they're finished with.
 
+ [*] Note: The result of __task_cred() should not be passed directly to
+     get_cred() as this may race with commit_cred().
+
 There are a couple of convenience functions to access bits of another task's
 credentials, hiding the RCU magic from the caller:
 
index db3d0f5061f9c42e301e420878b0dc5cbe31e6e1..02f75fccac20915ae4c7aad6b333ed0061f90e44 100644 (file)
@@ -6243,6 +6243,8 @@ F:        drivers/mmc/host/wbsd.*
 
 WATCHDOG DEVICE DRIVERS
 M:     Wim Van Sebroeck <wim@iguana.be>
+L:     linux-watchdog@vger.kernel.org
+W:     http://www.linux-watchdog.org/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
 S:     Maintained
 F:     Documentation/watchdog/
index 2ec3095ffb7b564e61a54bcc4e366f32b87e671c..b280efb1fa120806b1cfe85bdea1f90d1bc0caaf 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/mfd/tps6507x.h>
 #include <linux/input/tps6507x-ts.h>
 
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
        },
 };
 
+/* We take advantage of the fact that both defdcdc{2,3} are tied high */
+static struct tps6507x_reg_platform_data tps6507x_platform_data = {
+       .defdcdc_default = true,
+};
+
 struct regulator_init_data tps65070_regulator_data[] = {
        /* dcdc1 */
        {
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
                .consumer_supplies = tps65070_dcdc2_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* dcdc3 */
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = {
                },
                .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
                .consumer_supplies = tps65070_dcdc3_consumers,
+               .driver_data = &tps6507x_platform_data,
        },
 
        /* ldo1 */
index d5e3e60074472f8824f599d503c40744ad622ab0..bea9ee37ac9d2fc78cb9c5c7da4454bf529cb955 100644 (file)
@@ -535,8 +535,16 @@ pgm_no_vtime2:
        l       %r3,__LC_PGM_ILC        # load program interruption code
        la      %r8,0x7f
        nr      %r8,%r3                 # clear per-event-bit and ilc
-       be      BASED(pgm_exit)         # only per or per+check ?
-       b       BASED(pgm_do_call)
+       be      BASED(pgm_exit2)        # only per or per+check ?
+       l       %r7,BASED(.Ljump_table)
+       sll     %r8,2
+       l       %r7,0(%r8,%r7)          # load address of handler routine
+       la      %r2,SP_PTREGS(%r15)     # address of register-save area
+       basr    %r14,%r7                # branch to interrupt-handler
+pgm_exit2:
+       TRACE_IRQS_ON
+       stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
+       b       BASED(sysc_return)
 
 #
 # it was a single stepped SVC that is causing all the trouble
index e7192e1cb6785b24db347b2bbe2c22a469bdeb7d..8bccec15ea90086a557de590f90977d1e018cb4f 100644 (file)
@@ -544,8 +544,16 @@ pgm_no_vtime2:
        lgf     %r3,__LC_PGM_ILC        # load program interruption code
        lghi    %r8,0x7f
        ngr     %r8,%r3                 # clear per-event-bit and ilc
-       je      pgm_exit
-       j       pgm_do_call
+       je      pgm_exit2
+       sll     %r8,3
+       larl    %r1,pgm_check_table
+       lg      %r1,0(%r8,%r1)          # load address of handler routine
+       la      %r2,SP_PTREGS(%r15)     # address of register-save area
+       basr    %r14,%r1                # branch to interrupt-handler
+pgm_exit2:
+       TRACE_IRQS_ON
+       stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
+       j       sysc_return
 
 #
 # it was a single stepped SVC that is causing all the trouble
index a2163c95eb9845ffac908bf09b7af1bb5084cf3c..15a7536452d508b7998d37d9b679f4545d670dc1 100644 (file)
@@ -524,8 +524,11 @@ void etr_switch_to_local(void)
        if (!etr_eacr.sl)
                return;
        disable_sync_clock(NULL);
-       set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events);
-       queue_work(time_sync_wq, &etr_work);
+       if (!test_and_set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events)) {
+               etr_eacr.es = etr_eacr.sl = 0;
+               etr_setr(&etr_eacr);
+               queue_work(time_sync_wq, &etr_work);
+       }
 }
 
 /*
@@ -539,8 +542,11 @@ void etr_sync_check(void)
        if (!etr_eacr.es)
                return;
        disable_sync_clock(NULL);
-       set_bit(ETR_EVENT_SYNC_CHECK, &etr_events);
-       queue_work(time_sync_wq, &etr_work);
+       if (!test_and_set_bit(ETR_EVENT_SYNC_CHECK, &etr_events)) {
+               etr_eacr.es = 0;
+               etr_setr(&etr_eacr);
+               queue_work(time_sync_wq, &etr_work);
+       }
 }
 
 /*
@@ -902,7 +908,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib *aib,
         * Do not try to get the alternate port aib if the clock
         * is not in sync yet.
         */
-       if (!check_sync_clock())
+       if (!eacr.es || !check_sync_clock())
                return eacr;
 
        /*
@@ -1064,7 +1070,7 @@ static void etr_work_fn(struct work_struct *work)
         * If the clock is in sync just update the eacr and return.
         * If there is no valid sync port wait for a port update.
         */
-       if (check_sync_clock() || sync_port < 0) {
+       if ((eacr.es && check_sync_clock()) || sync_port < 0) {
                etr_update_eacr(eacr);
                etr_set_tolec_timeout(now);
                goto out_unlock;
index 4f4af75b94828af47b811b6b5c6a45e7c4ae650e..01ab17ae2ae72c7bdf2d2c4de2a51f19f59755bf 100644 (file)
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
        return NOTIFY_STOP;
 }
 
-#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
 int kgdb_ll_trap(int cmd, const char *str,
                 struct pt_regs *regs, long err, int trap, int sig)
 {
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str,
 
        return __kgdb_notify(&args, cmd);
 }
-#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
 
 static int
 kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
@@ -625,6 +623,12 @@ int kgdb_arch_init(void)
        return register_die_notifier(&kgdb_notifier);
 }
 
+static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi,
+               struct perf_sample_data *data, struct pt_regs *regs)
+{
+       kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP);
+}
+
 void kgdb_arch_late(void)
 {
        int i, cpu;
@@ -655,6 +659,7 @@ void kgdb_arch_late(void)
                for_each_online_cpu(cpu) {
                        pevent = per_cpu_ptr(breakinfo[i].pev, cpu);
                        pevent[0]->hw.sample_period = 1;
+                       pevent[0]->overflow_handler = kgdb_hw_overflow_handler;
                        if (pevent[0]->destroy != NULL) {
                                pevent[0]->destroy = NULL;
                                release_bp_slot(*pevent);
index 7b14a67bdca2df021e99b9615657da7d5bd3b361..11790990277a3dbd9a96ca2ba398f505480f5e19 100644 (file)
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg,
 {
        struct ab3100_regulator *abreg = reg->reg_data;
 
-       if (selector > abreg->voltages_len)
+       if (selector >= abreg->voltages_len)
                return -EINVAL;
        return abreg->typ_voltages[selector];
 }
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg)
        regval &= 0xE0;
        regval >>= 5;
 
-       if (regval > abreg->voltages_len) {
+       if (regval >= abreg->voltages_len) {
                dev_err(&reg->dev,
                        "regulator register %02x contains an illegal voltage setting\n",
                        abreg->regreg);
index 14b4576281c5e7e24fb5652d7383a6bb21df7dfe..8152d65220f5f342a7f312b326aff9c4047620c3 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/tps6507x.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/mfd/tps6507x.h>
@@ -101,9 +102,12 @@ struct tps_info {
        unsigned max_uV;
        u8 table_len;
        const u16 *table;
+
+       /* Does DCDC high or the low register defines output voltage? */
+       bool defdcdc_default;
 };
 
-static const struct tps_info tps6507x_pmic_regs[] = {
+static struct tps_info tps6507x_pmic_regs[] = {
        {
                .name = "VDCDC1",
                .min_uV = 725000,
@@ -145,7 +149,7 @@ struct tps6507x_pmic {
        struct regulator_desc desc[TPS6507X_NUM_REGULATOR];
        struct tps6507x_dev *mfd;
        struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR];
-       const struct tps_info *info[TPS6507X_NUM_REGULATOR];
+       struct tps_info *info[TPS6507X_NUM_REGULATOR];
        struct mutex io_lock;
 };
 static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg)
@@ -341,10 +345,16 @@ static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev)
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev,
                reg = TPS6507X_REG_DEFDCDC1;
                break;
        case TPS6507X_DCDC_2:
-               reg = TPS6507X_REG_DEFDCDC2_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC2_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC2_LOW;
                break;
        case TPS6507X_DCDC_3:
-               reg = TPS6507X_REG_DEFDCDC3_LOW;
+               if (tps->info[dcdc]->defdcdc_default)
+                       reg = TPS6507X_REG_DEFDCDC3_HIGH;
+               else
+                       reg = TPS6507X_REG_DEFDCDC3_LOW;
                break;
        default:
                return -EINVAL;
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
 {
        struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent);
        static int desc_id;
-       const struct tps_info *info = &tps6507x_pmic_regs[0];
+       struct tps_info *info = &tps6507x_pmic_regs[0];
        struct regulator_init_data *init_data;
        struct regulator_dev *rdev;
        struct tps6507x_pmic *tps;
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
        for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) {
                /* Register the regulators */
                tps->info[i] = info;
+               if (init_data->driver_data) {
+                       struct tps6507x_reg_platform_data *data =
+                                                       init_data->driver_data;
+                       tps->info[i]->defdcdc_default = data->defdcdc_default;
+               }
+
                tps->desc[i].name = info->name;
                tps->desc[i].id = desc_id++;
                tps->desc[i].n_voltages = num_voltages[i];
index 723cd1fb4867191078e3488ce3ff8267c8ec8f63..0e6ed7db93643436eadaeee5fbc48b7fd8ed599f 100644 (file)
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
        if (ret != 0) {
                dev_err(wm8350->dev, "Failed to register regulator %d: %d\n",
                        reg, ret);
-               platform_device_del(pdev);
+               platform_device_put(pdev);
                wm8350->pmic.pdev[reg] = NULL;
        }
 
index e3dbeda97179bccc814e424c705a53255ef61f54..fd068bc1bd0a11e5f7f698efa4d84f52a4df3073 100644 (file)
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
        if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
                return ZFCP_ERP_FAILED;
 
+       if (mempool_resize(act->adapter->pool.status_read_data,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
+       if (mempool_resize(act->adapter->pool.status_read_req,
+                          act->adapter->stat_read_buf_num, GFP_KERNEL))
+               return ZFCP_ERP_FAILED;
+
        atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
        if (zfcp_status_read_refill(act->adapter))
                return ZFCP_ERP_FAILED;
index 9ac6a6e4a6047531d142b86256c8266e5c411dfc..71663fb77310b5a51a9331d7210b978a444dd707 100644 (file)
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
 
        adapter->hydra_version = bottom->adapter_type;
        adapter->timer_ticks = bottom->timer_interval;
-       adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16);
+       adapter->stat_read_buf_num = max(bottom->status_read_buf_num,
+                                        (u16)FSF_STATUS_READS_RECOM);
 
        if (fc_host_permanent_port_name(shost) == -1)
                fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio,
        zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype,
                           req->qtcb, sizeof(struct fsf_qtcb));
 
-       if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) {
-               zfcp_fsf_req_free(req);
-               return ERR_PTR(-EIO);
-       }
-
        return req;
 }
 
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req,
        }
 
        /* use single, unchained SBAL if it can hold the request */
-       if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) {
+       if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) {
                zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req,
                                                sg_req, sg_resp);
                return 0;
index 28117e130e2c0848ddb64d3ac5c41c725fcd9bc9..6fa5e0453176e033b6c7367a07908cc15d035f8f 100644 (file)
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
        struct zfcp_qdio_queue *req_q = &qdio->req_q;
 
        spin_lock_bh(&qdio->req_q_lock);
-       if (atomic_read(&req_q->count))
+       if (atomic_read(&req_q->count) ||
+           !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
                return 1;
        spin_unlock_bh(&qdio->req_q_lock);
        return 0;
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
        spin_unlock_bh(&qdio->req_q_lock);
        ret = wait_event_interruptible_timeout(qdio->req_q_wq,
                               zfcp_qdio_sbal_check(qdio), 5 * HZ);
+
+       if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
+               return -EIO;
+
        if (ret > 0)
                return 0;
+
        if (!ret) {
                atomic_inc(&qdio->req_q_full);
                /* assume hanging outbound queue, try queue recovery */
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio)
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status);
        spin_unlock_bh(&qdio->req_q_lock);
 
+       wake_up(&qdio->req_q_wq);
+
        qdio_shutdown(qdio->adapter->ccw_device,
                      QDIO_FLAG_CLEANUP_USING_CLEAR);
 
index a864ccc0a342867d387c949e3e11b44ff071f95f..989b9a8ba72d7ab2cea41ad34797aa738f799129 100644 (file)
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto reg_crq_failed;
        }
 
+       queue->cur = 0;
+       spin_lock_init(&queue->lock);
+
+       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
+                    (unsigned long)hostdata);
+
        if (request_irq(vdev->irq,
                        rpavscsi_handle_event,
                        0, "ibmvscsi", (void *)hostdata) != 0) {
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue,
                goto req_irq_failed;
        }
 
-       queue->cur = 0;
-       spin_lock_init(&queue->lock);
-
-       tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
-                    (unsigned long)hostdata);
-
        return retrc;
 
       req_irq_failed:
+       tasklet_kill(&hostdata->srp_task);
        do {
                rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
        } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
index 82ea4a8226b0242040716134ab3f3efc19bdf254..f820cffb7f00e7f81fb00566711ee74efbbeab66 100644 (file)
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
 }
 
 /**
- * ipr_format_resource_path - Format the resource path for printing.
+ * ipr_format_res_path - Format the resource path for printing.
  * @res_path:  resource path
  * @buf:       buffer
  *
  * Return value:
  *     pointer to buffer
  **/
-static char *ipr_format_resource_path(u8 *res_path, char *buffer)
+static char *ipr_format_res_path(u8 *res_path, char *buffer, int len)
 {
        int i;
+       char *p = buffer;
 
-       sprintf(buffer, "%02X", res_path[0]);
-       for (i=1; res_path[i] != 0xff; i++)
-               sprintf(buffer, "%s-%02X", buffer, res_path[i]);
+       res_path[0] = '\0';
+       p += snprintf(p, buffer + len - p, "%02X", res_path[0]);
+       for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++)
+               p += snprintf(p, buffer + len - p, "-%02X", res_path[i]);
 
        return buffer;
 }
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
 
                if (res->sdev && new_path)
                        sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
        } else {
                res->flags = cfgtew->u.cfgte->flags;
                if (res->flags & IPR_IS_IOA_RESOURCE)
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err_separator;
 
                ipr_err("Device %d : %s", i + 1,
-                        ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(dev_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_log_ext_vpd(&dev_entry->vpd);
 
                ipr_err("-----New Device Information-----\n");
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n",
                                     path_active_desc[i].desc, path_state_desc[j].desc,
-                                    ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+                                    ipr_format_res_path(fabric->res_path, buffer,
+                                                        sizeof(buffer)));
                        return;
                }
        }
 
        ipr_err("Path state=%02X Resource Path=%s\n", path_state,
-               ipr_format_resource_path(&fabric->res_path[0], &buffer[0]));
+               ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer)));
 }
 
 static const struct {
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
 
                        ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n",
                                     path_status_desc[j].desc, path_type_desc[i].desc,
-                                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                                    ipr_format_res_path(cfg->res_path, buffer,
+                                                        sizeof(buffer)),
                                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
                        return;
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb,
        }
        ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s "
                     "WWN=%08X%08X\n", cfg->type_status,
-                    ipr_format_resource_path(&cfg->res_path[0], &buffer[0]),
+                    ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)),
                     link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK],
                     be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1]));
 }
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
 
        ipr_err("RAID %s Array Configuration: %s\n",
                error->protection_level,
-               ipr_format_resource_path(&error->last_res_path[0], &buffer[0]));
+               ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer)));
 
        ipr_err_separator;
 
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg,
                ipr_err("Array Member %d:\n", i);
                ipr_log_ext_vpd(&array_entry->vpd);
                ipr_err("Current Location: %s",
-                        ipr_format_resource_path(&array_entry->res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->res_path, buffer,
+                                            sizeof(buffer)));
                ipr_err("Expected Location: %s",
-                        ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0]));
+                        ipr_format_res_path(array_entry->expected_res_path,
+                                            buffer, sizeof(buffer)));
 
                ipr_err_separator;
        }
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = {
 };
 
 /**
- * ipr_show_resource_path - Show the resource path for this device.
+ * ipr_show_resource_path - Show the resource path or the resource address for
+ *                         this device.
  * @dev:       device struct
  * @buf:       buffer
  *
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut
 
        spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
        res = (struct ipr_resource_entry *)sdev->hostdata;
-       if (res)
+       if (res && ioa_cfg->sis64)
                len = snprintf(buf, PAGE_SIZE, "%s\n",
-                              ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                              ipr_format_res_path(res->res_path, buffer,
+                                                  sizeof(buffer)));
+       else if (res)
+               len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no,
+                              res->bus, res->target, res->lun);
+
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
        return len;
 }
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev)
                        scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
                if (ioa_cfg->sis64)
                        sdev_printk(KERN_INFO, sdev, "Resource path: %s\n",
-                                   ipr_format_resource_path(&res->res_path[0], &buffer[0]));
+                                   ipr_format_res_path(res->res_path, buffer,
+                                                       sizeof(buffer)));
                return 0;
        }
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
index 9ecd2259eb398dcc0f1e88746df8555dca09e80d..b965f3587c9d8afba54420e461464cf19a524356 100644 (file)
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header {
        if (ipr_is_device(hostrcb)) {                                   \
                if ((hostrcb)->ioa_cfg->sis64) {                        \
                        printk(KERN_ERR IPR_NAME ": %s: " fmt,          \
-                               ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \
-                                       &hostrcb->rp_buffer[0]),        \
+                               ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \
+                                       hostrcb->rp_buffer,             \
+                                       sizeof(hostrcb->rp_buffer)),    \
                                __VA_ARGS__);                           \
                } else {                                                \
                        ipr_ra_err((hostrcb)->ioa_cfg,                  \
index 04b8280582a94d2002cffb291b43f7fe586e6ff3..bc87b9c1d27ea8e253f5a1b9b395a287ede4106e 100644 (file)
@@ -2,7 +2,7 @@ config CEPH_FS
         tristate "Ceph distributed file system (EXPERIMENTAL)"
        depends on INET && EXPERIMENTAL
        select LIBCRC32C
-       select CONFIG_CRYPTO_AES
+       select CRYPTO_AES
        help
          Choose Y or M here to include support for mounting the
          experimental Ceph distributed file system.  Ceph is an extremely
index 74144d6389f0af2181d0f1e22fb4ae67c9839ca5..b81be9a5648792c3e6988855a903fb65473fa9c9 100644 (file)
@@ -627,7 +627,7 @@ retry:
        if (fmode >= 0)
                __ceph_get_fmode(ci, fmode);
        spin_unlock(&inode->i_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        }
 
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        return delayed;
 }
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
        else if (flushsnaps)
                ceph_flush_snaps(ci);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        if (put)
                iput(inode);
 }
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
                iput(inode);
        } else if (complete_capsnap) {
                ceph_flush_snaps(ci);
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
        }
        if (drop_capsnap)
                iput(inode);
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
        if (queue_invalidate)
                ceph_queue_invalidate(inode);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 
        if (check_caps == 1)
                ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY,
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                                         struct ceph_inode_info,
                                         i_flushing_item)->vfs_inode);
                mdsc->num_cap_flushing--;
-               wake_up(&mdsc->cap_flushing_wq);
+               wake_up_all(&mdsc->cap_flushing_wq);
                dout(" inode %p now !flushing\n", inode);
 
                if (ci->i_dirty_caps == 0) {
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                }
        }
        spin_unlock(&mdsc->cap_dirty_lock);
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
 
 out:
        spin_unlock(&inode->i_lock);
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry,
                memcpy(*p, dentry->d_name.name, dentry->d_name.len);
                *p += dentry->d_name.len;
                rel->dname_seq = cpu_to_le32(di->lease_seq);
+               __ceph_mdsc_drop_dentry_lease(dentry);
        }
        spin_unlock(&dentry->d_lock);
        return ret;
index f85719310db2f7aa48d15dee2b3b278e5e8375e0..f94ed3c7f6a5a862a3276b4b222231ab4c40e97f 100644 (file)
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
        spin_lock(&inode->i_lock);
        if ((filp->f_pos == 2 || fi->dentry) &&
            !ceph_test_opt(client, NOASYNCREADDIR) &&
+           ceph_snap(inode) != CEPH_SNAPDIR &&
            (ci->i_ceph_flags & CEPH_I_COMPLETE) &&
            __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) {
                err = __dcache_readdir(filp, dirent, filldir);
@@ -1013,18 +1014,22 @@ out_touch:
 
 /*
  * When a dentry is released, clear the dir I_COMPLETE if it was part
- * of the current dir gen.
+ * of the current dir gen or if this is in the snapshot namespace.
  */
 static void ceph_dentry_release(struct dentry *dentry)
 {
        struct ceph_dentry_info *di = ceph_dentry(dentry);
        struct inode *parent_inode = dentry->d_parent->d_inode;
+       u64 snapid = ceph_snap(parent_inode);
 
-       if (parent_inode) {
+       dout("dentry_release %p parent %p\n", dentry, parent_inode);
+
+       if (parent_inode && snapid != CEPH_SNAPDIR) {
                struct ceph_inode_info *ci = ceph_inode(parent_inode);
 
                spin_lock(&parent_inode->i_lock);
-               if (ci->i_shared_gen == di->lease_shared_gen) {
+               if (ci->i_shared_gen == di->lease_shared_gen ||
+                   snapid <= CEPH_MAXSNAP) {
                        dout(" clearing %p complete (d_release)\n",
                             parent_inode);
                        ci->i_ceph_flags &= ~CEPH_I_COMPLETE;
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = {
 
 struct dentry_operations ceph_snapdir_dentry_ops = {
        .d_revalidate = ceph_snapdir_d_revalidate,
+       .d_release = ceph_dentry_release,
 };
 
 struct dentry_operations ceph_snap_dentry_ops = {
+       .d_release = ceph_dentry_release,
 };
index 6251a1574b9473b7e267c987cd6f9613e49eb57f..7c08698fad3ef6a3aa4502f7ff1b830cde33146f 100644 (file)
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file)
        kmem_cache_free(ceph_file_cachep, cf);
 
        /* wake up anyone waiting for caps on this inode */
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        return 0;
 }
 
index 8f9b9fe8ef9f4a84056c16289650d482a8c0c8ff..389f9dbd9949557add69369e6fc4ba68e2c84e69 100644 (file)
@@ -1199,8 +1199,10 @@ retry_lookup:
                                goto out;
                        }
                        err = ceph_init_dentry(dn);
-                       if (err < 0)
+                       if (err < 0) {
+                               dput(dn);
                                goto out;
+                       }
                } else if (dn->d_inode &&
                           (ceph_ino(dn->d_inode) != vino.ino ||
                            ceph_snap(dn->d_inode) != vino.snap)) {
@@ -1499,7 +1501,7 @@ retry:
        if (wrbuffer_refs == 0)
                ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL);
        if (wake)
-               wake_up(&ci->i_cap_wq);
+               wake_up_all(&ci->i_cap_wq);
 }
 
 
index 416c08d315db52a409e85cc094588d3b5bfceed5..dd440bd438a930a5dbd30cfa5e6ea63ae24f5947 100644 (file)
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
 
-       wake_up(&ci->i_cap_wq);
+       wake_up_all(&ci->i_cap_wq);
        if (arg) {
                spin_lock(&inode->i_lock);
                ci->i_wanted_max_size = 0;
@@ -1564,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc,
        if (req->r_callback)
                req->r_callback(mdsc, req);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 }
 
 /*
@@ -1932,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
        if (head->safe) {
                req->r_got_safe = true;
                __unregister_request(mdsc, req);
-               complete(&req->r_safe_completion);
+               complete_all(&req->r_safe_completion);
 
                if (req->r_got_unsafe) {
                        /*
@@ -1947,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 
                        /* last unsafe request during umount? */
                        if (mdsc->stopping && !__get_oldest_req(mdsc))
-                               complete(&mdsc->safe_umount_waiters);
+                               complete_all(&mdsc->safe_umount_waiters);
                        mutex_unlock(&mdsc->mutex);
                        goto out;
                }
@@ -2126,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session,
                        pr_info("mds%d reconnect denied\n", session->s_mds);
                remove_session_caps(session);
                wake = 1; /* for good measure */
-               complete(&mdsc->session_close_waiters);
+               complete_all(&mdsc->session_close_waiters);
                kick_requests(mdsc, mds);
                break;
 
index cc115eafae11e23702cc38b7b015f8cf1d7c597c..54fe01c50706a935da2a9611677320bebae8b967 100644 (file)
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc,
 
 out:
        mutex_unlock(&monc->mutex);
-       wake_up(&client->auth_wq);
+       wake_up_all(&client->auth_wq);
 }
 
 /*
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc,
        }
        mutex_unlock(&monc->mutex);
        if (req) {
-               complete(&req->completion);
+               complete_all(&req->completion);
                put_generic_request(req);
        }
        return;
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
                                     monc->m_auth->front_max);
        if (ret < 0) {
                monc->client->auth_err = ret;
-               wake_up(&monc->client->auth_wq);
+               wake_up_all(&monc->client->auth_wq);
        } else if (ret > 0) {
                __send_prepared_auth_request(monc, ret);
        } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) {
index 92b7251a53f1415275ba8fd0a2d09f3b0cac6010..e38522347898046fe778df23bdc467c5d4248363 100644 (file)
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
        if (req->r_callback)
                req->r_callback(req, msg);
        else
-               complete(&req->r_completion);
+               complete_all(&req->r_completion);
 
        if (flags & CEPH_OSD_FLAG_ONDISK) {
                if (req->r_safe_callback)
                        req->r_safe_callback(req, msg);
-               complete(&req->r_safe_completion);  /* fsync waiter */
+               complete_all(&req->r_safe_completion);  /* fsync waiter */
        }
 
 done:
@@ -1083,7 +1083,7 @@ done:
        if (newmap)
                kick_requests(osdc, NULL);
        up_read(&osdc->map_sem);
-       wake_up(&osdc->client->auth_wq);
+       wake_up_all(&osdc->client->auth_wq);
        return;
 
 bad:
index 277f8b33957757ef506f6ac18816699b6b8156da..416d46adbf87208544a1813ddfdadbabf4beb511 100644 (file)
@@ -831,12 +831,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                /* remove any? */
                while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping,
                                                node)->pgid, pgid) <= 0) {
-                       struct rb_node *cur = rbp;
+                       struct ceph_pg_mapping *cur =
+                               rb_entry(rbp, struct ceph_pg_mapping, node);
+                       
                        rbp = rb_next(rbp);
-                       dout(" removed pg_temp %llx\n",
-                            *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                              node)->pgid);
-                       rb_erase(cur, &map->pg_temp);
+                       dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+                       rb_erase(&cur->node, &map->pg_temp);
+                       kfree(cur);
                }
 
                if (pglen) {
@@ -852,19 +853,22 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
                        for (j = 0; j < pglen; j++)
                                pg->osds[j] = ceph_decode_32(p);
                        err = __insert_pg_mapping(pg, &map->pg_temp);
-                       if (err)
+                       if (err) {
+                               kfree(pg);
                                goto bad;
+                       }
                        dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid,
                             pglen);
                }
        }
        while (rbp) {
-               struct rb_node *cur = rbp;
+               struct ceph_pg_mapping *cur =
+                       rb_entry(rbp, struct ceph_pg_mapping, node);
+
                rbp = rb_next(rbp);
-               dout(" removed pg_temp %llx\n",
-                    *(u64 *)&rb_entry(cur, struct ceph_pg_mapping,
-                                      node)->pgid);
-               rb_erase(cur, &map->pg_temp);
+               dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid);
+               rb_erase(&cur->node, &map->pg_temp);
+               kfree(cur);
        }
 
        /* ignore the rest */
index 49315cbf742d7ab22876b69349b6441723d850b7..853a968e82d74731b0c93083b238bca1ef5c96a1 100644 (file)
@@ -227,7 +227,7 @@ failed_put_cred:
        return ret;
 }
 
-void __exit cifs_exit_dns_resolver(void)
+void cifs_exit_dns_resolver(void)
 {
        key_revoke(dns_resolver_cache->thread_keyring);
        unregister_key_type(&key_type_dns_resolver);
index 26b9eaa9f5ee5898ae4241412e4127512fc95ec4..5d7f291df162731bb58abc124242211a88c0ad37 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifdef __KERNEL__
 extern int __init cifs_init_dns_resolver(void);
-extern void __exit cifs_exit_dns_resolver(void);
+extern void cifs_exit_dns_resolver(void);
 extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr);
 #endif /* KERNEL */
 
index 2d8dbce9d485e4a453903eb1f93473c5942155cc..46c4dd8dfcc3749acc04a03377c6740e280c519c 100644 (file)
@@ -31,9 +31,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux;
 
 static struct hlist_head *ecryptfs_daemon_hash;
 struct mutex ecryptfs_daemon_hash_mux;
-static int ecryptfs_hash_buckets;
+static int ecryptfs_hash_bits;
 #define ecryptfs_uid_hash(uid) \
-        hash_long((unsigned long)uid, ecryptfs_hash_buckets)
+        hash_long((unsigned long)uid, ecryptfs_hash_bits)
 
 static u32 ecryptfs_msg_counter;
 static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
@@ -486,18 +486,19 @@ int ecryptfs_init_messaging(void)
        }
        mutex_init(&ecryptfs_daemon_hash_mux);
        mutex_lock(&ecryptfs_daemon_hash_mux);
-       ecryptfs_hash_buckets = 1;
-       while (ecryptfs_number_of_users >> ecryptfs_hash_buckets)
-               ecryptfs_hash_buckets++;
+       ecryptfs_hash_bits = 1;
+       while (ecryptfs_number_of_users >> ecryptfs_hash_bits)
+               ecryptfs_hash_bits++;
        ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head)
-                                       * ecryptfs_hash_buckets), GFP_KERNEL);
+                                       * (1 << ecryptfs_hash_bits)),
+                                      GFP_KERNEL);
        if (!ecryptfs_daemon_hash) {
                rc = -ENOMEM;
                printk(KERN_ERR "%s: Failed to allocate memory\n", __func__);
                mutex_unlock(&ecryptfs_daemon_hash_mux);
                goto out;
        }
-       for (i = 0; i < ecryptfs_hash_buckets; i++)
+       for (i = 0; i < (1 << ecryptfs_hash_bits); i++)
                INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]);
        mutex_unlock(&ecryptfs_daemon_hash_mux);
        ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx)
@@ -554,7 +555,7 @@ void ecryptfs_release_messaging(void)
                int i;
 
                mutex_lock(&ecryptfs_daemon_hash_mux);
-               for (i = 0; i < ecryptfs_hash_buckets; i++) {
+               for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
                        int rc;
 
                        hlist_for_each_entry(daemon, elem,
index 26ca3361a8bcc3525758ed00c6186fb62494a6e3..6b48d7c268b24b65fae281e606fa32080490cf78 100644 (file)
@@ -1231,6 +1231,25 @@ static int do_filldir_main(struct gfs2_inode *dip, u64 *offset,
        return 0;
 }
 
+static void *gfs2_alloc_sort_buffer(unsigned size)
+{
+       void *ptr = NULL;
+
+       if (size < KMALLOC_MAX_SIZE)
+               ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN);
+       if (!ptr)
+               ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL);
+       return ptr;
+}
+
+static void gfs2_free_sort_buffer(void *ptr)
+{
+       if (is_vmalloc_addr(ptr))
+               vfree(ptr);
+       else
+               kfree(ptr);
+}
+
 static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                              filldir_t filldir, int *copied, unsigned *depth,
                              u64 leaf_no)
@@ -1271,7 +1290,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
         * 99 is the maximum number of entries that can fit in a single
         * leaf block.
         */
-       larr = vmalloc((leaves + entries + 99) * sizeof(void *));
+       larr = gfs2_alloc_sort_buffer((leaves + entries + 99) * sizeof(void *));
        if (!larr)
                goto out;
        darr = (const struct gfs2_dirent **)(larr + leaves);
@@ -1282,7 +1301,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        do {
                error = get_leaf(ip, lfn, &bh);
                if (error)
-                       goto out_kfree;
+                       goto out_free;
                lf = (struct gfs2_leaf *)bh->b_data;
                lfn = be64_to_cpu(lf->lf_next);
                if (lf->lf_entries) {
@@ -1291,7 +1310,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                                gfs2_dirent_gather, NULL, &g);
                        error = PTR_ERR(dent);
                        if (IS_ERR(dent))
-                               goto out_kfree;
+                               goto out_free;
                        if (entries2 != g.offset) {
                                fs_warn(sdp, "Number of entries corrupt in dir "
                                                "leaf %llu, entries2 (%u) != "
@@ -1300,7 +1319,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
                                        entries2, g.offset);
                                        
                                error = -EIO;
-                               goto out_kfree;
+                               goto out_free;
                        }
                        error = 0;
                        larr[leaf++] = bh;
@@ -1312,10 +1331,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque,
        BUG_ON(entries2 != entries);
        error = do_filldir_main(ip, offset, opaque, filldir, darr,
                                entries, copied);
-out_kfree:
+out_free:
        for(i = 0; i < leaf; i++)
                brelse(larr[i]);
-       vfree(larr);
+       gfs2_free_sort_buffer(larr);
 out:
        return error;
 }
index 9b58d38bc911e27faccc7ed9ffb2c53f0885df4a..fff6572676aed7bd337b737da35221af8fa070bb 100644 (file)
@@ -176,7 +176,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
                if (tracer)
                        tpid = task_pid_nr_ns(tracer, ns);
        }
-       cred = get_cred((struct cred *) __task_cred(p));
+       cred = get_task_cred(p);
        seq_printf(m,
                "State:\t%s\n"
                "Tgid:\t%d\n"
index 75c0fa8813088c31148be71b7cbff77670b6e5d0..4d2c39573f3694cdeef07d83c6f141b4804a5f36 100644 (file)
@@ -153,6 +153,7 @@ struct cred {
 extern void __put_cred(struct cred *);
 extern void exit_creds(struct task_struct *);
 extern int copy_creds(struct task_struct *, unsigned long);
+extern const struct cred *get_task_cred(struct task_struct *);
 extern struct cred *cred_alloc_blank(void);
 extern struct cred *prepare_creds(void);
 extern struct cred *prepare_exec_creds(void);
@@ -273,33 +274,18 @@ static inline void put_cred(const struct cred *_cred)
  * @task: The task to query
  *
  * Access the objective credentials of a task.  The caller must hold the RCU
- * readlock.
+ * readlock or the task must be dead and unable to change its own credentials.
  *
- * The caller must make sure task doesn't go away, either by holding a ref on
- * task or by holding tasklist_lock to prevent it from being unlinked.
+ * The result of this function should not be passed directly to get_cred();
+ * rather get_task_cred() should be used instead.
  */
-#define __task_cred(task) \
-       ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held())))
-
-/**
- * get_task_cred - Get another task's objective credentials
- * @task: The task to query
- *
- * Get the objective credentials of a task, pinning them so that they can't go
- * away.  Accessing a task's credentials directly is not permitted.
- *
- * The caller must make sure task doesn't go away, either by holding a ref on
- * task or by holding tasklist_lock to prevent it from being unlinked.
- */
-#define get_task_cred(task)                            \
-({                                                     \
-       struct cred *__cred;                            \
-       rcu_read_lock();                                \
-       __cred = (struct cred *) __task_cred((task));   \
-       get_cred(__cred);                               \
-       rcu_read_unlock();                              \
-       __cred;                                         \
-})
+#define __task_cred(task)                                              \
+       ({                                                              \
+               const struct task_struct *__t = (task);                 \
+               rcu_dereference_check(__t->real_cred,                   \
+                                     rcu_read_lock_held() ||           \
+                                     task_is_dead(__t));               \
+       })
 
 /**
  * get_current_cred - Get the current task's subjective credentials
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h
new file mode 100644 (file)
index 0000000..4892f59
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * tps6507x.h  --  Voltage regulation for the Texas Instruments TPS6507X
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+#ifndef REGULATOR_TPS6507X
+#define REGULATOR_TPS6507X
+
+/**
+ * tps6507x_reg_platform_data - platform data for tps6507x
+ * @defdcdc_default: Defines whether DCDC high or the low register controls
+ *     output voltage by default. Valid for DCDC2 and DCDC3 outputs only.
+ */
+struct tps6507x_reg_platform_data {
+       bool defdcdc_default;
+};
+
+#endif
index 747fcaedddb70d6cb0a49b43c0d2f2a6f23a693f..0478888c6899d3c59a1649d38dfdd58030f14918 100644 (file)
@@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!(
 
 #define task_is_traced(task)   ((task->state & __TASK_TRACED) != 0)
 #define task_is_stopped(task)  ((task->state & __TASK_STOPPED) != 0)
+#define task_is_dead(task)     ((task)->exit_state != 0)
 #define task_is_stopped_or_traced(task)        \
                        ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
 #define task_contributes_to_load(task) \
index a2d5504fbcc24abb44c44a158521617933df4367..60bc8b1e32e632eb2a51b318f1ae35486d01174f 100644 (file)
@@ -209,6 +209,31 @@ void exit_creds(struct task_struct *tsk)
        }
 }
 
+/**
+ * get_task_cred - Get another task's objective credentials
+ * @task: The task to query
+ *
+ * Get the objective credentials of a task, pinning them so that they can't go
+ * away.  Accessing a task's credentials directly is not permitted.
+ *
+ * The caller must also make sure task doesn't get deleted, either by holding a
+ * ref on task or by holding tasklist_lock to prevent it from being unlinked.
+ */
+const struct cred *get_task_cred(struct task_struct *task)
+{
+       const struct cred *cred;
+
+       rcu_read_lock();
+
+       do {
+               cred = __task_cred((task));
+               BUG_ON(!cred);
+       } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage));
+
+       rcu_read_unlock();
+       return cred;
+}
+
 /*
  * Allocate blank credentials, such that the credentials can be filled in at a
  * later date without risk of ENOMEM.
index 119b7ccdf39b8ee542d3f4d695bff3c9d5322987..bde42c6d3633f15cfe51b1eae8e3e56833e86955 100644 (file)
@@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
                                return i ? : -EFAULT;
                        }
                        if (pages) {
-                               struct page *page = vm_normal_page(gate_vma, start, *pte);
+                               struct page *page;
+
+                               page = vm_normal_page(gate_vma, start, *pte);
+                               if (!page) {
+                                       if (!(gup_flags & FOLL_DUMP) &&
+                                            is_zero_pfn(pte_pfn(*pte)))
+                                               page = pte_page(*pte);
+                                       else {
+                                               pte_unmap(pte);
+                                               return i ? : -EFAULT;
+                                       }
+                               }
                                pages[i] = page;
-                               if (page)
-                                       get_page(page);
+                               get_page(page);
                        }
                        pte_unmap(pte);
                        if (vmas)
index 86067ee786324b294be637b202b5c16e381724d0..2fc53961054ede2dc5cf3b1e62cede04a86c389a 100644 (file)
@@ -52,6 +52,10 @@ struct hdmi_spec {
         */
        struct hda_multi_out multiout;
        unsigned int codec_type;
+
+       /* misc flags */
+       /* PD bit indicates only the update, not the current state */
+       unsigned int old_pin_detect:1;
 };
 
 
@@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
  * Unsolicited events
  */
 
+static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid,
+                              struct hdmi_eld *eld);
+
 static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
 {
        struct hdmi_spec *spec = codec->spec;
@@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
        if (index < 0)
                return;
 
+       if (spec->old_pin_detect) {
+               if (pind)
+                       hdmi_present_sense(codec, tag, &spec->sink_eld[index]);
+               pind = spec->sink_eld[index].monitor_present;
+       }
+
        spec->sink_eld[index].monitor_present = pind;
        spec->sink_eld[index].eld_valid = eldv;
 
index 3c10c0b149f4c682d683a6ae21ae837b3fe18f4d..b0652acee9b2725541dc99df2af68513aa84009c 100644 (file)
@@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec)
 
        codec->spec = spec;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP89;
+       spec->old_pin_detect = 1;
 
        if (hdmi_parse_codec(codec) < 0) {
                codec->spec = NULL;
@@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
        spec->multiout.max_channels = 8;
        spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
+       spec->old_pin_detect = 1;
 
        codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
 
@@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
        spec->multiout.max_channels = 2;
        spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x;
        spec->codec_type = HDA_CODEC_NVIDIA_MCP7X;
+       spec->old_pin_detect = 1;
 
        codec->patch_ops = nvhdmi_patch_ops_2ch;
 
index ff614dd824c1fe97cbfe9ee378b744676bc50e93..596ea2f12cf60a74504efc751a9566265d7b3aeb 100644 (file)
@@ -1267,11 +1267,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
        unsigned nid = 0;
        struct alc_spec *spec = codec->spec;
 
+       spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
+
        ass = codec->subsystem_id & 0xffff;
-       if (ass != codec->bus->pci->subsystem_device && (ass & 1)) {
-               spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
+       if (ass != codec->bus->pci->subsystem_device && (ass & 1))
                goto do_sku;
-       }
 
        nid = 0x1d;
        if (codec->vendor_id == 0x10ec0260)
@@ -5180,8 +5180,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids,
 #ifdef CONFIG_SND_HDA_INPUT_BEEP
 #define set_beep_amp(spec, nid, idx, dir) \
        ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
+
+static struct snd_pci_quirk beep_white_list[] = {
+       SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
+       {}
+};
+
+static inline int has_cdefine_beep(struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+       const struct snd_pci_quirk *q;
+       q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
+       if (q)
+               return q->value;
+       return spec->cdefine.enable_pcbeep;
+}
 #else
 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
+#define has_cdefine_beep(codec)                0
 #endif
 
 /*
@@ -10566,10 +10582,12 @@ static int patch_alc882(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC882_AUTO)
@@ -10619,7 +10637,7 @@ static int patch_alc882(struct hda_codec *codec)
 
        set_capture_mixer(codec);
 
-       if (spec->cdefine.enable_pcbeep)
+       if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
        if (board_config == ALC882_AUTO)
@@ -12435,7 +12453,7 @@ static int patch_alc262(struct hda_codec *codec)
                }
        }
 
-       if (!spec->no_analog) {
+       if (!spec->no_analog && has_cdefine_beep(codec)) {
                err = snd_hda_attach_beep_device(codec, 0x1);
                if (err < 0) {
                        alc_free(codec);
@@ -12486,7 +12504,7 @@ static int patch_alc262(struct hda_codec *codec)
        }
        if (!spec->cap_mixer && !spec->no_analog)
                set_capture_mixer(codec);
-       if (!spec->no_analog && spec->cdefine.enable_pcbeep)
+       if (!spec->no_analog && has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
        spec->vmaster_nid = 0x0c;
@@ -14458,10 +14476,12 @@ static int patch_alc269(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC269_AUTO)
@@ -14494,7 +14514,7 @@ static int patch_alc269(struct hda_codec *codec)
 
        if (!spec->cap_mixer)
                set_capture_mixer(codec);
-       if (spec->cdefine.enable_pcbeep)
+       if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
 
        if (board_config == ALC269_AUTO)
@@ -18691,10 +18711,12 @@ static int patch_alc662(struct hda_codec *codec)
                }
        }
 
-       err = snd_hda_attach_beep_device(codec, 0x1);
-       if (err < 0) {
-               alc_free(codec);
-               return err;
+       if (has_cdefine_beep(codec)) {
+               err = snd_hda_attach_beep_device(codec, 0x1);
+               if (err < 0) {
+                       alc_free(codec);
+                       return err;
+               }
        }
 
        if (board_config != ALC662_AUTO)
@@ -18716,7 +18738,7 @@ static int patch_alc662(struct hda_codec *codec)
        if (!spec->cap_mixer)
                set_capture_mixer(codec);
 
-       if (spec->cdefine.enable_pcbeep) {
+       if (has_cdefine_beep(codec)) {
                switch (codec->vendor_id) {
                case 0x10ec0662:
                        set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);