]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-2.6.29' of git://linux-nfs.org/~bfields/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Jan 2009 00:07:44 +0000 (16:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Jan 2009 00:07:44 +0000 (16:07 -0800)
* 'for-2.6.29' of git://linux-nfs.org/~bfields/linux:
  nfsd: only set file_lock.fl_lmops in nfsd4_lockt if a stateowner is found
  nfsd: fix cred leak on every rpc
  nfsd: fix null dereference on error path
  nfs: note that CONFIG_SUNRPC_XPRT_RDMA turns on server side support too
  update port number in NFS/RDMA documentation

39 files changed:
arch/arm/mach-integrator/clock.h [deleted file]
crypto/authenc.c
crypto/blkcipher.c
crypto/ccm.c
drivers/ata/Kconfig
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-scsi.c
drivers/ata/libata-sff.c
drivers/ata/pata_rb532_cf.c
drivers/ata/pata_via.c
drivers/ata/sata_mv.c
drivers/ata/sata_nv.c
drivers/ata/sata_sil.c
drivers/char/tty_io.c
drivers/firmware/dmi_scan.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/libiscsi.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_sup.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla4xxx/ql4_def.h
drivers/scsi/qla4xxx/ql4_init.c
drivers/serial/8250_pci.c
drivers/serial/Kconfig
drivers/serial/jsm/jsm_driver.c
include/linux/dmi.h
include/linux/libata.h
include/linux/mod_devicetable.h
include/linux/pci_ids.h
include/linux/suspend.h
kernel/irq/handle.c
kernel/irq/manage.c
kernel/power/disk.c

diff --git a/arch/arm/mach-integrator/clock.h b/arch/arm/mach-integrator/clock.h
deleted file mode 100644 (file)
index e69de29..0000000
index 40b6e9ec9e3a0a2069b5f972226918dc33625294..5793b64c81a86449c7b09f56ae918f1ffcb73b9f 100644 (file)
@@ -158,16 +158,19 @@ static int crypto_authenc_genicv(struct aead_request *req, u8 *iv,
        dstp = sg_page(dst);
        vdst = PageHighMem(dstp) ? NULL : page_address(dstp) + dst->offset;
 
-       sg_init_table(cipher, 2);
-       sg_set_buf(cipher, iv, ivsize);
-       authenc_chain(cipher, dst, vdst == iv + ivsize);
+       if (ivsize) {
+               sg_init_table(cipher, 2);
+               sg_set_buf(cipher, iv, ivsize);
+               authenc_chain(cipher, dst, vdst == iv + ivsize);
+               dst = cipher;
+       }
 
        cryptlen = req->cryptlen + ivsize;
-       hash = crypto_authenc_hash(req, flags, cipher, cryptlen);
+       hash = crypto_authenc_hash(req, flags, dst, cryptlen);
        if (IS_ERR(hash))
                return PTR_ERR(hash);
 
-       scatterwalk_map_and_copy(hash, cipher, cryptlen,
+       scatterwalk_map_and_copy(hash, dst, cryptlen,
                                 crypto_aead_authsize(authenc), 1);
        return 0;
 }
@@ -285,11 +288,14 @@ static int crypto_authenc_iverify(struct aead_request *req, u8 *iv,
        srcp = sg_page(src);
        vsrc = PageHighMem(srcp) ? NULL : page_address(srcp) + src->offset;
 
-       sg_init_table(cipher, 2);
-       sg_set_buf(cipher, iv, ivsize);
-       authenc_chain(cipher, src, vsrc == iv + ivsize);
+       if (ivsize) {
+               sg_init_table(cipher, 2);
+               sg_set_buf(cipher, iv, ivsize);
+               authenc_chain(cipher, src, vsrc == iv + ivsize);
+               src = cipher;
+       }
 
-       return crypto_authenc_verify(req, cipher, cryptlen + ivsize);
+       return crypto_authenc_verify(req, src, cryptlen + ivsize);
 }
 
 static int crypto_authenc_decrypt(struct aead_request *req)
index 4a7e65c4df4dc3ac6af007efa1d136e1232be053..d70a41c002df192e49f77871cd0837732fbad861 100644 (file)
@@ -124,6 +124,7 @@ int blkcipher_walk_done(struct blkcipher_desc *desc,
        scatterwalk_done(&walk->in, 0, nbytes);
        scatterwalk_done(&walk->out, 1, nbytes);
 
+err:
        walk->total = nbytes;
        walk->nbytes = nbytes;
 
@@ -132,7 +133,6 @@ int blkcipher_walk_done(struct blkcipher_desc *desc,
                return blkcipher_walk_next(desc, walk);
        }
 
-err:
        if (walk->iv != desc->info)
                memcpy(desc->info, walk->iv, crypto_blkcipher_ivsize(tfm));
        if (walk->buffer != walk->page)
index 7cf7e5a6b7812688b278f643a84be3845089a650..c36d654cf56a0f08ef9ef4e4cd42eaa85047a6cd 100644 (file)
@@ -266,6 +266,8 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
        if (assoclen) {
                pctx->ilen = format_adata(idata, assoclen);
                get_data_to_compute(cipher, pctx, req->assoc, req->assoclen);
+       } else {
+               pctx->ilen = 0;
        }
 
        /* compute plaintext into mac */
index 503a908afc80f131e70538de4e525745384fca7e..0bcf264646702465795ba7e31e7dce1e014b87ae 100644 (file)
@@ -112,11 +112,11 @@ config ATA_PIIX
          If unsure, say N.
 
 config SATA_MV
-       tristate "Marvell SATA support (HIGHLY EXPERIMENTAL)"
-       depends on EXPERIMENTAL
+       tristate "Marvell SATA support"
        help
          This option enables support for the Marvell Serial ATA family.
-         Currently supports 88SX[56]0[48][01] chips.
+         Currently supports 88SX[56]0[48][01] PCI(-X) chips,
+         as well as the newer [67]042 PCI-X/PCIe and SOC devices.
 
          If unsure, say N.
 
index 96039671e3b9e6aac939833554fc95291609d6d1..77bba4c083cbe60efb19a714265a7cc44730212b 100644 (file)
@@ -2548,6 +2548,32 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
        }
 }
 
+static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
+{
+       static const struct dmi_system_id broken_systems[] = {
+               {
+                       .ident = "HP Compaq nx6310",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6310"),
+                       },
+                       /* PCI slot number of the controller */
+                       .driver_data = (void *)0x1FUL,
+               },
+
+               { }     /* terminate list */
+       };
+       const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+
+       if (dmi) {
+               unsigned long slot = (unsigned long)dmi->driver_data;
+               /* apply the quirk only to on-board controllers */
+               return slot == PCI_SLOT(pdev->devfn);
+       }
+
+       return false;
+}
+
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
@@ -2647,6 +2673,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                }
        }
 
