Merge branches 'bugzilla-14337', 'bugzilla-14998', 'bugzilla-15407', 'bugzilla-15903...
authorLen Brown <len.brown@intel.com>
Fri, 7 May 2010 02:04:31 +0000 (22:04 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 7 May 2010 02:04:31 +0000 (22:04 -0400)
15 files changed:
Documentation/DocBook/libata.tmpl
drivers/acpi/acpi_pad.c
drivers/acpi/bus.c
drivers/acpi/hest.c
drivers/acpi/power_meter.c
drivers/acpi/sbshc.c
drivers/ata/pata_pcmcia.c
drivers/ide/ide-cs.c
drivers/mtd/internal.h [deleted file]
drivers/mtd/mtdbdi.c [deleted file]
drivers/pnp/pnpacpi/rsparser.c
drivers/pnp/resource.c
mm/slub.c
security/keys/keyring.c
security/keys/request_key.c

index ba99757..ff3e5be 100644 (file)
@@ -107,10 +107,6 @@ void (*dev_config) (struct ata_port *, struct ata_device *);
        issue of SET FEATURES - XFER MODE, and prior to operation.
        </para>
        <para>
-       Called by ata_device_add() after ata_dev_identify() determines
-       a device is present.
-       </para>
-       <para>
        This entry may be specified as NULL in ata_port_operations.
        </para>
 
@@ -154,8 +150,8 @@ unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned in
 
        <sect2><title>Taskfile read/write</title>
        <programlisting>
-void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
-void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
+void (*sff_tf_load) (struct ata_port *ap, struct ata_taskfile *tf);
+void (*sff_tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
        </programlisting>
 
        <para>
@@ -164,36 +160,35 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
        hardware registers / DMA buffers, to obtain the current set of
        taskfile register values.
        Most drivers for taskfile-based hardware (PIO or MMIO) use
-       ata_tf_load() and ata_tf_read() for these hooks.
+       ata_sff_tf_load() and ata_sff_tf_read() for these hooks.
        </para>
 
        </sect2>
 
        <sect2><title>PIO data read/write</title>
        <programlisting>
-void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
+void (*sff_data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
        </programlisting>
 
        <para>
 All bmdma-style drivers must implement this hook.  This is the low-level
 operation that actually copies the data bytes during a PIO data
 transfer.
-Typically the driver
-will choose one of ata_pio_data_xfer_noirq(), ata_pio_data_xfer(), or
-ata_mmio_data_xfer().
+Typically the driver will choose one of ata_sff_data_xfer_noirq(),
+ata_sff_data_xfer(), or ata_sff_data_xfer32().
        </para>
 
        </sect2>
 
        <sect2><title>ATA command execute</title>
        <programlisting>
-void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
+void (*sff_exec_command)(struct ata_port *ap, struct ata_taskfile *tf);
        </programlisting>
 
        <para>
        causes an ATA command, previously loaded with
        ->tf_load(), to be initiated in hardware.
-       Most drivers for taskfile-based hardware use ata_exec_command()
+       Most drivers for taskfile-based hardware use ata_sff_exec_command()
        for this hook.
        </para>
 
@@ -218,8 +213,8 @@ command.
 
        <sect2><title>Read specific ATA shadow registers</title>
        <programlisting>
-u8   (*check_status)(struct ata_port *ap);
-u8   (*check_altstatus)(struct ata_port *ap);
+u8   (*sff_check_status)(struct ata_port *ap);
+u8   (*sff_check_altstatus)(struct ata_port *ap);
        </programlisting>
 
        <para>
@@ -227,20 +222,14 @@ u8   (*check_altstatus)(struct ata_port *ap);
        hardware.  On some hardware, reading the Status register has
        the side effect of clearing the interrupt condition.
        Most drivers for taskfile-based hardware use
-       ata_check_status() for this hook.
-       </para>
-       <para>
-       Note that because this is called from ata_device_add(), at
-       least a dummy function that clears device interrupts must be
-       provided for all drivers, even if the controller doesn't
-       actually have a taskfile status register.
+       ata_sff_check_status() for this hook.
        </para>
 
        </sect2>
 
        <sect2><title>Select ATA device on bus</title>
        <programlisting>
-void (*dev_select)(struct ata_port *ap, unsigned int device);
+void (*sff_dev_select)(struct ata_port *ap, unsigned int device);
        </programlisting>
 
        <para>
@@ -251,9 +240,7 @@ void (*dev_select)(struct ata_port *ap, unsigned int device);
        </para>
        <para>
        Most drivers for taskfile-based hardware use
-       ata_std_dev_select() for this hook.  Controllers which do not
-       support second drives on a port (such as SATA contollers) will
-       use ata_noop_dev_select().
+       ata_sff_dev_select() for this hook.
        </para>
 
        </sect2>
@@ -441,13 +428,13 @@ void (*irq_clear) (struct ata_port *);
        to struct ata_host_set.
        </para>
        <para>
-       Most legacy IDE drivers use ata_interrupt() for the
+       Most legacy IDE drivers use ata_sff_interrupt() for the
        irq_handler hook, which scans all ports in the host_set,
        determines which queued command was active (if any), and calls
-       ata_host_intr(ap,qc).
+       ata_sff_host_intr(ap,qc).
        </para>
        <para>
-       Most legacy IDE drivers use ata_bmdma_irq_clear() for the
+       Most legacy IDE drivers use ata_sff_irq_clear() for the
        irq_clear() hook, which simply clears the interrupt and error
        flags in the DMA status register.
        </para>
@@ -496,10 +483,6 @@ void (*host_stop) (struct ata_host_set *host_set);
        data from port at this time.
        </para>
        <para>
-       Many drivers use ata_port_stop() as this hook, which frees the
-       PRD table.
-       </para>
-       <para>
        ->host_stop() is called after all ->port_stop() calls
 have completed.  The hook must finalize hardware shutdown, release DMA
 and other resources, etc.
index 19dacfd..6212213 100644 (file)
@@ -31,7 +31,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#define ACPI_PROCESSOR_AGGREGATOR_CLASS        "processor_aggregator"
+#define ACPI_PROCESSOR_AGGREGATOR_CLASS        "acpi_pad"
 #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
 #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
 static DEFINE_MUTEX(isolated_cpus_lock);
index 37132dc..743576b 100644 (file)
@@ -527,7 +527,7 @@ int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id,
        if (!event_is_open)
                return 0;
 
-       event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
+       event = kzalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
        if (!event)
                return -ENOMEM;
 
index 4bb18c9..1c527a1 100644 (file)
@@ -123,6 +123,10 @@ int acpi_hest_firmware_first_pci(struct pci_dev *pci)
 {
        acpi_status status = AE_NOT_FOUND;
        struct acpi_table_header *hest = NULL;
+
+       if (acpi_disabled)
+               return 0;
+
        status = acpi_get_table(ACPI_SIG_HEST, 1, &hest);
 
        if (ACPI_SUCCESS(status)) {
index e8c32a4..66f6729 100644 (file)
@@ -35,7 +35,7 @@
 #define ACPI_POWER_METER_NAME          "power_meter"
 ACPI_MODULE_NAME(ACPI_POWER_METER_NAME);
 #define ACPI_POWER_METER_DEVICE_NAME   "Power Meter"
-#define ACPI_POWER_METER_CLASS         "power_meter_resource"
+#define ACPI_POWER_METER_CLASS         "pwr_meter_resource"
 
 #define NUM_SENSORS                    17
 
index 36704b8..f8be23b 100644 (file)
@@ -18,7 +18,7 @@
 
 #define PREFIX "ACPI: "
 
-#define ACPI_SMB_HC_CLASS      "smbus_host_controller"
+#define ACPI_SMB_HC_CLASS      "smbus_host_ctl"
 #define ACPI_SMB_HC_DEVICE_NAME        "ACPI SMBus HC"
 
 struct acpi_smb_hc {
index 4164dd2..d94b8f0 100644 (file)
@@ -424,7 +424,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
        PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
        PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
        PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
-       PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
+       PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb),
        PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
        PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
        PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
@@ -446,7 +446,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
-       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
+       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
        PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
        PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
index defce28..b854508 100644 (file)
@@ -409,7 +409,7 @@ static struct pcmcia_device_id ide_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420),
        PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178),
        PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753),
-       PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17),
+       PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb),
        PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10),
        PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e),
        PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2      ", 0x547e66dc, 0x8671043b),
