aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-09 16:33:05 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-09 16:33:05 -0400
commitc97f68145e8067b3ac4b126a6faebf90f9ffc302 (patch)
treeeb2060681552a00e9efa98224b95f69a3dc84390 /drivers
parentb1add0480a95b6ceaece5caf6c50614771eae9b2 (diff)
parent7bff3c4ce44ea48f50dc47a5994454984bd08c59 (diff)
Merge branch 'for-rmk' of git://source.mvista.com/git/linux-davinci-2.6.git
Merge branch 'davinci' into devel
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ata_piix.c2
-rw-r--r--drivers/ata/sata_inic162x.c3
-rw-r--r--drivers/crypto/talitos.c6
-rw-r--r--drivers/ide/ide-cd.c2
-rw-r--r--drivers/ide/pci/hpt366.c31
-rw-r--r--drivers/media/video/Kconfig2
-rw-r--r--drivers/memstick/core/memstick.c10
-rw-r--r--drivers/memstick/core/mspro_block.c33
-rw-r--r--drivers/memstick/host/jmb38x_ms.c39
-rw-r--r--drivers/misc/sgi-gru/grufile.c3
-rw-r--r--drivers/net/hp-plus.c8
-rw-r--r--drivers/net/niu.c56
-rw-r--r--drivers/net/wireless/ath9k/beacon.c13
-rw-r--r--drivers/net/wireless/ath9k/core.h1
-rw-r--r--drivers/net/wireless/ath9k/main.c14
-rw-r--r--drivers/net/wireless/b43/rfkill.c18
-rw-r--r--drivers/net/wireless/b43legacy/rfkill.c18
-rw-r--r--drivers/pci/hotplug/fakephp.c6
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c2
-rw-r--r--drivers/pci/intel-iommu.c23
-rw-r--r--drivers/pci/probe.c18
-rw-r--r--drivers/pci/setup-bus.c6
-rw-r--r--drivers/pcmcia/soc_common.c6
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c6
-rw-r--r--drivers/s390/scsi/zfcp_fc.c33
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c88
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c4
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c12
-rw-r--r--drivers/scsi/device_handler/scsi_dh_emc.c4
-rw-r--r--drivers/scsi/device_handler/scsi_dh_rdac.c4
-rw-r--r--drivers/scsi/scsi_error.c2
-rw-r--r--drivers/scsi/scsi_scan.c3
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/sr.c2
-rw-r--r--drivers/serial/imx.c27
-rw-r--r--drivers/spi/pxa2xx_spi.c116
-rw-r--r--drivers/spi/spi_mpc83xx.c26
-rw-r--r--drivers/spi/spi_s3c24xx.c6
-rw-r--r--drivers/video/atmel_lcdfb.c84
40 files changed, 477 insertions, 264 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index b1d08a8f5003..e6b4606e36b6 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1499,7 +1499,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
1499 * off. 1499 * off.
1500 */ 1500 */
1501 if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2652) { 1501 if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2652) {
1502 int rc = piix_disable_ahci(pdev); 1502 rc = piix_disable_ahci(pdev);
1503 if (rc) 1503 if (rc)
1504 return rc; 1504 return rc;
1505 } 1505 }
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 3ead02fe379e..5032c32fa505 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -96,6 +96,7 @@ enum {
96 PORT_SCR = 0x20, 96 PORT_SCR = 0x20,
97 97
98 /* HOST_CTL bits */ 98 /* HOST_CTL bits */
99 HCTL_LEDEN = (1 << 3), /* enable LED operation */
99 HCTL_IRQOFF = (1 << 8), /* global IRQ off */ 100 HCTL_IRQOFF = (1 << 8), /* global IRQ off */
100 HCTL_FTHD0 = (1 << 10), /* fifo threshold 0 */ 101 HCTL_FTHD0 = (1 << 10), /* fifo threshold 0 */
101 HCTL_FTHD1 = (1 << 11), /* fifo threshold 1*/ 102 HCTL_FTHD1 = (1 << 11), /* fifo threshold 1*/
@@ -540,7 +541,7 @@ static unsigned int inic_qc_issue(struct ata_queued_cmd *qc)
540 void __iomem *port_base = inic_port_base(ap); 541 void __iomem *port_base = inic_port_base(ap);
541 542
542 /* fire up the ADMA engine */ 543 /* fire up the ADMA engine */
543 writew(HCTL_FTHD0, port_base + HOST_CTL); 544 writew(HCTL_FTHD0 | HCTL_LEDEN, port_base + HOST_CTL);
544 writew(IDMA_CTL_GO, port_base + PORT_IDMA_CTL); 545 writew(IDMA_CTL_GO, port_base + PORT_IDMA_CTL);
545 writeb(0, port_base + PORT_CPB_PTQFIFO); 546 writeb(0, port_base + PORT_CPB_PTQFIFO);
546 547
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index ee827a7f7c6a..b6ad3ac5916e 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1157,6 +1157,8 @@ static int aead_authenc_givencrypt(
1157 edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT; 1157 edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT;
1158 1158
1159 memcpy(req->giv, ctx->iv, crypto_aead_ivsize(authenc)); 1159 memcpy(req->giv, ctx->iv, crypto_aead_ivsize(authenc));
1160 /* avoid consecutive packets going out with same IV */
1161 *(__be64 *)req->giv ^= cpu_to_be64(req->seq);
1160 1162
1161 return ipsec_esp(edesc, areq, req->giv, req->seq, 1163 return ipsec_esp(edesc, areq, req->giv, req->seq,
1162 ipsec_esp_encrypt_done); 1164 ipsec_esp_encrypt_done);
@@ -1449,6 +1451,8 @@ static int talitos_probe(struct of_device *ofdev,
1449 1451
1450 priv->ofdev = ofdev; 1452 priv->ofdev = ofdev;
1451 1453
1454 INIT_LIST_HEAD(&priv->alg_list);
1455
1452 tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); 1456 tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev);
1453 tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev); 1457 tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev);
1454 1458
@@ -1575,8 +1579,6 @@ static int talitos_probe(struct of_device *ofdev,
1575 } 1579 }
1576 1580
1577 /* register crypto algorithms the device supports */ 1581 /* register crypto algorithms the device supports */
1578 INIT_LIST_HEAD(&priv->alg_list);
1579
1580 for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { 1582 for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
1581 if (hw_supports(dev, driver_algs[i].desc_hdr_template)) { 1583 if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
1582 struct talitos_crypto_alg *t_alg; 1584 struct talitos_crypto_alg *t_alg;
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index f1489999cf91..49a8c589e346 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1933,7 +1933,6 @@ static void ide_cd_remove(ide_drive_t *drive)
1933 1933
1934 ide_proc_unregister_driver(drive, info->driver); 1934 ide_proc_unregister_driver(drive, info->driver);
1935 1935
1936 blk_unregister_filter(info->disk);
1937 del_gendisk(info->disk); 1936 del_gendisk(info->disk);
1938 1937
1939 ide_cd_put(info); 1938 ide_cd_put(info);
@@ -2159,7 +2158,6 @@ static int ide_cd_probe(ide_drive_t *drive)
2159 g->fops = &idecd_ops; 2158 g->fops = &idecd_ops;
2160 g->flags |= GENHD_FL_REMOVABLE; 2159 g->flags |= GENHD_FL_REMOVABLE;
2161 add_disk(g); 2160 add_disk(g);
2162 blk_register_filter(g);
2163 return 0; 2161 return 0;
2164 2162
2165out_free_cd: 2163out_free_cd:
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index eb107eef0dbc..c37ab1743819 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -613,6 +613,14 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
613 return 0; 613 return 0;
614} 614}
615 615
616static struct hpt_info *hpt3xx_get_info(struct device *dev)
617{
618 struct ide_host *host = dev_get_drvdata(dev);
619 struct hpt_info *info = (struct hpt_info *)host->host_priv;
620
621 return dev == host->dev[1] ? info + 1 : info;
622}
623
616/* 624/*
617 * The Marvell bridge chips used on the HighPoint SATA cards do not seem 625 * The Marvell bridge chips used on the HighPoint SATA cards do not seem
618 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... 626 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes...
@@ -621,9 +629,7 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
621static u8 hpt3xx_udma_filter(ide_drive_t *drive) 629static u8 hpt3xx_udma_filter(ide_drive_t *drive)
622{ 630{
623 ide_hwif_t *hwif = HWIF(drive); 631 ide_hwif_t *hwif = HWIF(drive);
624 struct pci_dev *dev = to_pci_dev(hwif->dev); 632 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
625 struct ide_host *host = pci_get_drvdata(dev);
626 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
627 u8 mask = hwif->ultra_mask; 633 u8 mask = hwif->ultra_mask;
628 634
629 switch (info->chip_type) { 635 switch (info->chip_type) {
@@ -662,9 +668,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive)
662static u8 hpt3xx_mdma_filter(ide_drive_t *drive) 668static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
663{ 669{
664 ide_hwif_t *hwif = HWIF(drive); 670 ide_hwif_t *hwif = HWIF(drive);
665 struct pci_dev *dev = to_pci_dev(hwif->dev); 671 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
666 struct ide_host *host = pci_get_drvdata(dev);
667 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
668 672
669 switch (info->chip_type) { 673 switch (info->chip_type) {
670 case HPT372 : 674 case HPT372 :
@@ -700,8 +704,7 @@ static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed)
700{ 704{
701 ide_hwif_t *hwif = drive->hwif; 705 ide_hwif_t *hwif = drive->hwif;
702 struct pci_dev *dev = to_pci_dev(hwif->dev); 706 struct pci_dev *dev = to_pci_dev(hwif->dev);
703 struct ide_host *host = pci_get_drvdata(dev); 707 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
704 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
705 struct hpt_timings *t = info->timings; 708 struct hpt_timings *t = info->timings;
706 u8 itr_addr = 0x40 + (drive->dn * 4); 709 u8 itr_addr = 0x40 + (drive->dn * 4);
707 u32 old_itr = 0; 710 u32 old_itr = 0;
@@ -744,8 +747,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
744{ 747{
745 ide_hwif_t *hwif = HWIF(drive); 748 ide_hwif_t *hwif = HWIF(drive);
746 struct pci_dev *dev = to_pci_dev(hwif->dev); 749 struct pci_dev *dev = to_pci_dev(hwif->dev);
747 struct ide_host *host = pci_get_drvdata(dev); 750 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
748 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
749 751
750 if (drive->quirk_list) { 752 if (drive->quirk_list) {
751 if (info->chip_type >= HPT370) { 753 if (info->chip_type >= HPT370) {
@@ -973,8 +975,7 @@ static int __devinit hpt37x_calibrate_dpll(struct pci_dev *dev, u16 f_low, u16 f
973static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) 975static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev)
974{ 976{
975 unsigned long io_base = pci_resource_start(dev, 4); 977 unsigned long io_base = pci_resource_start(dev, 4);
976 struct ide_host *host = pci_get_drvdata(dev); 978 struct hpt_info *info = hpt3xx_get_info(&dev->dev);
977 struct hpt_info *info = host->host_priv + (&dev->dev == host->dev[1]);
978 const char *name = DRV_NAME; 979 const char *name = DRV_NAME;
979 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ 980 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */
980 u8 chip_type; 981 u8 chip_type;
@@ -1217,8 +1218,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev)
1217static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) 1218static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1218{ 1219{
1219 struct pci_dev *dev = to_pci_dev(hwif->dev); 1220 struct pci_dev *dev = to_pci_dev(hwif->dev);
1220 struct ide_host *host = pci_get_drvdata(dev); 1221 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
1221 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
1222 u8 chip_type = info->chip_type; 1222 u8 chip_type = info->chip_type;
1223 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; 1223 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02;
1224 1224
@@ -1262,8 +1262,7 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1262static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) 1262static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1263{ 1263{
1264 struct pci_dev *dev = to_pci_dev(hwif->dev); 1264 struct pci_dev *dev = to_pci_dev(hwif->dev);
1265 struct ide_host *host = pci_get_drvdata(dev); 1265 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
1266 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
1267 int serialize = HPT_SERIALIZE_IO; 1266 int serialize = HPT_SERIALIZE_IO;
1268 u8 chip_type = info->chip_type; 1267 u8 chip_type = info->chip_type;
1269 u8 new_mcr, old_mcr = 0; 1268 u8 new_mcr, old_mcr = 0;
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index ecbfa1b39b70..3e9e0dcd217e 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -968,7 +968,7 @@ config VIDEO_PXA27x
968 968
969config VIDEO_SH_MOBILE_CEU 969config VIDEO_SH_MOBILE_CEU
970 tristate "SuperH Mobile CEU Interface driver" 970 tristate "SuperH Mobile CEU Interface driver"
971 depends on VIDEO_DEV 971 depends on VIDEO_DEV && HAS_DMA
972 select SOC_CAMERA 972 select SOC_CAMERA
973 select VIDEOBUF_DMA_CONTIG 973 select VIDEOBUF_DMA_CONTIG
974 ---help--- 974 ---help---
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index a38005008a20..cea46906408e 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -185,7 +185,7 @@ static void memstick_free(struct device *dev)
185} 185}
186 186
187static struct class memstick_host_class = { 187static struct class memstick_host_class = {
188 .name = "memstick_host", 188 .name = "memstick_host",
189 .dev_release = memstick_free 189 .dev_release = memstick_free
190}; 190};
191 191
@@ -264,7 +264,7 @@ EXPORT_SYMBOL(memstick_new_req);
264 * @sg - TPC argument 264 * @sg - TPC argument
265 */ 265 */
266void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, 266void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
267 struct scatterlist *sg) 267 const struct scatterlist *sg)
268{ 268{
269 mrq->tpc = tpc; 269 mrq->tpc = tpc;
270 if (tpc & 8) 270 if (tpc & 8)
@@ -294,7 +294,7 @@ EXPORT_SYMBOL(memstick_init_req_sg);
294 * user supplied buffer. 294 * user supplied buffer.
295 */ 295 */
296void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, 296void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
297 void *buf, size_t length) 297 const void *buf, size_t length)
298{ 298{
299 mrq->tpc = tpc; 299 mrq->tpc = tpc;
300 if (tpc & 8) 300 if (tpc & 8)
@@ -439,7 +439,7 @@ static void memstick_check(struct work_struct *work)
439 if (!host->card) { 439 if (!host->card) {
440 if (memstick_power_on(host)) 440 if (memstick_power_on(host))
441 goto out_power_off; 441 goto out_power_off;
442 } else 442 } else if (host->card->stop)
443 host->card->stop(host->card); 443 host->card->stop(host->card);
444 444
445 card = memstick_alloc_card(host); 445 card = memstick_alloc_card(host);
@@ -458,7 +458,7 @@ static void memstick_check(struct work_struct *work)
458 || !(host->card->check(host->card))) { 458 || !(host->card->check(host->card))) {
459 device_unregister(&host->card->dev); 459 device_unregister(&host->card->dev);
460 host->card = NULL; 460 host->card = NULL;
461 } else 461 } else if (host->card->start)
462 host->card->start(host->card); 462 host->card->start(host->card);
463 } 463 }
464 464
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 44b1817f2f2f..d2d2318dafa4 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -30,6 +30,8 @@ module_param(major, int, 0644);
30#define MSPRO_BLOCK_SIGNATURE 0xa5c3 30#define MSPRO_BLOCK_SIGNATURE 0xa5c3
31#define MSPRO_BLOCK_MAX_ATTRIBUTES 41 31#define MSPRO_BLOCK_MAX_ATTRIBUTES 41
32 32
33#define MSPRO_BLOCK_PART_SHIFT 3
34
33enum { 35enum {
34 MSPRO_BLOCK_ID_SYSINFO = 0x10, 36 MSPRO_BLOCK_ID_SYSINFO = 0x10,
35 MSPRO_BLOCK_ID_MODELNAME = 0x15, 37 MSPRO_BLOCK_ID_MODELNAME = 0x15,
@@ -195,7 +197,7 @@ static int mspro_block_bd_open(struct inode *inode, struct file *filp)
195static int mspro_block_disk_release(struct gendisk *disk) 197static int mspro_block_disk_release(struct gendisk *disk)
196{ 198{
197 struct mspro_block_data *msb = disk->private_data; 199 struct mspro_block_data *msb = disk->private_data;
198 int disk_id = disk->first_minor >> MEMSTICK_PART_SHIFT; 200 int disk_id = disk->first_minor >> MSPRO_BLOCK_PART_SHIFT;
199 201
200 mutex_lock(&mspro_block_disk_lock); 202 mutex_lock(&mspro_block_disk_lock);
201 203
@@ -877,6 +879,7 @@ static int mspro_block_switch_interface(struct memstick_dev *card)
877 struct mspro_block_data *msb = memstick_get_drvdata(card); 879 struct mspro_block_data *msb = memstick_get_drvdata(card);
878 int rc = 0; 880 int rc = 0;
879 881
882try_again:
880 if (msb->caps & MEMSTICK_CAP_PAR4) 883 if (msb->caps & MEMSTICK_CAP_PAR4)
881 rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR4); 884 rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR4);
882 else 885 else
@@ -930,6 +933,18 @@ static int mspro_block_switch_interface(struct memstick_dev *card)
930 rc = memstick_set_rw_addr(card); 933 rc = memstick_set_rw_addr(card);
931 if (!rc) 934 if (!rc)
932 rc = mspro_block_set_interface(card, msb->system); 935 rc = mspro_block_set_interface(card, msb->system);
936
937 if (!rc) {
938 msleep(150);
939 rc = mspro_block_wait_for_ced(card);
940 if (rc)
941 return rc;
942
943 if (msb->caps & MEMSTICK_CAP_PAR8) {
944 msb->caps &= ~MEMSTICK_CAP_PAR8;
945 goto try_again;
946 }
947 }
933 } 948 }
934 return rc; 949 return rc;
935} 950}
@@ -1117,14 +1132,16 @@ static int mspro_block_init_card(struct memstick_dev *card)
1117 return -EIO; 1132 return -EIO;
1118 1133
1119 msb->caps = host->caps; 1134 msb->caps = host->caps;
1120 rc = mspro_block_switch_interface(card); 1135
1136 msleep(150);
1137 rc = mspro_block_wait_for_ced(card);
1121 if (rc) 1138 if (rc)
1122 return rc; 1139 return rc;
1123 1140
1124 msleep(200); 1141 rc = mspro_block_switch_interface(card);
1125 rc = mspro_block_wait_for_ced(card);
1126 if (rc) 1142 if (rc)
1127 return rc; 1143 return rc;
1144
1128 dev_dbg(&card->dev, "card activated\n"); 1145 dev_dbg(&card->dev, "card activated\n");
1129 if (msb->system != MEMSTICK_SYS_SERIAL) 1146 if (msb->system != MEMSTICK_SYS_SERIAL)
1130 msb->caps |= MEMSTICK_CAP_AUTO_GET_INT; 1147 msb->caps |= MEMSTICK_CAP_AUTO_GET_INT;
@@ -1192,12 +1209,12 @@ static int mspro_block_init_disk(struct memstick_dev *card)
1192 if (rc) 1209 if (rc)
1193 return rc; 1210 return rc;
1194 1211
1195 if ((disk_id << MEMSTICK_PART_SHIFT) > 255) { 1212 if ((disk_id << MSPRO_BLOCK_PART_SHIFT) > 255) {
1196 rc = -ENOSPC; 1213 rc = -ENOSPC;
1197 goto out_release_id; 1214 goto out_release_id;
1198 } 1215 }
1199 1216
1200 msb->disk = alloc_disk(1 << MEMSTICK_PART_SHIFT); 1217 msb->disk = alloc_disk(1 << MSPRO_BLOCK_PART_SHIFT);
1201 if (!msb->disk) { 1218 if (!msb->disk) {
1202 rc = -ENOMEM; 1219 rc = -ENOMEM;
1203 goto out_release_id; 1220 goto out_release_id;
@@ -1220,7 +1237,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
1220 MSPRO_BLOCK_MAX_PAGES * msb->page_size); 1237 MSPRO_BLOCK_MAX_PAGES * msb->page_size);
1221 1238
1222 msb->disk->major = major; 1239 msb->disk->major = major;
1223 msb->disk->first_minor = disk_id << MEMSTICK_PART_SHIFT; 1240 msb->disk->first_minor = disk_id << MSPRO_BLOCK_PART_SHIFT;
1224 msb->disk->fops = &ms_block_bdops; 1241 msb->disk->fops = &ms_block_bdops;
1225 msb->usage_count = 1; 1242 msb->usage_count = 1;
1226 msb->disk->private_data = msb; 1243 msb->disk->private_data = msb;
@@ -1416,7 +1433,7 @@ out_unlock:
1416 1433
1417static struct memstick_device_id mspro_block_id_tbl[] = { 1434static struct memstick_device_id mspro_block_id_tbl[] = {
1418 {MEMSTICK_MATCH_ALL, MEMSTICK_TYPE_PRO, MEMSTICK_CATEGORY_STORAGE_DUO, 1435 {MEMSTICK_MATCH_ALL, MEMSTICK_TYPE_PRO, MEMSTICK_CATEGORY_STORAGE_DUO,
1419 MEMSTICK_CLASS_GENERIC_DUO}, 1436 MEMSTICK_CLASS_DUO},
1420 {} 1437 {}
1421}; 1438};
1422 1439
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index 3485c63d20b0..2fb95a5b72eb 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -81,6 +81,8 @@ struct jmb38x_ms {
81#define TPC_CODE_SZ_MASK 0x00000700 81#define TPC_CODE_SZ_MASK 0x00000700
82#define TPC_DATA_SZ_MASK 0x00000007 82#define TPC_DATA_SZ_MASK 0x00000007
83 83
84#define HOST_CONTROL_TDELAY_EN 0x00040000
85#define HOST_CONTROL_HW_OC_P 0x00010000
84#define HOST_CONTROL_RESET_REQ 0x00008000 86#define HOST_CONTROL_RESET_REQ 0x00008000
85#define HOST_CONTROL_REI 0x00004000 87#define HOST_CONTROL_REI 0x00004000
86#define HOST_CONTROL_LED 0x00000400 88#define HOST_CONTROL_LED 0x00000400
@@ -88,6 +90,7 @@ struct jmb38x_ms {
88#define HOST_CONTROL_RESET 0x00000100 90#define HOST_CONTROL_RESET 0x00000100
89#define HOST_CONTROL_POWER_EN 0x00000080 91#define HOST_CONTROL_POWER_EN 0x00000080
90#define HOST_CONTROL_CLOCK_EN 0x00000040 92#define HOST_CONTROL_CLOCK_EN 0x00000040
93#define HOST_CONTROL_REO 0x00000008
91#define HOST_CONTROL_IF_SHIFT 4 94#define HOST_CONTROL_IF_SHIFT 4
92 95
93#define HOST_CONTROL_IF_SERIAL 0x0 96#define HOST_CONTROL_IF_SERIAL 0x0
@@ -133,11 +136,15 @@ struct jmb38x_ms {
133#define PAD_PU_PD_ON_MS_SOCK1 0x0f0f0000 136#define PAD_PU_PD_ON_MS_SOCK1 0x0f0f0000
134 137
135#define CLOCK_CONTROL_40MHZ 0x00000001 138#define CLOCK_CONTROL_40MHZ 0x00000001
136#define CLOCK_CONTROL_50MHZ 0x00000002 139#define CLOCK_CONTROL_50MHZ 0x0000000a
137#define CLOCK_CONTROL_60MHZ 0x00000008 140#define CLOCK_CONTROL_60MHZ 0x00000008
138#define CLOCK_CONTROL_62_5MHZ 0x0000000c 141#define CLOCK_CONTROL_62_5MHZ 0x0000000c
139#define CLOCK_CONTROL_OFF 0x00000000 142#define CLOCK_CONTROL_OFF 0x00000000
140 143
144#define PCI_CTL_CLOCK_DLY_ADDR 0x000000b0
145#define PCI_CTL_CLOCK_DLY_MASK_A 0x00000f00
146#define PCI_CTL_CLOCK_DLY_MASK_B 0x0000f000
147
141enum { 148enum {
142 CMD_READY = 0x01, 149 CMD_READY = 0x01,
143 FIFO_READY = 0x02, 150 FIFO_READY = 0x02,
@@ -367,8 +374,7 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh)
367 return host->req->error; 374 return host->req->error;
368 } 375 }
369 376
370 dev_dbg(&msh->dev, "control %08x\n", 377 dev_dbg(&msh->dev, "control %08x\n", readl(host->addr + HOST_CONTROL));
371 readl(host->addr + HOST_CONTROL));
372 dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS)); 378 dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS));
373 dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS)); 379 dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS));
374 380
@@ -637,7 +643,7 @@ static int jmb38x_ms_reset(struct jmb38x_ms_host *host)
637 ndelay(20); 643 ndelay(20);
638 } 644 }
639 dev_dbg(&host->chip->pdev->dev, "reset_req timeout\n"); 645 dev_dbg(&host->chip->pdev->dev, "reset_req timeout\n");
640 return -EIO; 646 /* return -EIO; */
641 647
642reset_next: 648reset_next:
643 writel(HOST_CONTROL_RESET | HOST_CONTROL_CLOCK_EN 649 writel(HOST_CONTROL_RESET | HOST_CONTROL_CLOCK_EN
@@ -680,7 +686,9 @@ static int jmb38x_ms_set_param(struct memstick_host *msh,
680 686
681 host_ctl = 7; 687 host_ctl = 7;
682 host_ctl |= HOST_CONTROL_POWER_EN 688 host_ctl |= HOST_CONTROL_POWER_EN
683 | HOST_CONTROL_CLOCK_EN; 689 | HOST_CONTROL_CLOCK_EN
690 | HOST_CONTROL_HW_OC_P
691 | HOST_CONTROL_TDELAY_EN;
684 writel(host_ctl, host->addr + HOST_CONTROL); 692 writel(host_ctl, host->addr + HOST_CONTROL);
685 693
686 writel(host->id ? PAD_PU_PD_ON_MS_SOCK1 694 writel(host->id ? PAD_PU_PD_ON_MS_SOCK1
@@ -704,33 +712,40 @@ static int jmb38x_ms_set_param(struct memstick_host *msh,
704 break; 712 break;
705 case MEMSTICK_INTERFACE: 713 case MEMSTICK_INTERFACE:
706 host_ctl &= ~(3 << HOST_CONTROL_IF_SHIFT); 714 host_ctl &= ~(3 << HOST_CONTROL_IF_SHIFT);
715 pci_read_config_dword(host->chip->pdev,
716 PCI_CTL_CLOCK_DLY_ADDR,
717 &clock_delay);
718 clock_delay &= host->id ? ~PCI_CTL_CLOCK_DLY_MASK_B
719 : ~PCI_CTL_CLOCK_DLY_MASK_A;
707 720
708 if (value == MEMSTICK_SERIAL) { 721 if (value == MEMSTICK_SERIAL) {
709 host_ctl &= ~HOST_CONTROL_FAST_CLK; 722 host_ctl &= ~HOST_CONTROL_FAST_CLK;
723 host_ctl &= ~HOST_CONTROL_REO;
710 host_ctl |= HOST_CONTROL_IF_SERIAL 724 host_ctl |= HOST_CONTROL_IF_SERIAL
711 << HOST_CONTROL_IF_SHIFT; 725 << HOST_CONTROL_IF_SHIFT;
712 host_ctl |= HOST_CONTROL_REI; 726 host_ctl |= HOST_CONTROL_REI;
713 clock_ctl = CLOCK_CONTROL_40MHZ; 727 clock_ctl = CLOCK_CONTROL_40MHZ;
714 clock_delay = 0;
715 } else if (value == MEMSTICK_PAR4) { 728 } else if (value == MEMSTICK_PAR4) {
716 host_ctl |= HOST_CONTROL_FAST_CLK; 729 host_ctl |= HOST_CONTROL_FAST_CLK | HOST_CONTROL_REO;
717 host_ctl |= HOST_CONTROL_IF_PAR4 730 host_ctl |= HOST_CONTROL_IF_PAR4
718 << HOST_CONTROL_IF_SHIFT; 731 << HOST_CONTROL_IF_SHIFT;
719 host_ctl &= ~HOST_CONTROL_REI; 732 host_ctl &= ~HOST_CONTROL_REI;
720 clock_ctl = CLOCK_CONTROL_40MHZ; 733 clock_ctl = CLOCK_CONTROL_40MHZ;
721 clock_delay = 4; 734 clock_delay |= host->id ? (4 << 12) : (4 << 8);
722 } else if (value == MEMSTICK_PAR8) { 735 } else if (value == MEMSTICK_PAR8) {
723 host_ctl |= HOST_CONTROL_FAST_CLK; 736 host_ctl |= HOST_CONTROL_FAST_CLK;
724 host_ctl |= HOST_CONTROL_IF_PAR8 737 host_ctl |= HOST_CONTROL_IF_PAR8
725 << HOST_CONTROL_IF_SHIFT; 738 << HOST_CONTROL_IF_SHIFT;
726 host_ctl &= ~HOST_CONTROL_REI; 739 host_ctl &= ~(HOST_CONTROL_REI | HOST_CONTROL_REO);
727 clock_ctl = CLOCK_CONTROL_60MHZ; 740 clock_ctl = CLOCK_CONTROL_50MHZ;
728 clock_delay = 0;
729 } else 741 } else
730 return -EINVAL; 742 return -EINVAL;
743
731 writel(host_ctl, host->addr + HOST_CONTROL); 744 writel(host_ctl, host->addr + HOST_CONTROL);
732 writel(clock_ctl, host->addr + CLOCK_CONTROL); 745 writel(clock_ctl, host->addr + CLOCK_CONTROL);
733 writel(clock_delay, host->addr + CLOCK_DELAY); 746 pci_write_config_dword(host->chip->pdev,
747 PCI_CTL_CLOCK_DLY_ADDR,
748 clock_delay);
734 break; 749 break;
735 }; 750 };
736 return 0; 751 return 0;
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index 23c91f5f6b61..d61cee796efd 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -445,6 +445,9 @@ static void __exit gru_exit(void)
445 int order = get_order(sizeof(struct gru_state) * 445 int order = get_order(sizeof(struct gru_state) *
446 GRU_CHIPLETS_PER_BLADE); 446 GRU_CHIPLETS_PER_BLADE);
447 447
448 if (!IS_UV())
449 return;
450
448 for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) 451 for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++)
449 free_irq(IRQ_GRU + i, NULL); 452 free_irq(IRQ_GRU + i, NULL);
450 453
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index 8239939554bc..fbbd3e660c27 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -139,7 +139,7 @@ static int __init do_hpp_probe(struct net_device *dev)
139#ifndef MODULE 139#ifndef MODULE
140struct net_device * __init hp_plus_probe(int unit) 140struct net_device * __init hp_plus_probe(int unit)
141{ 141{
142 struct net_device *dev = alloc_ei_netdev(); 142 struct net_device *dev = alloc_eip_netdev();
143 int err; 143 int err;
144 144
145 if (!dev) 145 if (!dev)
@@ -284,7 +284,7 @@ hpp_open(struct net_device *dev)
284 int option_reg; 284 int option_reg;
285 int retval; 285 int retval;
286 286
287 if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) { 287 if ((retval = request_irq(dev->irq, eip_interrupt, 0, dev->name, dev))) {
288 return retval; 288 return retval;
289 } 289 }
290 290
@@ -302,7 +302,7 @@ hpp_open(struct net_device *dev)
302 /* Select the operational page. */ 302 /* Select the operational page. */
303 outw(Perf_Page, ioaddr + HP_PAGING); 303 outw(Perf_Page, ioaddr + HP_PAGING);
304 304
305 ei_open(dev); 305 eip_open(dev);
306 return 0; 306 return 0;
307} 307}
308 308
@@ -313,7 +313,7 @@ hpp_close(struct net_device *dev)
313 int option_reg = inw(ioaddr + HPP_OPTION); 313 int option_reg = inw(ioaddr + HPP_OPTION);
314 314
315 free_irq(dev->irq, dev); 315 free_irq(dev->irq, dev);
316 ei_close(dev); 316 eip_close(dev);
317 outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset, 317 outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset,
318 ioaddr + HPP_OPTION); 318 ioaddr + HPP_OPTION);
319 319
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index e4765b713aba..e3be81eba8a4 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -5984,6 +5984,56 @@ static void niu_netif_start(struct niu *np)
5984 niu_enable_interrupts(np, 1); 5984 niu_enable_interrupts(np, 1);
5985} 5985}
5986 5986
5987static void niu_reset_buffers(struct niu *np)
5988{
5989 int i, j, k, err;
5990
5991 if (np->rx_rings) {
5992 for (i = 0; i < np->num_rx_rings; i++) {
5993 struct rx_ring_info *rp = &np->rx_rings[i];
5994
5995 for (j = 0, k = 0; j < MAX_RBR_RING_SIZE; j++) {
5996 struct page *page;
5997
5998 page = rp->rxhash[j];
5999 while (page) {
6000 struct page *next =
6001 (struct page *) page->mapping;
6002 u64 base = page->index;
6003 base = base >> RBR_DESCR_ADDR_SHIFT;
6004 rp->rbr[k++] = cpu_to_le32(base);
6005 page = next;
6006 }
6007 }
6008 for (; k < MAX_RBR_RING_SIZE; k++) {
6009 err = niu_rbr_add_page(np, rp, GFP_ATOMIC, k);
6010 if (unlikely(err))
6011 break;
6012 }
6013
6014 rp->rbr_index = rp->rbr_table_size - 1;
6015 rp->rcr_index = 0;
6016 rp->rbr_pending = 0;
6017 rp->rbr_refill_pending = 0;
6018 }
6019 }
6020 if (np->tx_rings) {
6021 for (i = 0; i < np->num_tx_rings; i++) {
6022 struct tx_ring_info *rp = &np->tx_rings[i];
6023
6024 for (j = 0; j < MAX_TX_RING_SIZE; j++) {
6025 if (rp->tx_buffs[j].skb)
6026 (void) release_tx_packet(np, rp, j);
6027 }
6028
6029 rp->pending = MAX_TX_RING_SIZE;
6030 rp->prod = 0;
6031 rp->cons = 0;
6032 rp->wrap_bit = 0;
6033 }
6034 }
6035}
6036
5987static void niu_reset_task(struct work_struct *work) 6037static void niu_reset_task(struct work_struct *work)
5988{ 6038{
5989 struct niu *np = container_of(work, struct niu, reset_task); 6039 struct niu *np = container_of(work, struct niu, reset_task);
@@ -6006,6 +6056,12 @@ static void niu_reset_task(struct work_struct *work)
6006 6056
6007 niu_stop_hw(np); 6057 niu_stop_hw(np);
6008 6058
6059 spin_unlock_irqrestore(&np->lock, flags);
6060
6061 niu_reset_buffers(np);
6062
6063 spin_lock_irqsave(&np->lock, flags);
6064
6009 err = niu_init_hw(np); 6065 err = niu_init_hw(np);
6010 if (!err) { 6066 if (!err) {
6011 np->timer.expires = jiffies + HZ; 6067 np->timer.expires = jiffies + HZ;
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index caf569401a34..00a0eaa08866 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -209,6 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
209 unsigned int curlen; 209 unsigned int curlen;
210 struct ath_txq *cabq; 210 struct ath_txq *cabq;
211 struct ath_txq *mcastq; 211 struct ath_txq *mcastq;
212 struct ieee80211_tx_info *info;
212 avp = sc->sc_vaps[if_id]; 213 avp = sc->sc_vaps[if_id];
213 214
214 mcastq = &avp->av_mcastq; 215 mcastq = &avp->av_mcastq;
@@ -232,6 +233,18 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id)
232 */ 233 */
233 curlen = skb->len; 234 curlen = skb->len;
234 235
236 info = IEEE80211_SKB_CB(skb);
237 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
238 /*
239 * TODO: make sure the seq# gets assigned properly (vs. other
240 * TX frames)
241 */
242 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
243 sc->seq_no += 0x10;
244 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
245 hdr->seq_ctrl |= cpu_to_le16(sc->seq_no);
246 }
247
235 /* XXX: spin_lock_bh should not be used here, but sparse bitches 248 /* XXX: spin_lock_bh should not be used here, but sparse bitches
236 * otherwise. We should fix sparse :) */ 249 * otherwise. We should fix sparse :) */
237 spin_lock_bh(&mcastq->axq_lock); 250 spin_lock_bh(&mcastq->axq_lock);
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index 673b3d81133a..4ee695b76b88 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -992,6 +992,7 @@ struct ath_softc {
992 u32 sc_txintrperiod; /* tx interrupt batching */ 992 u32 sc_txintrperiod; /* tx interrupt batching */
993 int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ 993 int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */
994 u32 sc_ant_tx[8]; /* recent tx frames/antenna */ 994 u32 sc_ant_tx[8]; /* recent tx frames/antenna */
995 u16 seq_no; /* TX sequence number */
995 996
996 /* Beacon */ 997 /* Beacon */
997 struct ath9k_tx_queue_info sc_beacon_qi; 998 struct ath9k_tx_queue_info sc_beacon_qi;
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index c5107f269f24..99badf1404c3 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -369,6 +369,20 @@ static int ath9k_tx(struct ieee80211_hw *hw,
369{ 369{
370 struct ath_softc *sc = hw->priv; 370 struct ath_softc *sc = hw->priv;
371 int hdrlen, padsize; 371 int hdrlen, padsize;
372 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
373
374 /*
375 * As a temporary workaround, assign seq# here; this will likely need
376 * to be cleaned up to work better with Beacon transmission and virtual
377 * BSSes.
378 */
379 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
380 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
381 if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
382 sc->seq_no += 0x10;
383 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
384 hdr->seq_ctrl |= cpu_to_le16(sc->seq_no);
385 }
372 386
373 /* Add the padding after the header if this is not already done */ 387 /* Add the padding after the header if this is not already done */
374 hdrlen = ieee80211_get_hdrlen_from_skb(skb); 388 hdrlen = ieee80211_get_hdrlen_from_skb(skb);
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
index fec5645944a4..34ae125d5384 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -43,23 +43,6 @@ static bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
43 return 0; 43 return 0;
44} 44}
45 45
46/* Update the rfkill state */
47static void b43_rfkill_update_state(struct b43_wldev *dev)
48{
49 struct b43_rfkill *rfk = &(dev->wl->rfkill);
50
51 if (!dev->radio_hw_enable) {
52 rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED;
53 return;
54 }
55
56 if (!dev->phy.radio_on)
57 rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
58 else
59 rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
60
61}
62
63/* The poll callback for the hardware button. */ 46/* The poll callback for the hardware button. */
64static void b43_rfkill_poll(struct input_polled_dev *poll_dev) 47static void b43_rfkill_poll(struct input_polled_dev *poll_dev)
65{ 48{
@@ -77,7 +60,6 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev)
77 if (unlikely(enabled != dev->radio_hw_enable)) { 60 if (unlikely(enabled != dev->radio_hw_enable)) {
78 dev->radio_hw_enable = enabled; 61 dev->radio_hw_enable = enabled;
79 report_change = 1; 62 report_change = 1;
80 b43_rfkill_update_state(dev);
81 b43info(wl, "Radio hardware status changed to %s\n", 63 b43info(wl, "Radio hardware status changed to %s\n",
82 enabled ? "ENABLED" : "DISABLED"); 64 enabled ? "ENABLED" : "DISABLED");
83 } 65 }
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c
index 476add97e974..b32bf6a94f19 100644
--- a/drivers/net/wireless/b43legacy/rfkill.c
+++ b/drivers/net/wireless/b43legacy/rfkill.c
@@ -44,23 +44,6 @@ static bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev)
44 return 0; 44 return 0;
45} 45}
46 46
47/* Update the rfkill state */
48static void b43legacy_rfkill_update_state(struct b43legacy_wldev *dev)
49{
50 struct b43legacy_rfkill *rfk = &(dev->wl->rfkill);
51
52 if (!dev->radio_hw_enable) {
53 rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED;
54 return;
55 }
56
57 if (!dev->phy.radio_on)
58 rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
59 else
60 rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
61
62}
63
64/* The poll callback for the hardware button. */ 47/* The poll callback for the hardware button. */
65static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) 48static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev)
66{ 49{
@@ -78,7 +61,6 @@ static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev)
78 if (unlikely(enabled != dev->radio_hw_enable)) { 61 if (unlikely(enabled != dev->radio_hw_enable)) {
79 dev->radio_hw_enable = enabled; 62 dev->radio_hw_enable = enabled;
80 report_change = 1; 63 report_change = 1;
81 b43legacy_rfkill_update_state(dev);
82 b43legacyinfo(wl, "Radio hardware status changed to %s\n", 64 b43legacyinfo(wl, "Radio hardware status changed to %s\n",
83 enabled ? "ENABLED" : "DISABLED"); 65 enabled ? "ENABLED" : "DISABLED");
84 } 66 }
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 40337a06c18a..146ca9cd1567 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -320,15 +320,15 @@ static int disable_slot(struct hotplug_slot *slot)
320 return -ENODEV; 320 return -ENODEV;
321 } 321 }
322 322
323 /* remove the device from the pci core */
324 pci_remove_bus_device(dev);
325
323 /* queue work item to blow away this sysfs entry and other 326 /* queue work item to blow away this sysfs entry and other
324 * parts. 327 * parts.
325 */ 328 */
326 INIT_WORK(&dslot->remove_work, remove_slot_worker); 329 INIT_WORK(&dslot->remove_work, remove_slot_worker);
327 queue_work(dummyphp_wq, &dslot->remove_work); 330 queue_work(dummyphp_wq, &dslot->remove_work);
328 331
329 /* blow away this sysfs entry and other parts. */
330 remove_slot(dslot);
331
332 pci_dev_put(dev); 332 pci_dev_put(dev);
333 } 333 }
334 return 0; 334 return 0;
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index ab31f5ba665d..9d934ddee956 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -258,7 +258,7 @@ static int pcie_poll_cmd(struct controller *ctrl)
258 return 1; 258 return 1;
259 } 259 }
260 } 260 }
261 while (timeout > 1000) { 261 while (timeout > 0) {
262 msleep(10); 262 msleep(10);
263 timeout -= 10; 263 timeout -= 10;
264 if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) { 264 if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) {
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 8d0e60ac849c..c3edcdc08e72 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2348,11 +2348,34 @@ static void __init iommu_exit_mempool(void)
2348 2348
2349} 2349}
2350 2350
2351static int blacklist_iommu(const struct dmi_system_id *id)
2352{
2353 printk(KERN_INFO "%s detected; disabling IOMMU\n",
2354 id->ident);
2355 dmar_disabled = 1;
2356 return 0;
2357}
2358
2359static struct dmi_system_id __initdata intel_iommu_dmi_table[] = {
2360 { /* Some DG33BU BIOS revisions advertised non-existent VT-d */
2361 .callback = blacklist_iommu,
2362 .ident = "Intel DG33BU",
2363 { DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
2364 DMI_MATCH(DMI_BOARD_NAME, "DG33BU"),
2365 }
2366 },
2367 { }
2368};
2369
2370
2351void __init detect_intel_iommu(void) 2371void __init detect_intel_iommu(void)
2352{ 2372{
2353 if (swiotlb || no_iommu || iommu_detected || dmar_disabled) 2373 if (swiotlb || no_iommu || iommu_detected || dmar_disabled)
2354 return; 2374 return;
2355 if (early_dmar_detect()) { 2375 if (early_dmar_detect()) {
2376 dmi_check_system(intel_iommu_dmi_table);
2377 if (dmar_disabled)
2378 return;
2356 iommu_detected = 1; 2379 iommu_detected = 1;
2357 } 2380 }
2358} 2381}
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index cce2f4cb1fbf..36698e57b97f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -304,6 +304,9 @@ static int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
304 } else { 304 } else {
305 res->start = l64; 305 res->start = l64;
306 res->end = l64 + sz64; 306 res->end = l64 + sz64;
307 printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
308 pci_name(dev), pos, (unsigned long long)res->start,
309 (unsigned long long)res->end);
307 } 310 }
308 } else { 311 } else {
309 sz = pci_size(l, sz, mask); 312 sz = pci_size(l, sz, mask);
@@ -313,6 +316,9 @@ static int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
313 316
314 res->start = l; 317 res->start = l;
315 res->end = l + sz; 318 res->end = l + sz;
319 printk(KERN_DEBUG "PCI: %s reg %x %s: [%llx, %llx]\n", pci_name(dev),
320 pos, (res->flags & IORESOURCE_IO) ? "io port":"32bit mmio",
321 (unsigned long long)res->start, (unsigned long long)res->end);
316 } 322 }
317 323
318 out: 324 out:
@@ -383,7 +389,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
383 res->start = base; 389 res->start = base;
384 if (!res->end) 390 if (!res->end)
385 res->end = limit + 0xfff; 391 res->end = limit + 0xfff;
386 printk(KERN_INFO "PCI: bridge %s io port: [%llx, %llx]\n", pci_name(dev), res->start, res->end); 392 printk(KERN_DEBUG "PCI: bridge %s io port: [%llx, %llx]\n",
393 pci_name(dev), (unsigned long long) res->start,
394 (unsigned long long) res->end);
387 } 395 }
388 396
389 res = child->resource[1]; 397 res = child->resource[1];
@@ -395,7 +403,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
395 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; 403 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
396 res->start = base; 404 res->start = base;
397 res->end = limit + 0xfffff; 405 res->end = limit + 0xfffff;
398 printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", pci_name(dev), res->start, res->end); 406 printk(KERN_DEBUG "PCI: bridge %s 32bit mmio: [%llx, %llx]\n",
407 pci_name(dev), (unsigned long long) res->start,
408 (unsigned long long) res->end);
399 } 409 }
400 410
401 res = child->resource[2]; 411 res = child->resource[2];
@@ -431,7 +441,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
431 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH; 441 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
432 res->start = base; 442 res->start = base;
433 res->end = limit + 0xfffff; 443 res->end = limit + 0xfffff;
434 printk(KERN_INFO "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",res->start, res->end); 444 printk(KERN_DEBUG "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n",
445 pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32",
446 (unsigned long long) res->start, (unsigned long long) res->end);
435 } 447 }
436} 448}
437 449
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 1aad599816f7..3abbfad9ddab 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -540,7 +540,11 @@ static void pci_bus_dump_res(struct pci_bus *bus)
540 if (!res) 540 if (!res)
541 continue; 541 continue;
542 542
543 printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end); 543 printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n",
544 bus->number, i,
545 (res->flags & IORESOURCE_IO) ? "io port" : "mmio",
546 (unsigned long long) res->start,
547 (unsigned long long) res->end);
544 } 548 }
545} 549}
546 550
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index c48f3f69bdaf..da3972153226 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -748,7 +748,9 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
748 748
749 add_timer(&skt->poll_timer); 749 add_timer(&skt->poll_timer);
750 750
751 device_create_file(&skt->socket.dev, &dev_attr_status); 751 ret = device_create_file(&skt->socket.dev, &dev_attr_status);
752 if (ret)
753 goto out_err_8;
752 } 754 }
753 755
754 dev_set_drvdata(dev, sinfo); 756 dev_set_drvdata(dev, sinfo);
@@ -758,6 +760,8 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
758 do { 760 do {
759 skt = &sinfo->skt[i]; 761 skt = &sinfo->skt[i];
760 762
763 device_remove_file(&skt->socket.dev, &dev_attr_status);
764 out_err_8:
761 del_timer_sync(&skt->poll_timer); 765 del_timer_sync(&skt->poll_timer);
762 pcmcia_unregister_socket(&skt->socket); 766 pcmcia_unregister_socket(&skt->socket);
763 767
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 391dd29749f8..51b6a05f4d12 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -152,10 +152,8 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device)
152 */ 152 */
153static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) 153static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
154{ 154{
155 struct zfcp_adapter *adapter; 155 struct zfcp_adapter *adapter = dev_get_drvdata(&ccw_device->dev);
156 156
157 down(&zfcp_data.config_sema);
158 adapter = dev_get_drvdata(&ccw_device->dev);
159 switch (event) { 157 switch (event) {
160 case CIO_GONE: 158 case CIO_GONE:
161 dev_warn(&adapter->ccw_device->dev, "device gone\n"); 159 dev_warn(&adapter->ccw_device->dev, "device gone\n");
@@ -174,8 +172,6 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
174 89, NULL); 172 89, NULL);
175 break; 173 break;
176 } 174 }
177 zfcp_erp_wait(adapter);
178 up(&zfcp_data.config_sema);
179 return 1; 175 return 1;
180} 176}
181 177
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index e984469bb98b..56196c98c07b 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -39,18 +39,6 @@ struct zfcp_gpn_ft {
39 struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS]; 39 struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS];
40}; 40};
41 41
42static struct zfcp_port *zfcp_get_port_by_did(struct zfcp_adapter *adapter,
43 u32 d_id)
44{
45 struct zfcp_port *port;
46
47 list_for_each_entry(port, &adapter->port_list_head, list)
48 if ((port->d_id == d_id) &&
49 !atomic_test_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status))
50 return port;
51 return NULL;
52}
53
54static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, 42static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
55 struct fcp_rscn_element *elem) 43 struct fcp_rscn_element *elem)
56{ 44{
@@ -341,12 +329,13 @@ void zfcp_test_link(struct zfcp_port *port)
341 329
342 zfcp_port_get(port); 330 zfcp_port_get(port);
343 retval = zfcp_fc_adisc(port); 331 retval = zfcp_fc_adisc(port);
344 if (retval == 0 || retval == -EBUSY) 332 if (retval == 0)
345 return; 333 return;
346 334
347 /* send of ADISC was not possible */ 335 /* send of ADISC was not possible */
348 zfcp_port_put(port); 336 zfcp_port_put(port);
349 zfcp_erp_port_forced_reopen(port, 0, 65, NULL); 337 if (retval != -EBUSY)
338 zfcp_erp_port_forced_reopen(port, 0, 65, NULL);
350} 339}
351 340
352static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) 341static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter)
@@ -363,7 +352,6 @@ static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter)
363 if (ret) 352 if (ret)
364 return ret; 353 return ret;
365 zfcp_erp_wait(adapter); 354 zfcp_erp_wait(adapter);
366 zfcp_port_put(adapter->nameserver_port);
367 } 355 }
368 return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, 356 return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
369 &adapter->nameserver_port->status); 357 &adapter->nameserver_port->status);
@@ -475,7 +463,7 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
475 struct zfcp_adapter *adapter = ct->port->adapter; 463 struct zfcp_adapter *adapter = ct->port->adapter;
476 struct zfcp_port *port, *tmp; 464 struct zfcp_port *port, *tmp;
477 u32 d_id; 465 u32 d_id;
478 int ret = 0, x; 466 int ret = 0, x, last = 0;
479 467
480 if (ct->status) 468 if (ct->status)
481 return -EIO; 469 return -EIO;
@@ -492,19 +480,24 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
492 down(&zfcp_data.config_sema); 480 down(&zfcp_data.config_sema);
493 481
494 /* first entry is the header */ 482 /* first entry is the header */
495 for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES; x++) { 483 for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES && !last; x++) {
496 if (x % (ZFCP_GPN_FT_ENTRIES + 1)) 484 if (x % (ZFCP_GPN_FT_ENTRIES + 1))
497 acc++; 485 acc++;
498 else 486 else
499 acc = sg_virt(++sg); 487 acc = sg_virt(++sg);
500 488
489 last = acc->control & 0x80;
501 d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | 490 d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 |
502 acc->port_id[2]; 491 acc->port_id[2];
503 492
504 /* skip the adapter's port and known remote ports */ 493 /* skip the adapter's port and known remote ports */
505 if (acc->wwpn == fc_host_port_name(adapter->scsi_host) || 494 if (acc->wwpn == fc_host_port_name(adapter->scsi_host))
506 zfcp_get_port_by_did(adapter, d_id)) 495 continue;
496 port = zfcp_get_port_by_wwpn(adapter, acc->wwpn);
497 if (port) {
498 zfcp_port_get(port);
507 continue; 499 continue;
500 }
508 501
509 port = zfcp_port_enqueue(adapter, acc->wwpn, 502 port = zfcp_port_enqueue(adapter, acc->wwpn,
510 ZFCP_STATUS_PORT_DID_DID | 503 ZFCP_STATUS_PORT_DID_DID |
@@ -513,8 +506,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
513 ret = PTR_ERR(port); 506 ret = PTR_ERR(port);
514 else 507 else
515 zfcp_erp_port_reopen(port, 0, 149, NULL); 508 zfcp_erp_port_reopen(port, 0, 149, NULL);
516 if (acc->control & 0x80) /* last entry */
517 break;
518 } 509 }
519 510
520 zfcp_erp_wait(adapter); 511 zfcp_erp_wait(adapter);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 19c1ca913874..49dbeb754e5f 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -710,10 +710,10 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req)
710 710
711static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) 711static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue)
712{ 712{
713 spin_lock(&queue->lock); 713 spin_lock_bh(&queue->lock);
714 if (atomic_read(&queue->count)) 714 if (atomic_read(&queue->count))
715 return 1; 715 return 1;
716 spin_unlock(&queue->lock); 716 spin_unlock_bh(&queue->lock);
717 return 0; 717 return 0;
718} 718}
719 719
@@ -722,13 +722,13 @@ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
722 long ret; 722 long ret;
723 struct zfcp_qdio_queue *req_q = &adapter->req_q; 723 struct zfcp_qdio_queue *req_q = &adapter->req_q;
724 724
725 spin_unlock(&req_q->lock); 725 spin_unlock_bh(&req_q->lock);
726 ret = wait_event_interruptible_timeout(adapter->request_wq, 726 ret = wait_event_interruptible_timeout(adapter->request_wq,
727 zfcp_fsf_sbal_check(req_q), 5 * HZ); 727 zfcp_fsf_sbal_check(req_q), 5 * HZ);
728 if (ret > 0) 728 if (ret > 0)
729 return 0; 729 return 0;
730 730
731 spin_lock(&req_q->lock); 731 spin_lock_bh(&req_q->lock);
732 return -EIO; 732 return -EIO;
733} 733}
734 734
@@ -870,14 +870,14 @@ int zfcp_fsf_status_read(struct zfcp_adapter *adapter)
870 volatile struct qdio_buffer_element *sbale; 870 volatile struct qdio_buffer_element *sbale;
871 int retval = -EIO; 871 int retval = -EIO;
872 872
873 spin_lock(&adapter->req_q.lock); 873 spin_lock_bh(&adapter->req_q.lock);
874 if (zfcp_fsf_req_sbal_get(adapter)) 874 if (zfcp_fsf_req_sbal_get(adapter))
875 goto out; 875 goto out;
876 876
877 req = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS, 877 req = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS,
878 ZFCP_REQ_NO_QTCB, 878 ZFCP_REQ_NO_QTCB,
879 adapter->pool.fsf_req_status_read); 879 adapter->pool.fsf_req_status_read);
880 if (unlikely(IS_ERR(req))) { 880 if (IS_ERR(req)) {
881 retval = PTR_ERR(req); 881 retval = PTR_ERR(req);
882 goto out; 882 goto out;
883 } 883 }
@@ -910,7 +910,7 @@ failed_buf:
910 zfcp_fsf_req_free(req); 910 zfcp_fsf_req_free(req);
911 zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); 911 zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL);
912out: 912out:
913 spin_unlock(&adapter->req_q.lock); 913 spin_unlock_bh(&adapter->req_q.lock);
914 return retval; 914 return retval;
915} 915}
916 916
@@ -988,7 +988,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id,
988 goto out; 988 goto out;
989 req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, 989 req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND,
990 req_flags, adapter->pool.fsf_req_abort); 990 req_flags, adapter->pool.fsf_req_abort);
991 if (unlikely(IS_ERR(req))) 991 if (IS_ERR(req))
992 goto out; 992 goto out;
993 993
994 if (unlikely(!(atomic_read(&unit->status) & 994 if (unlikely(!(atomic_read(&unit->status) &
@@ -1106,13 +1106,13 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
1106 struct zfcp_fsf_req *req; 1106 struct zfcp_fsf_req *req;
1107 int ret = -EIO; 1107 int ret = -EIO;
1108 1108
1109 spin_lock(&adapter->req_q.lock); 1109 spin_lock_bh(&adapter->req_q.lock);
1110 if (zfcp_fsf_req_sbal_get(adapter)) 1110 if (zfcp_fsf_req_sbal_get(adapter))
1111 goto out; 1111 goto out;
1112 1112
1113 req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC, 1113 req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC,
1114 ZFCP_REQ_AUTO_CLEANUP, pool); 1114 ZFCP_REQ_AUTO_CLEANUP, pool);
1115 if (unlikely(IS_ERR(req))) { 1115 if (IS_ERR(req)) {
1116 ret = PTR_ERR(req); 1116 ret = PTR_ERR(req);
1117 goto out; 1117 goto out;
1118 } 1118 }
@@ -1148,7 +1148,7 @@ failed_send:
1148 if (erp_action) 1148 if (erp_action)
1149 erp_action->fsf_req = NULL; 1149 erp_action->fsf_req = NULL;
1150out: 1150out:
1151 spin_unlock(&adapter->req_q.lock); 1151 spin_unlock_bh(&adapter->req_q.lock);
1152 return ret; 1152 return ret;
1153} 1153}
1154 1154
@@ -1223,7 +1223,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els)
1223 goto out; 1223 goto out;
1224 req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, 1224 req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS,
1225 ZFCP_REQ_AUTO_CLEANUP, NULL); 1225 ZFCP_REQ_AUTO_CLEANUP, NULL);
1226 if (unlikely(IS_ERR(req))) { 1226 if (IS_ERR(req)) {
1227 ret = PTR_ERR(req); 1227 ret = PTR_ERR(req);
1228 goto out; 1228 goto out;
1229 } 1229 }
@@ -1263,14 +1263,14 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1263 struct zfcp_adapter *adapter = erp_action->adapter; 1263 struct zfcp_adapter *adapter = erp_action->adapter;
1264 int retval = -EIO; 1264 int retval = -EIO;
1265 1265
1266 spin_lock(&adapter->req_q.lock); 1266 spin_lock_bh(&adapter->req_q.lock);
1267 if (!atomic_read(&adapter->req_q.count)) 1267 if (!atomic_read(&adapter->req_q.count))
1268 goto out; 1268 goto out;
1269 req = zfcp_fsf_req_create(adapter, 1269 req = zfcp_fsf_req_create(adapter,
1270 FSF_QTCB_EXCHANGE_CONFIG_DATA, 1270 FSF_QTCB_EXCHANGE_CONFIG_DATA,
1271 ZFCP_REQ_AUTO_CLEANUP, 1271 ZFCP_REQ_AUTO_CLEANUP,
1272 adapter->pool.fsf_req_erp); 1272 adapter->pool.fsf_req_erp);
1273 if (unlikely(IS_ERR(req))) { 1273 if (IS_ERR(req)) {
1274 retval = PTR_ERR(req); 1274 retval = PTR_ERR(req);
1275 goto out; 1275 goto out;
1276 } 1276 }
@@ -1295,7 +1295,7 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1295 erp_action->fsf_req = NULL; 1295 erp_action->fsf_req = NULL;
1296 } 1296 }
1297out: 1297out:
1298 spin_unlock(&adapter->req_q.lock); 1298 spin_unlock_bh(&adapter->req_q.lock);
1299 return retval; 1299 return retval;
1300} 1300}
1301 1301
@@ -1306,13 +1306,13 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter,
1306 struct zfcp_fsf_req *req = NULL; 1306 struct zfcp_fsf_req *req = NULL;
1307 int retval = -EIO; 1307 int retval = -EIO;
1308 1308
1309 spin_lock(&adapter->req_q.lock); 1309 spin_lock_bh(&adapter->req_q.lock);
1310 if (zfcp_fsf_req_sbal_get(adapter)) 1310 if (zfcp_fsf_req_sbal_get(adapter))
1311 goto out; 1311 goto out;
1312 1312
1313 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA, 1313 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA,
1314 0, NULL); 1314 0, NULL);
1315 if (unlikely(IS_ERR(req))) { 1315 if (IS_ERR(req)) {
1316 retval = PTR_ERR(req); 1316 retval = PTR_ERR(req);
1317 goto out; 1317 goto out;
1318 } 1318 }
@@ -1334,7 +1334,7 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter,
1334 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1334 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
1335 retval = zfcp_fsf_req_send(req); 1335 retval = zfcp_fsf_req_send(req);
1336out: 1336out:
1337 spin_unlock(&adapter->req_q.lock); 1337 spin_unlock_bh(&adapter->req_q.lock);
1338 if (!retval) 1338 if (!retval)
1339 wait_event(req->completion_wq, 1339 wait_event(req->completion_wq,
1340 req->status & ZFCP_STATUS_FSFREQ_COMPLETED); 1340 req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
@@ -1359,13 +1359,13 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
1359 if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) 1359 if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT))
1360 return -EOPNOTSUPP; 1360 return -EOPNOTSUPP;
1361 1361
1362 spin_lock(&adapter->req_q.lock); 1362 spin_lock_bh(&adapter->req_q.lock);
1363 if (!atomic_read(&adapter->req_q.count)) 1363 if (!atomic_read(&adapter->req_q.count))
1364 goto out; 1364 goto out;
1365 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 1365 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
1366 ZFCP_REQ_AUTO_CLEANUP, 1366 ZFCP_REQ_AUTO_CLEANUP,
1367 adapter->pool.fsf_req_erp); 1367 adapter->pool.fsf_req_erp);
1368 if (unlikely(IS_ERR(req))) { 1368 if (IS_ERR(req)) {
1369 retval = PTR_ERR(req); 1369 retval = PTR_ERR(req);
1370 goto out; 1370 goto out;
1371 } 1371 }
@@ -1385,7 +1385,7 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
1385 erp_action->fsf_req = NULL; 1385 erp_action->fsf_req = NULL;
1386 } 1386 }
1387out: 1387out:
1388 spin_unlock(&adapter->req_q.lock); 1388 spin_unlock_bh(&adapter->req_q.lock);
1389 return retval; 1389 return retval;
1390} 1390}
1391 1391
@@ -1405,13 +1405,13 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter,
1405 if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) 1405 if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT))
1406 return -EOPNOTSUPP; 1406 return -EOPNOTSUPP;
1407 1407
1408 spin_lock(&adapter->req_q.lock); 1408 spin_lock_bh(&adapter->req_q.lock);
1409 if (!atomic_read(&adapter->req_q.count)) 1409 if (!atomic_read(&adapter->req_q.count))
1410 goto out; 1410 goto out;
1411 1411
1412 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0, 1412 req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0,
1413 NULL); 1413 NULL);
1414 if (unlikely(IS_ERR(req))) { 1414 if (IS_ERR(req)) {
1415 retval = PTR_ERR(req); 1415 retval = PTR_ERR(req);
1416 goto out; 1416 goto out;
1417 } 1417 }
@@ -1427,7 +1427,7 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter,
1427 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1427 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
1428 retval = zfcp_fsf_req_send(req); 1428 retval = zfcp_fsf_req_send(req);
1429out: 1429out:
1430 spin_unlock(&adapter->req_q.lock); 1430 spin_unlock_bh(&adapter->req_q.lock);
1431 if (!retval) 1431 if (!retval)
1432 wait_event(req->completion_wq, 1432 wait_event(req->completion_wq,
1433 req->status & ZFCP_STATUS_FSFREQ_COMPLETED); 1433 req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
@@ -1531,7 +1531,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1531 struct zfcp_fsf_req *req; 1531 struct zfcp_fsf_req *req;
1532 int retval = -EIO; 1532 int retval = -EIO;
1533 1533
1534 spin_lock(&adapter->req_q.lock); 1534 spin_lock_bh(&adapter->req_q.lock);
1535 if (zfcp_fsf_req_sbal_get(adapter)) 1535 if (zfcp_fsf_req_sbal_get(adapter))
1536 goto out; 1536 goto out;
1537 1537
@@ -1539,7 +1539,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1539 FSF_QTCB_OPEN_PORT_WITH_DID, 1539 FSF_QTCB_OPEN_PORT_WITH_DID,
1540 ZFCP_REQ_AUTO_CLEANUP, 1540 ZFCP_REQ_AUTO_CLEANUP,
1541 adapter->pool.fsf_req_erp); 1541 adapter->pool.fsf_req_erp);
1542 if (unlikely(IS_ERR(req))) { 1542 if (IS_ERR(req)) {
1543 retval = PTR_ERR(req); 1543 retval = PTR_ERR(req);
1544 goto out; 1544 goto out;
1545 } 1545 }
@@ -1562,7 +1562,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1562 erp_action->fsf_req = NULL; 1562 erp_action->fsf_req = NULL;
1563 } 1563 }
1564out: 1564out:
1565 spin_unlock(&adapter->req_q.lock); 1565 spin_unlock_bh(&adapter->req_q.lock);
1566 return retval; 1566 return retval;
1567} 1567}
1568 1568
@@ -1603,14 +1603,14 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
1603 struct zfcp_fsf_req *req; 1603 struct zfcp_fsf_req *req;
1604 int retval = -EIO; 1604 int retval = -EIO;
1605 1605
1606 spin_lock(&adapter->req_q.lock); 1606 spin_lock_bh(&adapter->req_q.lock);
1607 if (zfcp_fsf_req_sbal_get(adapter)) 1607 if (zfcp_fsf_req_sbal_get(adapter))
1608 goto out; 1608 goto out;
1609 1609
1610 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PORT, 1610 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PORT,
1611 ZFCP_REQ_AUTO_CLEANUP, 1611 ZFCP_REQ_AUTO_CLEANUP,
1612 adapter->pool.fsf_req_erp); 1612 adapter->pool.fsf_req_erp);
1613 if (unlikely(IS_ERR(req))) { 1613 if (IS_ERR(req)) {
1614 retval = PTR_ERR(req); 1614 retval = PTR_ERR(req);
1615 goto out; 1615 goto out;
1616 } 1616 }
@@ -1633,7 +1633,7 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
1633 erp_action->fsf_req = NULL; 1633 erp_action->fsf_req = NULL;
1634 } 1634 }
1635out: 1635out:
1636 spin_unlock(&adapter->req_q.lock); 1636 spin_unlock_bh(&adapter->req_q.lock);
1637 return retval; 1637 return retval;
1638} 1638}
1639 1639
@@ -1700,14 +1700,14 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
1700 struct zfcp_fsf_req *req; 1700 struct zfcp_fsf_req *req;
1701 int retval = -EIO; 1701 int retval = -EIO;
1702 1702
1703 spin_lock(&adapter->req_q.lock); 1703 spin_lock_bh(&adapter->req_q.lock);
1704 if (zfcp_fsf_req_sbal_get(adapter)) 1704 if (zfcp_fsf_req_sbal_get(adapter))
1705 goto out; 1705 goto out;
1706 1706
1707 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PHYSICAL_PORT, 1707 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PHYSICAL_PORT,
1708 ZFCP_REQ_AUTO_CLEANUP, 1708 ZFCP_REQ_AUTO_CLEANUP,
1709 adapter->pool.fsf_req_erp); 1709 adapter->pool.fsf_req_erp);
1710 if (unlikely(IS_ERR(req))) { 1710 if (IS_ERR(req)) {
1711 retval = PTR_ERR(req); 1711 retval = PTR_ERR(req);
1712 goto out; 1712 goto out;
1713 } 1713 }
@@ -1731,7 +1731,7 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
1731 erp_action->fsf_req = NULL; 1731 erp_action->fsf_req = NULL;
1732 } 1732 }
1733out: 1733out:
1734 spin_unlock(&adapter->req_q.lock); 1734 spin_unlock_bh(&adapter->req_q.lock);
1735 return retval; 1735 return retval;
1736} 1736}
1737 1737
@@ -1875,14 +1875,14 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
1875 struct zfcp_fsf_req *req; 1875 struct zfcp_fsf_req *req;
1876 int retval = -EIO; 1876 int retval = -EIO;
1877 1877
1878 spin_lock(&adapter->req_q.lock); 1878 spin_lock_bh(&adapter->req_q.lock);
1879 if (zfcp_fsf_req_sbal_get(adapter)) 1879 if (zfcp_fsf_req_sbal_get(adapter))
1880 goto out; 1880 goto out;
1881 1881
1882 req = zfcp_fsf_req_create(adapter, FSF_QTCB_OPEN_LUN, 1882 req = zfcp_fsf_req_create(adapter, FSF_QTCB_OPEN_LUN,
1883 ZFCP_REQ_AUTO_CLEANUP, 1883 ZFCP_REQ_AUTO_CLEANUP,
1884 adapter->pool.fsf_req_erp); 1884 adapter->pool.fsf_req_erp);
1885 if (unlikely(IS_ERR(req))) { 1885 if (IS_ERR(req)) {
1886 retval = PTR_ERR(req); 1886 retval = PTR_ERR(req);
1887 goto out; 1887 goto out;
1888 } 1888 }
@@ -1910,7 +1910,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
1910 erp_action->fsf_req = NULL; 1910 erp_action->fsf_req = NULL;
1911 } 1911 }
1912out: 1912out:
1913 spin_unlock(&adapter->req_q.lock); 1913 spin_unlock_bh(&adapter->req_q.lock);
1914 return retval; 1914 return retval;
1915} 1915}
1916 1916
@@ -1965,13 +1965,13 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
1965 struct zfcp_fsf_req *req; 1965 struct zfcp_fsf_req *req;
1966 int retval = -EIO; 1966 int retval = -EIO;
1967 1967
1968 spin_lock(&adapter->req_q.lock); 1968 spin_lock_bh(&adapter->req_q.lock);
1969 if (zfcp_fsf_req_sbal_get(adapter)) 1969 if (zfcp_fsf_req_sbal_get(adapter))
1970 goto out; 1970 goto out;
1971 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, 1971 req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN,
1972 ZFCP_REQ_AUTO_CLEANUP, 1972 ZFCP_REQ_AUTO_CLEANUP,
1973 adapter->pool.fsf_req_erp); 1973 adapter->pool.fsf_req_erp);
1974 if (unlikely(IS_ERR(req))) { 1974 if (IS_ERR(req)) {
1975 retval = PTR_ERR(req); 1975 retval = PTR_ERR(req);
1976 goto out; 1976 goto out;
1977 } 1977 }
@@ -1995,7 +1995,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
1995 erp_action->fsf_req = NULL; 1995 erp_action->fsf_req = NULL;
1996 } 1996 }
1997out: 1997out:
1998 spin_unlock(&adapter->req_q.lock); 1998 spin_unlock_bh(&adapter->req_q.lock);
1999 return retval; 1999 return retval;
2000} 2000}
2001 2001
@@ -2228,7 +2228,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
2228 goto out; 2228 goto out;
2229 req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, 2229 req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
2230 adapter->pool.fsf_req_scsi); 2230 adapter->pool.fsf_req_scsi);
2231 if (unlikely(IS_ERR(req))) { 2231 if (IS_ERR(req)) {
2232 retval = PTR_ERR(req); 2232 retval = PTR_ERR(req);
2233 goto out; 2233 goto out;
2234 } 2234 }
@@ -2351,7 +2351,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter,
2351 goto out; 2351 goto out;
2352 req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, 2352 req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
2353 adapter->pool.fsf_req_scsi); 2353 adapter->pool.fsf_req_scsi);
2354 if (unlikely(IS_ERR(req))) 2354 if (IS_ERR(req))
2355 goto out; 2355 goto out;
2356 2356
2357 req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT; 2357 req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT;
@@ -2417,12 +2417,12 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter,
2417 return ERR_PTR(-EINVAL); 2417 return ERR_PTR(-EINVAL);
2418 } 2418 }
2419 2419
2420 spin_lock(&adapter->req_q.lock); 2420 spin_lock_bh(&adapter->req_q.lock);
2421 if (zfcp_fsf_req_sbal_get(adapter)) 2421 if (zfcp_fsf_req_sbal_get(adapter))
2422 goto out; 2422 goto out;
2423 2423
2424 req = zfcp_fsf_req_create(adapter, fsf_cfdc->command, 0, NULL); 2424 req = zfcp_fsf_req_create(adapter, fsf_cfdc->command, 0, NULL);
2425 if (unlikely(IS_ERR(req))) { 2425 if (IS_ERR(req)) {
2426 retval = -EPERM; 2426 retval = -EPERM;
2427 goto out; 2427 goto out;
2428 } 2428 }
@@ -2447,7 +2447,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter,
2447 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 2447 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
2448 retval = zfcp_fsf_req_send(req); 2448 retval = zfcp_fsf_req_send(req);
2449out: 2449out:
2450 spin_unlock(&adapter->req_q.lock); 2450 spin_unlock_bh(&adapter->req_q.lock);
2451 2451
2452 if (!retval) { 2452 if (!retval) {
2453 wait_event(req->completion_wq, 2453 wait_event(req->completion_wq,
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index d6dbd653fde9..69d632d851d9 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -423,9 +423,9 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter)
423 423
424 /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ 424 /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */
425 req_q = &adapter->req_q; 425 req_q = &adapter->req_q;
426 spin_lock(&req_q->lock); 426 spin_lock_bh(&req_q->lock);
427 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); 427 atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status);
428 spin_unlock(&req_q->lock); 428 spin_unlock_bh(&req_q->lock);
429 429
430 qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); 430 qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR);
431 431
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index c7f06298bd3c..4e0322b1c1ea 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -63,7 +63,7 @@ comment "SCSI support type (disk, tape, CD-ROM)"
63config BLK_DEV_SD 63config BLK_DEV_SD
64 tristate "SCSI disk support" 64 tristate "SCSI disk support"
65 depends on SCSI 65 depends on SCSI
66 select CRC_T10DIF 66 select CRC_T10DIF if BLK_DEV_INTEGRITY
67 ---help--- 67 ---help---
68 If you want to use SCSI hard disks, Fibre Channel disks, 68 If you want to use SCSI hard disks, Fibre Channel disks,
69 Serial ATA (SATA) or Parallel ATA (PATA) hard disks, 69 Serial ATA (SATA) or Parallel ATA (PATA) hard disks,
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 994da56fffed..708e475896b9 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -425,7 +425,7 @@ static int alua_check_sense(struct scsi_device *sdev,
425 /* 425 /*
426 * LUN Not Accessible - ALUA state transition 426 * LUN Not Accessible - ALUA state transition
427 */ 427 */
428 return NEEDS_RETRY; 428 return ADD_TO_MLQUEUE;
429 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0b) 429 if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0b)
430 /* 430 /*
431 * LUN Not Accessible -- Target port in standby state 431 * LUN Not Accessible -- Target port in standby state
@@ -447,18 +447,18 @@ static int alua_check_sense(struct scsi_device *sdev,
447 /* 447 /*
448 * Power On, Reset, or Bus Device Reset, just retry. 448 * Power On, Reset, or Bus Device Reset, just retry.
449 */ 449 */
450 return NEEDS_RETRY; 450 return ADD_TO_MLQUEUE;
451 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06) { 451 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06) {
452 /* 452 /*
453 * ALUA state changed 453 * ALUA state changed
454 */ 454 */
455 return NEEDS_RETRY; 455 return ADD_TO_MLQUEUE;
456 } 456 }
457 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07) { 457 if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07) {
458 /* 458 /*
459 * Implicit ALUA state transition failed 459 * Implicit ALUA state transition failed
460 */ 460 */
461 return NEEDS_RETRY; 461 return ADD_TO_MLQUEUE;
462 } 462 }
463 break; 463 break;
464 } 464 }
@@ -490,7 +490,7 @@ static int alua_stpg(struct scsi_device *sdev, int state,
490 if (!err) 490 if (!err)
491 return SCSI_DH_IO; 491 return SCSI_DH_IO;
492 err = alua_check_sense(sdev, &sense_hdr); 492 err = alua_check_sense(sdev, &sense_hdr);
493 if (retry > 0 && err == NEEDS_RETRY) { 493 if (retry > 0 && err == ADD_TO_MLQUEUE) {
494 retry--; 494 retry--;
495 goto retry; 495 goto retry;
496 } 496 }
@@ -535,7 +535,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
535 return SCSI_DH_IO; 535 return SCSI_DH_IO;
536 536
537 err = alua_check_sense(sdev, &sense_hdr); 537 err = alua_check_sense(sdev, &sense_hdr);
538 if (err == NEEDS_RETRY) 538 if (err == ADD_TO_MLQUEUE)
539 goto retry; 539 goto retry;
540 sdev_printk(KERN_INFO, sdev, 540 sdev_printk(KERN_INFO, sdev,
541 "%s: rtpg sense code %02x/%02x/%02x\n", 541 "%s: rtpg sense code %02x/%02x/%02x\n",
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
index b9d23e9e9a44..ef693e8412e9 100644
--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -439,7 +439,7 @@ static int clariion_check_sense(struct scsi_device *sdev,
439 * Unit Attention Code. This is the first IO 439 * Unit Attention Code. This is the first IO
440 * to the new path, so just retry. 440 * to the new path, so just retry.
441 */ 441 */
442 return NEEDS_RETRY; 442 return ADD_TO_MLQUEUE;
443 break; 443 break;
444 } 444 }
445 445
@@ -514,7 +514,7 @@ retry:
514 return SCSI_DH_IO; 514 return SCSI_DH_IO;
515 515
516 err = clariion_check_sense(sdev, &sshdr); 516 err = clariion_check_sense(sdev, &sshdr);
517 if (retry > 0 && err == NEEDS_RETRY) { 517 if (retry > 0 && err == ADD_TO_MLQUEUE) {
518 retry--; 518 retry--;
519 goto retry; 519 goto retry;
520 } 520 }
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 2dee69da35cf..6e2f130d56de 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -551,7 +551,7 @@ static int rdac_check_sense(struct scsi_device *sdev,
551 * 551 *
552 * Just retry and wait. 552 * Just retry and wait.
553 */ 553 */
554 return NEEDS_RETRY; 554 return ADD_TO_MLQUEUE;
555 break; 555 break;
556 case ILLEGAL_REQUEST: 556 case ILLEGAL_REQUEST:
557 if (sense_hdr->asc == 0x94 && sense_hdr->ascq == 0x01) { 557 if (sense_hdr->asc == 0x94 && sense_hdr->ascq == 0x01) {
@@ -568,7 +568,7 @@ static int rdac_check_sense(struct scsi_device *sdev,
568 /* 568 /*
569 * Power On, Reset, or Bus Device Reset, just retry. 569 * Power On, Reset, or Bus Device Reset, just retry.
570 */ 570 */
571 return NEEDS_RETRY; 571 return ADD_TO_MLQUEUE;
572 break; 572 break;
573 } 573 }
574 /* success just means we do not care what scsi-ml does */ 574 /* success just means we do not care what scsi-ml does */
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 880051c89bde..39ce3aba1dac 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -391,7 +391,7 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
391 391
392 case HARDWARE_ERROR: 392 case HARDWARE_ERROR:
393 if (scmd->device->retry_hwerror) 393 if (scmd->device->retry_hwerror)
394 return NEEDS_RETRY; 394 return ADD_TO_MLQUEUE;
395 else 395 else
396 return SUCCESS; 396 return SUCCESS;
397 397
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 84b4879cff11..34d0de6cd511 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1080,7 +1080,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
1080 * PDT=1Fh none (no FDD connected to the requested logical unit) 1080 * PDT=1Fh none (no FDD connected to the requested logical unit)
1081 */ 1081 */
1082 if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && 1082 if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) &&
1083 (result[0] & 0x1f) == 0x1f) { 1083 (result[0] & 0x1f) == 0x1f &&
1084 !scsi_is_wlun(lun)) {
1084 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO 1085 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO
1085 "scsi scan: peripheral device type" 1086 "scsi scan: peripheral device type"
1086 " of 31, no device added\n")); 1087 " of 31, no device added\n"));
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 2a2bc89aba83..e5e7d7856454 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1875,7 +1875,6 @@ static int sd_probe(struct device *dev)
1875 1875
1876 dev_set_drvdata(dev, sdkp); 1876 dev_set_drvdata(dev, sdkp);
1877 add_disk(gd); 1877 add_disk(gd);
1878 blk_register_filter(gd);
1879 sd_dif_config_host(sdkp); 1878 sd_dif_config_host(sdkp);
1880 1879
1881 sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", 1880 sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
@@ -1909,7 +1908,6 @@ static int sd_remove(struct device *dev)
1909 struct scsi_disk *sdkp = dev_get_drvdata(dev); 1908 struct scsi_disk *sdkp = dev_get_drvdata(dev);
1910 1909
1911 device_del(&sdkp->dev); 1910 device_del(&sdkp->dev);
1912 blk_unregister_filter(sdkp->disk);
1913 del_gendisk(sdkp->disk); 1911 del_gendisk(sdkp->disk);
1914 sd_shutdown(dev); 1912 sd_shutdown(dev);
1915 1913
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 3292965bfd84..27f5bfd1def3 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -656,7 +656,6 @@ static int sr_probe(struct device *dev)
656 dev_set_drvdata(dev, cd); 656 dev_set_drvdata(dev, cd);
657 disk->flags |= GENHD_FL_REMOVABLE; 657 disk->flags |= GENHD_FL_REMOVABLE;
658 add_disk(disk); 658 add_disk(disk);
659 blk_register_filter(disk);
660 659
661 sdev_printk(KERN_DEBUG, sdev, 660 sdev_printk(KERN_DEBUG, sdev,
662 "Attached scsi CD-ROM %s\n", cd->cdi.name); 661 "Attached scsi CD-ROM %s\n", cd->cdi.name);
@@ -895,7 +894,6 @@ static int sr_remove(struct device *dev)
895{ 894{
896 struct scsi_cd *cd = dev_get_drvdata(dev); 895 struct scsi_cd *cd = dev_get_drvdata(dev);
897 896
898 blk_unregister_filter(cd->disk);
899 del_gendisk(cd->disk); 897 del_gendisk(cd->disk);
900 898
901 mutex_lock(&sr_ref_mutex); 899 mutex_lock(&sr_ref_mutex);
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 6a29f9330a73..3f90f1bbbbcd 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -127,8 +127,13 @@
127#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ 127#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
128#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ 128#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
129#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ 129#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
130#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */ 130#ifdef CONFIG_ARCH_IMX
131#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */ 131#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */
132#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */
133#endif
134#if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3
135#define UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */
136#endif
132#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ 137#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
133#define UCR3_BPEN (1<<0) /* Preset registers enable */ 138#define UCR3_BPEN (1<<0) /* Preset registers enable */
134#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ 139#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
@@ -445,7 +450,7 @@ static irqreturn_t imx_int(int irq, void *dev_id)
445 readl(sport->port.membase + UCR1) & UCR1_TXMPTYEN) 450 readl(sport->port.membase + UCR1) & UCR1_TXMPTYEN)
446 imx_txint(irq, dev_id); 451 imx_txint(irq, dev_id);
447 452
448 if (sts & USR1_RTSS) 453 if (sts & USR1_RTSD)
449 imx_rtsint(irq, dev_id); 454 imx_rtsint(irq, dev_id);
450 455
451 return IRQ_HANDLED; 456 return IRQ_HANDLED;
@@ -598,6 +603,12 @@ static int imx_startup(struct uart_port *port)
598 temp |= (UCR2_RXEN | UCR2_TXEN); 603 temp |= (UCR2_RXEN | UCR2_TXEN);
599 writel(temp, sport->port.membase + UCR2); 604 writel(temp, sport->port.membase + UCR2);
600 605
606#if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3
607 temp = readl(sport->port.membase + UCR3);
608 temp |= UCR3_RXDMUXSEL;
609 writel(temp, sport->port.membase + UCR3);
610#endif
611
601 /* 612 /*
602 * Enable modem status interrupts 613 * Enable modem status interrupts
603 */ 614 */
@@ -1133,13 +1144,19 @@ static int serial_imx_probe(struct platform_device *pdev)
1133 if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS)) 1144 if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS))
1134 sport->have_rtscts = 1; 1145 sport->have_rtscts = 1;
1135 1146
1136 if (pdata->init) 1147 if (pdata->init) {
1137 pdata->init(pdev); 1148 ret = pdata->init(pdev);
1149 if (ret)
1150 goto clkput;
1151 }
1138 1152
1139 uart_add_one_port(&imx_reg, &sport->port); 1153 uart_add_one_port(&imx_reg, &sport->port);
1140 platform_set_drvdata(pdev, &sport->port); 1154 platform_set_drvdata(pdev, &sport->port);
1141 1155
1142 return 0; 1156 return 0;
1157clkput:
1158 clk_put(sport->clk);
1159 clk_disable(sport->clk);
1143unmap: 1160unmap:
1144 iounmap(sport->port.membase); 1161 iounmap(sport->port.membase);
1145free: 1162free:
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 34c7c9875681..0e53354c1cfe 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -47,9 +47,10 @@ MODULE_ALIAS("platform:pxa2xx-spi");
47 47
48#define MAX_BUSES 3 48#define MAX_BUSES 3
49 49
50#define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR) 50#define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR)
51#define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK) 51#define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
52#define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0) 52#define IS_DMA_ALIGNED(x) (((x) & 0x07) == 0)
53#define MAX_DMA_LEN 8191
53 54
54/* 55/*
55 * for testing SSCR1 changes that require SSP restart, basically 56 * for testing SSCR1 changes that require SSP restart, basically
@@ -144,7 +145,6 @@ struct driver_data {
144 size_t tx_map_len; 145 size_t tx_map_len;
145 u8 n_bytes; 146 u8 n_bytes;
146 u32 dma_width; 147 u32 dma_width;
147 int cs_change;
148 int (*write)(struct driver_data *drv_data); 148 int (*write)(struct driver_data *drv_data);
149 int (*read)(struct driver_data *drv_data); 149 int (*read)(struct driver_data *drv_data);
150 irqreturn_t (*transfer_handler)(struct driver_data *drv_data); 150 irqreturn_t (*transfer_handler)(struct driver_data *drv_data);
@@ -406,8 +406,45 @@ static void giveback(struct driver_data *drv_data)
406 struct spi_transfer, 406 struct spi_transfer,
407 transfer_list); 407 transfer_list);
408 408
409 /* Delay if requested before any change in chip select */
410 if (last_transfer->delay_usecs)
411 udelay(last_transfer->delay_usecs);
412
413 /* Drop chip select UNLESS cs_change is true or we are returning
414 * a message with an error, or next message is for another chip
415 */
409 if (!last_transfer->cs_change) 416 if (!last_transfer->cs_change)
410 drv_data->cs_control(PXA2XX_CS_DEASSERT); 417 drv_data->cs_control(PXA2XX_CS_DEASSERT);
418 else {
419 struct spi_message *next_msg;
420
421 /* Holding of cs was hinted, but we need to make sure
422 * the next message is for the same chip. Don't waste
423 * time with the following tests unless this was hinted.
424 *
425 * We cannot postpone this until pump_messages, because
426 * after calling msg->complete (below) the driver that
427 * sent the current message could be unloaded, which
428 * could invalidate the cs_control() callback...
429 */
430
431 /* get a pointer to the next message, if any */
432 spin_lock_irqsave(&drv_data->lock, flags);
433 if (list_empty(&drv_data->queue))
434 next_msg = NULL;
435 else
436 next_msg = list_entry(drv_data->queue.next,
437 struct spi_message, queue);
438 spin_unlock_irqrestore(&drv_data->lock, flags);
439
440 /* see if the next and current messages point
441 * to the same chip
442 */
443 if (next_msg && next_msg->spi != msg->spi)
444 next_msg = NULL;
445 if (!next_msg || msg->state == ERROR_STATE)
446 drv_data->cs_control(PXA2XX_CS_DEASSERT);
447 }
411 448
412 msg->state = NULL; 449 msg->state = NULL;
413 if (msg->complete) 450 if (msg->complete)
@@ -490,10 +527,9 @@ static void dma_transfer_complete(struct driver_data *drv_data)
490 msg->actual_length += drv_data->len - 527 msg->actual_length += drv_data->len -
491 (drv_data->rx_end - drv_data->rx); 528 (drv_data->rx_end - drv_data->rx);
492 529
493 /* Release chip select if requested, transfer delays are 530 /* Transfer delays and chip select release are
494 * handled in pump_transfers */ 531 * handled in pump_transfers or giveback
495 if (drv_data->cs_change) 532 */
496 drv_data->cs_control(PXA2XX_CS_DEASSERT);
497 533
498 /* Move to next transfer */ 534 /* Move to next transfer */
499 msg->state = next_transfer(drv_data); 535 msg->state = next_transfer(drv_data);
@@ -602,10 +638,9 @@ static void int_transfer_complete(struct driver_data *drv_data)
602 drv_data->cur_msg->actual_length += drv_data->len - 638 drv_data->cur_msg->actual_length += drv_data->len -
603 (drv_data->rx_end - drv_data->rx); 639 (drv_data->rx_end - drv_data->rx);
604 640
605 /* Release chip select if requested, transfer delays are 641 /* Transfer delays and chip select release are
606 * handled in pump_transfers */ 642 * handled in pump_transfers or giveback
607 if (drv_data->cs_change) 643 */
608 drv_data->cs_control(PXA2XX_CS_DEASSERT);
609 644
610 /* Move to next transfer */ 645 /* Move to next transfer */
611 drv_data->cur_msg->state = next_transfer(drv_data); 646 drv_data->cur_msg->state = next_transfer(drv_data);
@@ -840,23 +875,40 @@ static void pump_transfers(unsigned long data)
840 return; 875 return;
841 } 876 }
842 877
843 /* Delay if requested at end of transfer*/ 878 /* Delay if requested at end of transfer before CS change */
844 if (message->state == RUNNING_STATE) { 879 if (message->state == RUNNING_STATE) {
845 previous = list_entry(transfer->transfer_list.prev, 880 previous = list_entry(transfer->transfer_list.prev,
846 struct spi_transfer, 881 struct spi_transfer,
847 transfer_list); 882 transfer_list);
848 if (previous->delay_usecs) 883 if (previous->delay_usecs)
849 udelay(previous->delay_usecs); 884 udelay(previous->delay_usecs);
885
886 /* Drop chip select only if cs_change is requested */
887 if (previous->cs_change)
888 drv_data->cs_control(PXA2XX_CS_DEASSERT);
850 } 889 }
851 890
852 /* Check transfer length */ 891 /* Check for transfers that need multiple DMA segments */
853 if (transfer->len > 8191) 892 if (transfer->len > MAX_DMA_LEN && chip->enable_dma) {
854 { 893
855 dev_warn(&drv_data->pdev->dev, "pump_transfers: transfer " 894 /* reject already-mapped transfers; PIO won't always work */
856 "length greater than 8191\n"); 895 if (message->is_dma_mapped
857 message->status = -EINVAL; 896 || transfer->rx_dma || transfer->tx_dma) {
858 giveback(drv_data); 897 dev_err(&drv_data->pdev->dev,
859 return; 898 "pump_transfers: mapped transfer length "
899 "of %lu is greater than %d\n",
900 transfer->len, MAX_DMA_LEN);
901 message->status = -EINVAL;
902 giveback(drv_data);
903 return;
904 }
905
906 /* warn ... we force this to PIO mode */
907 if (printk_ratelimit())
908 dev_warn(&message->spi->dev, "pump_transfers: "
909 "DMA disabled for transfer length %ld "
910 "greater than %d\n",
911 (long)drv_data->len, MAX_DMA_LEN);
860 } 912 }
861 913
862 /* Setup the transfer state based on the type of transfer */ 914 /* Setup the transfer state based on the type of transfer */
@@ -878,7 +930,6 @@ static void pump_transfers(unsigned long data)
878 drv_data->len = transfer->len & DCMD_LENGTH; 930 drv_data->len = transfer->len & DCMD_LENGTH;
879 drv_data->write = drv_data->tx ? chip->write : null_writer; 931 drv_data->write = drv_data->tx ? chip->write : null_writer;
880 drv_data->read = drv_data->rx ? chip->read : null_reader; 932 drv_data->read = drv_data->rx ? chip->read : null_reader;
881 drv_data->cs_change = transfer->cs_change;
882 933
883 /* Change speed and bit per word on a per transfer */ 934 /* Change speed and bit per word on a per transfer */
884 cr0 = chip->cr0; 935 cr0 = chip->cr0;
@@ -925,7 +976,7 @@ static void pump_transfers(unsigned long data)
925 &dma_thresh)) 976 &dma_thresh))
926 if (printk_ratelimit()) 977 if (printk_ratelimit())
927 dev_warn(&message->spi->dev, 978 dev_warn(&message->spi->dev,
928 "pump_transfer: " 979 "pump_transfers: "
929 "DMA burst size reduced to " 980 "DMA burst size reduced to "
930 "match bits_per_word\n"); 981 "match bits_per_word\n");
931 } 982 }
@@ -939,8 +990,23 @@ static void pump_transfers(unsigned long data)
939 990
940 message->state = RUNNING_STATE; 991 message->state = RUNNING_STATE;
941 992
942 /* Try to map dma buffer and do a dma transfer if successful */ 993 /* Try to map dma buffer and do a dma transfer if successful, but
943 if ((drv_data->dma_mapped = map_dma_buffers(drv_data))) { 994 * only if the length is non-zero and less than MAX_DMA_LEN.
995 *
996 * Zero-length non-descriptor DMA is illegal on PXA2xx; force use
997 * of PIO instead. Care is needed above because the transfer may
998 * have have been passed with buffers that are already dma mapped.
999 * A zero-length transfer in PIO mode will not try to write/read
1000 * to/from the buffers
1001 *
1002 * REVISIT large transfers are exactly where we most want to be
1003 * using DMA. If this happens much, split those transfers into
1004 * multiple DMA segments rather than forcing PIO.
1005 */
1006 drv_data->dma_mapped = 0;
1007 if (drv_data->len > 0 && drv_data->len <= MAX_DMA_LEN)
1008 drv_data->dma_mapped = map_dma_buffers(drv_data);
1009 if (drv_data->dma_mapped) {
944 1010
945 /* Ensure we have the correct interrupt handler */ 1011 /* Ensure we have the correct interrupt handler */
946 drv_data->transfer_handler = dma_transfer; 1012 drv_data->transfer_handler = dma_transfer;
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 070c6219e2d6..ac0e3e4b3c54 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -267,16 +267,13 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
267 cs->hw_mode |= SPMODE_LEN(bits_per_word); 267 cs->hw_mode |= SPMODE_LEN(bits_per_word);
268 268
269 if ((mpc83xx_spi->spibrg / hz) > 64) { 269 if ((mpc83xx_spi->spibrg / hz) > 64) {
270 cs->hw_mode |= SPMODE_DIV16;
270 pm = mpc83xx_spi->spibrg / (hz * 64); 271 pm = mpc83xx_spi->spibrg / (hz * 64);
271 if (pm > 16) { 272 if (pm > 16) {
272 cs->hw_mode |= SPMODE_DIV16; 273 dev_err(&spi->dev, "Requested speed is too "
273 pm /= 16; 274 "low: %d Hz. Will use %d Hz instead.\n",
274 if (pm > 16) { 275 hz, mpc83xx_spi->spibrg / 1024);
275 dev_err(&spi->dev, "Requested speed is too " 276 pm = 16;
276 "low: %d Hz. Will use %d Hz instead.\n",
277 hz, mpc83xx_spi->spibrg / 1024);
278 pm = 16;
279 }
280 } 277 }
281 } else 278 } else
282 pm = mpc83xx_spi->spibrg / (hz * 4); 279 pm = mpc83xx_spi->spibrg / (hz * 4);
@@ -315,11 +312,20 @@ static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
315 if (t->bits_per_word) 312 if (t->bits_per_word)
316 bits_per_word = t->bits_per_word; 313 bits_per_word = t->bits_per_word;
317 len = t->len; 314 len = t->len;
318 if (bits_per_word > 8) 315 if (bits_per_word > 8) {
316 /* invalid length? */
317 if (len & 1)
318 return -EINVAL;
319 len /= 2; 319 len /= 2;
320 if (bits_per_word > 16) 320 }
321 if (bits_per_word > 16) {
322 /* invalid length? */
323 if (len & 1)
324 return -EINVAL;
321 len /= 2; 325 len /= 2;
326 }
322 mpc83xx_spi->count = len; 327 mpc83xx_spi->count = len;
328
323 INIT_COMPLETION(mpc83xx_spi->done); 329 INIT_COMPLETION(mpc83xx_spi->done);
324 330
325 /* enable rx ints */ 331 /* enable rx ints */
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 98abc73c1a1d..3eb414b84a9d 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -430,7 +430,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
430#endif 430#endif
431 431
432MODULE_ALIAS("platform:s3c2410-spi"); 432MODULE_ALIAS("platform:s3c2410-spi");
433static struct platform_driver s3c24xx_spidrv = { 433static struct platform_driver s3c24xx_spi_driver = {
434 .remove = __exit_p(s3c24xx_spi_remove), 434 .remove = __exit_p(s3c24xx_spi_remove),
435 .suspend = s3c24xx_spi_suspend, 435 .suspend = s3c24xx_spi_suspend,
436 .resume = s3c24xx_spi_resume, 436 .resume = s3c24xx_spi_resume,
@@ -442,12 +442,12 @@ static struct platform_driver s3c24xx_spidrv = {
442 442
443static int __init s3c24xx_spi_init(void) 443static int __init s3c24xx_spi_init(void)
444{ 444{
445 return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe); 445 return platform_driver_probe(&s3c24xx_spi_driver, s3c24xx_spi_probe);
446} 446}
447 447
448static void __exit s3c24xx_spi_exit(void) 448static void __exit s3c24xx_spi_exit(void)
449{ 449{
450 platform_driver_unregister(&s3c24xx_spidrv); 450 platform_driver_unregister(&s3c24xx_spi_driver);
451} 451}
452 452
453module_init(s3c24xx_spi_init); 453module_init(s3c24xx_spi_init);
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index cedfd01c9833..d38fd5217422 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -208,6 +208,36 @@ static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
208 return value; 208 return value;
209} 209}
210 210
211static void atmel_lcdfb_stop_nowait(struct atmel_lcdfb_info *sinfo)
212{
213 /* Turn off the LCD controller and the DMA controller */
214 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
215 sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
216
217 /* Wait for the LCDC core to become idle */
218 while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
219 msleep(10);
220
221 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
222}
223
224static void atmel_lcdfb_stop(struct atmel_lcdfb_info *sinfo)
225{
226 atmel_lcdfb_stop_nowait(sinfo);
227
228 /* Wait for DMA engine to become idle... */
229 while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY)
230 msleep(10);
231}
232
233static void atmel_lcdfb_start(struct atmel_lcdfb_info *sinfo)
234{
235 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon);
236 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
237 (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET)
238 | ATMEL_LCDC_PWR);
239}
240
211static void atmel_lcdfb_update_dma(struct fb_info *info, 241static void atmel_lcdfb_update_dma(struct fb_info *info,
212 struct fb_var_screeninfo *var) 242 struct fb_var_screeninfo *var)
213{ 243{
@@ -424,26 +454,8 @@ static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo)
424{ 454{
425 might_sleep(); 455 might_sleep();
426 456
427 /* LCD power off */ 457 atmel_lcdfb_stop(sinfo);
428 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET); 458 atmel_lcdfb_start(sinfo);
429
430 /* wait for the LCDC core to become idle */
431 while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
432 msleep(10);
433
434 /* DMA disable */
435 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
436
437 /* wait for DMA engine to become idle */
438 while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY)
439 msleep(10);
440
441 /* LCD power on */
442 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
443 (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
444
445 /* DMA enable */
446 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon);
447} 459}
448 460
449/** 461/**
@@ -475,14 +487,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
475 info->var.xres, info->var.yres, 487 info->var.xres, info->var.yres,
476 info->var.xres_virtual, info->var.yres_virtual); 488 info->var.xres_virtual, info->var.yres_virtual);
477 489
478 /* Turn off the LCD controller and the DMA controller */ 490 atmel_lcdfb_stop_nowait(sinfo);
479 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
480
481 /* Wait for the LCDC core to become idle */
482 while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
483 msleep(10);
484
485 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
486 491
487 if (info->var.bits_per_pixel == 1) 492 if (info->var.bits_per_pixel == 1)
488 info->fix.visual = FB_VISUAL_MONO01; 493 info->fix.visual = FB_VISUAL_MONO01;
@@ -587,13 +592,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
587 while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) 592 while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY)
588 msleep(10); 593 msleep(10);
589 594
590 dev_dbg(info->device, " * re-enable DMA engine\n"); 595 atmel_lcdfb_start(sinfo);
591 /* ...and enable it with updated configuration */
592 lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon);
593
594 dev_dbg(info->device, " * re-enable LCDC core\n");
595 lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
596 (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
597 596
598 dev_dbg(info->device, " * DONE\n"); 597 dev_dbg(info->device, " * DONE\n");
599 598
@@ -1036,11 +1035,20 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
1036 struct fb_info *info = platform_get_drvdata(pdev); 1035 struct fb_info *info = platform_get_drvdata(pdev);
1037 struct atmel_lcdfb_info *sinfo = info->par; 1036 struct atmel_lcdfb_info *sinfo = info->par;
1038 1037
1038 /*
1039 * We don't want to handle interrupts while the clock is
1040 * stopped. It may take forever.
1041 */
1042 lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
1043
1039 sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); 1044 sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
1040 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0); 1045 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
1041 if (sinfo->atmel_lcdfb_power_control) 1046 if (sinfo->atmel_lcdfb_power_control)
1042 sinfo->atmel_lcdfb_power_control(0); 1047 sinfo->atmel_lcdfb_power_control(0);
1048
1049 atmel_lcdfb_stop(sinfo);
1043 atmel_lcdfb_stop_clock(sinfo); 1050 atmel_lcdfb_stop_clock(sinfo);
1051
1044 return 0; 1052 return 0;
1045} 1053}
1046 1054
@@ -1050,9 +1058,15 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
1050 struct atmel_lcdfb_info *sinfo = info->par; 1058 struct atmel_lcdfb_info *sinfo = info->par;
1051 1059
1052 atmel_lcdfb_start_clock(sinfo); 1060 atmel_lcdfb_start_clock(sinfo);
1061 atmel_lcdfb_start(sinfo);
1053 if (sinfo->atmel_lcdfb_power_control) 1062 if (sinfo->atmel_lcdfb_power_control)
1054 sinfo->atmel_lcdfb_power_control(1); 1063 sinfo->atmel_lcdfb_power_control(1);
1055 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon); 1064 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
1065
1066 /* Enable FIFO & DMA errors */
1067 lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI
1068 | ATMEL_LCDC_OWRI | ATMEL_LCDC_MERI);
1069
1056 return 0; 1070 return 0;
1057} 1071}
1058 1072