+       if (ahci_broken_system_poweroff(pdev)) {
+               pi.flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN;
+               dev_info(&pdev->dev,
+                       "quirky BIOS, skipping spindown on poweroff\n");
+       }
+
        /* CAP.NP sometimes indicate the index of the last enabled
         * port, at other times, that of the last possible port, so
         * determining the maximum port number requires looking at
index 887d8f46a287312fd554d77a1c498f37a30cd307..54961c0b2c73a58e2dc64313ff95a858bbb262d2 100644 (file)
@@ -1387,6 +1387,32 @@ static void piix_iocfg_bit18_quirk(struct ata_host *host)
        }
 }
 
+static bool piix_broken_system_poweroff(struct pci_dev *pdev)
+{
+       static const struct dmi_system_id broken_systems[] = {
+               {
+                       .ident = "HP Compaq 2510p",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 2510p"),
+                       },
+                       /* PCI slot number of the controller */
+                       .driver_data = (void *)0x1FUL,
+               },
+
+               { }     /* terminate list */
+       };
+       const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+
+       if (dmi) {
+               unsigned long slot = (unsigned long)dmi->driver_data;
+               /* apply the quirk only to on-board controllers */
+               return slot == PCI_SLOT(pdev->devfn);
+       }
+
+       return false;
+}
+
 /**
  *     piix_init_one - Register PIIX ATA PCI device with kernel services
  *     @pdev: PCI device to register
@@ -1422,6 +1448,14 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
        if (!in_module_init)
                return -ENODEV;
 
+       if (piix_broken_system_poweroff(pdev)) {
+               piix_port_info[ent->driver_data].flags |=
+                               ATA_FLAG_NO_POWEROFF_SPINDOWN |
+                                       ATA_FLAG_NO_HIBERNATE_SPINDOWN;
+               dev_info(&pdev->dev, "quirky BIOS, skipping spindown "
+                               "on poweroff and hibernation\n");
+       }
+
        port_info[0] = piix_port_info[ent->driver_data];
        port_info[1] = piix_port_info[ent->driver_data];
 
index a1a6e6298c33a4dc622a9c03aba181f70477a4e8..3c4c5ae277ba583074a2f407fe5cf25caf2b0320 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/libata.h>
 #include <linux/hdreg.h>
 #include <linux/uaccess.h>
+#include <linux/suspend.h>
 
 #include "libata.h"
 
@@ -1303,6 +1304,17 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
 
                tf->command = ATA_CMD_VERIFY;   /* READ VERIFY */
        } else {
+               /* Some odd clown BIOSen issue spindown on power off (ACPI S4
+                * or S5) causing some drives to spin up and down again.
+                */
+               if ((qc->ap->flags & ATA_FLAG_NO_POWEROFF_SPINDOWN) &&
+                   system_state == SYSTEM_POWER_OFF)
+                       goto skip;
+
+               if ((qc->ap->flags & ATA_FLAG_NO_HIBERNATE_SPINDOWN) &&
+                    system_entering_hibernation())
+                       goto skip;
+
                /* XXX: This is for backward compatibility, will be
                 * removed.  Read Documentation/feature-removal-schedule.txt
                 * for more info.
@@ -1326,8 +1338,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
                                scmd->scsi_done = qc->scsidone;
                                qc->scsidone = ata_delayed_done;
                        }
-                       scmd->result = SAM_STAT_GOOD;
-                       return 1;
+                       goto skip;
                }
 
                /* Issue ATA STANDBY IMMEDIATE command */
@@ -1343,10 +1354,13 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
 
        return 0;
 
-invalid_fld:
+ invalid_fld:
        ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0);
        /* "Invalid field in cbd" */
        return 1;
+ skip:
+       scmd->result = SAM_STAT_GOOD;
+       return 1;
 }
 
 
index 5a4aad123c4259236677470a202f0d46ca279766..0b299b0f81721bbe1446169b8fa5b51c86eecd2d 100644 (file)
@@ -1322,7 +1322,7 @@ fsm_start:
                                         * condition.  Mark hint.
                                         */
                                        ata_ehi_push_desc(ehi, "ST-ATA: "
-                                               "DRQ=1 with device error, "
+                                               "DRQ=0 without device error, "
                                                "dev_stat 0x%X", status);
                                        qc->err_mask |= AC_ERR_HSM |
                                                        AC_ERR_NODEV_HINT;
@@ -1358,6 +1358,16 @@ fsm_start:
                                        qc->err_mask |= AC_ERR_HSM;
                                }
 
+                               /* There are oddball controllers with
+                                * status register stuck at 0x7f and
+                                * lbal/m/h at zero which makes it
+                                * pass all other presence detection
+                                * mechanisms we have.  Set NODEV_HINT
+                                * for it.  Kernel bz#7241.
+                                */
+                               if (status == 0x7f)
+                                       qc->err_mask |= AC_ERR_NODEV_HINT;
+
                                /* ata_pio_sectors() might change the
                                 * state to HSM_ST_LAST. so, the state
                                 * is changed after ata_pio_sectors().
index c2e6fb9f2ef9f730b27c3a9c16f96f85fd3de7dd..ebfcda26d639bffa3cfce525b84883b0b7276d98 100644 (file)
@@ -63,8 +63,6 @@ static inline void rb532_pata_finish_io(struct ata_port *ap)
           ata_sff_sync might be sufficient. */
        ata_sff_dma_pause(ap);
        ndelay(RB500_CF_IO_DELAY);