@@ -431,7 +431,7 @@ static struct pcmcia_device_id ide_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8),
-       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d),
+       PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133),
        PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47),
        PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
        PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918),
diff --git a/drivers/mtd/internal.h b/drivers/mtd/internal.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/drivers/mtd/mtdbdi.c b/drivers/mtd/mtdbdi.c
deleted file mode 100644 (file)
index e69de29..0000000
index 35bb44a..100e4d9 100644 (file)
@@ -274,26 +274,6 @@ static void pnpacpi_parse_allocated_busresource(struct pnp_dev *dev,
        pnp_add_bus_resource(dev, start, end);
 }
 
-static u64 addr_space_length(struct pnp_dev *dev, u64 min, u64 max, u64 len)
-{
-       u64 max_len;
-
-       max_len = max - min + 1;
-       if (len <= max_len)
-               return len;
-
-       /*
-        * Per 6.4.3.5, _LEN cannot exceed _MAX - _MIN + 1, but some BIOSes
-        * don't do this correctly, e.g.,
-        * https://bugzilla.kernel.org/show_bug.cgi?id=15480
-        */
-       dev_info(&dev->dev,
-                "resource length %#llx doesn't fit in %#llx-%#llx, trimming\n",
-                (unsigned long long) len, (unsigned long long) min,
-                (unsigned long long) max);
-       return max_len;
-}
-
 static void pnpacpi_parse_allocated_address_space(struct pnp_dev *dev,
                                                  struct acpi_resource *res)
 {
@@ -309,7 +289,8 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_dev *dev,
                return;
        }
 