-
-       set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
 }
 
 static void rb532_pata_exec_command(struct ata_port *ap,
index 681169c9c6409d4514b1f68195e98c1d96e626e6..79a6c9a0b721b5caacb43c9785bebb877d16c9d1 100644 (file)
@@ -86,6 +86,10 @@ enum {
        VIA_SATA_PATA   = 0x800, /* SATA/PATA combined configuration */
 };
 
+enum {
+       VIA_IDFLAG_SINGLE = (1 << 0), /* single channel controller) */
+};
+
 /*
  * VIA SouthBridge chips.
  */
@@ -97,8 +101,12 @@ static const struct via_isa_bridge {
        u8 rev_max;
        u16 flags;
 } via_isa_bridges[] = {
+       { "vx855",      PCI_DEVICE_ID_VIA_VX855,    0x00, 0x2f,
+         VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
        { "vx800",      PCI_DEVICE_ID_VIA_VX800,    0x00, 0x2f, VIA_UDMA_133 |
        VIA_BAD_AST | VIA_SATA_PATA },
+       { "vt8261",     PCI_DEVICE_ID_VIA_8261,     0x00, 0x2f,
+         VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8237s",    PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "vt8251",     PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
        { "cx700",      PCI_DEVICE_ID_VIA_CX700,    0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
@@ -122,6 +130,8 @@ static const struct via_isa_bridge {
        { "vt82c586",   PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO },
        { "vt82c576",   PCI_DEVICE_ID_VIA_82C576,   0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK },
        { "vt82c576",   PCI_DEVICE_ID_VIA_82C576,   0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID },
+       { "vtxxxx",     PCI_DEVICE_ID_VIA_ANON,    0x00, 0x2f,
+         VIA_UDMA_133 | VIA_BAD_AST },
        { NULL }
 };
 
@@ -460,6 +470,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        static int printed_version;
        u8 enable;
        u32 timing;
+       unsigned long flags = id->driver_data;
        int rc;
 
        if (!printed_version++)
@@ -469,9 +480,13 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
        if (rc)
                return rc;
 
+       if (flags & VIA_IDFLAG_SINGLE)
+               ppi[1] = &ata_dummy_port_info;
+
        /* To find out how the IDE will behave and what features we
           actually have to look at the bridge not the IDE controller */
-       for (config = via_isa_bridges; config->id; config++)
+       for (config = via_isa_bridges; config->id != PCI_DEVICE_ID_VIA_ANON;
+            config++)
                if ((isa = pci_get_device(PCI_VENDOR_ID_VIA +
                        !!(config->flags & VIA_BAD_ID),
                        config->id, NULL))) {
@@ -482,10 +497,6 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
                        pci_dev_put(isa);
                }
 
-       if (!config->id) {
-               printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n");
-               return -ENODEV;
-       }
        pci_dev_put(isa);
 
        if (!(config->flags & VIA_NO_ENABLES)) {
@@ -587,6 +598,7 @@ static const struct pci_device_id via[] = {
        { PCI_VDEVICE(VIA, 0x1571), },
        { PCI_VDEVICE(VIA, 0x3164), },
        { PCI_VDEVICE(VIA, 0x5324), },
+       { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE },
 
        { },
 };
index 86918634a4c56e1ae7fa066006c5e56fc32ac123..f2d8a020ea53cb329bc8e2c846e752a33011099f 100644 (file)
  *
  * --> ATAPI support (Marvell claims the 60xx/70xx chips can do it).
  *
- * --> Investigate problems with PCI Message Signalled Interrupts (MSI).
- *
- * --> Cache frequently-accessed registers in mv_port_priv to reduce overhead.
- *
  * --> Develop a low-power-consumption strategy, and implement it.
  *
  * --> [Experiment, low priority] Investigate interrupt coalescing.
@@ -72,7 +68,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "sata_mv"
-#define DRV_VERSION    "1.24"
+#define DRV_VERSION    "1.25"
 
 enum {
        /* BAR's are enumerated in terms of pci_resource_start() terms */
@@ -351,8 +347,6 @@ enum {
 
        EDMA_HALTCOND_OFS       = 0x60,         /* GenIIe halt conditions */
 
-       GEN_II_NCQ_MAX_SECTORS  = 256,          /* max sects/io on Gen2 w/NCQ */
-
        /* Host private flags (hp_flags) */
        MV_HP_FLAG_MSI          = (1 << 0),
        MV_HP_ERRATA_50XXB0     = (1 << 1),
@@ -883,19 +877,15 @@ static void mv_start_dma(struct ata_port *ap, void __iomem *port_mmio,
                struct mv_host_priv *hpriv = ap->host->private_data;
                int hardport = mv_hardport_from_port(ap->port_no);
                void __iomem *hc_mmio = mv_hc_base_from_port(
-                                       mv_host_base(ap->host), hardport);
-               u32 hc_irq_cause, ipending;
+                                       mv_host_base(ap->host), ap->port_no);
+               u32 hc_irq_cause;
 
                /* clear EDMA event indicators, if any */
                writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
 
-               /* clear EDMA interrupt indicator, if any */
-               hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS);
-               ipending = (DEV_IRQ | DMA_IRQ) << hardport;
-               if (hc_irq_cause & ipending) {
-                       writelfl(hc_irq_cause & ~ipending,
-                                hc_mmio + HC_IRQ_CAUSE_OFS);
-               }
+               /* clear pending irq events */
+               hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport);
+               writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS);
 
                mv_edma_cfg(ap, want_ncq);
 
@@ -1099,20 +1089,12 @@ static void mv6_dev_config(struct ata_device *adev)
         *
         * Gen-II does not support NCQ over a port multiplier
         *  (no FIS-based switching).
-        *
-        * We don't have hob_nsect when doing NCQ commands on Gen-II.
-        * See mv_qc_prep() for more info.
         */
        if (adev->flags & ATA_DFLAG_NCQ) {
                if (sata_pmp_attached(adev->link->ap)) {
                        adev->flags &= ~ATA_DFLAG_NCQ;
                        ata_dev_printk(adev, KERN_INFO,
                                "NCQ disabled for command-based switching\n");
-               } else if (adev->max_sectors > GEN_II_NCQ_MAX_SECTORS) {
-                       adev->max_sectors = GEN_II_NCQ_MAX_SECTORS;
-                       ata_dev_printk(adev, KERN_INFO,
-                               "max_sectors limited to %u for NCQ\n",
-                               adev->max_sectors);
                }
        }
 }
@@ -1450,7 +1432,8 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
         * only 11 bytes...so we must pick and choose required
         * registers based on the command.  So, we drop feature and
         * hob_feature for [RW] DMA commands, but they are needed for
-        * NCQ.  NCQ will drop hob_nsect.
+        * NCQ.  NCQ will drop hob_nsect, which is not needed there
+        * (nsect is used only for the tag; feat/hob_feat hold true nsect).
         */
        switch (tf->command) {
        case ATA_CMD_READ:
@@ -2214,9 +2197,15 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance)
        struct ata_host *host = dev_instance;
        struct mv_host_priv *hpriv = host->private_data;
        unsigned int handled = 0;
+       int using_msi = hpriv->hp_flags & MV_HP_FLAG_MSI;
        u32 main_irq_cause, pending_irqs;
 
        spin_lock(&host->lock);
+
+       /* for MSI:  block new interrupts while in here */
+       if (using_msi)
+               writel(0, hpriv->main_irq_mask_addr);
+
        main_irq_cause = readl(hpriv->main_irq_cause_addr);
        pending_irqs   = main_irq_cause & hpriv->main_irq_mask;
        /*
@@ -2230,6 +2219,11 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance)
                        handled = mv_host_intr(host, pending_irqs);
        }
        spin_unlock(&host->lock);
+
+       /* for MSI: unmask; interrupt cause bits will retrigger now */
+       if (using_msi)
+               writel(hpriv->main_irq_mask, hpriv->main_irq_mask_addr);
+
        return IRQ_RETVAL(handled);
 }
 
@@ -2821,8 +2815,7 @@ static void mv_eh_thaw(struct ata_port *ap)
        writel(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
 
        /* clear pending irq events */
-       hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS);
-       hc_irq_cause &= ~((DEV_IRQ | DMA_IRQ) << hardport);
+       hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport);
        writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS);
 
        mv_enable_port_irqs(ap, ERR_IRQ);
@@ -3075,6 +3068,9 @@ static int mv_init_host(struct ata_host *host, unsigned int board_idx)
                hpriv->main_irq_mask_addr  = mmio + PCI_HC_MAIN_IRQ_MASK_OFS;
        }
 
+       /* initialize shadow irq mask with register's value */
+       hpriv->main_irq_mask = readl(hpriv->main_irq_mask_addr);
+
        /* global interrupt mask: 0 == mask everything */
        mv_set_main_irq_mask(host, ~0, 0);
 
@@ -3430,9 +3426,9 @@ static int mv_pci_init_one(struct pci_dev *pdev,
        if (rc)
                return rc;
 
-       /* Enable interrupts */
-       if (msi && pci_enable_msi(pdev))
-               pci_intx(pdev, 1);
+       /* Enable message-switched interrupts, if requested */
+       if (msi && pci_enable_msi(pdev) == 0)
+               hpriv->hp_flags |= MV_HP_FLAG_MSI;
 
        mv_dump_pci_cfg(pdev, 0x68);
        mv_print_info(host);
index 6f1460614325fb61553ca457d6201eb1faacd493..c49ad0e61b6f2550a8b3f0b84122aa6f0bc0b40b 100644 (file)
@@ -305,10 +305,10 @@ static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance);
 static int nv_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
 static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
 
+static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class,
+                                  unsigned long deadline);
 static void nv_nf2_freeze(struct ata_port *ap);
 static void nv_nf2_thaw(struct ata_port *ap);
-static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class,
-                           unsigned long deadline);
 static void nv_ck804_freeze(struct ata_port *ap);
 static void nv_ck804_thaw(struct ata_port *ap);
 static int nv_adma_slave_config(struct scsi_device *sdev);
@@ -352,6 +352,7 @@ enum nv_host_type
        NFORCE3 = NFORCE2,      /* NF2 == NF3 as far as sata_nv is concerned */
        CK804,
        ADMA,
+       MCP5x,
        SWNCQ,
 };
 
@@ -363,10 +364,10 @@ static const struct pci_device_id nv_pci_tbl[] = {
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2), CK804 },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA), CK804 },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2), CK804 },
-       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), SWNCQ },
-       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ },
-       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ },
-       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ },
+       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), MCP5x },
+       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), MCP5x },
+       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), MCP5x },
+       { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), MCP5x },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC },
        { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC },
@@ -432,7 +433,7 @@ static struct ata_port_operations nv_nf2_ops = {
        .inherits               = &nv_common_ops,
        .freeze                 = nv_nf2_freeze,
        .thaw                   = nv_nf2_thaw,
-       .hardreset              = nv_nf2_hardreset,
+       .hardreset              = nv_noclassify_hardreset,
 };
 
 /* CK804 finally gets hardreset right */
@@ -467,8 +468,19 @@ static struct ata_port_operations nv_adma_ops = {
        .host_stop              = nv_adma_host_stop,
 };
 
+/* Kernel bz#12351 reports that when SWNCQ is enabled, for hotplug to
+ * work, hardreset should be used and hardreset can't report proper
+ * signature, which suggests that mcp5x is closer to nf2 as long as
+ * reset quirkiness is concerned.  Define separate ops for mcp5x with
+ * nv_noclassify_hardreset().
+ */
+static struct ata_port_operations nv_mcp5x_ops = {
+       .inherits               = &nv_common_ops,
+       .hardreset              = nv_noclassify_hardreset,
+};
+
 static struct ata_port_operations nv_swncq_ops = {
-       .inherits               = &nv_generic_ops,
+       .inherits               = &nv_mcp5x_ops,
 
        .qc_defer               = ata_std_qc_defer,
        .qc_prep                = nv_swncq_qc_prep,
@@ -531,6 +543,15 @@ static const struct ata_port_info nv_port_info[] = {
                .port_ops       = &nv_adma_ops,
                .private_data   = NV_PI_PRIV(nv_adma_interrupt, &nv_adma_sht),
        },
+       /* MCP5x */
+       {
+               .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
+               .pio_mask       = NV_PIO_MASK,
+               .mwdma_mask     = NV_MWDMA_MASK,
+               .udma_mask      = NV_UDMA_MASK,
+               .port_ops       = &nv_mcp5x_ops,
+               .private_data   = NV_PI_PRIV(nv_generic_interrupt, &nv_sht),
+       },
        /* SWNCQ */
        {
                .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
@@ -1530,6 +1551,17 @@ static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val)
        return 0;
 }
 
+static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class,
+                                  unsigned long deadline)
+{
+       bool online;
+       int rc;
+
+       rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
+                                &online, NULL);
+       return online ? -EAGAIN : rc;
+}
+
 static void nv_nf2_freeze(struct ata_port *ap)
 {
        void __iomem *scr_addr = ap->host->ports[0]->ioaddr.scr_addr;
@@ -1554,17 +1586,6 @@ static void nv_nf2_thaw(struct ata_port *ap)
        iowrite8(mask, scr_addr + NV_INT_ENABLE);
 }
 
-static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class,
-                           unsigned long deadline)
-{
-       bool online;
-       int rc;
-
-       rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline,
-                                &online, NULL);
-       return online ? -EAGAIN : rc;
-}
-
 static void nv_ck804_freeze(struct ata_port *ap)
 {
        void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR];
@@ -2355,14 +2376,9 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (type == CK804 && adma_enabled) {
                dev_printk(KERN_NOTICE, &pdev->dev, "Using ADMA mode\n");
                type = ADMA;
-       }
-
-       if (type == SWNCQ) {
-               if (swncq_enabled)
-                       dev_printk(KERN_NOTICE, &pdev->dev,
-                                  "Using SWNCQ mode\n");
-               else
-                       type = GENERIC;
+       } else if (type == MCP5x && swncq_enabled) {
+               dev_printk(KERN_NOTICE, &pdev->dev, "Using SWNCQ mode\n");
+               type = SWNCQ;
        }
 
        ppi[0] = &nv_port_info[type];
index 564c142b03b043ec9faf0c930b5ded6af1dc8b1d..bfd55b085ae63f55065ca85833b2a48fa6721dd6 100644 (file)
@@ -695,11 +695,38 @@ static void sil_init_controller(struct ata_host *host)
        }
 }
 
+static bool sil_broken_system_poweroff(struct pci_dev *pdev)
+{
+       static const struct dmi_system_id broken_systems[] = {
+               {
+                       .ident = "HP Compaq nx6325",
+                       .matches = {
+                               DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+                               DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
+                       },
+                       /* PCI slot number of the controller */
+                       .driver_data = (void *)0x12UL,
+               },
+
+               { }     /* terminate list */
+       };
+       const struct dmi_system_id *dmi = dmi_first_match(broken_systems);
+
+       if (dmi) {
+               unsigned long slot = (unsigned long)dmi->driver_data;
+               /* apply the quirk only to on-board controllers */
+               return slot == PCI_SLOT(pdev->devfn);
+       }
+
+       return false;
+}
+
 static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
        static int printed_version;
        int board_id = ent->driver_data;
-       const struct ata_port_info *ppi[] = { &sil_port_info[board_id], NULL };
+       struct ata_port_info pi = sil_port_info[board_id];
+       const struct ata_port_info *ppi[] = { &pi, NULL };
        struct ata_host *host;
        void __iomem *mmio_base;
        int n_ports, rc;
@@ -713,6 +740,13 @@ static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (board_id == sil_3114)
                n_ports = 4;
 
+       if (sil_broken_system_poweroff(pdev)) {
+               pi.flags |= ATA_FLAG_NO_POWEROFF_SPINDOWN |
+                                       ATA_FLAG_NO_HIBERNATE_SPINDOWN;
+               dev_info(&pdev->dev, "quirky BIOS, skipping spindown "
+                               "on poweroff and hibernation\n");
+       }
+
        host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
        if (!host)
                return -ENOMEM;
index d33e5ab061779a67e63b305b30b29d01f6fe38ca..bc84e125c6bc428ca1d51cbcb29909466ea96b87 100644 (file)
@@ -1817,8 +1817,10 @@ got_driver:
                /* check whether we're reopening an existing tty */
                tty = tty_driver_lookup_tty(driver, inode, index);
 
-               if (IS_ERR(tty))
+               if (IS_ERR(tty)) {
+                       mutex_unlock(&tty_mutex);
                        return PTR_ERR(tty);
+               }
        }
 
        if (tty) {
index d76adfea5df7c78bb6421a327f417ae3ed210fd6..8f0f7c44930540aa6829fdbe92b085d7c4009a46 100644 (file)
@@ -414,6 +414,29 @@ void __init dmi_scan_machine(void)
        dmi_initialized = 1;
 }
 