-       len = addr_space_length(dev, p->minimum, p->maximum, p->address_length);
+       /* Windows apparently computes length rather than using _LEN */
+       len = p->maximum - p->minimum + 1;
        window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
 
        if (p->resource_type == ACPI_MEMORY_RANGE)
@@ -330,7 +311,8 @@ static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev,
        int window;
        u64 len;
 
-       len = addr_space_length(dev, p->minimum, p->maximum, p->address_length);
+       /* Windows apparently computes length rather than using _LEN */
+       len = p->maximum - p->minimum + 1;
        window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0;
 
        if (p->resource_type == ACPI_MEMORY_RANGE)
index 2e54e6a..e3446ab 100644 (file)
@@ -211,6 +211,8 @@ int pnp_check_port(struct pnp_dev *dev, struct resource *res)
                        if (tres->flags & IORESOURCE_IO) {
                                if (cannot_compare(tres->flags))
                                        continue;
+                               if (tres->flags & IORESOURCE_WINDOW)
+                                       continue;
                                tport = &tres->start;
                                tend = &tres->end;
                                if (ranged_conflict(port, end, tport, tend))
@@ -271,6 +273,8 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res)
                        if (tres->flags & IORESOURCE_MEM) {
                                if (cannot_compare(tres->flags))
                                        continue;
+                               if (tres->flags & IORESOURCE_WINDOW)
+                                       continue;
                                taddr = &tres->start;
                                tend = &tres->end;
                                if (ranged_conflict(addr, end, taddr, tend))
index 7d6c8b1..d2a54fe 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags)
        int local_node;
 
        if (slab_state >= UP && (s < kmalloc_caches ||
-                       s > kmalloc_caches + KMALLOC_CACHES))
+                       s >= kmalloc_caches + KMALLOC_CACHES))
                local_node = page_to_nid(virt_to_page(s));
        else
                local_node = 0;
index dd7cd0f..1e4b003 100644 (file)
 #include <asm/uaccess.h>
 #include "internal.h"
 
+#define rcu_dereference_locked_keyring(keyring)                                \
+       (rcu_dereference_protected(                                     \
+               (keyring)->payload.subscriptions,                       \
+               rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem)))
+
 /*
  * when plumbing the depths of the key tree, this sets a hard limit set on how
  * deep we're willing to go
@@ -201,8 +206,7 @@ static long keyring_read(const struct key *keyring,
        int loop, ret;
 
        ret = 0;
-       klist = keyring->payload.subscriptions;
-
+       klist = rcu_dereference_locked_keyring(keyring);
        if (klist) {
                /* calculate how much data we could return */
                qty = klist->nkeys * sizeof(key_serial_t);
@@ -526,9 +530,8 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
        struct key *keyring;
        int bucket;
 
-       keyring = ERR_PTR(-EINVAL);
        if (!name)
-               goto error;
+               return ERR_PTR(-EINVAL);
 
        bucket = keyring_hash(name);
 
@@ -555,17 +558,18 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
                                           KEY_SEARCH) < 0)
                                continue;
 
-                       /* we've got a match */
-                       atomic_inc(&keyring->usage);
-                       read_unlock(&keyring_name_lock);
-                       goto error;
+                       /* we've got a match but we might end up racing with
+                        * key_cleanup() if the keyring is currently 'dead'
+                        * (ie. it has a zero usage count) */
+                       if (!atomic_inc_not_zero(&keyring->usage))
+                               continue;
+                       goto out;
                }
        }
 
-       read_unlock(&keyring_name_lock);
        keyring = ERR_PTR(-ENOKEY);
-
- error:
+out:
+       read_unlock(&keyring_name_lock);
        return keyring;
 
 } /* end find_keyring_by_name() */
@@ -720,8 +724,7 @@ int __key_link(struct key *keyring, struct key *key)
        }
 
        /* see if there's a matching key we can displace */
-       klist = keyring->payload.subscriptions;
-
+       klist = rcu_dereference_locked_keyring(keyring);
        if (klist && klist->nkeys > 0) {
                struct key_type *type = key->type;
 
@@ -765,8 +768,6 @@ int __key_link(struct key *keyring, struct key *key)
        if (ret < 0)
                goto error2;
 
-       klist = keyring->payload.subscriptions;
-
        if (klist && klist->nkeys < klist->maxkeys) {
                /* there's sufficient slack space to add directly */
                atomic_inc(&key->usage);
@@ -868,7 +869,7 @@ int key_unlink(struct key *keyring, struct key *key)
 
        down_write(&keyring->sem);
 
-       klist = keyring->payload.subscriptions;
+       klist = rcu_dereference_locked_keyring(keyring);
        if (klist) {
                /* search the keyring for the key */
                for (loop = 0; loop < klist->nkeys; loop++)
@@ -959,7 +960,7 @@ int keyring_clear(struct key *keyring)
                /* detach the pointer block with the locks held */
                down_write(&keyring->sem);
 
-               klist = keyring->payload.subscriptions;
+               klist = rcu_dereference_locked_keyring(keyring);
                if (klist) {
                        /* adjust the quota */
                        key_payload_reserve(keyring,
@@ -991,7 +992,9 @@ EXPORT_SYMBOL(keyring_clear);
  */
 static void keyring_revoke(struct key *keyring)
 {
-       struct keyring_list *klist = keyring->payload.subscriptions;
+       struct keyring_list *klist;
+
+       klist = rcu_dereference_locked_keyring(keyring);
 
        /* adjust the quota */
        key_payload_reserve(keyring, 0);
@@ -1025,7 +1028,7 @@ void keyring_gc(struct key *keyring, time_t limit)
 
        down_write(&keyring->sem);
 
-       klist = keyring->payload.subscriptions;
+       klist = rcu_dereference_locked_keyring(keyring);
        if (!klist)
                goto no_klist;
 
index d737cea..d8c1a6a 100644 (file)
@@ -94,7 +94,7 @@ static int call_sbin_request_key(struct key_construction *cons,
        }
 
        /* attach the auth key to the session keyring */
-       ret = __key_link(keyring, authkey);
+       ret = key_link(keyring, authkey);
        if (ret < 0)
                goto error_link;