+/**
+ *     dmi_matches - check if dmi_system_id structure matches system DMI data
+ *     @dmi: pointer to the dmi_system_id structure to check
+ */
+static bool dmi_matches(const struct dmi_system_id *dmi)
+{
+       int i;
+
+       WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n");
+
+       for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) {
+               int s = dmi->matches[i].slot;
+               if (s == DMI_NONE)
+                       continue;
+               if (dmi_ident[s]
+                   && strstr(dmi_ident[s], dmi->matches[i].substr))
+                       continue;
+               /* No match */
+               return false;
+       }
+       return true;
+}
+
 /**
  *     dmi_check_system - check system DMI data
  *     @list: array of dmi_system_id structures to match against
@@ -429,31 +452,44 @@ void __init dmi_scan_machine(void)
  */
 int dmi_check_system(const struct dmi_system_id *list)
 {
-       int i, count = 0;
-       const struct dmi_system_id *d = list;
-
-       WARN(!dmi_initialized, KERN_ERR "dmi check: not initialized yet.\n");
-
-       while (d->ident) {
-               for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
-                       int s = d->matches[i].slot;
-                       if (s == DMI_NONE)
-                               continue;
-                       if (dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
-                               continue;
-                       /* No match */
-                       goto fail;
+       int count = 0;
+       const struct dmi_system_id *d;
+
+       for (d = list; d->ident; d++)
+               if (dmi_matches(d)) {
+                       count++;
+                       if (d->callback && d->callback(d))
+                               break;
                }
-               count++;
-               if (d->callback && d->callback(d))
-                       break;
-fail:          d++;
-       }
 
        return count;
 }
 EXPORT_SYMBOL(dmi_check_system);
 
+/**
+ *     dmi_first_match - find dmi_system_id structure matching system DMI data
+ *     @list: array of dmi_system_id structures to match against
+ *             All non-null elements of the list must match
+ *             their slot's (field index's) data (i.e., each
+ *             list string must be a substring of the specified
+ *             DMI slot's string data) to be considered a
+ *             successful match.
+ *
+ *     Walk the blacklist table until the first match is found.  Return the
+ *     pointer to the matching entry or NULL if there's no match.
+ */
+const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list)
+{
+       const struct dmi_system_id *d;
+
+       for (d = list; d->ident; d++)
+               if (dmi_matches(d))
+                       return d;
+
+       return NULL;
+}
+EXPORT_SYMBOL(dmi_first_match);
+
 /**
  *     dmi_get_system_info - return DMI data value
  *     @field: data index (see enum dmi_field)
index 91ef669d98f64583e94fb9d57c4e855679cc680b..a1a511bdec8cb87961023da3bbf487de6d9a580e 100644 (file)
@@ -1322,7 +1322,9 @@ static int ibmvfc_map_sg_data(struct scsi_cmnd *scmd,
                                               &evt->ext_list_token);
 
                if (!evt->ext_list) {
-                       scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n");
+                       scsi_dma_unmap(scmd);
+                       if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL)
+                               scmd_printk(KERN_ERR, scmd, "Can't allocate memory for scatterlist\n");
                        return -ENOMEM;
                }
        }
index 7225b6e2029e53e8f57e42078cbef77865bbe1a1..257c24115de9108132d955ab5e488cf0b6c37c3e 100644 (file)
@@ -1981,6 +1981,7 @@ void iscsi_pool_free(struct iscsi_pool *q)
                kfree(q->pool[i]);
        if (q->pool)
                kfree(q->pool);
+       kfree(q->queue);
 }
 EXPORT_SYMBOL_GPL(iscsi_pool_free);
 
index c7acef50d5da03ccc45eef456d161b1618691c2d..33a3c13fd8936b717fb3cec81258a76e88478094 100644 (file)
@@ -1016,6 +1016,9 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
        struct Scsi_Host *host = rport_to_shost(rport);
        fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
 
+       if (!fcport)
+               return;
+
        qla2x00_abort_fcport_cmds(fcport);
 
        /*
@@ -1033,6 +1036,9 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
 {
        fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
 
+       if (!fcport)
+               return;
+
        /*
         * At this point all fcport's software-states are cleared.  Perform any
         * final cleanup of firmware resources (PCBs and XCBs).
index ba4913353752a9672c13d6f5b1752bd31918a8f7..a336b4bc81a7e50b5d1407ba249c0c5944615a6f 100644 (file)
@@ -34,6 +34,7 @@ extern void qla24xx_update_fw_options(scsi_qla_host_t *);
 extern void qla81xx_update_fw_options(scsi_qla_host_t *);
 extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
 extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
+extern int qla81xx_load_risc(scsi_qla_host_t *, uint32_t *);
 
 extern int qla2x00_loop_resync(scsi_qla_host_t *);
 
index 9ad4d0968e5c87b38045c60e08cd6f244aa0ff5b..f6368a1d3021e1e4e2f2c569d5742683cab61d47 100644 (file)
@@ -3562,6 +3562,9 @@ qla24xx_reset_adapter(scsi_qla_host_t *vha)
        WRT_REG_DWORD(&reg->hccr, HCCRX_REL_RISC_PAUSE);
        RD_REG_DWORD(&reg->hccr);
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+       if (IS_NOPOLLING_TYPE(ha))
+               ha->isp_ops->enable_intrs(ha);
 }
 
 /* On sparc systems, obtain port and node WWN from firmware
@@ -3847,6 +3850,10 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr)
        uint32_t i;
        struct qla_hw_data *ha = vha->hw;
        struct req_que *req = ha->req_q_map[0];
+
+       qla_printk(KERN_INFO, ha,
+           "FW: Loading from flash (%x)...\n", ha->flt_region_fw);
+
        rval = QLA_SUCCESS;
 
        segments = FA_RISC_CODE_SEGMENTS;
@@ -4022,8 +4029,8 @@ fail_fw_integrity:
        return QLA_FUNCTION_FAILED;
 }
 
-int
-qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
+static int
+qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
 {
        int     rval;
        int     segments, fragment;
@@ -4043,12 +4050,12 @@ qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
                qla_printk(KERN_ERR, ha, "Firmware images can be retrieved "
                    "from: " QLA_FW_URL ".\n");
 
-               /* Try to load RISC code from flash. */
-               qla_printk(KERN_ERR, ha, "Attempting to load (potentially "
-                   "outdated) firmware from flash.\n");
-               return qla24xx_load_risc_flash(vha, srisc_addr);
+               return QLA_FUNCTION_FAILED;
        }
 
+       qla_printk(KERN_INFO, ha,
+           "FW: Loading via request-firmware...\n");
+
        rval = QLA_SUCCESS;
 
        segments = FA_RISC_CODE_SEGMENTS;
@@ -4133,6 +4140,40 @@ fail_fw_integrity:
        return QLA_FUNCTION_FAILED;
 }
 
+int
+qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
+{
+       int rval;
+
+       /*
+        * FW Load priority:
+        * 1) Firmware via request-firmware interface (.bin file).
+        * 2) Firmware residing in flash.
+        */
+       rval = qla24xx_load_risc_blob(vha, srisc_addr);
+       if (rval == QLA_SUCCESS)
+               return rval;
+
+       return qla24xx_load_risc_flash(vha, srisc_addr);
+}
+
+int
+qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
+{
+       int rval;
+
+       /*
+        * FW Load priority:
+        * 1) Firmware residing in flash.
+        * 2) Firmware via request-firmware interface (.bin file).
+        */
+       rval = qla24xx_load_risc_flash(vha, srisc_addr);
+       if (rval == QLA_SUCCESS)
+               return rval;
+
+       return qla24xx_load_risc_blob(vha, srisc_addr);
+}
+
 void
 qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha)
 {
index 789fc576f222b305c7b5bd5a222986458ced33ae..e28ad81baf1e09d84edcbfef99e1ce945c2264b3 100644 (file)
@@ -1868,6 +1868,7 @@ qla24xx_disable_msix(struct qla_hw_data *ha)
 static int
 qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 {
+#define MIN_MSIX_COUNT 2
        int i, ret;
        struct msix_entry *entries;
        struct qla_msix_entry *qentry;
@@ -1883,12 +1884,16 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 
        ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
        if (ret) {
+               if (ret < MIN_MSIX_COUNT)
+                       goto msix_failed;
+
                qla_printk(KERN_WARNING, ha,
                        "MSI-X: Failed to enable support -- %d/%d\n"
                        " Retry with %d vectors\n", ha->msix_count, ret, ret);
                ha->msix_count = ret;
                ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
                if (ret) {
+msix_failed:
                        qla_printk(KERN_WARNING, ha, "MSI-X: Failed to enable"
                                " support, giving up -- %d/%d\n",
                                ha->msix_count, ret);
index db4df45234a562397f39a3b6944c333acf1f36a8..f94ffbb98e95f2a53918888ed76ebf235b3aa5cc 100644 (file)
@@ -58,14 +58,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
         * seconds. This is to serialize actual issuing of mailbox cmds during
         * non ISP abort time.
         */
-       if (!abort_active) {
-               if (!wait_for_completion_timeout(&ha->mbx_cmd_comp,
-                   mcp->tov * HZ)) {
-                       /* Timeout occurred. Return error. */
-                       DEBUG2_3_11(printk("%s(%ld): cmd access timeout. "
-                           "Exiting.\n", __func__, base_vha->host_no));
-                       return QLA_FUNCTION_TIMEOUT;
-               }
+       if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, mcp->tov * HZ)) {
+               /* Timeout occurred. Return error. */
+               DEBUG2_3_11(printk("%s(%ld): cmd access timeout. "
+                   "Exiting.\n", __func__, base_vha->host_no));
+               return QLA_FUNCTION_TIMEOUT;
        }
 
        ha->flags.mbox_busy = 1;
@@ -265,8 +262,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
        }
 
        /* Allow next mbx cmd to come in. */
-       if (!abort_active)
-               complete(&ha->mbx_cmd_comp);
+       complete(&ha->mbx_cmd_comp);
 
        if (rval) {
                DEBUG2_3_11(printk("%s(%ld): **** FAILED. mbx0=%x, mbx1=%x, "
index cf32653fe01a2317aee14dae3856c2aee8017953..c11f872d3e105776f76b9fe566f24289bb87d331 100644 (file)
@@ -65,8 +65,6 @@ MODULE_PARM_DESC(ql2xextended_error_logging,
 
 static void qla2x00_free_device(scsi_qla_host_t *);
 
-static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
-
 int ql2xfdmienable=1;
 module_param(ql2xfdmienable, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xfdmienable,
@@ -800,6 +798,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
                if (ha->isp_ops->abort_command(vha, sp, req)) {
                        DEBUG2(printk("%s(%ld): abort_command "
                        "mbx failed.\n", __func__, vha->host_no));
+                       ret = FAILED;
                } else {
                        DEBUG3(printk("%s(%ld): abort_command "
                        "mbx success.\n", __func__, vha->host_no));
@@ -1241,9 +1240,8 @@ qla2x00_change_queue_type(struct scsi_device *sdev, int tag_type)
  * supported addressing method.
  */
 static void
-qla2x00_config_dma_addressing(scsi_qla_host_t *vha)
+qla2x00_config_dma_addressing(struct qla_hw_data *ha)
 {
-       struct qla_hw_data *ha = vha->hw;
        /* Assume a 32bit DMA mask. */
        ha->flags.enable_64bit_addressing = 0;
 
@@ -1480,7 +1478,7 @@ static struct isp_operations qla81xx_isp_ops = {
        .reset_adapter          = qla24xx_reset_adapter,
        .nvram_config           = qla81xx_nvram_config,
        .update_fw_options      = qla81xx_update_fw_options,
-       .load_risc              = qla24xx_load_risc,
+       .load_risc              = qla81xx_load_risc,
        .pci_info_str           = qla24xx_pci_info_str,
        .fw_version_str         = qla24xx_fw_version_str,
        .intr_handler           = qla24xx_intr_handler,
@@ -1869,6 +1867,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        set_bit(0, (unsigned long *) ha->vp_idx_map);
 
+       qla2x00_config_dma_addressing(ha);
        ret = qla2x00_mem_alloc(ha, req_length, rsp_length, &req, &rsp);
        if (!ret) {
                qla_printk(KERN_WARNING, ha,
@@ -1888,13 +1887,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
                    "[ERROR] Failed to allocate memory for scsi_host\n");
 
                ret = -ENOMEM;
+               qla2x00_mem_free(ha);
+               qla2x00_free_que(ha, req, rsp);
                goto probe_hw_failed;
        }
 
        pci_set_drvdata(pdev, base_vha);
 
-       qla2x00_config_dma_addressing(base_vha);
-
        host = base_vha->host;
        base_vha->req_ques[0] = req->id;
        host->can_queue = req->length + 128;
@@ -1917,14 +1916,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        /* Set up the irqs */
        ret = qla2x00_request_irqs(ha, rsp);
        if (ret)
-               goto probe_failed;
-
+               goto probe_init_failed;
        /* Alloc arrays of request and response ring ptrs */
        if (!qla2x00_alloc_queues(ha)) {
                qla_printk(KERN_WARNING, ha,
                "[ERROR] Failed to allocate memory for queue"
                " pointers\n");
-               goto probe_failed;
+               goto probe_init_failed;
        }
        ha->rsp_q_map[0] = rsp;
        ha->req_q_map[0] = req;
@@ -1997,6 +1995,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        return 0;
 
+probe_init_failed:
+       qla2x00_free_que(ha, req, rsp);
+       ha->max_queues = 0;
+
 probe_failed:
        qla2x00_free_device(base_vha);
 
index 303f8ee11f2550399b439fee5756d3414cffa401..9c3b694c049dad0695a4d99d59de28d3a57493ce 100644 (file)
@@ -944,9 +944,9 @@ qla24xx_unprotect_flash(struct qla_hw_data *ha)
        if (!ha->fdt_wrt_disable)
                return;
 
-       /* Disable flash write-protection. */
+       /* Disable flash write-protection, first clear SR protection bit */
        qla24xx_write_flash_dword(ha, flash_conf_addr(ha, 0x101), 0);
-       /* Some flash parts need an additional zero-write to clear bits.*/
+       /* Then write zero again to clear remaining SR bits.*/
        qla24xx_write_flash_dword(ha, flash_conf_addr(ha, 0x101), 0);
 }
 
@@ -980,12 +980,11 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
     uint32_t dwords)
 {
        int ret;
-       uint32_t liter, miter;
+       uint32_t liter;
        uint32_t sec_mask, rest_addr;
-       uint32_t fdata, findex;
+       uint32_t fdata;
        dma_addr_t optrom_dma;
        void *optrom = NULL;
-       uint32_t *s, *d;
        struct qla_hw_data *ha = vha->hw;
 
        ret = QLA_SUCCESS;
@@ -1003,17 +1002,15 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
        }
 
        rest_addr = (ha->fdt_block_size >> 2) - 1;
-       sec_mask = (ha->optrom_size >> 2) - (ha->fdt_block_size >> 2);
+       sec_mask = ~rest_addr;
 
        qla24xx_unprotect_flash(ha);
 
        for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) {
-
-               findex = faddr;
-               fdata = (findex & sec_mask) << 2;
+               fdata = (faddr & sec_mask) << 2;
 
                /* Are we at the beginning of a sector? */
-               if ((findex & rest_addr) == 0) {
+               if ((faddr & rest_addr) == 0) {
                        /* Do sector unprotect. */
                        if (ha->fdt_unprotect_sec_cmd)
                                qla24xx_write_flash_dword(ha,
@@ -1024,7 +1021,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
                            (fdata & 0xff00) |((fdata << 16) &
                            0xff0000) | ((fdata >> 16) & 0xff));
                        if (ret != QLA_SUCCESS) {
-                               DEBUG9(qla_printk("Unable to flash sector: "
+                               DEBUG9(qla_printk("Unable to erase sector: "
                                    "address=%x.\n", faddr));
                                break;
                        }
@@ -1033,9 +1030,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
                /* Go with burst-write. */
                if (optrom && (liter + OPTROM_BURST_DWORDS) <= dwords) {
                        /* Copy data to DMA'ble buffer. */
-                       for (miter = 0, s = optrom, d = dwptr;
-                           miter < OPTROM_BURST_DWORDS; miter++, s++, d++)
-                               *s = cpu_to_le32(*d);
+                       memcpy(optrom, dwptr, OPTROM_BURST_SIZE);
 
                        ret = qla2x00_load_ram(vha, optrom_dma,
                            flash_data_addr(ha, faddr),
index 808bab6ef06bd68ad062a2c3bae279be83db24a7..cfa4c11a4797abf8a8a2e9b7ee1669ca6d3705ac 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.03.00-k1"
+#define QLA2XXX_VERSION      "8.03.00-k2"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   3
index d6be0762eb918977b27bd428f7057a8e25bba3af..b586f27c3bd4a32f0baa1e629eccbde2eb7ec32b 100644 (file)
@@ -244,6 +244,7 @@ struct ddb_entry {
        uint8_t ip_addr[ISCSI_IPADDR_SIZE];
        uint8_t iscsi_name[ISCSI_NAME_SIZE];    /* 72 x48 */
        uint8_t iscsi_alias[0x20];
+       uint8_t isid[6];
 };
 
 /*
index 109c5f5985ecfb1772956296a27ea219ee7a01ff..af8c3233e8aef9c3449917e9e3850e553a937ca3 100644 (file)
@@ -342,8 +342,12 @@ static struct ddb_entry* qla4xxx_get_ddb_entry(struct scsi_qla_host *ha,
        DEBUG2(printk("scsi%ld: %s: Looking for ddb[%d]\n", ha->host_no,
                      __func__, fw_ddb_index));
        list_for_each_entry(ddb_entry, &ha->ddb_list, list) {
-               if (memcmp(ddb_entry->iscsi_name, fw_ddb_entry->iscsi_name,
-                          ISCSI_NAME_SIZE) == 0) {
+               if ((memcmp(ddb_entry->iscsi_name, fw_ddb_entry->iscsi_name,
+                          ISCSI_NAME_SIZE) == 0) &&
+                       (ddb_entry->tpgt ==
+                               le32_to_cpu(fw_ddb_entry->tgt_portal_grp)) &&
+                       (memcmp(ddb_entry->isid, fw_ddb_entry->isid,
+                               sizeof(ddb_entry->isid)) == 0)) {
                        found++;
                        break;
                }
@@ -430,6 +434,8 @@ static int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha,
 
        ddb_entry->port = le16_to_cpu(fw_ddb_entry->port);
        ddb_entry->tpgt = le32_to_cpu(fw_ddb_entry->tgt_portal_grp);
+       memcpy(ddb_entry->isid, fw_ddb_entry->isid, sizeof(ddb_entry->isid));
+
        memcpy(&ddb_entry->iscsi_name[0], &fw_ddb_entry->iscsi_name[0],
               min(sizeof(ddb_entry->iscsi_name),
                   sizeof(fw_ddb_entry->iscsi_name)));
index 2a3671233b15ac1b45d183b5a7e4b1f545cf281c..536d8e510f66da655b9106ac7eb2e0719edce2b3 100644 (file)
@@ -806,6 +806,8 @@ pci_default_setup(struct serial_private *priv,
 #define PCI_SUBDEVICE_ID_OCTPRO422     0x0208
 #define PCI_SUBDEVICE_ID_POCTAL232     0x0308
 #define PCI_SUBDEVICE_ID_POCTAL422     0x0408
+#define PCI_VENDOR_ID_ADVANTECH                0x13fe
+#define PCI_DEVICE_ID_ADVANTECH_PCI3620        0x3620
 
 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584        0x1584
@@ -2152,6 +2154,10 @@ static int pciserial_resume_one(struct pci_dev *dev)
 #endif
 
 static struct pci_device_id serial_pci_tbl[] = {
+       /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
+       {       PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
+               PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
+               pbn_b2_8_921600 },
        {       PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
                PCI_SUBVENDOR_ID_CONNECT_TECH,
                PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
index 3e525e38a5d998ffbd0331f0b51ebb65ec45ca3c..7d7f576da202728435d314a501e086418d09dd10 100644 (file)
@@ -982,7 +982,7 @@ config SERIAL_SH_SCI_CONSOLE
 
 config SERIAL_PNX8XXX
        bool "Enable PNX8XXX SoCs' UART Support"
-       depends on MIPS && SOC_PNX8550
+       depends on MIPS && (SOC_PNX8550 || SOC_PNX833X)
        select SERIAL_CORE
        help
          If you have a MIPS-based Philips SoC such as PNX8550 or PNX8330
index 338cf8a08b436db85c1b9d11b10b2f868e93fd24..92187e28608aeb6cb03c0a090a38db5d186bd090 100644 (file)
@@ -180,7 +180,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        return rc;
 }
 
-static void jsm_remove_one(struct pci_dev *pdev)
+static void __devexit jsm_remove_one(struct pci_dev *pdev)
 {
        struct jsm_board *brd = pci_get_drvdata(pdev);
        int i = 0;
index 34161907b2f8c2c397867468395541cf7b78d10b..aea23105d3ed4c8bad7e22a38f786c99f3e0f71a 100644 (file)
@@ -38,6 +38,7 @@ struct dmi_device {
 #ifdef CONFIG_DMI
 
 extern int dmi_check_system(const struct dmi_system_id *list);
+const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
 extern const char * dmi_get_system_info(int field);
 extern const struct dmi_device * dmi_find_device(int type, const char *name,
        const struct dmi_device *from);
index 2c6bd66209ff6a076464b206662d7a6cf7730adb..bca3ba25f52ac3cba6c983eb66c0e78ce3074fd9 100644 (file)
@@ -187,6 +187,8 @@ enum {
        ATA_FLAG_PIO_POLLING    = (1 << 9), /* use polling PIO if LLD
                                             * doesn't handle PIO interrupts */
        ATA_FLAG_NCQ            = (1 << 10), /* host supports NCQ */
+       ATA_FLAG_NO_POWEROFF_SPINDOWN = (1 << 11), /* don't spindown before poweroff */
+       ATA_FLAG_NO_HIBERNATE_SPINDOWN = (1 << 12), /* don't spindown before hibernation */
        ATA_FLAG_DEBUGMSG       = (1 << 13),
        ATA_FLAG_IGN_SIMPLEX    = (1 << 15), /* ignore SIMPLEX */
        ATA_FLAG_NO_IORDY       = (1 << 16), /* controller lacks iordy */
index 97b91d1abb433e39ced31566b7d160d46719b66e..fde86671f48f380ed6205eb0c66dcf7aec17fd2c 100644 (file)
@@ -443,6 +443,13 @@ struct dmi_system_id {
        struct dmi_strmatch matches[4];
        void *driver_data;
 };
+/*
+ * struct dmi_device_id appears during expansion of
+ * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it
+ * but this is enough for gcc 3.4.6 to error out:
+ *     error: storage size of '__mod_dmi_device_table' isn't known
+ */
+#define dmi_device_id dmi_system_id
 #endif
 
 #define DMI_MATCH(a, b)        { a, b }
index d56ad9c21c09fb677e9a312da9c30987268ca504..febc10ed3858a474a5d1edf12c8759e133af4fe1 100644 (file)
 #define PCI_DEVICE_ID_VIA_8783_0       0x3208
 #define PCI_DEVICE_ID_VIA_8237         0x3227
 #define PCI_DEVICE_ID_VIA_8251         0x3287
+#define PCI_DEVICE_ID_VIA_8261         0x3402
 #define PCI_DEVICE_ID_VIA_8237A                0x3337
 #define PCI_DEVICE_ID_VIA_8237S                0x3372
 #define PCI_DEVICE_ID_VIA_SATA_EIDE    0x5324
 #define PCI_DEVICE_ID_VIA_CX700                0x8324
 #define PCI_DEVICE_ID_VIA_CX700_IDE    0x0581
 #define PCI_DEVICE_ID_VIA_VX800                0x8353
+#define PCI_DEVICE_ID_VIA_VX855                0x8409
 #define PCI_DEVICE_ID_VIA_8371_1       0x8391
 #define PCI_DEVICE_ID_VIA_82C598_1     0x8598
 #define PCI_DEVICE_ID_VIA_838X_1       0xB188
 #define PCI_DEVICE_ID_VIA_83_87XX_1    0xB198
+#define PCI_DEVICE_ID_VIA_C409_IDE     0XC409
+#define PCI_DEVICE_ID_VIA_ANON         0xFFFF
 
 #define PCI_VENDOR_ID_SIEMENS           0x110A
 #define PCI_DEVICE_ID_SIEMENS_DSCC4     0x2102
index 2b409c44db83456918d5f2e9b6ba72a70732377b..c7d9bb1832ba98ff88ea0fa19f7734b4f238103a 100644 (file)
@@ -237,6 +237,7 @@ extern int hibernate_nvs_alloc(void);
 extern void hibernate_nvs_free(void);
 extern void hibernate_nvs_save(void);
 extern void hibernate_nvs_restore(void);
+extern bool system_entering_hibernation(void);
 #else /* CONFIG_HIBERNATION */
 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
 static inline void swsusp_set_page_free(struct page *p) {}
@@ -252,6 +253,7 @@ static inline int hibernate_nvs_alloc(void) { return 0; }
 static inline void hibernate_nvs_free(void) {}
 static inline void hibernate_nvs_save(void) {}
 static inline void hibernate_nvs_restore(void) {}
+static inline bool system_entering_hibernation(void) { return false; }
 #endif /* CONFIG_HIBERNATION */
 
 #ifdef CONFIG_PM_SLEEP
index c20db0be9173969a52c7ab75341cc8171db63d46..3aba8d12f328ec91e59f5c72217ceb0c0d2fd0a1 100644 (file)
@@ -39,6 +39,18 @@ void handle_bad_irq(unsigned int irq, struct irq_desc *desc)
        ack_bad_irq(irq);
 }
 
+#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
+static void __init init_irq_default_affinity(void)
+{
+       alloc_bootmem_cpumask_var(&irq_default_affinity);
+       cpumask_setall(irq_default_affinity);
+}
+#else
+static void __init init_irq_default_affinity(void)
+{
+}
+#endif
+
 /*
  * Linux has a controller-independent interrupt architecture.
  * Every controller has a 'controller-template', that is used
@@ -134,6 +146,8 @@ int __init early_irq_init(void)
        int legacy_count;
        int i;
 
+       init_irq_default_affinity();
+
        desc = irq_desc_legacy;
        legacy_count = ARRAY_SIZE(irq_desc_legacy);
 
@@ -219,6 +233,8 @@ int __init early_irq_init(void)
        int count;
        int i;
 
+       init_irq_default_affinity();
+
        desc = irq_desc;
        count = ARRAY_SIZE(irq_desc);
 
index cd0cd8dcb3453aee98a20cd6652144cf10e42281..291f03664552387658690f947b1d3a4d9562dcc6 100644 (file)
 
 #include "internals.h"
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
 cpumask_var_t irq_default_affinity;
 
-static int init_irq_default_affinity(void)
-{
-       alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL);
-       cpumask_setall(irq_default_affinity);
-       return 0;
-}
-core_initcall(init_irq_default_affinity);
-
 /**
  *     synchronize_irq - wait for pending IRQ handlers (on other CPUs)
  *     @irq: interrupt number to wait for
index 45e8541ab7e3ee0b699142ed20094b817bdd8255..432ee575c9ee4fd201481a9ebdb674c29b96dab8 100644 (file)
@@ -71,6 +71,14 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops)
        mutex_unlock(&pm_mutex);
 }
 
+static bool entering_platform_hibernation;
+
+bool system_entering_hibernation(void)
+{
+       return entering_platform_hibernation;
+}
+EXPORT_SYMBOL(system_entering_hibernation);
+
 #ifdef CONFIG_PM_DEBUG
 static void hibernation_debug_sleep(void)
 {
@@ -411,6 +419,7 @@ int hibernation_platform_enter(void)
        if (error)
                goto Close;
 
+       entering_platform_hibernation = true;
        suspend_console();
        error = device_suspend(PMSG_HIBERNATE);
        if (error) {
@@ -445,6 +454,7 @@ int hibernation_platform_enter(void)
  Finish:
        hibernation_ops->finish();
  Resume_devices:
+       entering_platform_hibernation = false;
        device_resume(PMSG_RESTORE);
        resume_console();
  Close: