diff options
Diffstat (limited to 'drivers')
214 files changed, 2082 insertions, 1551 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 5207f9e4b443..cbb6f0814ce2 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -322,10 +322,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr) | |||
322 | if (result) | 322 | if (result) |
323 | return result; | 323 | return result; |
324 | 324 | ||
325 | result = acpi_processor_get_platform_limit(pr); | ||
326 | if (result) | ||
327 | return result; | ||
328 | |||
329 | return 0; | 325 | return 0; |
330 | } | 326 | } |
331 | 327 | ||
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 36b37d755dbc..3d54680d0333 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -1677,8 +1677,6 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | |||
1677 | struct acpi_video_device *video_device = data; | 1677 | struct acpi_video_device *video_device = data; |
1678 | struct acpi_device *device = NULL; | 1678 | struct acpi_device *device = NULL; |
1679 | 1679 | ||
1680 | |||
1681 | printk("video device notify\n"); | ||
1682 | if (!video_device) | 1680 | if (!video_device) |
1683 | return; | 1681 | return; |
1684 | 1682 | ||
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index da21552d2b1c..1c94b43d2c9b 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -19,6 +19,10 @@ config ATA | |||
19 | 19 | ||
20 | if ATA | 20 | if ATA |
21 | 21 | ||
22 | config ATA_NONSTANDARD | ||
23 | bool | ||
24 | default n | ||
25 | |||
22 | config SATA_AHCI | 26 | config SATA_AHCI |
23 | tristate "AHCI SATA support" | 27 | tristate "AHCI SATA support" |
24 | depends on PCI | 28 | depends on PCI |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b517d2493551..48616c6fee9d 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -75,6 +75,7 @@ enum { | |||
75 | AHCI_CMD_CLR_BUSY = (1 << 10), | 75 | AHCI_CMD_CLR_BUSY = (1 << 10), |
76 | 76 | ||
77 | RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ | 77 | RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ |
78 | RX_FIS_SDB = 0x58, /* offset of SDB FIS data */ | ||
78 | RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ | 79 | RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ |
79 | 80 | ||
80 | board_ahci = 0, | 81 | board_ahci = 0, |
@@ -202,6 +203,10 @@ struct ahci_port_priv { | |||
202 | dma_addr_t cmd_tbl_dma; | 203 | dma_addr_t cmd_tbl_dma; |
203 | void *rx_fis; | 204 | void *rx_fis; |
204 | dma_addr_t rx_fis_dma; | 205 | dma_addr_t rx_fis_dma; |
206 | /* for NCQ spurious interrupt analysis */ | ||
207 | int ncq_saw_spurious_sdb_cnt; | ||
208 | unsigned int ncq_saw_d2h:1; | ||
209 | unsigned int ncq_saw_dmas:1; | ||
205 | }; | 210 | }; |
206 | 211 | ||
207 | static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg); | 212 | static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg); |
@@ -361,7 +366,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
361 | { PCI_VDEVICE(INTEL, 0x27c1), board_ahci }, /* ICH7 */ | 366 | { PCI_VDEVICE(INTEL, 0x27c1), board_ahci }, /* ICH7 */ |
362 | { PCI_VDEVICE(INTEL, 0x27c5), board_ahci }, /* ICH7M */ | 367 | { PCI_VDEVICE(INTEL, 0x27c5), board_ahci }, /* ICH7M */ |
363 | { PCI_VDEVICE(INTEL, 0x27c3), board_ahci }, /* ICH7R */ | 368 | { PCI_VDEVICE(INTEL, 0x27c3), board_ahci }, /* ICH7R */ |
364 | { PCI_VDEVICE(AL, 0x5288), board_ahci }, /* ULi M5288 */ | 369 | { PCI_VDEVICE(AL, 0x5288), board_ahci_ign_iferr }, /* ULi M5288 */ |
365 | { PCI_VDEVICE(INTEL, 0x2681), board_ahci }, /* ESB2 */ | 370 | { PCI_VDEVICE(INTEL, 0x2681), board_ahci }, /* ESB2 */ |
366 | { PCI_VDEVICE(INTEL, 0x2682), board_ahci }, /* ESB2 */ | 371 | { PCI_VDEVICE(INTEL, 0x2682), board_ahci }, /* ESB2 */ |
367 | { PCI_VDEVICE(INTEL, 0x2683), board_ahci }, /* ESB2 */ | 372 | { PCI_VDEVICE(INTEL, 0x2683), board_ahci }, /* ESB2 */ |
@@ -586,35 +591,18 @@ static void ahci_power_down(void __iomem *port_mmio, u32 cap) | |||
586 | { | 591 | { |
587 | u32 cmd, scontrol; | 592 | u32 cmd, scontrol; |
588 | 593 | ||
589 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; | 594 | if (!(cap & HOST_CAP_SSS)) |
590 | 595 | return; | |
591 | if (cap & HOST_CAP_SSC) { | ||
592 | /* enable transitions to slumber mode */ | ||
593 | scontrol = readl(port_mmio + PORT_SCR_CTL); | ||
594 | if ((scontrol & 0x0f00) > 0x100) { | ||
595 | scontrol &= ~0xf00; | ||
596 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
597 | } | ||
598 | |||
599 | /* put device into slumber mode */ | ||
600 | writel(cmd | PORT_CMD_ICC_SLUMBER, port_mmio + PORT_CMD); | ||
601 | |||
602 | /* wait for the transition to complete */ | ||
603 | ata_wait_register(port_mmio + PORT_CMD, PORT_CMD_ICC_SLUMBER, | ||
604 | PORT_CMD_ICC_SLUMBER, 1, 50); | ||
605 | } | ||
606 | 596 | ||
607 | /* put device into listen mode */ | 597 | /* put device into listen mode, first set PxSCTL.DET to 0 */ |
608 | if (cap & HOST_CAP_SSS) { | 598 | scontrol = readl(port_mmio + PORT_SCR_CTL); |
609 | /* first set PxSCTL.DET to 0 */ | 599 | scontrol &= ~0xf; |
610 | scontrol = readl(port_mmio + PORT_SCR_CTL); | 600 | writel(scontrol, port_mmio + PORT_SCR_CTL); |
611 | scontrol &= ~0xf; | ||
612 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
613 | 601 | ||
614 | /* then set PxCMD.SUD to 0 */ | 602 | /* then set PxCMD.SUD to 0 */ |
615 | cmd &= ~PORT_CMD_SPIN_UP; | 603 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; |
616 | writel(cmd, port_mmio + PORT_CMD); | 604 | cmd &= ~PORT_CMD_SPIN_UP; |
617 | } | 605 | writel(cmd, port_mmio + PORT_CMD); |
618 | } | 606 | } |
619 | 607 | ||
620 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, | 608 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, |
@@ -915,7 +903,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class) | |||
915 | 903 | ||
916 | /* clear D2H reception area to properly wait for D2H FIS */ | 904 | /* clear D2H reception area to properly wait for D2H FIS */ |
917 | ata_tf_init(ap->device, &tf); | 905 | ata_tf_init(ap->device, &tf); |
918 | tf.command = 0xff; | 906 | tf.command = 0x80; |
919 | ata_tf_to_fis(&tf, d2h_fis, 0); | 907 | ata_tf_to_fis(&tf, d2h_fis, 0); |
920 | 908 | ||
921 | rc = sata_std_hardreset(ap, class); | 909 | rc = sata_std_hardreset(ap, class); |
@@ -1126,8 +1114,9 @@ static void ahci_host_intr(struct ata_port *ap) | |||
1126 | void __iomem *mmio = ap->host->mmio_base; | 1114 | void __iomem *mmio = ap->host->mmio_base; |
1127 | void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); | 1115 | void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); |
1128 | struct ata_eh_info *ehi = &ap->eh_info; | 1116 | struct ata_eh_info *ehi = &ap->eh_info; |
1117 | struct ahci_port_priv *pp = ap->private_data; | ||
1129 | u32 status, qc_active; | 1118 | u32 status, qc_active; |
1130 | int rc; | 1119 | int rc, known_irq = 0; |
1131 | 1120 | ||
1132 | status = readl(port_mmio + PORT_IRQ_STAT); | 1121 | status = readl(port_mmio + PORT_IRQ_STAT); |
1133 | writel(status, port_mmio + PORT_IRQ_STAT); | 1122 | writel(status, port_mmio + PORT_IRQ_STAT); |
@@ -1154,17 +1143,53 @@ static void ahci_host_intr(struct ata_port *ap) | |||
1154 | 1143 | ||
1155 | /* hmmm... a spurious interupt */ | 1144 | /* hmmm... a spurious interupt */ |
1156 | 1145 | ||
1157 | /* some devices send D2H reg with I bit set during NCQ command phase */ | 1146 | /* if !NCQ, ignore. No modern ATA device has broken HSM |
1158 | if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS)) | 1147 | * implementation for non-NCQ commands. |
1148 | */ | ||
1149 | if (!ap->sactive) | ||
1159 | return; | 1150 | return; |
1160 | 1151 | ||
1161 | /* ignore interim PIO setup fis interrupts */ | 1152 | if (status & PORT_IRQ_D2H_REG_FIS) { |
1162 | if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) | 1153 | if (!pp->ncq_saw_d2h) |
1163 | return; | 1154 | ata_port_printk(ap, KERN_INFO, |
1155 | "D2H reg with I during NCQ, " | ||
1156 | "this message won't be printed again\n"); | ||
1157 | pp->ncq_saw_d2h = 1; | ||
1158 | known_irq = 1; | ||
1159 | } | ||
1160 | |||
1161 | if (status & PORT_IRQ_DMAS_FIS) { | ||
1162 | if (!pp->ncq_saw_dmas) | ||
1163 | ata_port_printk(ap, KERN_INFO, | ||
1164 | "DMAS FIS during NCQ, " | ||
1165 | "this message won't be printed again\n"); | ||
1166 | pp->ncq_saw_dmas = 1; | ||
1167 | known_irq = 1; | ||
1168 | } | ||
1169 | |||
1170 | if (status & PORT_IRQ_SDB_FIS && | ||
1171 | pp->ncq_saw_spurious_sdb_cnt < 10) { | ||
1172 | /* SDB FIS containing spurious completions might be | ||
1173 | * dangerous, we need to know more about them. Print | ||
1174 | * more of it. | ||
1175 | */ | ||
1176 | const u32 *f = pp->rx_fis + RX_FIS_SDB; | ||
1177 | |||
1178 | ata_port_printk(ap, KERN_INFO, "Spurious SDB FIS during NCQ " | ||
1179 | "issue=0x%x SAct=0x%x FIS=%08x:%08x%s\n", | ||
1180 | readl(port_mmio + PORT_CMD_ISSUE), | ||
1181 | readl(port_mmio + PORT_SCR_ACT), | ||
1182 | le32_to_cpu(f[0]), le32_to_cpu(f[1]), | ||
1183 | pp->ncq_saw_spurious_sdb_cnt < 10 ? | ||
1184 | "" : ", shutting up"); | ||
1185 | |||
1186 | pp->ncq_saw_spurious_sdb_cnt++; | ||
1187 | known_irq = 1; | ||
1188 | } | ||
1164 | 1189 | ||
1165 | if (ata_ratelimit()) | 1190 | if (!known_irq) |
1166 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " | 1191 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " |
1167 | "(irq_stat 0x%x active_tag %d sactive 0x%x)\n", | 1192 | "(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n", |
1168 | status, ap->active_tag, ap->sactive); | 1193 | status, ap->active_tag, ap->sactive); |
1169 | } | 1194 | } |
1170 | 1195 | ||
@@ -1257,7 +1282,7 @@ static void ahci_thaw(struct ata_port *ap) | |||
1257 | /* clear IRQ */ | 1282 | /* clear IRQ */ |
1258 | tmp = readl(port_mmio + PORT_IRQ_STAT); | 1283 | tmp = readl(port_mmio + PORT_IRQ_STAT); |
1259 | writel(tmp, port_mmio + PORT_IRQ_STAT); | 1284 | writel(tmp, port_mmio + PORT_IRQ_STAT); |
1260 | writel(1 << ap->id, mmio + HOST_IRQ_STAT); | 1285 | writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); |
1261 | 1286 | ||
1262 | /* turn IRQ back on */ | 1287 | /* turn IRQ back on */ |
1263 | writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK); | 1288 | writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK); |
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c index 908751d27e76..24af56081b5d 100644 --- a/drivers/ata/ata_generic.c +++ b/drivers/ata/ata_generic.c | |||
@@ -64,6 +64,7 @@ static void generic_error_handler(struct ata_port *ap) | |||
64 | /** | 64 | /** |
65 | * generic_set_mode - mode setting | 65 | * generic_set_mode - mode setting |
66 | * @ap: interface to set up | 66 | * @ap: interface to set up |
67 | * @unused: returned device on error | ||
67 | * | 68 | * |
68 | * Use a non standard set_mode function. We don't want to be tuned. | 69 | * Use a non standard set_mode function. We don't want to be tuned. |
69 | * The BIOS configured everything. Our job is not to fiddle. We | 70 | * The BIOS configured everything. Our job is not to fiddle. We |
@@ -71,7 +72,7 @@ static void generic_error_handler(struct ata_port *ap) | |||
71 | * and respect them. | 72 | * and respect them. |
72 | */ | 73 | */ |
73 | 74 | ||
74 | static void generic_set_mode(struct ata_port *ap) | 75 | static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) |
75 | { | 76 | { |
76 | int dma_enabled = 0; | 77 | int dma_enabled = 0; |
77 | int i; | 78 | int i; |
@@ -82,7 +83,7 @@ static void generic_set_mode(struct ata_port *ap) | |||
82 | 83 | ||
83 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 84 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
84 | struct ata_device *dev = &ap->device[i]; | 85 | struct ata_device *dev = &ap->device[i]; |
85 | if (ata_dev_enabled(dev)) { | 86 | if (ata_dev_ready(dev)) { |
86 | /* We don't really care */ | 87 | /* We don't really care */ |
87 | dev->pio_mode = XFER_PIO_0; | 88 | dev->pio_mode = XFER_PIO_0; |
88 | dev->dma_mode = XFER_MW_DMA_0; | 89 | dev->dma_mode = XFER_MW_DMA_0; |
@@ -99,6 +100,7 @@ static void generic_set_mode(struct ata_port *ap) | |||
99 | } | 100 | } |
100 | } | 101 | } |
101 | } | 102 | } |
103 | return 0; | ||
102 | } | 104 | } |
103 | 105 | ||
104 | static struct scsi_host_template generic_sht = { | 106 | static struct scsi_host_template generic_sht = { |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 0d51d13b16bf..667acd283364 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
1037 | * the PIO timing number for the maximum. Turn it into | 1037 | * the PIO timing number for the maximum. Turn it into |
1038 | * a mask. | 1038 | * a mask. |
1039 | */ | 1039 | */ |
1040 | u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; | 1040 | u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF; |
1041 | if (mode < 5) /* Valid PIO range */ | 1041 | if (mode < 5) /* Valid PIO range */ |
1042 | pio_mask = (2 << mode) - 1; | 1042 | pio_mask = (2 << mode) - 1; |
1043 | else | 1043 | else |
@@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, | |||
1250 | 1250 | ||
1251 | ata_sg_init(qc, sg, n_elem); | 1251 | ata_sg_init(qc, sg, n_elem); |
1252 | qc->nsect = buflen / ATA_SECT_SIZE; | 1252 | qc->nsect = buflen / ATA_SECT_SIZE; |
1253 | qc->nbytes = buflen; | ||
1253 | } | 1254 | } |
1254 | 1255 | ||
1255 | qc->private_data = &wait; | 1256 | qc->private_data = &wait; |
@@ -2431,18 +2432,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) | |||
2431 | int i, rc = 0, used_dma = 0, found = 0; | 2432 | int i, rc = 0, used_dma = 0, found = 0; |
2432 | 2433 | ||
2433 | /* has private set_mode? */ | 2434 | /* has private set_mode? */ |
2434 | if (ap->ops->set_mode) { | 2435 | if (ap->ops->set_mode) |
2435 | /* FIXME: make ->set_mode handle no device case and | 2436 | return ap->ops->set_mode(ap, r_failed_dev); |
2436 | * return error code and failing device on failure. | ||
2437 | */ | ||
2438 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | ||
2439 | if (ata_dev_ready(&ap->device[i])) { | ||
2440 | ap->ops->set_mode(ap); | ||
2441 | break; | ||
2442 | } | ||
2443 | } | ||
2444 | return 0; | ||
2445 | } | ||
2446 | 2437 | ||
2447 | /* step 1: calculate xfer_mask */ | 2438 | /* step 1: calculate xfer_mask */ |
2448 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 2439 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 08ad44b3e48f..748435807d68 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1796,7 +1796,7 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev) | |||
1796 | *r_failed_dev = dev; | 1796 | *r_failed_dev = dev; |
1797 | 1797 | ||
1798 | DPRINTK("EXIT\n"); | 1798 | DPRINTK("EXIT\n"); |
1799 | return 0; | 1799 | return rc; |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | /** | 1802 | /** |
@@ -1979,6 +1979,10 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
1979 | 1979 | ||
1980 | ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; | 1980 | ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; |
1981 | 1981 | ||
1982 | /* collect port action mask recorded in dev actions */ | ||
1983 | ehc->i.action |= ehc->i.dev_action[i] & ~ATA_EH_PERDEV_MASK; | ||
1984 | ehc->i.dev_action[i] &= ATA_EH_PERDEV_MASK; | ||
1985 | |||
1982 | /* process hotplug request */ | 1986 | /* process hotplug request */ |
1983 | if (dev->flags & ATA_DFLAG_DETACH) | 1987 | if (dev->flags & ATA_DFLAG_DETACH) |
1984 | ata_eh_detach_dev(dev); | 1988 | ata_eh_detach_dev(dev); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 836947da5b14..73902d335767 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -273,8 +273,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
273 | { | 273 | { |
274 | int rc = 0; | 274 | int rc = 0; |
275 | u8 scsi_cmd[MAX_COMMAND_SIZE]; | 275 | u8 scsi_cmd[MAX_COMMAND_SIZE]; |
276 | u8 args[7]; | 276 | u8 args[7], *sensebuf = NULL; |
277 | struct scsi_sense_hdr sshdr; | 277 | int cmd_result; |
278 | 278 | ||
279 | if (arg == NULL) | 279 | if (arg == NULL) |
280 | return -EINVAL; | 280 | return -EINVAL; |
@@ -282,10 +282,14 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
282 | if (copy_from_user(args, arg, sizeof(args))) | 282 | if (copy_from_user(args, arg, sizeof(args))) |
283 | return -EFAULT; | 283 | return -EFAULT; |
284 | 284 | ||
285 | sensebuf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_NOIO); | ||
286 | if (!sensebuf) | ||
287 | return -ENOMEM; | ||
288 | |||
285 | memset(scsi_cmd, 0, sizeof(scsi_cmd)); | 289 | memset(scsi_cmd, 0, sizeof(scsi_cmd)); |
286 | scsi_cmd[0] = ATA_16; | 290 | scsi_cmd[0] = ATA_16; |
287 | scsi_cmd[1] = (3 << 1); /* Non-data */ | 291 | scsi_cmd[1] = (3 << 1); /* Non-data */ |
288 | /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */ | 292 | scsi_cmd[2] = 0x20; /* cc but no off.line or data xfer */ |
289 | scsi_cmd[4] = args[1]; | 293 | scsi_cmd[4] = args[1]; |
290 | scsi_cmd[6] = args[2]; | 294 | scsi_cmd[6] = args[2]; |
291 | scsi_cmd[8] = args[3]; | 295 | scsi_cmd[8] = args[3]; |
@@ -295,11 +299,46 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
295 | 299 | ||
296 | /* Good values for timeout and retries? Values below | 300 | /* Good values for timeout and retries? Values below |
297 | from scsi_ioctl_send_command() for default case... */ | 301 | from scsi_ioctl_send_command() for default case... */ |
298 | if (scsi_execute_req(scsidev, scsi_cmd, DMA_NONE, NULL, 0, &sshdr, | 302 | cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, |
299 | (10*HZ), 5)) | 303 | sensebuf, (10*HZ), 5, 0); |
304 | |||
305 | if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */ | ||
306 | u8 *desc = sensebuf + 8; | ||
307 | cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ | ||
308 | |||
309 | /* If we set cc then ATA pass-through will cause a | ||
310 | * check condition even if no error. Filter that. */ | ||
311 | if (cmd_result & SAM_STAT_CHECK_CONDITION) { | ||
312 | struct scsi_sense_hdr sshdr; | ||
313 | scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, | ||
314 | &sshdr); | ||
315 | if (sshdr.sense_key==0 && | ||
316 | sshdr.asc==0 && sshdr.ascq==0) | ||
317 | cmd_result &= ~SAM_STAT_CHECK_CONDITION; | ||
318 | } | ||
319 | |||
320 | /* Send userspace ATA registers */ | ||
321 | if (sensebuf[0] == 0x72 && /* format is "descriptor" */ | ||
322 | desc[0] == 0x09) {/* code is "ATA Descriptor" */ | ||
323 | args[0] = desc[13]; /* status */ | ||
324 | args[1] = desc[3]; /* error */ | ||
325 | args[2] = desc[5]; /* sector count (0:7) */ | ||
326 | args[3] = desc[7]; /* lbal */ | ||
327 | args[4] = desc[9]; /* lbam */ | ||
328 | args[5] = desc[11]; /* lbah */ | ||
329 | args[6] = desc[12]; /* select */ | ||
330 | if (copy_to_user(arg, args, sizeof(args))) | ||
331 | rc = -EFAULT; | ||
332 | } | ||
333 | } | ||
334 | |||
335 | if (cmd_result) { | ||
300 | rc = -EIO; | 336 | rc = -EIO; |
337 | goto error; | ||
338 | } | ||
301 | 339 | ||
302 | /* Need code to retrieve data from check condition? */ | 340 | error: |
341 | kfree(sensebuf); | ||
303 | return rc; | 342 | return rc; |
304 | } | 343 | } |
305 | 344 | ||
@@ -372,7 +411,7 @@ struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, | |||
372 | if (cmd->use_sg) { | 411 | if (cmd->use_sg) { |
373 | qc->__sg = (struct scatterlist *) cmd->request_buffer; | 412 | qc->__sg = (struct scatterlist *) cmd->request_buffer; |
374 | qc->n_elem = cmd->use_sg; | 413 | qc->n_elem = cmd->use_sg; |
375 | } else { | 414 | } else if (cmd->request_bufflen) { |
376 | qc->__sg = &qc->sgent; | 415 | qc->__sg = &qc->sgent; |
377 | qc->n_elem = 1; | 416 | qc->n_elem = 1; |
378 | } | 417 | } |
@@ -983,11 +1022,10 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) | |||
983 | } | 1022 | } |
984 | 1023 | ||
985 | tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ | 1024 | tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ |
986 | } else { | 1025 | } else |
987 | tf->nsect = 0; /* time period value (0 implies now) */ | 1026 | /* Issue ATA STANDBY IMMEDIATE command */ |
988 | tf->command = ATA_CMD_STANDBY; | 1027 | tf->command = ATA_CMD_STANDBYNOW1; |
989 | /* Consider: ATA STANDBY IMMEDIATE command */ | 1028 | |
990 | } | ||
991 | /* | 1029 | /* |
992 | * Standby and Idle condition timers could be implemented but that | 1030 | * Standby and Idle condition timers could be implemented but that |
993 | * would require libata to implement the Power condition mode page | 1031 | * would require libata to implement the Power condition mode page |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 623cec914c9b..12c88c588039 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -827,7 +827,8 @@ void ata_bmdma_error_handler(struct ata_port *ap) | |||
827 | */ | 827 | */ |
828 | void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) | 828 | void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) |
829 | { | 829 | { |
830 | ata_bmdma_stop(qc); | 830 | if (qc->ap->ioaddr.bmdma_addr) |
831 | ata_bmdma_stop(qc); | ||
831 | } | 832 | } |
832 | 833 | ||
833 | #ifdef CONFIG_PCI | 834 | #ifdef CONFIG_PCI |
@@ -870,7 +871,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int | |||
870 | pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; | 871 | pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; |
871 | bmdma = pci_resource_start(pdev, 4); | 872 | bmdma = pci_resource_start(pdev, 4); |
872 | if (bmdma) { | 873 | if (bmdma) { |
873 | if (inb(bmdma + 2) & 0x80) | 874 | if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
875 | (inb(bmdma + 2) & 0x80)) | ||
874 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 876 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
875 | probe_ent->port[p].bmdma_addr = bmdma; | 877 | probe_ent->port[p].bmdma_addr = bmdma; |
876 | } | 878 | } |
@@ -886,7 +888,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int | |||
886 | bmdma = pci_resource_start(pdev, 4); | 888 | bmdma = pci_resource_start(pdev, 4); |
887 | if (bmdma) { | 889 | if (bmdma) { |
888 | bmdma += 8; | 890 | bmdma += 8; |
889 | if(inb(bmdma + 2) & 0x80) | 891 | if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
892 | (inb(bmdma + 2) & 0x80)) | ||
890 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 893 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
891 | probe_ent->port[p].bmdma_addr = bmdma; | 894 | probe_ent->port[p].bmdma_addr = bmdma; |
892 | } | 895 | } |
@@ -914,13 +917,14 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
914 | probe_ent->irq_flags = IRQF_SHARED; | 917 | probe_ent->irq_flags = IRQF_SHARED; |
915 | 918 | ||
916 | if (port_mask & ATA_PORT_PRIMARY) { | 919 | if (port_mask & ATA_PORT_PRIMARY) { |
917 | probe_ent->irq = ATA_PRIMARY_IRQ; | 920 | probe_ent->irq = ATA_PRIMARY_IRQ(pdev); |
918 | probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; | 921 | probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; |
919 | probe_ent->port[0].altstatus_addr = | 922 | probe_ent->port[0].altstatus_addr = |
920 | probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; | 923 | probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; |
921 | if (bmdma) { | 924 | if (bmdma) { |
922 | probe_ent->port[0].bmdma_addr = bmdma; | 925 | probe_ent->port[0].bmdma_addr = bmdma; |
923 | if (inb(bmdma + 2) & 0x80) | 926 | if ((!(port[0]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
927 | (inb(bmdma + 2) & 0x80)) | ||
924 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 928 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
925 | } | 929 | } |
926 | ata_std_ports(&probe_ent->port[0]); | 930 | ata_std_ports(&probe_ent->port[0]); |
@@ -929,15 +933,16 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
929 | 933 | ||
930 | if (port_mask & ATA_PORT_SECONDARY) { | 934 | if (port_mask & ATA_PORT_SECONDARY) { |
931 | if (probe_ent->irq) | 935 | if (probe_ent->irq) |
932 | probe_ent->irq2 = ATA_SECONDARY_IRQ; | 936 | probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev); |
933 | else | 937 | else |
934 | probe_ent->irq = ATA_SECONDARY_IRQ; | 938 | probe_ent->irq = ATA_SECONDARY_IRQ(pdev); |
935 | probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; | 939 | probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; |
936 | probe_ent->port[1].altstatus_addr = | 940 | probe_ent->port[1].altstatus_addr = |
937 | probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; | 941 | probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; |
938 | if (bmdma) { | 942 | if (bmdma) { |
939 | probe_ent->port[1].bmdma_addr = bmdma + 8; | 943 | probe_ent->port[1].bmdma_addr = bmdma + 8; |
940 | if (inb(bmdma + 10) & 0x80) | 944 | if ((!(port[1]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
945 | (inb(bmdma + 10) & 0x80)) | ||
941 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 946 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
942 | } | 947 | } |
943 | ata_std_ports(&probe_ent->port[1]); | 948 | ata_std_ports(&probe_ent->port[1]); |
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index 6f6672c55131..504e1dbfffd7 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c | |||
@@ -36,15 +36,22 @@ enum { | |||
36 | static int atiixp_pre_reset(struct ata_port *ap) | 36 | static int atiixp_pre_reset(struct ata_port *ap) |
37 | { | 37 | { |
38 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 38 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
39 | static struct pci_bits atiixp_enable_bits[] = { | 39 | static const struct pci_bits atiixp_enable_bits[] = { |
40 | { 0x48, 1, 0x01, 0x00 }, | 40 | { 0x48, 1, 0x01, 0x00 }, |
41 | { 0x48, 1, 0x08, 0x00 } | 41 | { 0x48, 1, 0x08, 0x00 } |
42 | }; | 42 | }; |
43 | u8 udma; | ||
43 | 44 | ||
44 | if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) | 45 | if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) |
45 | return -ENOENT; | 46 | return -ENOENT; |
46 | 47 | ||
47 | ap->cbl = ATA_CBL_PATA80; | 48 | /* Hack from drivers/ide/pci. Really we want to know how to do the |
49 | raw detection not play follow the bios mode guess */ | ||
50 | pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma); | ||
51 | if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40) | ||
52 | ap->cbl = ATA_CBL_PATA80; | ||
53 | else | ||
54 | ap->cbl = ATA_CBL_PATA40; | ||
48 | return ata_std_prereset(ap); | 55 | return ata_std_prereset(ap); |
49 | } | 56 | } |
50 | 57 | ||
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 15841a563694..449162cbf93e 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
@@ -197,7 +197,7 @@ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
197 | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) | 197 | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) |
198 | { | 198 | { |
199 | static const u8 udma_data[] = { | 199 | static const u8 udma_data[] = { |
200 | 0x31, 0x21, 0x11, 0x25, 0x15, 0x05 | 200 | 0x30, 0x20, 0x10, 0x20, 0x10, 0x00 |
201 | }; | 201 | }; |
202 | static const u8 mwdma_data[] = { | 202 | static const u8 mwdma_data[] = { |
203 | 0x30, 0x20, 0x10 | 203 | 0x30, 0x20, 0x10 |
@@ -213,12 +213,21 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
213 | pci_read_config_byte(pdev, pciD, ®D); | 213 | pci_read_config_byte(pdev, pciD, ®D); |
214 | pci_read_config_byte(pdev, pciU, ®U); | 214 | pci_read_config_byte(pdev, pciU, ®U); |
215 | 215 | ||
216 | regD &= ~(0x20 << shift); | 216 | /* DMA bits off */ |
217 | regU &= ~(0x35 << shift); | 217 | regD &= ~(0x20 << adev->devno); |
218 | /* DMA control bits */ | ||
219 | regU &= ~(0x30 << shift); | ||
220 | /* DMA timing bits */ | ||
221 | regU &= ~(0x05 << adev->devno); | ||
218 | 222 | ||
219 | if (adev->dma_mode >= XFER_UDMA_0) | 223 | if (adev->dma_mode >= XFER_UDMA_0) { |
224 | /* Merge thge timing value */ | ||
220 | regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; | 225 | regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; |
221 | else | 226 | /* Merge the control bits */ |
227 | regU |= 1 << adev->devno; /* UDMA on */ | ||
228 | if (adev->dma_mode > 2) /* 15nS timing */ | ||
229 | regU |= 4 << adev->devno; | ||
230 | } else | ||
222 | regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; | 231 | regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; |
223 | 232 | ||
224 | regD |= 0x20 << adev->devno; | 233 | regD |= 0x20 << adev->devno; |
@@ -239,8 +248,8 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc) | |||
239 | struct ata_port *ap = qc->ap; | 248 | struct ata_port *ap = qc->ap; |
240 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 249 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
241 | u8 dma_intr; | 250 | u8 dma_intr; |
242 | int dma_reg = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; | 251 | int dma_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; |
243 | int dma_mask = ap->port_no ? ARTTIM2 : CFR; | 252 | int dma_reg = ap->port_no ? ARTTIM2 : CFR; |
244 | 253 | ||
245 | ata_bmdma_stop(qc); | 254 | ata_bmdma_stop(qc); |
246 | 255 | ||
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index f6817b4093a4..886fab9aa62c 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
26 | 26 | ||
27 | #define DRV_NAME "pata_hpt3x2n" | 27 | #define DRV_NAME "pata_hpt3x2n" |
28 | #define DRV_VERSION "0.3" | 28 | #define DRV_VERSION "0.3.2" |
29 | 29 | ||
30 | enum { | 30 | enum { |
31 | HPT_PCI_FAST = (1 << 31), | 31 | HPT_PCI_FAST = (1 << 31), |
@@ -297,11 +297,11 @@ static int hpt3x2n_pair_idle(struct ata_port *ap) | |||
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | static int hpt3x2n_use_dpll(struct ata_port *ap, int reading) | 300 | static int hpt3x2n_use_dpll(struct ata_port *ap, int writing) |
301 | { | 301 | { |
302 | long flags = (long)ap->host->private_data; | 302 | long flags = (long)ap->host->private_data; |
303 | /* See if we should use the DPLL */ | 303 | /* See if we should use the DPLL */ |
304 | if (reading == 0) | 304 | if (writing) |
305 | return USE_DPLL; /* Needed for write */ | 305 | return USE_DPLL; /* Needed for write */ |
306 | if (flags & PCI66) | 306 | if (flags & PCI66) |
307 | return USE_DPLL; /* Needed at 66Mhz */ | 307 | return USE_DPLL; /* Needed at 66Mhz */ |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 0b56ff3d1cfe..e8afd486434a 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -476,6 +476,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) | |||
476 | /** | 476 | /** |
477 | * it821x_smart_set_mode - mode setting | 477 | * it821x_smart_set_mode - mode setting |
478 | * @ap: interface to set up | 478 | * @ap: interface to set up |
479 | * @unused: device that failed (error only) | ||
479 | * | 480 | * |
480 | * Use a non standard set_mode function. We don't want to be tuned. | 481 | * Use a non standard set_mode function. We don't want to be tuned. |
481 | * The BIOS configured everything. Our job is not to fiddle. We | 482 | * The BIOS configured everything. Our job is not to fiddle. We |
@@ -483,7 +484,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) | |||
483 | * and respect them. | 484 | * and respect them. |
484 | */ | 485 | */ |
485 | 486 | ||
486 | static void it821x_smart_set_mode(struct ata_port *ap) | 487 | static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) |
487 | { | 488 | { |
488 | int dma_enabled = 0; | 489 | int dma_enabled = 0; |
489 | int i; | 490 | int i; |
@@ -512,6 +513,7 @@ static void it821x_smart_set_mode(struct ata_port *ap) | |||
512 | } | 513 | } |
513 | } | 514 | } |
514 | } | 515 | } |
516 | return 0; | ||
515 | } | 517 | } |
516 | 518 | ||
517 | /** | 519 | /** |
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index cb8924109f59..23b8aab3ebd8 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <scsi/scsi_host.h> | 23 | #include <scsi/scsi_host.h> |
24 | 24 | ||
25 | #define DRV_NAME "pata_ixp4xx_cf" | 25 | #define DRV_NAME "pata_ixp4xx_cf" |
26 | #define DRV_VERSION "0.1.1" | 26 | #define DRV_VERSION "0.1.1ac1" |
27 | 27 | ||
28 | static void ixp4xx_set_mode(struct ata_port *ap) | 28 | static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device *adev) |
29 | { | 29 | { |
30 | int i; | 30 | int i; |
31 | 31 | ||
@@ -38,6 +38,7 @@ static void ixp4xx_set_mode(struct ata_port *ap) | |||
38 | dev->flags |= ATA_DFLAG_PIO; | 38 | dev->flags |= ATA_DFLAG_PIO; |
39 | } | 39 | } |
40 | } | 40 | } |
41 | return 0; | ||
41 | } | 42 | } |
42 | 43 | ||
43 | static void ixp4xx_phy_reset(struct ata_port *ap) | 44 | static void ixp4xx_phy_reset(struct ata_port *ap) |
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c index 2d661cb4df3c..d50264af2848 100644 --- a/drivers/ata/pata_jmicron.c +++ b/drivers/ata/pata_jmicron.c | |||
@@ -204,20 +204,12 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i | |||
204 | 204 | ||
205 | u32 reg; | 205 | u32 reg; |
206 | 206 | ||
207 | if (id->driver_data != 368) { | 207 | /* PATA controller is fn 1, AHCI is fn 0 */ |
208 | /* Put the controller into AHCI mode in case the AHCI driver | 208 | if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1) |
209 | has not yet been loaded. This can be done with either | 209 | return -ENODEV; |
210 | function present */ | ||
211 | 210 | ||
212 | /* FIXME: We may want a way to override this in future */ | 211 | /* The 365/66 have two PATA channels, redirect the second */ |
213 | pci_write_config_byte(pdev, 0x41, 0xa1); | 212 | if (id->driver_data == 365 || id->driver_data == 366) { |
214 | |||
215 | /* PATA controller is fn 1, AHCI is fn 0 */ | ||
216 | if (PCI_FUNC(pdev->devfn) != 1) | ||
217 | return -ENODEV; | ||
218 | } | ||
219 | if ( id->driver_data == 365 || id->driver_data == 366) { | ||
220 | /* The 365/66 have two PATA channels, redirect the second */ | ||
221 | pci_read_config_dword(pdev, 0x80, ®); | 213 | pci_read_config_dword(pdev, 0x80, ®); |
222 | reg |= (1 << 24); /* IDE1 to PATA IDE secondary */ | 214 | reg |= (1 << 24); /* IDE1 to PATA IDE secondary */ |
223 | pci_write_config_dword(pdev, 0x80, reg); | 215 | pci_write_config_dword(pdev, 0x80, reg); |
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index e7bf9d89c8ee..581cb33c6f45 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -96,6 +96,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ | |||
96 | /** | 96 | /** |
97 | * legacy_set_mode - mode setting | 97 | * legacy_set_mode - mode setting |
98 | * @ap: IDE interface | 98 | * @ap: IDE interface |
99 | * @unused: Device that failed when error is returned | ||
99 | * | 100 | * |
100 | * Use a non standard set_mode function. We don't want to be tuned. | 101 | * Use a non standard set_mode function. We don't want to be tuned. |
101 | * | 102 | * |
@@ -105,7 +106,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ | |||
105 | * expand on this as per hdparm in the base kernel. | 106 | * expand on this as per hdparm in the base kernel. |
106 | */ | 107 | */ |
107 | 108 | ||
108 | static void legacy_set_mode(struct ata_port *ap) | 109 | static int legacy_set_mode(struct ata_port *ap, struct ata_device **unused) |
109 | { | 110 | { |
110 | int i; | 111 | int i; |
111 | 112 | ||
@@ -118,6 +119,7 @@ static void legacy_set_mode(struct ata_port *ap) | |||
118 | dev->flags |= ATA_DFLAG_PIO; | 119 | dev->flags |= ATA_DFLAG_PIO; |
119 | } | 120 | } |
120 | } | 121 | } |
122 | return 0; | ||
121 | } | 123 | } |
122 | 124 | ||
123 | static struct scsi_host_template legacy_sht = { | 125 | static struct scsi_host_template legacy_sht = { |
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index 443b1d85c6c4..40ae11cbfda4 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c | |||
@@ -30,7 +30,7 @@ static int pio_mask = 1; | |||
30 | * Provide our own set_mode() as we don't want to change anything that has | 30 | * Provide our own set_mode() as we don't want to change anything that has |
31 | * already been configured.. | 31 | * already been configured.. |
32 | */ | 32 | */ |
33 | static void pata_platform_set_mode(struct ata_port *ap) | 33 | static int pata_platform_set_mode(struct ata_port *ap, struct ata_device **unused) |
34 | { | 34 | { |
35 | int i; | 35 | int i; |
36 | 36 | ||
@@ -44,6 +44,7 @@ static void pata_platform_set_mode(struct ata_port *ap) | |||
44 | dev->flags |= ATA_DFLAG_PIO; | 44 | dev->flags |= ATA_DFLAG_PIO; |
45 | } | 45 | } |
46 | } | 46 | } |
47 | return 0; | ||
47 | } | 48 | } |
48 | 49 | ||
49 | static void pata_platform_host_stop(struct ata_host *host) | 50 | static void pata_platform_host_stop(struct ata_host *host) |
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c index adf4cc134f25..cec0729225e1 100644 --- a/drivers/ata/pata_rz1000.c +++ b/drivers/ata/pata_rz1000.c | |||
@@ -52,19 +52,20 @@ static void rz1000_error_handler(struct ata_port *ap) | |||
52 | /** | 52 | /** |
53 | * rz1000_set_mode - mode setting function | 53 | * rz1000_set_mode - mode setting function |
54 | * @ap: ATA interface | 54 | * @ap: ATA interface |
55 | * @unused: returned device on set_mode failure | ||
55 | * | 56 | * |
56 | * Use a non standard set_mode function. We don't want to be tuned. We | 57 | * Use a non standard set_mode function. We don't want to be tuned. We |
57 | * would prefer to be BIOS generic but for the fact our hardware is | 58 | * would prefer to be BIOS generic but for the fact our hardware is |
58 | * whacked out. | 59 | * whacked out. |
59 | */ | 60 | */ |
60 | 61 | ||
61 | static void rz1000_set_mode(struct ata_port *ap) | 62 | static int rz1000_set_mode(struct ata_port *ap, struct ata_device **unused) |
62 | { | 63 | { |
63 | int i; | 64 | int i; |
64 | 65 | ||
65 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 66 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
66 | struct ata_device *dev = &ap->device[i]; | 67 | struct ata_device *dev = &ap->device[i]; |
67 | if (ata_dev_enabled(dev)) { | 68 | if (ata_dev_ready(dev)) { |
68 | /* We don't really care */ | 69 | /* We don't really care */ |
69 | dev->pio_mode = XFER_PIO_0; | 70 | dev->pio_mode = XFER_PIO_0; |
70 | dev->xfer_mode = XFER_PIO_0; | 71 | dev->xfer_mode = XFER_PIO_0; |
@@ -72,6 +73,7 @@ static void rz1000_set_mode(struct ata_port *ap) | |||
72 | dev->flags |= ATA_DFLAG_PIO; | 73 | dev->flags |= ATA_DFLAG_PIO; |
73 | } | 74 | } |
74 | } | 75 | } |
76 | return 0; | ||
75 | } | 77 | } |
76 | 78 | ||
77 | 79 | ||
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c index 32cf0bfa8921..e8dfd8fc3ff7 100644 --- a/drivers/ata/pata_sil680.c +++ b/drivers/ata/pata_sil680.c | |||
@@ -135,7 +135,7 @@ static void sil680_error_handler(struct ata_port *ap) | |||
135 | static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev) | 135 | static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev) |
136 | { | 136 | { |
137 | static u16 speed_p[5] = { 0x328A, 0x2283, 0x1104, 0x10C3, 0x10C1 }; | 137 | static u16 speed_p[5] = { 0x328A, 0x2283, 0x1104, 0x10C3, 0x10C1 }; |
138 | static u16 speed_t[5] = { 0x328A, 0x1281, 0x1281, 0x10C3, 0x10C1 }; | 138 | static u16 speed_t[5] = { 0x328A, 0x2283, 0x1281, 0x10C3, 0x10C1 }; |
139 | 139 | ||
140 | unsigned long tfaddr = sil680_selreg(ap, 0x02); | 140 | unsigned long tfaddr = sil680_selreg(ap, 0x02); |
141 | unsigned long addr = sil680_seldev(ap, adev, 0x04); | 141 | unsigned long addr = sil680_seldev(ap, adev, 0x04); |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index f0d4f7e9ed31..f0b6c3b71429 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * VIA VT8233c - UDMA100 | 23 | * VIA VT8233c - UDMA100 |
24 | * VIA VT8235 - UDMA133 | 24 | * VIA VT8235 - UDMA133 |
25 | * VIA VT8237 - UDMA133 | 25 | * VIA VT8237 - UDMA133 |
26 | * VIA VT8237S - UDMA133 | ||
26 | * VIA VT8251 - UDMA133 | 27 | * VIA VT8251 - UDMA133 |
27 | * | 28 | * |
28 | * Most registers remain compatible across chips. Others start reserved | 29 | * Most registers remain compatible across chips. Others start reserved |
@@ -61,7 +62,7 @@ | |||
61 | #include <linux/libata.h> | 62 | #include <linux/libata.h> |
62 | 63 | ||
63 | #define DRV_NAME "pata_via" | 64 | #define DRV_NAME "pata_via" |
64 | #define DRV_VERSION "0.2.0" | 65 | #define DRV_VERSION "0.2.1" |
65 | 66 | ||
66 | /* | 67 | /* |
67 | * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx | 68 | * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx |
@@ -95,6 +96,7 @@ static const struct via_isa_bridge { | |||
95 | u8 rev_max; | 96 | u8 rev_max; |
96 | u16 flags; | 97 | u16 flags; |
97 | } via_isa_bridges[] = { | 98 | } via_isa_bridges[] = { |
99 | { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | ||
98 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 100 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
99 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 101 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
100 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, | 102 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 1b8e0eb9e032..aae0b5201c1e 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -523,8 +523,7 @@ static const struct ata_port_info mv_port_info[] = { | |||
523 | }, | 523 | }, |
524 | { /* chip_7042 */ | 524 | { /* chip_7042 */ |
525 | .sht = &mv_sht, | 525 | .sht = &mv_sht, |
526 | .flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS | | 526 | .flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS), |
527 | MV_FLAG_DUAL_HC), | ||
528 | .pio_mask = 0x1f, /* pio0-4 */ | 527 | .pio_mask = 0x1f, /* pio0-4 */ |
529 | .udma_mask = 0x7f, /* udma0-6 */ | 528 | .udma_mask = 0x7f, /* udma0-6 */ |
530 | .port_ops = &mv_iie_ops, | 529 | .port_ops = &mv_iie_ops, |
@@ -545,6 +544,8 @@ static const struct pci_device_id mv_pci_tbl[] = { | |||
545 | 544 | ||
546 | { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x }, | 545 | { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x }, |
547 | 546 | ||
547 | { PCI_VDEVICE(TTI, 0x2310), chip_7042 }, | ||
548 | |||
548 | { } /* terminate list */ | 549 | { } /* terminate list */ |
549 | }; | 550 | }; |
550 | 551 | ||
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index f6d498e1cf80..f7a963eb1f02 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -700,7 +700,6 @@ static void nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err) | |||
700 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) | 700 | static int nv_host_intr(struct ata_port *ap, u8 irq_stat) |
701 | { | 701 | { |
702 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); | 702 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); |
703 | int handled; | ||
704 | 703 | ||
705 | /* freeze if hotplugged */ | 704 | /* freeze if hotplugged */ |
706 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { | 705 | if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) { |
@@ -719,13 +718,7 @@ static int nv_host_intr(struct ata_port *ap, u8 irq_stat) | |||
719 | } | 718 | } |
720 | 719 | ||
721 | /* handle interrupt */ | 720 | /* handle interrupt */ |
722 | handled = ata_host_intr(ap, qc); | 721 | return ata_host_intr(ap, qc); |
723 | if (unlikely(!handled)) { | ||
724 | /* spurious, clear it */ | ||
725 | ata_check_status(ap); | ||
726 | } | ||
727 | |||
728 | return 1; | ||
729 | } | 722 | } |
730 | 723 | ||
731 | static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | 724 | static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) |
@@ -752,6 +745,11 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) | |||
752 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { | 745 | if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) { |
753 | u8 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804) | 746 | u8 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804) |
754 | >> (NV_INT_PORT_SHIFT * i); | 747 | >> (NV_INT_PORT_SHIFT * i); |
748 | if(ata_tag_valid(ap->active_tag)) | ||
749 | /** NV_INT_DEV indication seems unreliable at times | ||
750 | at least in ADMA mode. Force it on always when a | ||
751 | command is active, to prevent losing interrupts. */ | ||
752 | irq_stat |= NV_INT_DEV; | ||
755 | handled += nv_host_intr(ap, irq_stat); | 753 | handled += nv_host_intr(ap, irq_stat); |
756 | continue; | 754 | continue; |
757 | } | 755 | } |
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c index 5c603ca3a50a..a43aec62d505 100644 --- a/drivers/ata/sata_uli.c +++ b/drivers/ata/sata_uli.c | |||
@@ -128,7 +128,8 @@ static const struct ata_port_operations uli_ops = { | |||
128 | 128 | ||
129 | static struct ata_port_info uli_port_info = { | 129 | static struct ata_port_info uli_port_info = { |
130 | .sht = &uli_sht, | 130 | .sht = &uli_sht, |
131 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, | 131 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
132 | ATA_FLAG_IGN_SIMPLEX, | ||
132 | .pio_mask = 0x1f, /* pio0-4 */ | 133 | .pio_mask = 0x1f, /* pio0-4 */ |
133 | .udma_mask = 0x7f, /* udma0-6 */ | 134 | .udma_mask = 0x7f, /* udma0-6 */ |
134 | .port_ops = &uli_ops, | 135 | .port_ops = &uli_ops, |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index 1c7f19aecc25..d3d5c0d57032 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -74,9 +74,11 @@ enum { | |||
74 | static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 74 | static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
75 | static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); | 75 | static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); |
76 | static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 76 | static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
77 | static void svia_noop_freeze(struct ata_port *ap); | ||
77 | static void vt6420_error_handler(struct ata_port *ap); | 78 | static void vt6420_error_handler(struct ata_port *ap); |
78 | 79 | ||
79 | static const struct pci_device_id svia_pci_tbl[] = { | 80 | static const struct pci_device_id svia_pci_tbl[] = { |
81 | { PCI_VDEVICE(VIA, 0x5337), vt6420 }, | ||
80 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, | 82 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, |
81 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, | 83 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, |
82 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, | 84 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, |
@@ -127,7 +129,7 @@ static const struct ata_port_operations vt6420_sata_ops = { | |||
127 | .qc_issue = ata_qc_issue_prot, | 129 | .qc_issue = ata_qc_issue_prot, |
128 | .data_xfer = ata_pio_data_xfer, | 130 | .data_xfer = ata_pio_data_xfer, |
129 | 131 | ||
130 | .freeze = ata_bmdma_freeze, | 132 | .freeze = svia_noop_freeze, |
131 | .thaw = ata_bmdma_thaw, | 133 | .thaw = ata_bmdma_thaw, |
132 | .error_handler = vt6420_error_handler, | 134 | .error_handler = vt6420_error_handler, |
133 | .post_internal_cmd = ata_bmdma_post_internal_cmd, | 135 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
@@ -203,6 +205,15 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | |||
203 | outl(val, ap->ioaddr.scr_addr + (4 * sc_reg)); | 205 | outl(val, ap->ioaddr.scr_addr + (4 * sc_reg)); |
204 | } | 206 | } |
205 | 207 | ||
208 | static void svia_noop_freeze(struct ata_port *ap) | ||
209 | { | ||
210 | /* Some VIA controllers choke if ATA_NIEN is manipulated in | ||
211 | * certain way. Leave it alone and just clear pending IRQ. | ||
212 | */ | ||
213 | ata_chk_status(ap); | ||
214 | ata_bmdma_irq_clear(ap); | ||
215 | } | ||
216 | |||
206 | /** | 217 | /** |
207 | * vt6420_prereset - prereset for vt6420 | 218 | * vt6420_prereset - prereset for vt6420 |
208 | * @ap: target ATA port | 219 | * @ap: target ATA port |
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 4dc10105d610..f96446c358ba 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
@@ -1845,7 +1845,7 @@ static u16 __devinit read_bia (const hrz_dev * dev, u16 addr) | |||
1845 | 1845 | ||
1846 | /********** initialise a card **********/ | 1846 | /********** initialise a card **********/ |
1847 | 1847 | ||
1848 | static int __init hrz_init (hrz_dev * dev) { | 1848 | static int __devinit hrz_init (hrz_dev * dev) { |
1849 | int onefivefive; | 1849 | int onefivefive; |
1850 | 1850 | ||
1851 | u16 chan; | 1851 | u16 chan; |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 51d0d562d01e..c85c8cadb6df 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -101,6 +101,11 @@ static int amd_create_gatt_pages(int nr_tables) | |||
101 | for (i = 0; i < nr_tables; i++) { | 101 | for (i = 0; i < nr_tables; i++) { |
102 | entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL); | 102 | entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL); |
103 | if (entry == NULL) { | 103 | if (entry == NULL) { |
104 | while (i > 0) { | ||
105 | kfree(tables[i-1]); | ||
106 | i--; | ||
107 | } | ||
108 | kfree(tables); | ||
104 | retval = -ENOMEM; | 109 | retval = -ENOMEM; |
105 | break; | 110 | break; |
106 | } | 111 | } |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 979300405c0e..93d2209fee4c 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -655,7 +655,7 @@ static struct pci_device_id agp_amd64_pci_table[] = { | |||
655 | .class = (PCI_CLASS_BRIDGE_HOST << 8), | 655 | .class = (PCI_CLASS_BRIDGE_HOST << 8), |
656 | .class_mask = ~0, | 656 | .class_mask = ~0, |
657 | .vendor = PCI_VENDOR_ID_VIA, | 657 | .vendor = PCI_VENDOR_ID_VIA, |
658 | .device = PCI_DEVICE_ID_VIA_K8M890CE, | 658 | .device = PCI_DEVICE_ID_VIA_VT3336, |
659 | .subvendor = PCI_ANY_ID, | 659 | .subvendor = PCI_ANY_ID, |
660 | .subdevice = PCI_ANY_ID, | 660 | .subdevice = PCI_ANY_ID, |
661 | }, | 661 | }, |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index f244c6682738..9987dc2e0c3f 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -41,18 +41,18 @@ static struct gatt_mask ati_generic_masks[] = | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | 43 | ||
44 | typedef struct _ati_page_map { | 44 | struct ati_page_map { |
45 | unsigned long *real; | 45 | unsigned long *real; |
46 | unsigned long __iomem *remapped; | 46 | unsigned long __iomem *remapped; |
47 | } ati_page_map; | 47 | }; |
48 | 48 | ||
49 | static struct _ati_generic_private { | 49 | static struct _ati_generic_private { |
50 | volatile u8 __iomem *registers; | 50 | volatile u8 __iomem *registers; |
51 | ati_page_map **gatt_pages; | 51 | struct ati_page_map **gatt_pages; |
52 | int num_tables; | 52 | int num_tables; |
53 | } ati_generic_private; | 53 | } ati_generic_private; |
54 | 54 | ||
55 | static int ati_create_page_map(ati_page_map *page_map) | 55 | static int ati_create_page_map(struct ati_page_map *page_map) |
56 | { | 56 | { |
57 | int i, err = 0; | 57 | int i, err = 0; |
58 | 58 | ||
@@ -82,7 +82,7 @@ static int ati_create_page_map(ati_page_map *page_map) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | static void ati_free_page_map(ati_page_map *page_map) | 85 | static void ati_free_page_map(struct ati_page_map *page_map) |
86 | { | 86 | { |
87 | unmap_page_from_agp(virt_to_page(page_map->real)); | 87 | unmap_page_from_agp(virt_to_page(page_map->real)); |
88 | iounmap(page_map->remapped); | 88 | iounmap(page_map->remapped); |
@@ -94,8 +94,8 @@ static void ati_free_page_map(ati_page_map *page_map) | |||
94 | static void ati_free_gatt_pages(void) | 94 | static void ati_free_gatt_pages(void) |
95 | { | 95 | { |
96 | int i; | 96 | int i; |
97 | ati_page_map **tables; | 97 | struct ati_page_map **tables; |
98 | ati_page_map *entry; | 98 | struct ati_page_map *entry; |
99 | 99 | ||
100 | tables = ati_generic_private.gatt_pages; | 100 | tables = ati_generic_private.gatt_pages; |
101 | for (i = 0; i < ati_generic_private.num_tables; i++) { | 101 | for (i = 0; i < ati_generic_private.num_tables; i++) { |
@@ -112,30 +112,30 @@ static void ati_free_gatt_pages(void) | |||
112 | 112 | ||
113 | static int ati_create_gatt_pages(int nr_tables) | 113 | static int ati_create_gatt_pages(int nr_tables) |
114 | { | 114 | { |
115 | ati_page_map **tables; | 115 | struct ati_page_map **tables; |
116 | ati_page_map *entry; | 116 | struct ati_page_map *entry; |
117 | int retval = 0; | 117 | int retval = 0; |
118 | int i; | 118 | int i; |
119 | 119 | ||
120 | tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL); | 120 | tables = kzalloc((nr_tables + 1) * sizeof(struct ati_page_map *),GFP_KERNEL); |
121 | if (tables == NULL) | 121 | if (tables == NULL) |
122 | return -ENOMEM; | 122 | return -ENOMEM; |
123 | 123 | ||
124 | for (i = 0; i < nr_tables; i++) { | 124 | for (i = 0; i < nr_tables; i++) { |
125 | entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL); | 125 | entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL); |
126 | if (entry == NULL) { | 126 | if (entry == NULL) { |
127 | while (i>0) { | 127 | while (i > 0) { |
128 | kfree (tables[i-1]); | 128 | kfree(tables[i-1]); |
129 | i--; | 129 | i--; |
130 | } | 130 | } |
131 | kfree (tables); | 131 | kfree(tables); |
132 | tables = NULL; | ||
133 | retval = -ENOMEM; | 132 | retval = -ENOMEM; |
134 | break; | 133 | break; |
135 | } | 134 | } |
136 | tables[i] = entry; | 135 | tables[i] = entry; |
137 | retval = ati_create_page_map(entry); | 136 | retval = ati_create_page_map(entry); |
138 | if (retval != 0) break; | 137 | if (retval != 0) |
138 | break; | ||
139 | } | 139 | } |
140 | ati_generic_private.num_tables = nr_tables; | 140 | ati_generic_private.num_tables = nr_tables; |
141 | ati_generic_private.gatt_pages = tables; | 141 | ati_generic_private.gatt_pages = tables; |
@@ -340,7 +340,7 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start, | |||
340 | static int ati_create_gatt_table(struct agp_bridge_data *bridge) | 340 | static int ati_create_gatt_table(struct agp_bridge_data *bridge) |
341 | { | 341 | { |
342 | struct aper_size_info_lvl2 *value; | 342 | struct aper_size_info_lvl2 *value; |
343 | ati_page_map page_dir; | 343 | struct ati_page_map page_dir; |
344 | unsigned long addr; | 344 | unsigned long addr; |
345 | int retval; | 345 | int retval; |
346 | u32 temp; | 346 | u32 temp; |
@@ -400,7 +400,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge) | |||
400 | 400 | ||
401 | static int ati_free_gatt_table(struct agp_bridge_data *bridge) | 401 | static int ati_free_gatt_table(struct agp_bridge_data *bridge) |
402 | { | 402 | { |
403 | ati_page_map page_dir; | 403 | struct ati_page_map page_dir; |
404 | 404 | ||
405 | page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; | 405 | page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; |
406 | page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; | 406 | page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index ab0a9c0ad7c0..a3011de51f7c 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -1955,6 +1955,15 @@ static int agp_intel_resume(struct pci_dev *pdev) | |||
1955 | 1955 | ||
1956 | pci_restore_state(pdev); | 1956 | pci_restore_state(pdev); |
1957 | 1957 | ||
1958 | /* We should restore our graphics device's config space, | ||
1959 | * as host bridge (00:00) resumes before graphics device (02:00), | ||
1960 | * then our access to its pci space can work right. | ||
1961 | */ | ||
1962 | if (intel_i810_private.i810_dev) | ||
1963 | pci_restore_state(intel_i810_private.i810_dev); | ||
1964 | if (intel_i830_private.i830_dev) | ||
1965 | pci_restore_state(intel_i830_private.i830_dev); | ||
1966 | |||
1958 | if (bridge->driver == &intel_generic_driver) | 1967 | if (bridge->driver == &intel_generic_driver) |
1959 | intel_configure(); | 1968 | intel_configure(); |
1960 | else if (bridge->driver == &intel_850_driver) | 1969 | else if (bridge->driver == &intel_850_driver) |
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index c149ac9ce9a7..2ded7a280d7f 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -380,9 +380,23 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = | |||
380 | /* P4M800CE */ | 380 | /* P4M800CE */ |
381 | { | 381 | { |
382 | .device_id = PCI_DEVICE_ID_VIA_P4M800CE, | 382 | .device_id = PCI_DEVICE_ID_VIA_P4M800CE, |
383 | .chipset_name = "P4M800CE", | 383 | .chipset_name = "VT3314", |
384 | }, | ||
385 | /* CX700 */ | ||
386 | { | ||
387 | .device_id = PCI_DEVICE_ID_VIA_CX700, | ||
388 | .chipset_name = "CX700", | ||
389 | }, | ||
390 | /* VT3336 */ | ||
391 | { | ||
392 | .device_id = PCI_DEVICE_ID_VIA_VT3336, | ||
393 | .chipset_name = "VT3336", | ||
394 | }, | ||
395 | /* P4M890 */ | ||
396 | { | ||
397 | .device_id = PCI_DEVICE_ID_VIA_P4M890, | ||
398 | .chipset_name = "P4M890", | ||
384 | }, | 399 | }, |
385 | |||
386 | { }, /* dummy final entry, always present */ | 400 | { }, /* dummy final entry, always present */ |
387 | }; | 401 | }; |
388 | 402 | ||
@@ -524,6 +538,9 @@ static const struct pci_device_id agp_via_pci_table[] = { | |||
524 | ID(PCI_DEVICE_ID_VIA_83_87XX_1), | 538 | ID(PCI_DEVICE_ID_VIA_83_87XX_1), |
525 | ID(PCI_DEVICE_ID_VIA_3296_0), | 539 | ID(PCI_DEVICE_ID_VIA_3296_0), |
526 | ID(PCI_DEVICE_ID_VIA_P4M800CE), | 540 | ID(PCI_DEVICE_ID_VIA_P4M800CE), |
541 | ID(PCI_DEVICE_ID_VIA_CX700), | ||
542 | ID(PCI_DEVICE_ID_VIA_VT3336), | ||
543 | ID(PCI_DEVICE_ID_VIA_P4M890), | ||
527 | { } | 544 | { } |
528 | }; | 545 | }; |
529 | 546 | ||
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 4e4691a53890..53582b53da95 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -3649,8 +3649,6 @@ static void ipmi_timeout_handler(long timeout_period) | |||
3649 | unsigned long flags; | 3649 | unsigned long flags; |
3650 | int i; | 3650 | int i; |
3651 | 3651 | ||
3652 | INIT_LIST_HEAD(&timeouts); | ||
3653 | |||
3654 | rcu_read_lock(); | 3652 | rcu_read_lock(); |
3655 | list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { | 3653 | list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { |
3656 | /* See if any waiting messages need to be processed. */ | 3654 | /* See if any waiting messages need to be processed. */ |
@@ -3671,6 +3669,7 @@ static void ipmi_timeout_handler(long timeout_period) | |||
3671 | /* Go through the seq table and find any messages that | 3669 | /* Go through the seq table and find any messages that |
3672 | have timed out, putting them in the timeouts | 3670 | have timed out, putting them in the timeouts |
3673 | list. */ | 3671 | list. */ |
3672 | INIT_LIST_HEAD(&timeouts); | ||
3674 | spin_lock_irqsave(&intf->seq_lock, flags); | 3673 | spin_lock_irqsave(&intf->seq_lock, flags); |
3675 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) | 3674 | for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) |
3676 | check_msg_timeout(intf, &(intf->seq_table[i]), | 3675 | check_msg_timeout(intf, &(intf->seq_table[i]), |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 4f1813e04754..f5c160caf9f4 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -293,8 +293,8 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | |||
293 | { | 293 | { |
294 | unsigned long pfn; | 294 | unsigned long pfn; |
295 | 295 | ||
296 | /* Turn a pfn offset into an absolute pfn */ | 296 | /* Turn a kernel-virtual address into a physical page frame */ |
297 | pfn = PFN_DOWN(virt_to_phys((void *)PAGE_OFFSET)) + vma->vm_pgoff; | 297 | pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; |
298 | 298 | ||
299 | /* | 299 | /* |
300 | * RED-PEN: on some architectures there is more mapped memory | 300 | * RED-PEN: on some architectures there is more mapped memory |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 13935235e066..7fd3cd5ddf21 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) | |||
215 | } | 215 | } |
216 | static struct sysrq_key_op sysrq_showstate_blocked_op = { | 216 | static struct sysrq_key_op sysrq_showstate_blocked_op = { |
217 | .handler = sysrq_handle_showstate_blocked, | 217 | .handler = sysrq_handle_showstate_blocked, |
218 | .help_msg = "showBlockedTasks", | 218 | .help_msg = "shoW-blocked-tasks", |
219 | .action_msg = "Show Blocked State", | 219 | .action_msg = "Show Blocked State", |
220 | .enable_mask = SYSRQ_ENABLE_DUMP, | 220 | .enable_mask = SYSRQ_ENABLE_DUMP, |
221 | }; | 221 | }; |
@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
315 | &sysrq_loglevel_op, /* 9 */ | 315 | &sysrq_loglevel_op, /* 9 */ |
316 | 316 | ||
317 | /* | 317 | /* |
318 | * Don't use for system provided sysrqs, it is handled specially on | 318 | * a: Don't use for system provided sysrqs, it is handled specially on |
319 | * sparc and will never arrive | 319 | * sparc and will never arrive. |
320 | */ | 320 | */ |
321 | NULL, /* a */ | 321 | NULL, /* a */ |
322 | &sysrq_reboot_op, /* b */ | 322 | &sysrq_reboot_op, /* b */ |
323 | &sysrq_crashdump_op, /* c */ | 323 | &sysrq_crashdump_op, /* c & ibm_emac driver debug */ |
324 | &sysrq_showlocks_op, /* d */ | 324 | &sysrq_showlocks_op, /* d */ |
325 | &sysrq_term_op, /* e */ | 325 | &sysrq_term_op, /* e */ |
326 | &sysrq_moom_op, /* f */ | 326 | &sysrq_moom_op, /* f */ |
327 | /* g: May be registered by ppc for kgdb */ | ||
327 | NULL, /* g */ | 328 | NULL, /* g */ |
328 | NULL, /* h */ | 329 | NULL, /* h */ |
329 | &sysrq_kill_op, /* i */ | 330 | &sysrq_kill_op, /* i */ |
@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = { | |||
332 | NULL, /* l */ | 333 | NULL, /* l */ |
333 | &sysrq_showmem_op, /* m */ | 334 | &sysrq_showmem_op, /* m */ |
334 | &sysrq_unrt_op, /* n */ | 335 | &sysrq_unrt_op, /* n */ |
335 | /* This will often be registered as 'Off' at init time */ | 336 | /* o: This will often be registered as 'Off' at init time */ |
336 | NULL, /* o */ | 337 | NULL, /* o */ |
337 | &sysrq_showregs_op, /* p */ | 338 | &sysrq_showregs_op, /* p */ |
338 | NULL, /* q */ | 339 | NULL, /* q */ |
339 | &sysrq_unraw_op, /* r */ | 340 | &sysrq_unraw_op, /* r */ |
340 | &sysrq_sync_op, /* s */ | 341 | &sysrq_sync_op, /* s */ |
341 | &sysrq_showstate_op, /* t */ | 342 | &sysrq_showstate_op, /* t */ |
342 | &sysrq_mountro_op, /* u */ | 343 | &sysrq_mountro_op, /* u */ |
343 | /* May be assigned at init time by SMP VOYAGER */ | 344 | /* v: May be registered at init time by SMP VOYAGER */ |
344 | NULL, /* v */ | 345 | NULL, /* v */ |
345 | NULL, /* w */ | 346 | &sysrq_showstate_blocked_op, /* w */ |
346 | &sysrq_showstate_blocked_op, /* x */ | 347 | /* x: May be registered on ppc/powerpc for xmon */ |
348 | NULL, /* x */ | ||
347 | NULL, /* y */ | 349 | NULL, /* y */ |
348 | NULL /* z */ | 350 | NULL /* z */ |
349 | }; | 351 | }; |
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 448d5083c381..4fac2bdf6215 100644 --- a/drivers/char/tlclk.c +++ b/drivers/char/tlclk.c | |||
@@ -186,6 +186,7 @@ static int got_event; /* if events processing have been done */ | |||
186 | static void switchover_timeout(unsigned long data); | 186 | static void switchover_timeout(unsigned long data); |
187 | static struct timer_list switchover_timer = | 187 | static struct timer_list switchover_timer = |
188 | TIMER_INITIALIZER(switchover_timeout , 0, 0); | 188 | TIMER_INITIALIZER(switchover_timeout , 0, 0); |
189 | static unsigned long tlclk_timer_data; | ||
189 | 190 | ||
190 | static struct tlclk_alarms *alarm_events; | 191 | static struct tlclk_alarms *alarm_events; |
191 | 192 | ||
@@ -197,10 +198,19 @@ static irqreturn_t tlclk_interrupt(int irq, void *dev_id); | |||
197 | 198 | ||
198 | static DECLARE_WAIT_QUEUE_HEAD(wq); | 199 | static DECLARE_WAIT_QUEUE_HEAD(wq); |
199 | 200 | ||
201 | static unsigned long useflags; | ||
202 | static DEFINE_MUTEX(tlclk_mutex); | ||
203 | |||
200 | static int tlclk_open(struct inode *inode, struct file *filp) | 204 | static int tlclk_open(struct inode *inode, struct file *filp) |
201 | { | 205 | { |
202 | int result; | 206 | int result; |
203 | 207 | ||
208 | if (test_and_set_bit(0, &useflags)) | ||
209 | return -EBUSY; | ||
210 | /* this legacy device is always one per system and it doesn't | ||
211 | * know how to handle multiple concurrent clients. | ||
212 | */ | ||
213 | |||
204 | /* Make sure there is no interrupt pending while | 214 | /* Make sure there is no interrupt pending while |
205 | * initialising interrupt handler */ | 215 | * initialising interrupt handler */ |
206 | inb(TLCLK_REG6); | 216 | inb(TLCLK_REG6); |
@@ -221,6 +231,7 @@ static int tlclk_open(struct inode *inode, struct file *filp) | |||
221 | static int tlclk_release(struct inode *inode, struct file *filp) | 231 | static int tlclk_release(struct inode *inode, struct file *filp) |
222 | { | 232 | { |
223 | free_irq(telclk_interrupt, tlclk_interrupt); | 233 | free_irq(telclk_interrupt, tlclk_interrupt); |
234 | clear_bit(0, &useflags); | ||
224 | 235 | ||
225 | return 0; | 236 | return 0; |
226 | } | 237 | } |
@@ -230,26 +241,25 @@ static ssize_t tlclk_read(struct file *filp, char __user *buf, size_t count, | |||
230 | { | 241 | { |
231 | if (count < sizeof(struct tlclk_alarms)) | 242 | if (count < sizeof(struct tlclk_alarms)) |
232 | return -EIO; | 243 | return -EIO; |
244 | if (mutex_lock_interruptible(&tlclk_mutex)) | ||
245 | return -EINTR; | ||
246 | |||
233 | 247 | ||
234 | wait_event_interruptible(wq, got_event); | 248 | wait_event_interruptible(wq, got_event); |
235 | if (copy_to_user(buf, alarm_events, sizeof(struct tlclk_alarms))) | 249 | if (copy_to_user(buf, alarm_events, sizeof(struct tlclk_alarms))) { |
250 | mutex_unlock(&tlclk_mutex); | ||
236 | return -EFAULT; | 251 | return -EFAULT; |
252 | } | ||
237 | 253 | ||
238 | memset(alarm_events, 0, sizeof(struct tlclk_alarms)); | 254 | memset(alarm_events, 0, sizeof(struct tlclk_alarms)); |
239 | got_event = 0; | 255 | got_event = 0; |
240 | 256 | ||
257 | mutex_unlock(&tlclk_mutex); | ||
241 | return sizeof(struct tlclk_alarms); | 258 | return sizeof(struct tlclk_alarms); |
242 | } | 259 | } |
243 | 260 | ||
244 | static ssize_t tlclk_write(struct file *filp, const char __user *buf, size_t count, | ||
245 | loff_t *f_pos) | ||
246 | { | ||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | static const struct file_operations tlclk_fops = { | 261 | static const struct file_operations tlclk_fops = { |
251 | .read = tlclk_read, | 262 | .read = tlclk_read, |
252 | .write = tlclk_write, | ||
253 | .open = tlclk_open, | 263 | .open = tlclk_open, |
254 | .release = tlclk_release, | 264 | .release = tlclk_release, |
255 | 265 | ||
@@ -540,7 +550,7 @@ static ssize_t store_select_amcb1_transmit_clock(struct device *d, | |||
540 | SET_PORT_BITS(TLCLK_REG3, 0xf8, 0x7); | 550 | SET_PORT_BITS(TLCLK_REG3, 0xf8, 0x7); |
541 | switch (val) { | 551 | switch (val) { |
542 | case CLK_8_592MHz: | 552 | case CLK_8_592MHz: |
543 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 1); | 553 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 2); |
544 | break; | 554 | break; |
545 | case CLK_11_184MHz: | 555 | case CLK_11_184MHz: |
546 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 0); | 556 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 0); |
@@ -549,7 +559,7 @@ static ssize_t store_select_amcb1_transmit_clock(struct device *d, | |||
549 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 3); | 559 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 3); |
550 | break; | 560 | break; |
551 | case CLK_44_736MHz: | 561 | case CLK_44_736MHz: |
552 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 2); | 562 | SET_PORT_BITS(TLCLK_REG0, 0xfc, 1); |
553 | break; | 563 | break; |
554 | } | 564 | } |
555 | } else | 565 | } else |
@@ -839,11 +849,13 @@ static void __exit tlclk_cleanup(void) | |||
839 | 849 | ||
840 | static void switchover_timeout(unsigned long data) | 850 | static void switchover_timeout(unsigned long data) |
841 | { | 851 | { |
842 | if ((data & 1)) { | 852 | unsigned long flags = *(unsigned long *) data; |
843 | if ((inb(TLCLK_REG1) & 0x08) != (data & 0x08)) | 853 | |
854 | if ((flags & 1)) { | ||
855 | if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08)) | ||
844 | alarm_events->switchover_primary++; | 856 | alarm_events->switchover_primary++; |
845 | } else { | 857 | } else { |
846 | if ((inb(TLCLK_REG1) & 0x08) != (data & 0x08)) | 858 | if ((inb(TLCLK_REG1) & 0x08) != (flags & 0x08)) |
847 | alarm_events->switchover_secondary++; | 859 | alarm_events->switchover_secondary++; |
848 | } | 860 | } |
849 | 861 | ||
@@ -901,8 +913,9 @@ static irqreturn_t tlclk_interrupt(int irq, void *dev_id) | |||
901 | 913 | ||
902 | /* TIMEOUT in ~10ms */ | 914 | /* TIMEOUT in ~10ms */ |
903 | switchover_timer.expires = jiffies + msecs_to_jiffies(10); | 915 | switchover_timer.expires = jiffies + msecs_to_jiffies(10); |
904 | switchover_timer.data = inb(TLCLK_REG1); | 916 | tlclk_timer_data = inb(TLCLK_REG1); |
905 | add_timer(&switchover_timer); | 917 | switchover_timer.data = (unsigned long) &tlclk_timer_data; |
918 | mod_timer(&switchover_timer, switchover_timer.expires); | ||
906 | } else { | 919 | } else { |
907 | got_event = 1; | 920 | got_event = 1; |
908 | wake_up(&wq); | 921 | wake_up(&wq); |
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c index a744dad9cf45..0cea8d4907df 100644 --- a/drivers/char/vr41xx_giu.c +++ b/drivers/char/vr41xx_giu.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2002 MontaVista Software Inc. | 4 | * Copyright (C) 2002 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> |
6 | * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -125,30 +125,17 @@ static inline uint16_t giu_clear(uint16_t offset, uint16_t clear) | |||
125 | return data; | 125 | return data; |
126 | } | 126 | } |
127 | 127 | ||
128 | static unsigned int startup_giuint_low_irq(unsigned int irq) | 128 | static void ack_giuint_low(unsigned int irq) |
129 | { | 129 | { |
130 | unsigned int pin; | 130 | giu_write(GIUINTSTATL, 1 << GPIO_PIN_OF_IRQ(irq)); |
131 | |||
132 | pin = GPIO_PIN_OF_IRQ(irq); | ||
133 | giu_write(GIUINTSTATL, 1 << pin); | ||
134 | giu_set(GIUINTENL, 1 << pin); | ||
135 | |||
136 | return 0; | ||
137 | } | 131 | } |
138 | 132 | ||
139 | static void shutdown_giuint_low_irq(unsigned int irq) | 133 | static void mask_giuint_low(unsigned int irq) |
140 | { | 134 | { |
141 | giu_clear(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); | 135 | giu_clear(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); |
142 | } | 136 | } |
143 | 137 | ||
144 | static void enable_giuint_low_irq(unsigned int irq) | 138 | static void mask_ack_giuint_low(unsigned int irq) |
145 | { | ||
146 | giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); | ||
147 | } | ||
148 | |||
149 | #define disable_giuint_low_irq shutdown_giuint_low_irq | ||
150 | |||
151 | static void ack_giuint_low_irq(unsigned int irq) | ||
152 | { | 139 | { |
153 | unsigned int pin; | 140 | unsigned int pin; |
154 | 141 | ||
@@ -157,46 +144,30 @@ static void ack_giuint_low_irq(unsigned int irq) | |||
157 | giu_write(GIUINTSTATL, 1 << pin); | 144 | giu_write(GIUINTSTATL, 1 << pin); |
158 | } | 145 | } |
159 | 146 | ||
160 | static void end_giuint_low_irq(unsigned int irq) | 147 | static void unmask_giuint_low(unsigned int irq) |
161 | { | 148 | { |
162 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | 149 | giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); |
163 | giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); | ||
164 | } | 150 | } |
165 | 151 | ||
166 | static struct hw_interrupt_type giuint_low_irq_type = { | 152 | static struct irq_chip giuint_low_irq_chip = { |
167 | .typename = "GIUINTL", | 153 | .name = "GIUINTL", |
168 | .startup = startup_giuint_low_irq, | 154 | .ack = ack_giuint_low, |
169 | .shutdown = shutdown_giuint_low_irq, | 155 | .mask = mask_giuint_low, |
170 | .enable = enable_giuint_low_irq, | 156 | .mask_ack = mask_ack_giuint_low, |
171 | .disable = disable_giuint_low_irq, | 157 | .unmask = unmask_giuint_low, |
172 | .ack = ack_giuint_low_irq, | ||
173 | .end = end_giuint_low_irq, | ||
174 | }; | 158 | }; |
175 | 159 | ||
176 | static unsigned int startup_giuint_high_irq(unsigned int irq) | 160 | static void ack_giuint_high(unsigned int irq) |
177 | { | 161 | { |
178 | unsigned int pin; | 162 | giu_write(GIUINTSTATH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); |
179 | |||
180 | pin = GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET; | ||
181 | giu_write(GIUINTSTATH, 1 << pin); | ||
182 | giu_set(GIUINTENH, 1 << pin); | ||
183 | |||
184 | return 0; | ||
185 | } | 163 | } |
186 | 164 | ||
187 | static void shutdown_giuint_high_irq(unsigned int irq) | 165 | static void mask_giuint_high(unsigned int irq) |
188 | { | 166 | { |
189 | giu_clear(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); | 167 | giu_clear(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); |
190 | } | 168 | } |
191 | 169 | ||
192 | static void enable_giuint_high_irq(unsigned int irq) | 170 | static void mask_ack_giuint_high(unsigned int irq) |
193 | { | ||
194 | giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); | ||
195 | } | ||
196 | |||
197 | #define disable_giuint_high_irq shutdown_giuint_high_irq | ||
198 | |||
199 | static void ack_giuint_high_irq(unsigned int irq) | ||
200 | { | 171 | { |
201 | unsigned int pin; | 172 | unsigned int pin; |
202 | 173 | ||
@@ -205,20 +176,17 @@ static void ack_giuint_high_irq(unsigned int irq) | |||
205 | giu_write(GIUINTSTATH, 1 << pin); | 176 | giu_write(GIUINTSTATH, 1 << pin); |
206 | } | 177 | } |
207 | 178 | ||
208 | static void end_giuint_high_irq(unsigned int irq) | 179 | static void unmask_giuint_high(unsigned int irq) |
209 | { | 180 | { |
210 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | 181 | giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); |
211 | giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); | ||
212 | } | 182 | } |
213 | 183 | ||
214 | static struct hw_interrupt_type giuint_high_irq_type = { | 184 | static struct irq_chip giuint_high_irq_chip = { |
215 | .typename = "GIUINTH", | 185 | .name = "GIUINTH", |
216 | .startup = startup_giuint_high_irq, | 186 | .ack = ack_giuint_high, |
217 | .shutdown = shutdown_giuint_high_irq, | 187 | .mask = mask_giuint_high, |
218 | .enable = enable_giuint_high_irq, | 188 | .mask_ack = mask_ack_giuint_high, |
219 | .disable = disable_giuint_high_irq, | 189 | .unmask = unmask_giuint_high, |
220 | .ack = ack_giuint_high_irq, | ||
221 | .end = end_giuint_high_irq, | ||
222 | }; | 190 | }; |
223 | 191 | ||
224 | static int giu_get_irq(unsigned int irq) | 192 | static int giu_get_irq(unsigned int irq) |
@@ -282,9 +250,15 @@ void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_ | |||
282 | break; | 250 | break; |
283 | } | 251 | } |
284 | } | 252 | } |
253 | set_irq_chip_and_handler(GIU_IRQ(pin), | ||
254 | &giuint_low_irq_chip, | ||
255 | handle_edge_irq); | ||
285 | } else { | 256 | } else { |
286 | giu_clear(GIUINTTYPL, mask); | 257 | giu_clear(GIUINTTYPL, mask); |
287 | giu_clear(GIUINTHTSELL, mask); | 258 | giu_clear(GIUINTHTSELL, mask); |
259 | set_irq_chip_and_handler(GIU_IRQ(pin), | ||
260 | &giuint_low_irq_chip, | ||
261 | handle_level_irq); | ||
288 | } | 262 | } |
289 | giu_write(GIUINTSTATL, mask); | 263 | giu_write(GIUINTSTATL, mask); |
290 | } else if (pin < GIUINT_HIGH_MAX) { | 264 | } else if (pin < GIUINT_HIGH_MAX) { |
@@ -311,9 +285,15 @@ void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_ | |||
311 | break; | 285 | break; |
312 | } | 286 | } |
313 | } | 287 | } |
288 | set_irq_chip_and_handler(GIU_IRQ(pin), | ||
289 | &giuint_high_irq_chip, | ||
290 | handle_edge_irq); | ||
314 | } else { | 291 | } else { |
315 | giu_clear(GIUINTTYPH, mask); | 292 | giu_clear(GIUINTTYPH, mask); |
316 | giu_clear(GIUINTHTSELH, mask); | 293 | giu_clear(GIUINTHTSELH, mask); |
294 | set_irq_chip_and_handler(GIU_IRQ(pin), | ||
295 | &giuint_high_irq_chip, | ||
296 | handle_level_irq); | ||
317 | } | 297 | } |
318 | giu_write(GIUINTSTATH, mask); | 298 | giu_write(GIUINTSTATH, mask); |
319 | } | 299 | } |
@@ -617,10 +597,11 @@ static const struct file_operations gpio_fops = { | |||
617 | static int __devinit giu_probe(struct platform_device *dev) | 597 | static int __devinit giu_probe(struct platform_device *dev) |
618 | { | 598 | { |
619 | unsigned long start, size, flags = 0; | 599 | unsigned long start, size, flags = 0; |
620 | unsigned int nr_pins = 0; | 600 | unsigned int nr_pins = 0, trigger, i, pin; |
621 | struct resource *res1, *res2 = NULL; | 601 | struct resource *res1, *res2 = NULL; |
622 | void *base; | 602 | void *base; |
623 | int retval, i; | 603 | struct irq_chip *chip; |
604 | int retval; | ||
624 | 605 | ||
625 | switch (current_cpu_data.cputype) { | 606 | switch (current_cpu_data.cputype) { |
626 | case CPU_VR4111: | 607 | case CPU_VR4111: |
@@ -688,11 +669,20 @@ static int __devinit giu_probe(struct platform_device *dev) | |||
688 | giu_write(GIUINTENL, 0); | 669 | giu_write(GIUINTENL, 0); |
689 | giu_write(GIUINTENH, 0); | 670 | giu_write(GIUINTENH, 0); |
690 | 671 | ||
672 | trigger = giu_read(GIUINTTYPH) << 16; | ||
673 | trigger |= giu_read(GIUINTTYPL); | ||
691 | for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) { | 674 | for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) { |
692 | if (i < GIU_IRQ(GIUINT_HIGH_OFFSET)) | 675 | pin = GPIO_PIN_OF_IRQ(i); |
693 | irq_desc[i].chip = &giuint_low_irq_type; | 676 | if (pin < GIUINT_HIGH_OFFSET) |
677 | chip = &giuint_low_irq_chip; | ||
694 | else | 678 | else |
695 | irq_desc[i].chip = &giuint_high_irq_type; | 679 | chip = &giuint_high_irq_chip; |
680 | |||
681 | if (trigger & (1 << pin)) | ||
682 | set_irq_chip_and_handler(i, chip, handle_edge_irq); | ||
683 | else | ||
684 | set_irq_chip_and_handler(i, chip, handle_level_irq); | ||
685 | |||
696 | } | 686 | } |
697 | 687 | ||
698 | return cascade_irq(GIUINT_IRQ, giu_get_irq); | 688 | return cascade_irq(GIUINT_IRQ, giu_get_irq); |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d91330432ba2..a45cc89e387a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -722,8 +722,13 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) | |||
722 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 722 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
723 | 723 | ||
724 | dprintk("CPU already managed, adding link\n"); | 724 | dprintk("CPU already managed, adding link\n"); |
725 | sysfs_create_link(&sys_dev->kobj, | 725 | ret = sysfs_create_link(&sys_dev->kobj, |
726 | &managed_policy->kobj, "cpufreq"); | 726 | &managed_policy->kobj, |
727 | "cpufreq"); | ||
728 | if (ret) { | ||
729 | mutex_unlock(&policy->lock); | ||
730 | goto err_out_driver_exit; | ||
731 | } | ||
727 | 732 | ||
728 | cpufreq_debug_enable_ratelimit(); | 733 | cpufreq_debug_enable_ratelimit(); |
729 | mutex_unlock(&policy->lock); | 734 | mutex_unlock(&policy->lock); |
@@ -770,8 +775,12 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) | |||
770 | dprintk("CPU %u already managed, adding link\n", j); | 775 | dprintk("CPU %u already managed, adding link\n", j); |
771 | cpufreq_cpu_get(cpu); | 776 | cpufreq_cpu_get(cpu); |
772 | cpu_sys_dev = get_cpu_sysdev(j); | 777 | cpu_sys_dev = get_cpu_sysdev(j); |
773 | sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, | 778 | ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, |
774 | "cpufreq"); | 779 | "cpufreq"); |
780 | if (ret) { | ||
781 | mutex_unlock(&policy->lock); | ||
782 | goto err_out_unregister; | ||
783 | } | ||
775 | } | 784 | } |
776 | 785 | ||
777 | policy->governor = NULL; /* to assure that the starting sequence is | 786 | policy->governor = NULL; /* to assure that the starting sequence is |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 5ab5e393b882..c6281ccd4fe7 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -122,8 +122,6 @@ struct efivar_entry { | |||
122 | struct kobject kobj; | 122 | struct kobject kobj; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | #define get_efivar_entry(n) list_entry(n, struct efivar_entry, list) | ||
126 | |||
127 | struct efivar_attribute { | 125 | struct efivar_attribute { |
128 | struct attribute attr; | 126 | struct attribute attr; |
129 | ssize_t (*show) (struct efivar_entry *entry, char *buf); | 127 | ssize_t (*show) (struct efivar_entry *entry, char *buf); |
@@ -386,9 +384,6 @@ static struct sysfs_ops efivar_attr_ops = { | |||
386 | static void efivar_release(struct kobject *kobj) | 384 | static void efivar_release(struct kobject *kobj) |
387 | { | 385 | { |
388 | struct efivar_entry *var = container_of(kobj, struct efivar_entry, kobj); | 386 | struct efivar_entry *var = container_of(kobj, struct efivar_entry, kobj); |
389 | spin_lock(&efivars_lock); | ||
390 | list_del(&var->list); | ||
391 | spin_unlock(&efivars_lock); | ||
392 | kfree(var); | 387 | kfree(var); |
393 | } | 388 | } |
394 | 389 | ||
@@ -430,9 +425,8 @@ static ssize_t | |||
430 | efivar_create(struct subsystem *sub, const char *buf, size_t count) | 425 | efivar_create(struct subsystem *sub, const char *buf, size_t count) |
431 | { | 426 | { |
432 | struct efi_variable *new_var = (struct efi_variable *)buf; | 427 | struct efi_variable *new_var = (struct efi_variable *)buf; |
433 | struct efivar_entry *search_efivar = NULL; | 428 | struct efivar_entry *search_efivar, *n; |
434 | unsigned long strsize1, strsize2; | 429 | unsigned long strsize1, strsize2; |
435 | struct list_head *pos, *n; | ||
436 | efi_status_t status = EFI_NOT_FOUND; | 430 | efi_status_t status = EFI_NOT_FOUND; |
437 | int found = 0; | 431 | int found = 0; |
438 | 432 | ||
@@ -444,8 +438,7 @@ efivar_create(struct subsystem *sub, const char *buf, size_t count) | |||
444 | /* | 438 | /* |
445 | * Does this variable already exist? | 439 | * Does this variable already exist? |
446 | */ | 440 | */ |
447 | list_for_each_safe(pos, n, &efivar_list) { | 441 | list_for_each_entry_safe(search_efivar, n, &efivar_list, list) { |
448 | search_efivar = get_efivar_entry(pos); | ||
449 | strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024); | 442 | strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024); |
450 | strsize2 = utf8_strsize(new_var->VariableName, 1024); | 443 | strsize2 = utf8_strsize(new_var->VariableName, 1024); |
451 | if (strsize1 == strsize2 && | 444 | if (strsize1 == strsize2 && |
@@ -490,9 +483,8 @@ static ssize_t | |||
490 | efivar_delete(struct subsystem *sub, const char *buf, size_t count) | 483 | efivar_delete(struct subsystem *sub, const char *buf, size_t count) |
491 | { | 484 | { |
492 | struct efi_variable *del_var = (struct efi_variable *)buf; | 485 | struct efi_variable *del_var = (struct efi_variable *)buf; |
493 | struct efivar_entry *search_efivar = NULL; | 486 | struct efivar_entry *search_efivar, *n; |
494 | unsigned long strsize1, strsize2; | 487 | unsigned long strsize1, strsize2; |
495 | struct list_head *pos, *n; | ||
496 | efi_status_t status = EFI_NOT_FOUND; | 488 | efi_status_t status = EFI_NOT_FOUND; |
497 | int found = 0; | 489 | int found = 0; |
498 | 490 | ||
@@ -504,8 +496,7 @@ efivar_delete(struct subsystem *sub, const char *buf, size_t count) | |||
504 | /* | 496 | /* |
505 | * Does this variable already exist? | 497 | * Does this variable already exist? |
506 | */ | 498 | */ |
507 | list_for_each_safe(pos, n, &efivar_list) { | 499 | list_for_each_entry_safe(search_efivar, n, &efivar_list, list) { |
508 | search_efivar = get_efivar_entry(pos); | ||
509 | strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024); | 500 | strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024); |
510 | strsize2 = utf8_strsize(del_var->VariableName, 1024); | 501 | strsize2 = utf8_strsize(del_var->VariableName, 1024); |
511 | if (strsize1 == strsize2 && | 502 | if (strsize1 == strsize2 && |
@@ -537,9 +528,9 @@ efivar_delete(struct subsystem *sub, const char *buf, size_t count) | |||
537 | spin_unlock(&efivars_lock); | 528 | spin_unlock(&efivars_lock); |
538 | return -EIO; | 529 | return -EIO; |
539 | } | 530 | } |
531 | list_del(&search_efivar->list); | ||
540 | /* We need to release this lock before unregistering. */ | 532 | /* We need to release this lock before unregistering. */ |
541 | spin_unlock(&efivars_lock); | 533 | spin_unlock(&efivars_lock); |
542 | |||
543 | efivar_unregister(search_efivar); | 534 | efivar_unregister(search_efivar); |
544 | 535 | ||
545 | /* It's dead Jim.... */ | 536 | /* It's dead Jim.... */ |
@@ -768,10 +759,14 @@ out_free: | |||
768 | static void __exit | 759 | static void __exit |
769 | efivars_exit(void) | 760 | efivars_exit(void) |
770 | { | 761 | { |
771 | struct list_head *pos, *n; | 762 | struct efivar_entry *entry, *n; |
772 | 763 | ||
773 | list_for_each_safe(pos, n, &efivar_list) | 764 | list_for_each_entry_safe(entry, n, &efivar_list, list) { |
774 | efivar_unregister(get_efivar_entry(pos)); | 765 | spin_lock(&efivars_lock); |
766 | list_del(&entry->list); | ||
767 | spin_unlock(&efivars_lock); | ||
768 | efivar_unregister(entry); | ||
769 | } | ||
775 | 770 | ||
776 | subsystem_unregister(&vars_subsys); | 771 | subsystem_unregister(&vars_subsys); |
777 | firmware_unregister(&efi_subsys); | 772 | firmware_unregister(&efi_subsys); |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 1e1a7770a6b9..49f18f5b2514 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -543,6 +543,7 @@ void hid_free_device(struct hid_device *device) | |||
543 | } | 543 | } |
544 | 544 | ||
545 | kfree(device->rdesc); | 545 | kfree(device->rdesc); |
546 | kfree(device->collection); | ||
546 | kfree(device); | 547 | kfree(device); |
547 | } | 548 | } |
548 | EXPORT_SYMBOL_GPL(hid_free_device); | 549 | EXPORT_SYMBOL_GPL(hid_free_device); |
@@ -880,6 +881,10 @@ static void hid_output_field(struct hid_field *field, __u8 *data) | |||
880 | unsigned size = field->report_size; | 881 | unsigned size = field->report_size; |
881 | unsigned n; | 882 | unsigned n; |
882 | 883 | ||
884 | /* make sure the unused bits in the last byte are zeros */ | ||
885 | if (count > 0 && size > 0) | ||
886 | data[(count*size-1)/8] = 0; | ||
887 | |||
883 | for (n = 0; n < count; n++) { | 888 | for (n = 0; n < count; n++) { |
884 | if (field->logical_minimum < 0) /* signed values */ | 889 | if (field->logical_minimum < 0) /* signed values */ |
885 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); | 890 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); |
@@ -947,7 +952,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i | |||
947 | } | 952 | } |
948 | 953 | ||
949 | #ifdef DEBUG_DATA | 954 | #ifdef DEBUG_DATA |
950 | printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", len, report_enum->numbered ? "" : "un"); | 955 | printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un"); |
951 | #endif | 956 | #endif |
952 | 957 | ||
953 | n = 0; /* Normally report number is 0 */ | 958 | n = 0; /* Normally report number is 0 */ |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 28689e3eb552..c7a6833f6821 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -30,12 +30,16 @@ | |||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
33 | #include <linux/usb/input.h> | ||
34 | 33 | ||
35 | #undef DEBUG | 34 | #undef DEBUG |
36 | 35 | ||
37 | #include <linux/hid.h> | 36 | #include <linux/hid.h> |
38 | 37 | ||
38 | static int hid_pb_fnmode = 1; | ||
39 | module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); | ||
40 | MODULE_PARM_DESC(pb_fnmode, | ||
41 | "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); | ||
42 | |||
39 | #define unk KEY_UNKNOWN | 43 | #define unk KEY_UNKNOWN |
40 | 44 | ||
41 | static const unsigned char hid_keyboard[256] = { | 45 | static const unsigned char hid_keyboard[256] = { |
@@ -155,7 +159,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | |||
155 | return 1; | 159 | return 1; |
156 | } | 160 | } |
157 | 161 | ||
158 | if (hid->pb_fnmode) { | 162 | if (hid_pb_fnmode) { |
159 | int do_translate; | 163 | int do_translate; |
160 | 164 | ||
161 | trans = find_translation(powerbook_fn_keys, usage->code); | 165 | trans = find_translation(powerbook_fn_keys, usage->code); |
@@ -164,8 +168,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | |||
164 | do_translate = 1; | 168 | do_translate = 1; |
165 | else if (trans->flags & POWERBOOK_FLAG_FKEY) | 169 | else if (trans->flags & POWERBOOK_FLAG_FKEY) |
166 | do_translate = | 170 | do_translate = |
167 | (hid->pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || | 171 | (hid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || |
168 | (hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); | 172 | (hid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); |
169 | else | 173 | else |
170 | do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); | 174 | do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); |
171 | 175 | ||
@@ -364,9 +368,22 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
364 | break; | 368 | break; |
365 | 369 | ||
366 | case HID_UP_LED: | 370 | case HID_UP_LED: |
367 | if (((usage->hid - 1) & 0xffff) >= LED_MAX) | 371 | |
368 | goto ignore; | 372 | switch (usage->hid & 0xffff) { /* HID-Value: */ |
369 | map_led((usage->hid - 1) & 0xffff); | 373 | case 0x01: map_led (LED_NUML); break; /* "Num Lock" */ |
374 | case 0x02: map_led (LED_CAPSL); break; /* "Caps Lock" */ | ||
375 | case 0x03: map_led (LED_SCROLLL); break; /* "Scroll Lock" */ | ||
376 | case 0x04: map_led (LED_COMPOSE); break; /* "Compose" */ | ||
377 | case 0x05: map_led (LED_KANA); break; /* "Kana" */ | ||
378 | case 0x27: map_led (LED_SLEEP); break; /* "Stand-By" */ | ||
379 | case 0x4c: map_led (LED_SUSPEND); break; /* "System Suspend" */ | ||
380 | case 0x09: map_led (LED_MUTE); break; /* "Mute" */ | ||
381 | case 0x4b: map_led (LED_MISC); break; /* "Generic Indicator" */ | ||
382 | case 0x19: map_led (LED_MAIL); break; /* "Message Waiting" */ | ||
383 | case 0x4d: map_led (LED_CHARGING); break; /* "External Power Connected" */ | ||
384 | |||
385 | default: goto ignore; | ||
386 | } | ||
370 | break; | 387 | break; |
371 | 388 | ||
372 | case HID_UP_DIGITIZER: | 389 | case HID_UP_DIGITIZER: |
@@ -419,6 +436,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
419 | case 0x040: map_key_clear(KEY_MENU); break; | 436 | case 0x040: map_key_clear(KEY_MENU); break; |
420 | case 0x045: map_key_clear(KEY_RADIO); break; | 437 | case 0x045: map_key_clear(KEY_RADIO); break; |
421 | 438 | ||
439 | case 0x083: map_key_clear(KEY_LAST); break; | ||
422 | case 0x088: map_key_clear(KEY_PC); break; | 440 | case 0x088: map_key_clear(KEY_PC); break; |
423 | case 0x089: map_key_clear(KEY_TV); break; | 441 | case 0x089: map_key_clear(KEY_TV); break; |
424 | case 0x08a: map_key_clear(KEY_WWW); break; | 442 | case 0x08a: map_key_clear(KEY_WWW); break; |
@@ -436,6 +454,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
436 | case 0x096: map_key_clear(KEY_TAPE); break; | 454 | case 0x096: map_key_clear(KEY_TAPE); break; |
437 | case 0x097: map_key_clear(KEY_TV2); break; | 455 | case 0x097: map_key_clear(KEY_TV2); break; |
438 | case 0x098: map_key_clear(KEY_SAT); break; | 456 | case 0x098: map_key_clear(KEY_SAT); break; |
457 | case 0x09a: map_key_clear(KEY_PVR); break; | ||
439 | 458 | ||
440 | case 0x09c: map_key_clear(KEY_CHANNELUP); break; | 459 | case 0x09c: map_key_clear(KEY_CHANNELUP); break; |
441 | case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; | 460 | case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; |
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index 31c42002708f..b80f6ed5acfc 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c | |||
@@ -93,7 +93,7 @@ int vid_from_reg(int val, u8 vrm) | |||
93 | case 110: /* Intel Conroe */ | 93 | case 110: /* Intel Conroe */ |
94 | /* compute in uV, round to mV */ | 94 | /* compute in uV, round to mV */ |
95 | val &= 0xff; | 95 | val &= 0xff; |
96 | if(((val & 0x7e) == 0xfe) || (!(val & 0x7e))) | 96 | if (val < 0x02 || val > 0xb2) |
97 | return 0; | 97 | return 0; |
98 | return((1600000 - (val - 2) * 6250 + 500) / 1000); | 98 | return((1600000 - (val - 2) * 6250 + 500) / 1000); |
99 | case 24: /* Opteron processor */ | 99 | case 24: /* Opteron processor */ |
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index c12ac5abc2bb..253ffaf1568a 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -117,6 +117,7 @@ static const u16 W83793_REG_IN[][3] = { | |||
117 | /* Low Bits of Vcore A/B Vtt Read/High/Low */ | 117 | /* Low Bits of Vcore A/B Vtt Read/High/Low */ |
118 | static const u16 W83793_REG_IN_LOW_BITS[] = { 0x1b, 0x68, 0x69 }; | 118 | static const u16 W83793_REG_IN_LOW_BITS[] = { 0x1b, 0x68, 0x69 }; |
119 | static u8 scale_in[] = { 2, 2, 2, 16, 16, 16, 8, 24, 24, 16 }; | 119 | static u8 scale_in[] = { 2, 2, 2, 16, 16, 16, 8, 24, 24, 16 }; |
120 | static u8 scale_in_add[] = { 0, 0, 0, 0, 0, 0, 0, 150, 150, 0 }; | ||
120 | 121 | ||
121 | #define W83793_REG_FAN(index) (0x23 + 2 * (index)) /* High byte */ | 122 | #define W83793_REG_FAN(index) (0x23 + 2 * (index)) /* High byte */ |
122 | #define W83793_REG_FAN_MIN(index) (0x90 + 2 * (index)) /* High byte */ | 123 | #define W83793_REG_FAN_MIN(index) (0x90 + 2 * (index)) /* High byte */ |
@@ -203,6 +204,8 @@ struct w83793_data { | |||
203 | u8 temp_fan_map[6]; /* Temp controls which pwm fan, bit field */ | 204 | u8 temp_fan_map[6]; /* Temp controls which pwm fan, bit field */ |
204 | 205 | ||
205 | u8 has_pwm; | 206 | u8 has_pwm; |
207 | u8 has_temp; | ||
208 | u8 has_vid; | ||
206 | u8 pwm_enable; /* Register value, each Temp has 1 bit */ | 209 | u8 pwm_enable; /* Register value, each Temp has 1 bit */ |
207 | u8 pwm_uptime; /* Register value */ | 210 | u8 pwm_uptime; /* Register value */ |
208 | u8 pwm_downtime; /* Register value */ | 211 | u8 pwm_downtime; /* Register value */ |
@@ -500,7 +503,7 @@ store_temp(struct device *dev, struct device_attribute *attr, | |||
500 | each has 4 mode:(2 bits) | 503 | each has 4 mode:(2 bits) |
501 | 0: Stop monitor | 504 | 0: Stop monitor |
502 | 1: Use internal temp sensor(default) | 505 | 1: Use internal temp sensor(default) |
503 | 2: Use sensor in AMD CPU and get result by AMDSI | 506 | 2: Reserved |
504 | 3: Use sensor in Intel CPU and get result by PECI | 507 | 3: Use sensor in Intel CPU and get result by PECI |
505 | 508 | ||
506 | TR1-TR2 | 509 | TR1-TR2 |
@@ -509,8 +512,8 @@ store_temp(struct device *dev, struct device_attribute *attr, | |||
509 | 1: To enable temp sensors monitor | 512 | 1: To enable temp sensors monitor |
510 | */ | 513 | */ |
511 | 514 | ||
512 | /* 0 disable, 5 AMDSI, 6 PECI */ | 515 | /* 0 disable, 6 PECI */ |
513 | static u8 TO_TEMP_MODE[] = { 0, 0, 5, 6 }; | 516 | static u8 TO_TEMP_MODE[] = { 0, 0, 0, 6 }; |
514 | 517 | ||
515 | static ssize_t | 518 | static ssize_t |
516 | show_temp_mode(struct device *dev, struct device_attribute *attr, char *buf) | 519 | show_temp_mode(struct device *dev, struct device_attribute *attr, char *buf) |
@@ -550,11 +553,10 @@ store_temp_mode(struct device *dev, struct device_attribute *attr, | |||
550 | u8 val = simple_strtoul(buf, NULL, 10); | 553 | u8 val = simple_strtoul(buf, NULL, 10); |
551 | 554 | ||
552 | /* transform the sysfs interface values into table above */ | 555 | /* transform the sysfs interface values into table above */ |
553 | if ((val == 5 || val == 6) && (index < 4)) { | 556 | if ((val == 6) && (index < 4)) { |
554 | val -= 3; | 557 | val -= 3; |
555 | } else if ((val == 3 && index < 4) | 558 | } else if ((val == 3 && index < 4) |
556 | || (val == 4 && index >= 4) | 559 | || (val == 4 && index >= 4)) { |
557 | || val == 0) { | ||
558 | /* transform diode or thermistor into internal enable */ | 560 | /* transform diode or thermistor into internal enable */ |
559 | val = !!val; | 561 | val = !!val; |
560 | } else { | 562 | } else { |
@@ -839,7 +841,9 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf) | |||
839 | val <<= 2; | 841 | val <<= 2; |
840 | val += (data->in_low_bits[nr] >> (index * 2)) & 0x3; | 842 | val += (data->in_low_bits[nr] >> (index * 2)) & 0x3; |
841 | } | 843 | } |
842 | return sprintf(buf, "%d\n", val * scale_in[index]); | 844 | /* voltage inputs 5VDD and 5VSB needs 150mV offset */ |
845 | val = val * scale_in[index] + scale_in_add[index]; | ||
846 | return sprintf(buf, "%d\n", val); | ||
843 | } | 847 | } |
844 | 848 | ||
845 | static ssize_t | 849 | static ssize_t |
@@ -859,6 +863,10 @@ store_in(struct device *dev, struct device_attribute *attr, | |||
859 | scale_in[index] / 2) / scale_in[index]; | 863 | scale_in[index] / 2) / scale_in[index]; |
860 | mutex_lock(&data->update_lock); | 864 | mutex_lock(&data->update_lock); |
861 | if (index > 2) { | 865 | if (index > 2) { |
866 | /* fix the limit values of 5VDD and 5VSB to ALARM mechanism */ | ||
867 | if (1 == nr || 2 == nr) { | ||
868 | val -= scale_in_add[index] / scale_in[index]; | ||
869 | } | ||
862 | val = SENSORS_LIMIT(val, 0, 255); | 870 | val = SENSORS_LIMIT(val, 0, 255); |
863 | } else { | 871 | } else { |
864 | val = SENSORS_LIMIT(val, 0, 0x3FF); | 872 | val = SENSORS_LIMIT(val, 0, 0x3FF); |
@@ -979,12 +987,6 @@ static struct sensor_device_attribute_2 w83793_sensor_attr_2[] = { | |||
979 | SENSOR_ATTR_IN(7), | 987 | SENSOR_ATTR_IN(7), |
980 | SENSOR_ATTR_IN(8), | 988 | SENSOR_ATTR_IN(8), |
981 | SENSOR_ATTR_IN(9), | 989 | SENSOR_ATTR_IN(9), |
982 | SENSOR_ATTR_TEMP(1), | ||
983 | SENSOR_ATTR_TEMP(2), | ||
984 | SENSOR_ATTR_TEMP(3), | ||
985 | SENSOR_ATTR_TEMP(4), | ||
986 | SENSOR_ATTR_TEMP(5), | ||
987 | SENSOR_ATTR_TEMP(6), | ||
988 | SENSOR_ATTR_FAN(1), | 990 | SENSOR_ATTR_FAN(1), |
989 | SENSOR_ATTR_FAN(2), | 991 | SENSOR_ATTR_FAN(2), |
990 | SENSOR_ATTR_FAN(3), | 992 | SENSOR_ATTR_FAN(3), |
@@ -995,6 +997,15 @@ static struct sensor_device_attribute_2 w83793_sensor_attr_2[] = { | |||
995 | SENSOR_ATTR_PWM(3), | 997 | SENSOR_ATTR_PWM(3), |
996 | }; | 998 | }; |
997 | 999 | ||
1000 | static struct sensor_device_attribute_2 w83793_temp[] = { | ||
1001 | SENSOR_ATTR_TEMP(1), | ||
1002 | SENSOR_ATTR_TEMP(2), | ||
1003 | SENSOR_ATTR_TEMP(3), | ||
1004 | SENSOR_ATTR_TEMP(4), | ||
1005 | SENSOR_ATTR_TEMP(5), | ||
1006 | SENSOR_ATTR_TEMP(6), | ||
1007 | }; | ||
1008 | |||
998 | /* Fan6-Fan12 */ | 1009 | /* Fan6-Fan12 */ |
999 | static struct sensor_device_attribute_2 w83793_left_fan[] = { | 1010 | static struct sensor_device_attribute_2 w83793_left_fan[] = { |
1000 | SENSOR_ATTR_FAN(6), | 1011 | SENSOR_ATTR_FAN(6), |
@@ -1015,9 +1026,12 @@ static struct sensor_device_attribute_2 w83793_left_pwm[] = { | |||
1015 | SENSOR_ATTR_PWM(8), | 1026 | SENSOR_ATTR_PWM(8), |
1016 | }; | 1027 | }; |
1017 | 1028 | ||
1018 | static struct sensor_device_attribute_2 sda_single_files[] = { | 1029 | static struct sensor_device_attribute_2 w83793_vid[] = { |
1019 | SENSOR_ATTR_2(cpu0_vid, S_IRUGO, show_vid, NULL, NOT_USED, 0), | 1030 | SENSOR_ATTR_2(cpu0_vid, S_IRUGO, show_vid, NULL, NOT_USED, 0), |
1020 | SENSOR_ATTR_2(cpu1_vid, S_IRUGO, show_vid, NULL, NOT_USED, 1), | 1031 | SENSOR_ATTR_2(cpu1_vid, S_IRUGO, show_vid, NULL, NOT_USED, 1), |
1032 | }; | ||
1033 | |||
1034 | static struct sensor_device_attribute_2 sda_single_files[] = { | ||
1021 | SENSOR_ATTR_2(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm, | 1035 | SENSOR_ATTR_2(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm, |
1022 | NOT_USED, NOT_USED), | 1036 | NOT_USED, NOT_USED), |
1023 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, | 1037 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, |
@@ -1070,11 +1084,17 @@ static int w83793_detach_client(struct i2c_client *client) | |||
1070 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) | 1084 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) |
1071 | device_remove_file(dev, &sda_single_files[i].dev_attr); | 1085 | device_remove_file(dev, &sda_single_files[i].dev_attr); |
1072 | 1086 | ||
1087 | for (i = 0; i < ARRAY_SIZE(w83793_vid); i++) | ||
1088 | device_remove_file(dev, &w83793_vid[i].dev_attr); | ||
1089 | |||
1073 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) | 1090 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) |
1074 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); | 1091 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); |
1075 | 1092 | ||
1076 | for (i = 0; i < ARRAY_SIZE(w83793_left_pwm); i++) | 1093 | for (i = 0; i < ARRAY_SIZE(w83793_left_pwm); i++) |
1077 | device_remove_file(dev, &w83793_left_pwm[i].dev_attr); | 1094 | device_remove_file(dev, &w83793_left_pwm[i].dev_attr); |
1095 | |||
1096 | for (i = 0; i < ARRAY_SIZE(w83793_temp); i++) | ||
1097 | device_remove_file(dev, &w83793_temp[i].dev_attr); | ||
1078 | } | 1098 | } |
1079 | 1099 | ||
1080 | if ((err = i2c_detach_client(client))) | 1100 | if ((err = i2c_detach_client(client))) |
@@ -1187,6 +1207,7 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1187 | struct w83793_data *data; | 1207 | struct w83793_data *data; |
1188 | int files_fan = ARRAY_SIZE(w83793_left_fan) / 7; | 1208 | int files_fan = ARRAY_SIZE(w83793_left_fan) / 7; |
1189 | int files_pwm = ARRAY_SIZE(w83793_left_pwm) / 5; | 1209 | int files_pwm = ARRAY_SIZE(w83793_left_pwm) / 5; |
1210 | int files_temp = ARRAY_SIZE(w83793_temp) / 6; | ||
1190 | int err = 0; | 1211 | int err = 0; |
1191 | 1212 | ||
1192 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | 1213 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { |
@@ -1313,6 +1334,44 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1313 | data->has_pwm |= 0x80; | 1334 | data->has_pwm |= 0x80; |
1314 | } | 1335 | } |
1315 | 1336 | ||
1337 | tmp = w83793_read_value(client, W83793_REG_FANIN_SEL); | ||
1338 | if ((tmp & 0x01) && (val & 0x08)) { /* fan 9, second location */ | ||
1339 | data->has_fan |= 0x100; | ||
1340 | } | ||
1341 | if ((tmp & 0x02) && (val & 0x10)) { /* fan 10, second location */ | ||
1342 | data->has_fan |= 0x200; | ||
1343 | } | ||
1344 | if ((tmp & 0x04) && (val & 0x20)) { /* fan 11, second location */ | ||
1345 | data->has_fan |= 0x400; | ||
1346 | } | ||
1347 | if ((tmp & 0x08) && (val & 0x40)) { /* fan 12, second location */ | ||
1348 | data->has_fan |= 0x800; | ||
1349 | } | ||
1350 | |||
1351 | /* check the temp1-6 mode, ignore former AMDSI selected inputs */ | ||
1352 | tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[0]); | ||
1353 | if (tmp & 0x01) | ||
1354 | data->has_temp |= 0x01; | ||
1355 | if (tmp & 0x04) | ||
1356 | data->has_temp |= 0x02; | ||
1357 | if (tmp & 0x10) | ||
1358 | data->has_temp |= 0x04; | ||
1359 | if (tmp & 0x40) | ||
1360 | data->has_temp |= 0x08; | ||
1361 | |||
1362 | tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[1]); | ||
1363 | if (tmp & 0x01) | ||
1364 | data->has_temp |= 0x10; | ||
1365 | if (tmp & 0x02) | ||
1366 | data->has_temp |= 0x20; | ||
1367 | |||
1368 | /* Detect the VID usage and ignore unused input */ | ||
1369 | tmp = w83793_read_value(client, W83793_REG_MFC); | ||
1370 | if (!(tmp & 0x29)) | ||
1371 | data->has_vid |= 0x1; /* has VIDA */ | ||
1372 | if (tmp & 0x80) | ||
1373 | data->has_vid |= 0x2; /* has VIDB */ | ||
1374 | |||
1316 | /* Register sysfs hooks */ | 1375 | /* Register sysfs hooks */ |
1317 | for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) { | 1376 | for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) { |
1318 | err = device_create_file(dev, | 1377 | err = device_create_file(dev, |
@@ -1321,6 +1380,14 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1321 | goto exit_remove; | 1380 | goto exit_remove; |
1322 | } | 1381 | } |
1323 | 1382 | ||
1383 | for (i = 0; i < ARRAY_SIZE(w83793_vid); i++) { | ||
1384 | if (!(data->has_vid & (1 << i))) | ||
1385 | continue; | ||
1386 | err = device_create_file(dev, &w83793_vid[i].dev_attr); | ||
1387 | if (err) | ||
1388 | goto exit_remove; | ||
1389 | } | ||
1390 | |||
1324 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { | 1391 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { |
1325 | err = device_create_file(dev, &sda_single_files[i].dev_attr); | 1392 | err = device_create_file(dev, &sda_single_files[i].dev_attr); |
1326 | if (err) | 1393 | if (err) |
@@ -1328,6 +1395,19 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1328 | 1395 | ||
1329 | } | 1396 | } |
1330 | 1397 | ||
1398 | for (i = 0; i < 6; i++) { | ||
1399 | int j; | ||
1400 | if (!(data->has_temp & (1 << i))) | ||
1401 | continue; | ||
1402 | for (j = 0; j < files_temp; j++) { | ||
1403 | err = device_create_file(dev, | ||
1404 | &w83793_temp[(i) * files_temp | ||
1405 | + j].dev_attr); | ||
1406 | if (err) | ||
1407 | goto exit_remove; | ||
1408 | } | ||
1409 | } | ||
1410 | |||
1331 | for (i = 5; i < 12; i++) { | 1411 | for (i = 5; i < 12; i++) { |
1332 | int j; | 1412 | int j; |
1333 | if (!(data->has_fan & (1 << i))) | 1413 | if (!(data->has_fan & (1 << i))) |
@@ -1371,12 +1451,18 @@ exit_remove: | |||
1371 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) | 1451 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) |
1372 | device_remove_file(dev, &sda_single_files[i].dev_attr); | 1452 | device_remove_file(dev, &sda_single_files[i].dev_attr); |
1373 | 1453 | ||
1454 | for (i = 0; i < ARRAY_SIZE(w83793_vid); i++) | ||
1455 | device_remove_file(dev, &w83793_vid[i].dev_attr); | ||
1456 | |||
1374 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) | 1457 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) |
1375 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); | 1458 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); |
1376 | 1459 | ||
1377 | for (i = 0; i < ARRAY_SIZE(w83793_left_pwm); i++) | 1460 | for (i = 0; i < ARRAY_SIZE(w83793_left_pwm); i++) |
1378 | device_remove_file(dev, &w83793_left_pwm[i].dev_attr); | 1461 | device_remove_file(dev, &w83793_left_pwm[i].dev_attr); |
1379 | 1462 | ||
1463 | for (i = 0; i < ARRAY_SIZE(w83793_temp); i++) | ||
1464 | device_remove_file(dev, &w83793_temp[i].dev_attr); | ||
1465 | |||
1380 | if (data->lm75[0] != NULL) { | 1466 | if (data->lm75[0] != NULL) { |
1381 | i2c_detach_client(data->lm75[0]); | 1467 | i2c_detach_client(data->lm75[0]); |
1382 | kfree(data->lm75[0]); | 1468 | kfree(data->lm75[0]); |
@@ -1428,6 +1514,8 @@ static void w83793_update_nonvolatile(struct device *dev) | |||
1428 | } | 1514 | } |
1429 | 1515 | ||
1430 | for (i = 0; i < ARRAY_SIZE(data->temp_fan_map); i++) { | 1516 | for (i = 0; i < ARRAY_SIZE(data->temp_fan_map); i++) { |
1517 | if (!(data->has_temp & (1 << i))) | ||
1518 | continue; | ||
1431 | data->temp_fan_map[i] = | 1519 | data->temp_fan_map[i] = |
1432 | w83793_read_value(client, W83793_REG_TEMP_FAN_MAP(i)); | 1520 | w83793_read_value(client, W83793_REG_TEMP_FAN_MAP(i)); |
1433 | for (j = 1; j < 5; j++) { | 1521 | for (j = 1; j < 5; j++) { |
@@ -1510,9 +1598,12 @@ static struct w83793_data *w83793_update_device(struct device *dev) | |||
1510 | w83793_read_value(client, W83793_REG_FAN(i) + 1); | 1598 | w83793_read_value(client, W83793_REG_FAN(i) + 1); |
1511 | } | 1599 | } |
1512 | 1600 | ||
1513 | for (i = 0; i < ARRAY_SIZE(data->temp); i++) | 1601 | for (i = 0; i < ARRAY_SIZE(data->temp); i++) { |
1602 | if (!(data->has_temp & (1 << i))) | ||
1603 | continue; | ||
1514 | data->temp[i][TEMP_READ] = | 1604 | data->temp[i][TEMP_READ] = |
1515 | w83793_read_value(client, W83793_REG_TEMP[i][TEMP_READ]); | 1605 | w83793_read_value(client, W83793_REG_TEMP[i][TEMP_READ]); |
1606 | } | ||
1516 | 1607 | ||
1517 | data->temp_low_bits = | 1608 | data->temp_low_bits = |
1518 | w83793_read_value(client, W83793_REG_TEMP_LOW_BITS); | 1609 | w83793_read_value(client, W83793_REG_TEMP_LOW_BITS); |
@@ -1527,8 +1618,10 @@ static struct w83793_data *w83793_update_device(struct device *dev) | |||
1527 | for (i = 0; i < ARRAY_SIZE(data->alarms); i++) | 1618 | for (i = 0; i < ARRAY_SIZE(data->alarms); i++) |
1528 | data->alarms[i] = | 1619 | data->alarms[i] = |
1529 | w83793_read_value(client, W83793_REG_ALARM(i)); | 1620 | w83793_read_value(client, W83793_REG_ALARM(i)); |
1530 | data->vid[0] = w83793_read_value(client, W83793_REG_VID_INA); | 1621 | if (data->has_vid & 0x01) |
1531 | data->vid[1] = w83793_read_value(client, W83793_REG_VID_INB); | 1622 | data->vid[0] = w83793_read_value(client, W83793_REG_VID_INA); |
1623 | if (data->has_vid & 0x02) | ||
1624 | data->vid[1] = w83793_read_value(client, W83793_REG_VID_INB); | ||
1532 | w83793_update_nonvolatile(dev); | 1625 | w83793_update_nonvolatile(dev); |
1533 | data->last_updated = jiffies; | 1626 | data->last_updated = jiffies; |
1534 | data->valid = 1; | 1627 | data->valid = 1; |
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index df7d1504f84e..98410ca044cf 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -73,3 +73,8 @@ void __init pnpide_init(void) | |||
73 | { | 73 | { |
74 | pnp_register_driver(&idepnp_driver); | 74 | pnp_register_driver(&idepnp_driver); |
75 | } | 75 | } |
76 | |||
77 | void __exit pnpide_exit(void) | ||
78 | { | ||
79 | pnp_unregister_driver(&idepnp_driver); | ||
80 | } | ||
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 16890769dca6..6c9bd5165bdb 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1781,8 +1781,9 @@ done: | |||
1781 | return 1; | 1781 | return 1; |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | extern void pnpide_init(void); | 1784 | extern void __init pnpide_init(void); |
1785 | extern void h8300_ide_init(void); | 1785 | extern void __exit pnpide_exit(void); |
1786 | extern void __init h8300_ide_init(void); | ||
1786 | 1787 | ||
1787 | /* | 1788 | /* |
1788 | * probe_for_hwifs() finds/initializes "known" IDE interfaces | 1789 | * probe_for_hwifs() finds/initializes "known" IDE interfaces |
@@ -2087,13 +2088,17 @@ int __init init_module (void) | |||
2087 | return ide_init(); | 2088 | return ide_init(); |
2088 | } | 2089 | } |
2089 | 2090 | ||
2090 | void cleanup_module (void) | 2091 | void __exit cleanup_module (void) |
2091 | { | 2092 | { |
2092 | int index; | 2093 | int index; |
2093 | 2094 | ||
2094 | for (index = 0; index < MAX_HWIFS; ++index) | 2095 | for (index = 0; index < MAX_HWIFS; ++index) |
2095 | ide_unregister(index); | 2096 | ide_unregister(index); |
2096 | 2097 | ||
2098 | #ifdef CONFIG_BLK_DEV_IDEPNP | ||
2099 | pnpide_exit(); | ||
2100 | #endif | ||
2101 | |||
2097 | #ifdef CONFIG_PROC_FS | 2102 | #ifdef CONFIG_PROC_FS |
2098 | proc_ide_destroy(); | 2103 | proc_ide_destroy(); |
2099 | #endif | 2104 | #endif |
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index f286079d233f..d261bfbad222 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c | |||
@@ -441,7 +441,7 @@ static struct pci_driver driver = { | |||
441 | .probe = aec62xx_init_one, | 441 | .probe = aec62xx_init_one, |
442 | }; | 442 | }; |
443 | 443 | ||
444 | static int aec62xx_ide_init(void) | 444 | static int __init aec62xx_ide_init(void) |
445 | { | 445 | { |
446 | return ide_pci_register_driver(&driver); | 446 | return ide_pci_register_driver(&driver); |
447 | } | 447 | } |
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 89109be5162c..68df77ec502b 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -907,7 +907,7 @@ static struct pci_driver driver = { | |||
907 | .probe = alim15x3_init_one, | 907 | .probe = alim15x3_init_one, |
908 | }; | 908 | }; |
909 | 909 | ||
910 | static int ali15x3_ide_init(void) | 910 | static int __init ali15x3_ide_init(void) |
911 | { | 911 | { |
912 | return ide_pci_register_driver(&driver); | 912 | return ide_pci_register_driver(&driver); |
913 | } | 913 | } |
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 753fe0e21456..a4336995a410 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -544,7 +544,7 @@ static struct pci_driver driver = { | |||
544 | .probe = amd74xx_probe, | 544 | .probe = amd74xx_probe, |
545 | }; | 545 | }; |
546 | 546 | ||
547 | static int amd74xx_ide_init(void) | 547 | static int __init amd74xx_ide_init(void) |
548 | { | 548 | { |
549 | return ide_pci_register_driver(&driver); | 549 | return ide_pci_register_driver(&driver); |
550 | } | 550 | } |
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 524e65de4398..982ac31fa995 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c | |||
@@ -291,8 +291,12 @@ fast_ata_pio: | |||
291 | 291 | ||
292 | static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | 292 | static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) |
293 | { | 293 | { |
294 | u8 udma_mode = 0; | ||
295 | u8 ch = hwif->channel; | ||
296 | struct pci_dev *pdev = hwif->pci_dev; | ||
297 | |||
294 | if (!hwif->irq) | 298 | if (!hwif->irq) |
295 | hwif->irq = hwif->channel ? 15 : 14; | 299 | hwif->irq = ch ? 15 : 14; |
296 | 300 | ||
297 | hwif->autodma = 0; | 301 | hwif->autodma = 0; |
298 | hwif->tuneproc = &atiixp_tuneproc; | 302 | hwif->tuneproc = &atiixp_tuneproc; |
@@ -308,8 +312,12 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | |||
308 | hwif->mwdma_mask = 0x06; | 312 | hwif->mwdma_mask = 0x06; |
309 | hwif->swdma_mask = 0x04; | 313 | hwif->swdma_mask = 0x04; |
310 | 314 | ||
311 | /* FIXME: proper cable detection needed */ | 315 | pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode); |
312 | hwif->udma_four = 1; | 316 | if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40) |
317 | hwif->udma_four = 1; | ||
318 | else | ||
319 | hwif->udma_four = 0; | ||
320 | |||
313 | hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; | 321 | hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; |
314 | hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; | 322 | hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; |
315 | hwif->ide_dma_check = &atiixp_dma_check; | 323 | hwif->ide_dma_check = &atiixp_dma_check; |
@@ -320,19 +328,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) | |||
320 | hwif->drives[0].autodma = hwif->autodma; | 328 | hwif->drives[0].autodma = hwif->autodma; |
321 | } | 329 | } |
322 | 330 | ||
323 | static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif) | ||
324 | { | ||
325 | |||
326 | hwif->atapi_dma = 1; | ||
327 | hwif->ultra_mask = 0x7f; | ||
328 | hwif->mwdma_mask = 0x07; | ||
329 | hwif->swdma_mask = 0x07; | ||
330 | |||
331 | if (!noautodma) | ||
332 | hwif->autodma = 1; | ||
333 | hwif->drives[0].autodma = hwif->autodma; | ||
334 | hwif->drives[1].autodma = hwif->autodma; | ||
335 | } | ||
336 | 331 | ||
337 | static ide_pci_device_t atiixp_pci_info[] __devinitdata = { | 332 | static ide_pci_device_t atiixp_pci_info[] __devinitdata = { |
338 | { /* 0 */ | 333 | { /* 0 */ |
@@ -343,12 +338,13 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = { | |||
343 | .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, | 338 | .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, |
344 | .bootable = ON_BOARD, | 339 | .bootable = ON_BOARD, |
345 | },{ /* 1 */ | 340 | },{ /* 1 */ |
346 | .name = "ATI SB600 SATA Legacy IDE", | 341 | .name = "SB600_PATA", |
347 | .init_hwif = init_hwif_sb600_legacy, | 342 | .init_hwif = init_hwif_atiixp, |
348 | .channels = 2, | 343 | .channels = 1, |
349 | .autodma = AUTODMA, | 344 | .autodma = AUTODMA, |
350 | .bootable = ON_BOARD, | 345 | .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, |
351 | } | 346 | .bootable = ON_BOARD, |
347 | }, | ||
352 | }; | 348 | }; |
353 | 349 | ||
354 | /** | 350 | /** |
@@ -369,7 +365,7 @@ static struct pci_device_id atiixp_pci_tbl[] = { | |||
369 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 365 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
370 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 366 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
371 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 367 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
372 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 368 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
373 | { 0, }, | 369 | { 0, }, |
374 | }; | 370 | }; |
375 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); | 371 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); |
@@ -380,7 +376,7 @@ static struct pci_driver driver = { | |||
380 | .probe = atiixp_init_one, | 376 | .probe = atiixp_init_one, |
381 | }; | 377 | }; |
382 | 378 | ||
383 | static int atiixp_ide_init(void) | 379 | static int __init atiixp_ide_init(void) |
384 | { | 380 | { |
385 | return ide_pci_register_driver(&driver); | 381 | return ide_pci_register_driver(&driver); |
386 | } | 382 | } |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 20c32716bbc4..aee947e8fc38 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -793,7 +793,7 @@ static struct pci_driver driver = { | |||
793 | .probe = cmd64x_init_one, | 793 | .probe = cmd64x_init_one, |
794 | }; | 794 | }; |
795 | 795 | ||
796 | static int cmd64x_ide_init(void) | 796 | static int __init cmd64x_ide_init(void) |
797 | { | 797 | { |
798 | return ide_pci_register_driver(&driver); | 798 | return ide_pci_register_driver(&driver); |
799 | } | 799 | } |
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 079f7c86726b..ba6786aabf3b 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c | |||
@@ -260,7 +260,7 @@ static struct pci_driver driver = { | |||
260 | .probe = cs5520_init_one, | 260 | .probe = cs5520_init_one, |
261 | }; | 261 | }; |
262 | 262 | ||
263 | static int cs5520_ide_init(void) | 263 | static int __init cs5520_ide_init(void) |
264 | { | 264 | { |
265 | return ide_pci_register_driver(&driver); | 265 | return ide_pci_register_driver(&driver); |
266 | } | 266 | } |
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index ae405fa32236..9bf5fdfc5b1f 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -374,7 +374,7 @@ static struct pci_driver driver = { | |||
374 | .probe = cs5530_init_one, | 374 | .probe = cs5530_init_one, |
375 | }; | 375 | }; |
376 | 376 | ||
377 | static int cs5530_ide_init(void) | 377 | static int __init cs5530_ide_init(void) |
378 | { | 378 | { |
379 | return ide_pci_register_driver(&driver); | 379 | return ide_pci_register_driver(&driver); |
380 | } | 380 | } |
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 64330c459bd4..9eafcbf444f4 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c | |||
@@ -519,7 +519,7 @@ static struct pci_driver driver = { | |||
519 | .probe = cy82c693_init_one, | 519 | .probe = cy82c693_init_one, |
520 | }; | 520 | }; |
521 | 521 | ||
522 | static int cy82c693_ide_init(void) | 522 | static int __init cy82c693_ide_init(void) |
523 | { | 523 | { |
524 | return ide_pci_register_driver(&driver); | 524 | return ide_pci_register_driver(&driver); |
525 | } | 525 | } |
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index 9f306880491a..b408c6c517ea 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -185,36 +185,6 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { | |||
185 | .channels = 2, | 185 | .channels = 2, |
186 | .autodma = AUTODMA, | 186 | .autodma = AUTODMA, |
187 | .bootable = OFF_BOARD, | 187 | .bootable = OFF_BOARD, |
188 | },{ /* 15 */ | ||
189 | .name = "JMB361", | ||
190 | .init_hwif = init_hwif_generic, | ||
191 | .channels = 2, | ||
192 | .autodma = AUTODMA, | ||
193 | .bootable = OFF_BOARD, | ||
194 | },{ /* 16 */ | ||
195 | .name = "JMB363", | ||
196 | .init_hwif = init_hwif_generic, | ||
197 | .channels = 2, | ||
198 | .autodma = AUTODMA, | ||
199 | .bootable = OFF_BOARD, | ||
200 | },{ /* 17 */ | ||
201 | .name = "JMB365", | ||
202 | .init_hwif = init_hwif_generic, | ||
203 | .channels = 2, | ||
204 | .autodma = AUTODMA, | ||
205 | .bootable = OFF_BOARD, | ||
206 | },{ /* 18 */ | ||
207 | .name = "JMB366", | ||
208 | .init_hwif = init_hwif_generic, | ||
209 | .channels = 2, | ||
210 | .autodma = AUTODMA, | ||
211 | .bootable = OFF_BOARD, | ||
212 | },{ /* 19 */ | ||
213 | .name = "JMB368", | ||
214 | .init_hwif = init_hwif_generic, | ||
215 | .channels = 2, | ||
216 | .autodma = AUTODMA, | ||
217 | .bootable = OFF_BOARD, | ||
218 | } | 188 | } |
219 | }; | 189 | }; |
220 | 190 | ||
@@ -281,11 +251,6 @@ static struct pci_device_id generic_pci_tbl[] = { | |||
281 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, | 251 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, |
282 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, | 252 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, |
283 | { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, | 253 | { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, |
284 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, | ||
285 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, | ||
286 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, | ||
287 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, | ||
288 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19}, | ||
289 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ | 254 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ |
290 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, | 255 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, |
291 | { 0, }, | 256 | { 0, }, |
@@ -298,7 +263,7 @@ static struct pci_driver driver = { | |||
298 | .probe = generic_init_one, | 263 | .probe = generic_init_one, |
299 | }; | 264 | }; |
300 | 265 | ||
301 | static int generic_ide_init(void) | 266 | static int __init generic_ide_init(void) |
302 | { | 267 | { |
303 | return ide_pci_register_driver(&driver); | 268 | return ide_pci_register_driver(&driver); |
304 | } | 269 | } |
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index b46cb042290a..ce7b08f08a09 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c | |||
@@ -265,7 +265,7 @@ static struct pci_driver driver = { | |||
265 | .probe = hpt34x_init_one, | 265 | .probe = hpt34x_init_one, |
266 | }; | 266 | }; |
267 | 267 | ||
268 | static int hpt34x_ide_init(void) | 268 | static int __init hpt34x_ide_init(void) |
269 | { | 269 | { |
270 | return ide_pci_register_driver(&driver); | 270 | return ide_pci_register_driver(&driver); |
271 | } | 271 | } |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 08119da06d54..b486442dd5d7 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -1613,7 +1613,7 @@ static struct pci_driver driver = { | |||
1613 | .probe = hpt366_init_one, | 1613 | .probe = hpt366_init_one, |
1614 | }; | 1614 | }; |
1615 | 1615 | ||
1616 | static int hpt366_ide_init(void) | 1616 | static int __init hpt366_ide_init(void) |
1617 | { | 1617 | { |
1618 | return ide_pci_register_driver(&driver); | 1618 | return ide_pci_register_driver(&driver); |
1619 | } | 1619 | } |
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index c1cec236ecf0..f07bbbed1778 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c | |||
@@ -86,15 +86,16 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif) | |||
86 | { | 86 | { |
87 | case PORT_PATA0: | 87 | case PORT_PATA0: |
88 | if (control & (1 << 3)) /* 40/80 pin primary */ | 88 | if (control & (1 << 3)) /* 40/80 pin primary */ |
89 | return 1; | 89 | return 0; |
90 | return 0; | 90 | return 1; |
91 | case PORT_PATA1: | 91 | case PORT_PATA1: |
92 | if (control5 & (1 << 19)) /* 40/80 pin secondary */ | 92 | if (control5 & (1 << 19)) /* 40/80 pin secondary */ |
93 | return 0; | 93 | return 0; |
94 | return 1; | 94 | return 1; |
95 | case PORT_SATA: | 95 | case PORT_SATA: |
96 | return 1; | 96 | break; |
97 | } | 97 | } |
98 | return 1; /* Avoid bogus "control reaches end of non-void function" */ | ||
98 | } | 99 | } |
99 | 100 | ||
100 | static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) | 101 | static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) |
@@ -240,11 +241,11 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi | |||
240 | } | 241 | } |
241 | 242 | ||
242 | static struct pci_device_id jmicron_pci_tbl[] = { | 243 | static struct pci_device_id jmicron_pci_tbl[] = { |
243 | { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 0}, | 244 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
244 | { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 1}, | 245 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
245 | { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 2}, | 246 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, |
246 | { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 3}, | 247 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, |
247 | { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 4}, | 248 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, |
248 | { 0, }, | 249 | { 0, }, |
249 | }; | 250 | }; |
250 | 251 | ||
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index d95714bcee4e..8aaea4ea5549 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -302,7 +302,7 @@ static struct pci_driver driver = { | |||
302 | .probe = ns87415_init_one, | 302 | .probe = ns87415_init_one, |
303 | }; | 303 | }; |
304 | 304 | ||
305 | static int ns87415_ide_init(void) | 305 | static int __init ns87415_ide_init(void) |
306 | { | 306 | { |
307 | return ide_pci_register_driver(&driver); | 307 | return ide_pci_register_driver(&driver); |
308 | } | 308 | } |
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index 7a7c2ef78ac2..22bbf613f948 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c | |||
@@ -382,7 +382,7 @@ static struct pci_driver driver = { | |||
382 | .probe = opti621_init_one, | 382 | .probe = opti621_init_one, |
383 | }; | 383 | }; |
384 | 384 | ||
385 | static int opti621_ide_init(void) | 385 | static int __init opti621_ide_init(void) |
386 | { | 386 | { |
387 | return ide_pci_register_driver(&driver); | 387 | return ide_pci_register_driver(&driver); |
388 | } | 388 | } |
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 7cb48576e479..77a9aaa7dab9 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -756,7 +756,7 @@ static struct pci_driver driver = { | |||
756 | .probe = pdc202new_init_one, | 756 | .probe = pdc202new_init_one, |
757 | }; | 757 | }; |
758 | 758 | ||
759 | static int pdc202new_ide_init(void) | 759 | static int __init pdc202new_ide_init(void) |
760 | { | 760 | { |
761 | return ide_pci_register_driver(&driver); | 761 | return ide_pci_register_driver(&driver); |
762 | } | 762 | } |
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 184cdacddeb6..143239c093d5 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -719,7 +719,7 @@ static struct pci_driver driver = { | |||
719 | .probe = pdc202xx_init_one, | 719 | .probe = pdc202xx_init_one, |
720 | }; | 720 | }; |
721 | 721 | ||
722 | static int pdc202xx_ide_init(void) | 722 | static int __init pdc202xx_ide_init(void) |
723 | { | 723 | { |
724 | return ide_pci_register_driver(&driver); | 724 | return ide_pci_register_driver(&driver); |
725 | } | 725 | } |
diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c index 5f6950c2d1d1..c1855311052b 100644 --- a/drivers/ide/pci/rz1000.c +++ b/drivers/ide/pci/rz1000.c | |||
@@ -77,7 +77,7 @@ static struct pci_driver driver = { | |||
77 | .probe = rz1000_init_one, | 77 | .probe = rz1000_init_one, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static int rz1000_ide_init(void) | 80 | static int __init rz1000_ide_init(void) |
81 | { | 81 | { |
82 | return ide_pci_register_driver(&driver); | 82 | return ide_pci_register_driver(&driver); |
83 | } | 83 | } |
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index ff80937d94dd..8d762d323f8b 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c | |||
@@ -507,7 +507,7 @@ static struct pci_driver driver = { | |||
507 | #endif | 507 | #endif |
508 | }; | 508 | }; |
509 | 509 | ||
510 | static int sc1200_ide_init(void) | 510 | static int __init sc1200_ide_init(void) |
511 | { | 511 | { |
512 | return ide_pci_register_driver(&driver); | 512 | return ide_pci_register_driver(&driver); |
513 | } | 513 | } |
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index 057548d07205..ea9a28a45853 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -666,7 +666,7 @@ static struct pci_driver driver = { | |||
666 | .probe = svwks_init_one, | 666 | .probe = svwks_init_one, |
667 | }; | 667 | }; |
668 | 668 | ||
669 | static int svwks_ide_init(void) | 669 | static int __init svwks_ide_init(void) |
670 | { | 670 | { |
671 | return ide_pci_register_driver(&driver); | 671 | return ide_pci_register_driver(&driver); |
672 | } | 672 | } |
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index cfad09accf52..b0bf01809279 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -762,8 +762,7 @@ static struct ioc4_submodule ioc4_ide_submodule = { | |||
762 | /* .is_remove = ioc4_ide_remove_one, */ | 762 | /* .is_remove = ioc4_ide_remove_one, */ |
763 | }; | 763 | }; |
764 | 764 | ||
765 | static int __devinit | 765 | static int __init ioc4_ide_init(void) |
766 | ioc4_ide_init(void) | ||
767 | { | 766 | { |
768 | return ioc4_register_submodule(&ioc4_ide_submodule); | 767 | return ioc4_register_submodule(&ioc4_ide_submodule); |
769 | } | 768 | } |
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 697f566fb90a..4ff89c7d990a 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -1096,7 +1096,7 @@ static struct pci_driver driver = { | |||
1096 | .probe = siimage_init_one, | 1096 | .probe = siimage_init_one, |
1097 | }; | 1097 | }; |
1098 | 1098 | ||
1099 | static int siimage_ide_init(void) | 1099 | static int __init siimage_ide_init(void) |
1100 | { | 1100 | { |
1101 | return ide_pci_register_driver(&driver); | 1101 | return ide_pci_register_driver(&driver); |
1102 | } | 1102 | } |
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 6b313139b5e4..1afff659ab55 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -968,7 +968,7 @@ static struct pci_driver driver = { | |||
968 | .probe = sis5513_init_one, | 968 | .probe = sis5513_init_one, |
969 | }; | 969 | }; |
970 | 970 | ||
971 | static int sis5513_ide_init(void) | 971 | static int __init sis5513_ide_init(void) |
972 | { | 972 | { |
973 | return ide_pci_register_driver(&driver); | 973 | return ide_pci_register_driver(&driver); |
974 | } | 974 | } |
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 5afefe8692fe..170a26199050 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c | |||
@@ -492,7 +492,7 @@ static struct pci_driver driver = { | |||
492 | .probe = sl82c105_init_one, | 492 | .probe = sl82c105_init_one, |
493 | }; | 493 | }; |
494 | 494 | ||
495 | static int sl82c105_ide_init(void) | 495 | static int __init sl82c105_ide_init(void) |
496 | { | 496 | { |
497 | return ide_pci_register_driver(&driver); | 497 | return ide_pci_register_driver(&driver); |
498 | } | 498 | } |
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 9be7e49cba0e..90e79c0844d2 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c | |||
@@ -253,7 +253,7 @@ static struct pci_driver driver = { | |||
253 | .probe = slc90e66_init_one, | 253 | .probe = slc90e66_init_one, |
254 | }; | 254 | }; |
255 | 255 | ||
256 | static int slc90e66_ide_init(void) | 256 | static int __init slc90e66_ide_init(void) |
257 | { | 257 | { |
258 | return ide_pci_register_driver(&driver); | 258 | return ide_pci_register_driver(&driver); |
259 | } | 259 | } |
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 56d84931d6de..b13cce1fd1a6 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c | |||
@@ -173,7 +173,7 @@ static struct pci_driver driver = { | |||
173 | .probe = triflex_init_one, | 173 | .probe = triflex_init_one, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static int triflex_ide_init(void) | 176 | static int __init triflex_ide_init(void) |
177 | { | 177 | { |
178 | return ide_pci_register_driver(&driver); | 178 | return ide_pci_register_driver(&driver); |
179 | } | 179 | } |
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index 2a282529bfc1..174b88c4780e 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c | |||
@@ -355,7 +355,7 @@ static struct pci_driver driver = { | |||
355 | .probe = trm290_init_one, | 355 | .probe = trm290_init_one, |
356 | }; | 356 | }; |
357 | 357 | ||
358 | static int trm290_ide_init(void) | 358 | static int __init trm290_ide_init(void) |
359 | { | 359 | { |
360 | return ide_pci_register_driver(&driver); | 360 | return ide_pci_register_driver(&driver); |
361 | } | 361 | } |
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 381cc6f101ce..6fb6e50b8231 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -78,6 +78,8 @@ static struct via_isa_bridge { | |||
78 | u8 rev_max; | 78 | u8 rev_max; |
79 | u16 flags; | 79 | u16 flags; |
80 | } via_isa_bridges[] = { | 80 | } via_isa_bridges[] = { |
81 | { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | ||
82 | { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | ||
81 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 83 | { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
82 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 84 | { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
83 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, | 85 | { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, |
@@ -504,6 +506,7 @@ static struct pci_device_id via_pci_tbl[] = { | |||
504 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 506 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
505 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 507 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
506 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | 508 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
509 | { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_SATA_EIDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | ||
507 | { 0, }, | 510 | { 0, }, |
508 | }; | 511 | }; |
509 | MODULE_DEVICE_TABLE(pci, via_pci_tbl); | 512 | MODULE_DEVICE_TABLE(pci, via_pci_tbl); |
@@ -514,7 +517,7 @@ static struct pci_driver driver = { | |||
514 | .probe = via_init_one, | 517 | .probe = via_init_one, |
515 | }; | 518 | }; |
516 | 519 | ||
517 | static int via_ide_init(void) | 520 | static int __init via_ide_init(void) |
518 | { | 521 | { |
519 | return ide_pci_register_driver(&driver); | 522 | return ide_pci_register_driver(&driver); |
520 | } | 523 | } |
diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 93995b658d94..6074c897f51c 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c | |||
@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq) | |||
344 | unsigned long flags; | 344 | unsigned long flags; |
345 | 345 | ||
346 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | 346 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); |
347 | while (my_cq->nr_callbacks) | 347 | while (my_cq->nr_callbacks) { |
348 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
348 | yield(); | 349 | yield(); |
350 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
351 | } | ||
349 | 352 | ||
350 | idr_remove(&ehca_cq_idr, my_cq->token); | 353 | idr_remove(&ehca_cq_idr, my_cq->token); |
351 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 354 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); |
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index e7209afb4250..c069be8cbcb2 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -440,7 +440,8 @@ void ehca_tasklet_eq(unsigned long data) | |||
440 | cq = idr_find(&ehca_cq_idr, token); | 440 | cq = idr_find(&ehca_cq_idr, token); |
441 | 441 | ||
442 | if (cq == NULL) { | 442 | if (cq == NULL) { |
443 | spin_unlock(&ehca_cq_idr_lock); | 443 | spin_unlock_irqrestore(&ehca_cq_idr_lock, |
444 | flags); | ||
444 | break; | 445 | break; |
445 | } | 446 | } |
446 | 447 | ||
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cdecbf5911c8..72611fd15103 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1621,18 +1621,30 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1621 | switch (token) { | 1621 | switch (token) { |
1622 | case SRP_OPT_ID_EXT: | 1622 | case SRP_OPT_ID_EXT: |
1623 | p = match_strdup(args); | 1623 | p = match_strdup(args); |
1624 | if (!p) { | ||
1625 | ret = -ENOMEM; | ||
1626 | goto out; | ||
1627 | } | ||
1624 | target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1628 | target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1625 | kfree(p); | 1629 | kfree(p); |
1626 | break; | 1630 | break; |
1627 | 1631 | ||
1628 | case SRP_OPT_IOC_GUID: | 1632 | case SRP_OPT_IOC_GUID: |
1629 | p = match_strdup(args); | 1633 | p = match_strdup(args); |
1634 | if (!p) { | ||
1635 | ret = -ENOMEM; | ||
1636 | goto out; | ||
1637 | } | ||
1630 | target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1638 | target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1631 | kfree(p); | 1639 | kfree(p); |
1632 | break; | 1640 | break; |
1633 | 1641 | ||
1634 | case SRP_OPT_DGID: | 1642 | case SRP_OPT_DGID: |
1635 | p = match_strdup(args); | 1643 | p = match_strdup(args); |
1644 | if (!p) { | ||
1645 | ret = -ENOMEM; | ||
1646 | goto out; | ||
1647 | } | ||
1636 | if (strlen(p) != 32) { | 1648 | if (strlen(p) != 32) { |
1637 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); | 1649 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); |
1638 | kfree(p); | 1650 | kfree(p); |
@@ -1656,6 +1668,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1656 | 1668 | ||
1657 | case SRP_OPT_SERVICE_ID: | 1669 | case SRP_OPT_SERVICE_ID: |
1658 | p = match_strdup(args); | 1670 | p = match_strdup(args); |
1671 | if (!p) { | ||
1672 | ret = -ENOMEM; | ||
1673 | goto out; | ||
1674 | } | ||
1659 | target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1675 | target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1660 | kfree(p); | 1676 | kfree(p); |
1661 | break; | 1677 | break; |
@@ -1693,6 +1709,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1693 | 1709 | ||
1694 | case SRP_OPT_INITIATOR_EXT: | 1710 | case SRP_OPT_INITIATOR_EXT: |
1695 | p = match_strdup(args); | 1711 | p = match_strdup(args); |
1712 | if (!p) { | ||
1713 | ret = -ENOMEM; | ||
1714 | goto out; | ||
1715 | } | ||
1696 | target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1716 | target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1697 | kfree(p); | 1717 | kfree(p); |
1698 | break; | 1718 | break; |
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 95eff3b2917a..4f75cce6fdff 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c | |||
@@ -356,16 +356,17 @@ static struct cardstate *alloc_cs(struct gigaset_driver *drv) | |||
356 | { | 356 | { |
357 | unsigned long flags; | 357 | unsigned long flags; |
358 | unsigned i; | 358 | unsigned i; |
359 | static struct cardstate *ret = NULL; | 359 | struct cardstate *ret = NULL; |
360 | 360 | ||
361 | spin_lock_irqsave(&drv->lock, flags); | 361 | spin_lock_irqsave(&drv->lock, flags); |
362 | for (i = 0; i < drv->minors; ++i) { | 362 | for (i = 0; i < drv->minors; ++i) { |
363 | if (!(drv->flags[i] & VALID_MINOR)) { | 363 | if (!(drv->flags[i] & VALID_MINOR)) { |
364 | drv->flags[i] = VALID_MINOR; | 364 | if (try_module_get(drv->owner)) { |
365 | ret = drv->cs + i; | 365 | drv->flags[i] = VALID_MINOR; |
366 | } | 366 | ret = drv->cs + i; |
367 | if (ret) | 367 | } |
368 | break; | 368 | break; |
369 | } | ||
369 | } | 370 | } |
370 | spin_unlock_irqrestore(&drv->lock, flags); | 371 | spin_unlock_irqrestore(&drv->lock, flags); |
371 | return ret; | 372 | return ret; |
@@ -376,6 +377,8 @@ static void free_cs(struct cardstate *cs) | |||
376 | unsigned long flags; | 377 | unsigned long flags; |
377 | struct gigaset_driver *drv = cs->driver; | 378 | struct gigaset_driver *drv = cs->driver; |
378 | spin_lock_irqsave(&drv->lock, flags); | 379 | spin_lock_irqsave(&drv->lock, flags); |
380 | if (drv->flags[cs->minor_index] & VALID_MINOR) | ||
381 | module_put(drv->owner); | ||
379 | drv->flags[cs->minor_index] = 0; | 382 | drv->flags[cs->minor_index] = 0; |
380 | spin_unlock_irqrestore(&drv->lock, flags); | 383 | spin_unlock_irqrestore(&drv->lock, flags); |
381 | } | 384 | } |
@@ -579,7 +582,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs, | |||
579 | } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) | 582 | } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) |
580 | skb_reserve(bcs->skb, HW_HDR_LEN); | 583 | skb_reserve(bcs->skb, HW_HDR_LEN); |
581 | else { | 584 | else { |
582 | warn("could not allocate skb\n"); | 585 | warn("could not allocate skb"); |
583 | bcs->inputstate |= INS_skip_frame; | 586 | bcs->inputstate |= INS_skip_frame; |
584 | } | 587 | } |
585 | 588 | ||
@@ -632,17 +635,25 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
632 | int i; | 635 | int i; |
633 | 636 | ||
634 | gig_dbg(DEBUG_INIT, "allocating cs"); | 637 | gig_dbg(DEBUG_INIT, "allocating cs"); |
635 | cs = alloc_cs(drv); | 638 | if (!(cs = alloc_cs(drv))) { |
636 | if (!cs) | 639 | err("maximum number of devices exceeded"); |
637 | goto error; | 640 | return NULL; |
641 | } | ||
642 | mutex_init(&cs->mutex); | ||
643 | mutex_lock(&cs->mutex); | ||
644 | |||
638 | gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); | 645 | gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); |
639 | cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); | 646 | cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); |
640 | if (!cs->bcs) | 647 | if (!cs->bcs) { |
648 | err("out of memory"); | ||
641 | goto error; | 649 | goto error; |
650 | } | ||
642 | gig_dbg(DEBUG_INIT, "allocating inbuf"); | 651 | gig_dbg(DEBUG_INIT, "allocating inbuf"); |
643 | cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL); | 652 | cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL); |
644 | if (!cs->inbuf) | 653 | if (!cs->inbuf) { |
654 | err("out of memory"); | ||
645 | goto error; | 655 | goto error; |
656 | } | ||
646 | 657 | ||
647 | cs->cs_init = 0; | 658 | cs->cs_init = 0; |
648 | cs->channels = channels; | 659 | cs->channels = channels; |
@@ -654,8 +665,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
654 | spin_lock_init(&cs->ev_lock); | 665 | spin_lock_init(&cs->ev_lock); |
655 | cs->ev_tail = 0; | 666 | cs->ev_tail = 0; |
656 | cs->ev_head = 0; | 667 | cs->ev_head = 0; |
657 | mutex_init(&cs->mutex); | ||
658 | mutex_lock(&cs->mutex); | ||
659 | 668 | ||
660 | tasklet_init(&cs->event_tasklet, &gigaset_handle_event, | 669 | tasklet_init(&cs->event_tasklet, &gigaset_handle_event, |
661 | (unsigned long) cs); | 670 | (unsigned long) cs); |
@@ -684,8 +693,10 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
684 | 693 | ||
685 | for (i = 0; i < channels; ++i) { | 694 | for (i = 0; i < channels; ++i) { |
686 | gig_dbg(DEBUG_INIT, "setting up bcs[%d].read", i); | 695 | gig_dbg(DEBUG_INIT, "setting up bcs[%d].read", i); |
687 | if (!gigaset_initbcs(cs->bcs + i, cs, i)) | 696 | if (!gigaset_initbcs(cs->bcs + i, cs, i)) { |
697 | err("could not allocate channel %d data", i); | ||
688 | goto error; | 698 | goto error; |
699 | } | ||
689 | } | 700 | } |
690 | 701 | ||
691 | ++cs->cs_init; | 702 | ++cs->cs_init; |
@@ -720,8 +731,10 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
720 | make_valid(cs, VALID_ID); | 731 | make_valid(cs, VALID_ID); |
721 | ++cs->cs_init; | 732 | ++cs->cs_init; |
722 | gig_dbg(DEBUG_INIT, "setting up hw"); | 733 | gig_dbg(DEBUG_INIT, "setting up hw"); |
723 | if (!cs->ops->initcshw(cs)) | 734 | if (!cs->ops->initcshw(cs)) { |
735 | err("could not allocate device specific data"); | ||
724 | goto error; | 736 | goto error; |
737 | } | ||
725 | 738 | ||
726 | ++cs->cs_init; | 739 | ++cs->cs_init; |
727 | 740 | ||
@@ -743,8 +756,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
743 | mutex_unlock(&cs->mutex); | 756 | mutex_unlock(&cs->mutex); |
744 | return cs; | 757 | return cs; |
745 | 758 | ||
746 | error: if (cs) | 759 | error: |
747 | mutex_unlock(&cs->mutex); | 760 | mutex_unlock(&cs->mutex); |
748 | gig_dbg(DEBUG_INIT, "failed"); | 761 | gig_dbg(DEBUG_INIT, "failed"); |
749 | gigaset_freecs(cs); | 762 | gigaset_freecs(cs); |
750 | return NULL; | 763 | return NULL; |
@@ -1040,7 +1053,6 @@ void gigaset_freedriver(struct gigaset_driver *drv) | |||
1040 | spin_unlock_irqrestore(&driver_lock, flags); | 1053 | spin_unlock_irqrestore(&driver_lock, flags); |
1041 | 1054 | ||
1042 | gigaset_if_freedriver(drv); | 1055 | gigaset_if_freedriver(drv); |
1043 | module_put(drv->owner); | ||
1044 | 1056 | ||
1045 | kfree(drv->cs); | 1057 | kfree(drv->cs); |
1046 | kfree(drv->flags); | 1058 | kfree(drv->flags); |
@@ -1072,10 +1084,6 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, | |||
1072 | if (!drv) | 1084 | if (!drv) |
1073 | return NULL; | 1085 | return NULL; |
1074 | 1086 | ||
1075 | if (!try_module_get(owner)) | ||
1076 | goto out1; | ||
1077 | |||
1078 | drv->cs = NULL; | ||
1079 | drv->have_tty = 0; | 1087 | drv->have_tty = 0; |
1080 | drv->minor = minor; | 1088 | drv->minor = minor; |
1081 | drv->minors = minors; | 1089 | drv->minors = minors; |
@@ -1087,11 +1095,11 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, | |||
1087 | 1095 | ||
1088 | drv->cs = kmalloc(minors * sizeof *drv->cs, GFP_KERNEL); | 1096 | drv->cs = kmalloc(minors * sizeof *drv->cs, GFP_KERNEL); |
1089 | if (!drv->cs) | 1097 | if (!drv->cs) |
1090 | goto out2; | 1098 | goto error; |
1091 | 1099 | ||
1092 | drv->flags = kmalloc(minors * sizeof *drv->flags, GFP_KERNEL); | 1100 | drv->flags = kmalloc(minors * sizeof *drv->flags, GFP_KERNEL); |
1093 | if (!drv->flags) | 1101 | if (!drv->flags) |
1094 | goto out3; | 1102 | goto error; |
1095 | 1103 | ||
1096 | for (i = 0; i < minors; ++i) { | 1104 | for (i = 0; i < minors; ++i) { |
1097 | drv->flags[i] = 0; | 1105 | drv->flags[i] = 0; |
@@ -1108,11 +1116,8 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors, | |||
1108 | 1116 | ||
1109 | return drv; | 1117 | return drv; |
1110 | 1118 | ||
1111 | out3: | 1119 | error: |
1112 | kfree(drv->cs); | 1120 | kfree(drv->cs); |
1113 | out2: | ||
1114 | module_put(owner); | ||
1115 | out1: | ||
1116 | kfree(drv); | 1121 | kfree(drv); |
1117 | return NULL; | 1122 | return NULL; |
1118 | } | 1123 | } |
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 91e0c75aca8f..2db1ca4c6800 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -242,6 +242,7 @@ struct kvm_vcpu { | |||
242 | u64 pdptrs[4]; /* pae */ | 242 | u64 pdptrs[4]; /* pae */ |
243 | u64 shadow_efer; | 243 | u64 shadow_efer; |
244 | u64 apic_base; | 244 | u64 apic_base; |
245 | u64 ia32_misc_enable_msr; | ||
245 | int nmsrs; | 246 | int nmsrs; |
246 | struct vmx_msr_entry *guest_msrs; | 247 | struct vmx_msr_entry *guest_msrs; |
247 | struct vmx_msr_entry *host_msrs; | 248 | struct vmx_msr_entry *host_msrs; |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 67c1154960f0..b10972ed0c9f 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -272,7 +272,9 @@ static void kvm_free_physmem(struct kvm *kvm) | |||
272 | 272 | ||
273 | static void kvm_free_vcpu(struct kvm_vcpu *vcpu) | 273 | static void kvm_free_vcpu(struct kvm_vcpu *vcpu) |
274 | { | 274 | { |
275 | vcpu_load(vcpu->kvm, vcpu_slot(vcpu)); | ||
275 | kvm_mmu_destroy(vcpu); | 276 | kvm_mmu_destroy(vcpu); |
277 | vcpu_put(vcpu); | ||
276 | kvm_arch_ops->vcpu_free(vcpu); | 278 | kvm_arch_ops->vcpu_free(vcpu); |
277 | } | 279 | } |
278 | 280 | ||
@@ -1224,6 +1226,9 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) | |||
1224 | case MSR_IA32_APICBASE: | 1226 | case MSR_IA32_APICBASE: |
1225 | data = vcpu->apic_base; | 1227 | data = vcpu->apic_base; |
1226 | break; | 1228 | break; |
1229 | case MSR_IA32_MISC_ENABLE: | ||
1230 | data = vcpu->ia32_misc_enable_msr; | ||
1231 | break; | ||
1227 | #ifdef CONFIG_X86_64 | 1232 | #ifdef CONFIG_X86_64 |
1228 | case MSR_EFER: | 1233 | case MSR_EFER: |
1229 | data = vcpu->shadow_efer; | 1234 | data = vcpu->shadow_efer; |
@@ -1295,6 +1300,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) | |||
1295 | case MSR_IA32_APICBASE: | 1300 | case MSR_IA32_APICBASE: |
1296 | vcpu->apic_base = data; | 1301 | vcpu->apic_base = data; |
1297 | break; | 1302 | break; |
1303 | case MSR_IA32_MISC_ENABLE: | ||
1304 | vcpu->ia32_misc_enable_msr = data; | ||
1305 | break; | ||
1298 | default: | 1306 | default: |
1299 | printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr); | 1307 | printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr); |
1300 | return 1; | 1308 | return 1; |
@@ -1598,6 +1606,10 @@ static u32 msrs_to_save[] = { | |||
1598 | 1606 | ||
1599 | static unsigned num_msrs_to_save; | 1607 | static unsigned num_msrs_to_save; |
1600 | 1608 | ||
1609 | static u32 emulated_msrs[] = { | ||
1610 | MSR_IA32_MISC_ENABLE, | ||
1611 | }; | ||
1612 | |||
1601 | static __init void kvm_init_msr_list(void) | 1613 | static __init void kvm_init_msr_list(void) |
1602 | { | 1614 | { |
1603 | u32 dummy[2]; | 1615 | u32 dummy[2]; |
@@ -1923,7 +1935,7 @@ static long kvm_dev_ioctl(struct file *filp, | |||
1923 | if (copy_from_user(&msr_list, user_msr_list, sizeof msr_list)) | 1935 | if (copy_from_user(&msr_list, user_msr_list, sizeof msr_list)) |
1924 | goto out; | 1936 | goto out; |
1925 | n = msr_list.nmsrs; | 1937 | n = msr_list.nmsrs; |
1926 | msr_list.nmsrs = num_msrs_to_save; | 1938 | msr_list.nmsrs = num_msrs_to_save + ARRAY_SIZE(emulated_msrs); |
1927 | if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list)) | 1939 | if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list)) |
1928 | goto out; | 1940 | goto out; |
1929 | r = -E2BIG; | 1941 | r = -E2BIG; |
@@ -1933,6 +1945,11 @@ static long kvm_dev_ioctl(struct file *filp, | |||
1933 | if (copy_to_user(user_msr_list->indices, &msrs_to_save, | 1945 | if (copy_to_user(user_msr_list->indices, &msrs_to_save, |
1934 | num_msrs_to_save * sizeof(u32))) | 1946 | num_msrs_to_save * sizeof(u32))) |
1935 | goto out; | 1947 | goto out; |
1948 | if (copy_to_user(user_msr_list->indices | ||
1949 | + num_msrs_to_save * sizeof(u32), | ||
1950 | &emulated_msrs, | ||
1951 | ARRAY_SIZE(emulated_msrs) * sizeof(u32))) | ||
1952 | goto out; | ||
1936 | r = 0; | 1953 | r = 0; |
1937 | break; | 1954 | break; |
1938 | } | 1955 | } |
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index c6f972914f08..22c426cd8cb2 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -143,6 +143,7 @@ static int dbg = 1; | |||
143 | #define PFERR_PRESENT_MASK (1U << 0) | 143 | #define PFERR_PRESENT_MASK (1U << 0) |
144 | #define PFERR_WRITE_MASK (1U << 1) | 144 | #define PFERR_WRITE_MASK (1U << 1) |
145 | #define PFERR_USER_MASK (1U << 2) | 145 | #define PFERR_USER_MASK (1U << 2) |
146 | #define PFERR_FETCH_MASK (1U << 4) | ||
146 | 147 | ||
147 | #define PT64_ROOT_LEVEL 4 | 148 | #define PT64_ROOT_LEVEL 4 |
148 | #define PT32_ROOT_LEVEL 2 | 149 | #define PT32_ROOT_LEVEL 2 |
@@ -168,6 +169,11 @@ static int is_cpuid_PSE36(void) | |||
168 | return 1; | 169 | return 1; |
169 | } | 170 | } |
170 | 171 | ||
172 | static int is_nx(struct kvm_vcpu *vcpu) | ||
173 | { | ||
174 | return vcpu->shadow_efer & EFER_NX; | ||
175 | } | ||
176 | |||
171 | static int is_present_pte(unsigned long pte) | 177 | static int is_present_pte(unsigned long pte) |
172 | { | 178 | { |
173 | return pte & PT_PRESENT_MASK; | 179 | return pte & PT_PRESENT_MASK; |
@@ -992,16 +998,6 @@ static inline int fix_read_pf(u64 *shadow_ent) | |||
992 | return 0; | 998 | return 0; |
993 | } | 999 | } |
994 | 1000 | ||
995 | static int may_access(u64 pte, int write, int user) | ||
996 | { | ||
997 | |||
998 | if (user && !(pte & PT_USER_MASK)) | ||
999 | return 0; | ||
1000 | if (write && !(pte & PT_WRITABLE_MASK)) | ||
1001 | return 0; | ||
1002 | return 1; | ||
1003 | } | ||
1004 | |||
1005 | static void paging_free(struct kvm_vcpu *vcpu) | 1001 | static void paging_free(struct kvm_vcpu *vcpu) |
1006 | { | 1002 | { |
1007 | nonpaging_free(vcpu); | 1003 | nonpaging_free(vcpu); |
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 2dbf4307ed9e..149fa45fd9a5 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -63,13 +63,15 @@ struct guest_walker { | |||
63 | pt_element_t *ptep; | 63 | pt_element_t *ptep; |
64 | pt_element_t inherited_ar; | 64 | pt_element_t inherited_ar; |
65 | gfn_t gfn; | 65 | gfn_t gfn; |
66 | u32 error_code; | ||
66 | }; | 67 | }; |
67 | 68 | ||
68 | /* | 69 | /* |
69 | * Fetch a guest pte for a guest virtual address | 70 | * Fetch a guest pte for a guest virtual address |
70 | */ | 71 | */ |
71 | static void FNAME(walk_addr)(struct guest_walker *walker, | 72 | static int FNAME(walk_addr)(struct guest_walker *walker, |
72 | struct kvm_vcpu *vcpu, gva_t addr) | 73 | struct kvm_vcpu *vcpu, gva_t addr, |
74 | int write_fault, int user_fault, int fetch_fault) | ||
73 | { | 75 | { |
74 | hpa_t hpa; | 76 | hpa_t hpa; |
75 | struct kvm_memory_slot *slot; | 77 | struct kvm_memory_slot *slot; |
@@ -86,7 +88,7 @@ static void FNAME(walk_addr)(struct guest_walker *walker, | |||
86 | walker->ptep = &vcpu->pdptrs[(addr >> 30) & 3]; | 88 | walker->ptep = &vcpu->pdptrs[(addr >> 30) & 3]; |
87 | root = *walker->ptep; | 89 | root = *walker->ptep; |
88 | if (!(root & PT_PRESENT_MASK)) | 90 | if (!(root & PT_PRESENT_MASK)) |
89 | return; | 91 | goto not_present; |
90 | --walker->level; | 92 | --walker->level; |
91 | } | 93 | } |
92 | #endif | 94 | #endif |
@@ -111,11 +113,23 @@ static void FNAME(walk_addr)(struct guest_walker *walker, | |||
111 | ASSERT(((unsigned long)walker->table & PAGE_MASK) == | 113 | ASSERT(((unsigned long)walker->table & PAGE_MASK) == |
112 | ((unsigned long)ptep & PAGE_MASK)); | 114 | ((unsigned long)ptep & PAGE_MASK)); |
113 | 115 | ||
114 | if (is_present_pte(*ptep) && !(*ptep & PT_ACCESSED_MASK)) | ||
115 | *ptep |= PT_ACCESSED_MASK; | ||
116 | |||
117 | if (!is_present_pte(*ptep)) | 116 | if (!is_present_pte(*ptep)) |
118 | break; | 117 | goto not_present; |
118 | |||
119 | if (write_fault && !is_writeble_pte(*ptep)) | ||
120 | if (user_fault || is_write_protection(vcpu)) | ||
121 | goto access_error; | ||
122 | |||
123 | if (user_fault && !(*ptep & PT_USER_MASK)) | ||
124 | goto access_error; | ||
125 | |||
126 | #if PTTYPE == 64 | ||
127 | if (fetch_fault && is_nx(vcpu) && (*ptep & PT64_NX_MASK)) | ||
128 | goto access_error; | ||
129 | #endif | ||
130 | |||
131 | if (!(*ptep & PT_ACCESSED_MASK)) | ||
132 | *ptep |= PT_ACCESSED_MASK; /* avoid rmw */ | ||
119 | 133 | ||
120 | if (walker->level == PT_PAGE_TABLE_LEVEL) { | 134 | if (walker->level == PT_PAGE_TABLE_LEVEL) { |
121 | walker->gfn = (*ptep & PT_BASE_ADDR_MASK) | 135 | walker->gfn = (*ptep & PT_BASE_ADDR_MASK) |
@@ -146,6 +160,23 @@ static void FNAME(walk_addr)(struct guest_walker *walker, | |||
146 | } | 160 | } |
147 | walker->ptep = ptep; | 161 | walker->ptep = ptep; |
148 | pgprintk("%s: pte %llx\n", __FUNCTION__, (u64)*ptep); | 162 | pgprintk("%s: pte %llx\n", __FUNCTION__, (u64)*ptep); |
163 | return 1; | ||
164 | |||
165 | not_present: | ||
166 | walker->error_code = 0; | ||
167 | goto err; | ||
168 | |||
169 | access_error: | ||
170 | walker->error_code = PFERR_PRESENT_MASK; | ||
171 | |||
172 | err: | ||
173 | if (write_fault) | ||
174 | walker->error_code |= PFERR_WRITE_MASK; | ||
175 | if (user_fault) | ||
176 | walker->error_code |= PFERR_USER_MASK; | ||
177 | if (fetch_fault) | ||
178 | walker->error_code |= PFERR_FETCH_MASK; | ||
179 | return 0; | ||
149 | } | 180 | } |
150 | 181 | ||
151 | static void FNAME(release_walker)(struct guest_walker *walker) | 182 | static void FNAME(release_walker)(struct guest_walker *walker) |
@@ -274,7 +305,7 @@ static int FNAME(fix_write_pf)(struct kvm_vcpu *vcpu, | |||
274 | struct kvm_mmu_page *page; | 305 | struct kvm_mmu_page *page; |
275 | 306 | ||
276 | if (is_writeble_pte(*shadow_ent)) | 307 | if (is_writeble_pte(*shadow_ent)) |
277 | return 0; | 308 | return !user || (*shadow_ent & PT_USER_MASK); |
278 | 309 | ||
279 | writable_shadow = *shadow_ent & PT_SHADOW_WRITABLE_MASK; | 310 | writable_shadow = *shadow_ent & PT_SHADOW_WRITABLE_MASK; |
280 | if (user) { | 311 | if (user) { |
@@ -347,8 +378,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
347 | u32 error_code) | 378 | u32 error_code) |
348 | { | 379 | { |
349 | int write_fault = error_code & PFERR_WRITE_MASK; | 380 | int write_fault = error_code & PFERR_WRITE_MASK; |
350 | int pte_present = error_code & PFERR_PRESENT_MASK; | ||
351 | int user_fault = error_code & PFERR_USER_MASK; | 381 | int user_fault = error_code & PFERR_USER_MASK; |
382 | int fetch_fault = error_code & PFERR_FETCH_MASK; | ||
352 | struct guest_walker walker; | 383 | struct guest_walker walker; |
353 | u64 *shadow_pte; | 384 | u64 *shadow_pte; |
354 | int fixed; | 385 | int fixed; |
@@ -365,19 +396,20 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
365 | /* | 396 | /* |
366 | * Look up the shadow pte for the faulting address. | 397 | * Look up the shadow pte for the faulting address. |
367 | */ | 398 | */ |
368 | FNAME(walk_addr)(&walker, vcpu, addr); | 399 | r = FNAME(walk_addr)(&walker, vcpu, addr, write_fault, user_fault, |
369 | shadow_pte = FNAME(fetch)(vcpu, addr, &walker); | 400 | fetch_fault); |
370 | 401 | ||
371 | /* | 402 | /* |
372 | * The page is not mapped by the guest. Let the guest handle it. | 403 | * The page is not mapped by the guest. Let the guest handle it. |
373 | */ | 404 | */ |
374 | if (!shadow_pte) { | 405 | if (!r) { |
375 | pgprintk("%s: not mapped\n", __FUNCTION__); | 406 | pgprintk("%s: guest page fault\n", __FUNCTION__); |
376 | inject_page_fault(vcpu, addr, error_code); | 407 | inject_page_fault(vcpu, addr, walker.error_code); |
377 | FNAME(release_walker)(&walker); | 408 | FNAME(release_walker)(&walker); |
378 | return 0; | 409 | return 0; |
379 | } | 410 | } |
380 | 411 | ||
412 | shadow_pte = FNAME(fetch)(vcpu, addr, &walker); | ||
381 | pgprintk("%s: shadow pte %p %llx\n", __FUNCTION__, | 413 | pgprintk("%s: shadow pte %p %llx\n", __FUNCTION__, |
382 | shadow_pte, *shadow_pte); | 414 | shadow_pte, *shadow_pte); |
383 | 415 | ||
@@ -399,22 +431,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
399 | * mmio: emulate if accessible, otherwise its a guest fault. | 431 | * mmio: emulate if accessible, otherwise its a guest fault. |
400 | */ | 432 | */ |
401 | if (is_io_pte(*shadow_pte)) { | 433 | if (is_io_pte(*shadow_pte)) { |
402 | if (may_access(*shadow_pte, write_fault, user_fault)) | 434 | return 1; |
403 | return 1; | ||
404 | pgprintk("%s: io work, no access\n", __FUNCTION__); | ||
405 | inject_page_fault(vcpu, addr, | ||
406 | error_code | PFERR_PRESENT_MASK); | ||
407 | kvm_mmu_audit(vcpu, "post page fault (io)"); | ||
408 | return 0; | ||
409 | } | ||
410 | |||
411 | /* | ||
412 | * pte not present, guest page fault. | ||
413 | */ | ||
414 | if (pte_present && !fixed && !write_pt) { | ||
415 | inject_page_fault(vcpu, addr, error_code); | ||
416 | kvm_mmu_audit(vcpu, "post page fault (guest)"); | ||
417 | return 0; | ||
418 | } | 435 | } |
419 | 436 | ||
420 | ++kvm_stat.pf_fixed; | 437 | ++kvm_stat.pf_fixed; |
@@ -429,7 +446,7 @@ static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr) | |||
429 | pt_element_t guest_pte; | 446 | pt_element_t guest_pte; |
430 | gpa_t gpa; | 447 | gpa_t gpa; |
431 | 448 | ||
432 | FNAME(walk_addr)(&walker, vcpu, vaddr); | 449 | FNAME(walk_addr)(&walker, vcpu, vaddr, 0, 0, 0); |
433 | guest_pte = *walker.ptep; | 450 | guest_pte = *walker.ptep; |
434 | FNAME(release_walker)(&walker); | 451 | FNAME(release_walker)(&walker); |
435 | 452 | ||
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 714f6a7841cd..c79df79307ed 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -502,6 +502,7 @@ static void init_vmcb(struct vmcb *vmcb) | |||
502 | (1ULL << INTERCEPT_IOIO_PROT) | | 502 | (1ULL << INTERCEPT_IOIO_PROT) | |
503 | (1ULL << INTERCEPT_MSR_PROT) | | 503 | (1ULL << INTERCEPT_MSR_PROT) | |
504 | (1ULL << INTERCEPT_TASK_SWITCH) | | 504 | (1ULL << INTERCEPT_TASK_SWITCH) | |
505 | (1ULL << INTERCEPT_SHUTDOWN) | | ||
505 | (1ULL << INTERCEPT_VMRUN) | | 506 | (1ULL << INTERCEPT_VMRUN) | |
506 | (1ULL << INTERCEPT_VMMCALL) | | 507 | (1ULL << INTERCEPT_VMMCALL) | |
507 | (1ULL << INTERCEPT_VMLOAD) | | 508 | (1ULL << INTERCEPT_VMLOAD) | |
@@ -680,14 +681,14 @@ static void svm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) | |||
680 | 681 | ||
681 | static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 682 | static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) |
682 | { | 683 | { |
683 | dt->limit = vcpu->svm->vmcb->save.ldtr.limit; | 684 | dt->limit = vcpu->svm->vmcb->save.idtr.limit; |
684 | dt->base = vcpu->svm->vmcb->save.ldtr.base; | 685 | dt->base = vcpu->svm->vmcb->save.idtr.base; |
685 | } | 686 | } |
686 | 687 | ||
687 | static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 688 | static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) |
688 | { | 689 | { |
689 | vcpu->svm->vmcb->save.ldtr.limit = dt->limit; | 690 | vcpu->svm->vmcb->save.idtr.limit = dt->limit; |
690 | vcpu->svm->vmcb->save.ldtr.base = dt->base ; | 691 | vcpu->svm->vmcb->save.idtr.base = dt->base ; |
691 | } | 692 | } |
692 | 693 | ||
693 | static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) | 694 | static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) |
@@ -892,6 +893,19 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
892 | return 0; | 893 | return 0; |
893 | } | 894 | } |
894 | 895 | ||
896 | static int shutdown_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | ||
897 | { | ||
898 | /* | ||
899 | * VMCB is undefined after a SHUTDOWN intercept | ||
900 | * so reinitialize it. | ||
901 | */ | ||
902 | memset(vcpu->svm->vmcb, 0, PAGE_SIZE); | ||
903 | init_vmcb(vcpu->svm->vmcb); | ||
904 | |||
905 | kvm_run->exit_reason = KVM_EXIT_SHUTDOWN; | ||
906 | return 0; | ||
907 | } | ||
908 | |||
895 | static int io_get_override(struct kvm_vcpu *vcpu, | 909 | static int io_get_override(struct kvm_vcpu *vcpu, |
896 | struct vmcb_seg **seg, | 910 | struct vmcb_seg **seg, |
897 | int *addr_override) | 911 | int *addr_override) |
@@ -1149,7 +1163,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) | |||
1149 | case MSR_K6_STAR: | 1163 | case MSR_K6_STAR: |
1150 | vcpu->svm->vmcb->save.star = data; | 1164 | vcpu->svm->vmcb->save.star = data; |
1151 | break; | 1165 | break; |
1152 | #ifdef CONFIG_X86_64_ | 1166 | #ifdef CONFIG_X86_64 |
1153 | case MSR_LSTAR: | 1167 | case MSR_LSTAR: |
1154 | vcpu->svm->vmcb->save.lstar = data; | 1168 | vcpu->svm->vmcb->save.lstar = data; |
1155 | break; | 1169 | break; |
@@ -1249,6 +1263,7 @@ static int (*svm_exit_handlers[])(struct kvm_vcpu *vcpu, | |||
1249 | [SVM_EXIT_IOIO] = io_interception, | 1263 | [SVM_EXIT_IOIO] = io_interception, |
1250 | [SVM_EXIT_MSR] = msr_interception, | 1264 | [SVM_EXIT_MSR] = msr_interception, |
1251 | [SVM_EXIT_TASK_SWITCH] = task_switch_interception, | 1265 | [SVM_EXIT_TASK_SWITCH] = task_switch_interception, |
1266 | [SVM_EXIT_SHUTDOWN] = shutdown_interception, | ||
1252 | [SVM_EXIT_VMRUN] = invalid_op_interception, | 1267 | [SVM_EXIT_VMRUN] = invalid_op_interception, |
1253 | [SVM_EXIT_VMMCALL] = invalid_op_interception, | 1268 | [SVM_EXIT_VMMCALL] = invalid_op_interception, |
1254 | [SVM_EXIT_VMLOAD] = invalid_op_interception, | 1269 | [SVM_EXIT_VMLOAD] = invalid_op_interception, |
@@ -1407,7 +1422,8 @@ static int svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1407 | int r; | 1422 | int r; |
1408 | 1423 | ||
1409 | again: | 1424 | again: |
1410 | do_interrupt_requests(vcpu, kvm_run); | 1425 | if (!vcpu->mmio_read_completed) |
1426 | do_interrupt_requests(vcpu, kvm_run); | ||
1411 | 1427 | ||
1412 | clgi(); | 1428 | clgi(); |
1413 | 1429 | ||
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index ce219e3f557f..54c35c0b3181 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) | |||
1116 | 1116 | ||
1117 | if (rdmsr_safe(index, &data_low, &data_high) < 0) | 1117 | if (rdmsr_safe(index, &data_low, &data_high) < 0) |
1118 | continue; | 1118 | continue; |
1119 | if (wrmsr_safe(index, data_low, data_high) < 0) | ||
1120 | continue; | ||
1119 | data = data_low | ((u64)data_high << 32); | 1121 | data = data_low | ((u64)data_high << 32); |
1120 | vcpu->host_msrs[j].index = index; | 1122 | vcpu->host_msrs[j].index = index; |
1121 | vcpu->host_msrs[j].reserved = 0; | 1123 | vcpu->host_msrs[j].reserved = 0; |
@@ -1717,7 +1719,8 @@ again: | |||
1717 | vmcs_writel(HOST_GS_BASE, segment_base(gs_sel)); | 1719 | vmcs_writel(HOST_GS_BASE, segment_base(gs_sel)); |
1718 | #endif | 1720 | #endif |
1719 | 1721 | ||
1720 | do_interrupt_requests(vcpu, kvm_run); | 1722 | if (!vcpu->mmio_read_completed) |
1723 | do_interrupt_requests(vcpu, kvm_run); | ||
1721 | 1724 | ||
1722 | if (vcpu->guest_debug.enabled) | 1725 | if (vcpu->guest_debug.enabled) |
1723 | kvm_guest_debug_pre(vcpu); | 1726 | kvm_guest_debug_pre(vcpu); |
@@ -1824,7 +1827,7 @@ again: | |||
1824 | #endif | 1827 | #endif |
1825 | "setbe %0 \n\t" | 1828 | "setbe %0 \n\t" |
1826 | "popf \n\t" | 1829 | "popf \n\t" |
1827 | : "=g" (fail) | 1830 | : "=q" (fail) |
1828 | : "r"(vcpu->launched), "d"((unsigned long)HOST_RSP), | 1831 | : "r"(vcpu->launched), "d"((unsigned long)HOST_RSP), |
1829 | "c"(vcpu), | 1832 | "c"(vcpu), |
1830 | [rax]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RAX])), | 1833 | [rax]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RAX])), |
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index be70795b4822..7513cddb929f 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #define ModRM (1<<6) | 61 | #define ModRM (1<<6) |
62 | /* Destination is only written; never read. */ | 62 | /* Destination is only written; never read. */ |
63 | #define Mov (1<<7) | 63 | #define Mov (1<<7) |
64 | #define BitOp (1<<8) | ||
64 | 65 | ||
65 | static u8 opcode_table[256] = { | 66 | static u8 opcode_table[256] = { |
66 | /* 0x00 - 0x07 */ | 67 | /* 0x00 - 0x07 */ |
@@ -148,7 +149,7 @@ static u8 opcode_table[256] = { | |||
148 | 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM | 149 | 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM |
149 | }; | 150 | }; |
150 | 151 | ||
151 | static u8 twobyte_table[256] = { | 152 | static u16 twobyte_table[256] = { |
152 | /* 0x00 - 0x0F */ | 153 | /* 0x00 - 0x0F */ |
153 | 0, SrcMem | ModRM | DstReg, 0, 0, 0, 0, ImplicitOps, 0, | 154 | 0, SrcMem | ModRM | DstReg, 0, 0, 0, 0, ImplicitOps, 0, |
154 | 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, | 155 | 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, |
@@ -180,16 +181,16 @@ static u8 twobyte_table[256] = { | |||
180 | /* 0x90 - 0x9F */ | 181 | /* 0x90 - 0x9F */ |
181 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 182 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
182 | /* 0xA0 - 0xA7 */ | 183 | /* 0xA0 - 0xA7 */ |
183 | 0, 0, 0, DstMem | SrcReg | ModRM, 0, 0, 0, 0, | 184 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, |
184 | /* 0xA8 - 0xAF */ | 185 | /* 0xA8 - 0xAF */ |
185 | 0, 0, 0, DstMem | SrcReg | ModRM, 0, 0, 0, 0, | 186 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, |
186 | /* 0xB0 - 0xB7 */ | 187 | /* 0xB0 - 0xB7 */ |
187 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, | 188 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, |
188 | DstMem | SrcReg | ModRM, | 189 | DstMem | SrcReg | ModRM | BitOp, |
189 | 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, | 190 | 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, |
190 | DstReg | SrcMem16 | ModRM | Mov, | 191 | DstReg | SrcMem16 | ModRM | Mov, |
191 | /* 0xB8 - 0xBF */ | 192 | /* 0xB8 - 0xBF */ |
192 | 0, 0, DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM, | 193 | 0, 0, DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM | BitOp, |
193 | 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, | 194 | 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, |
194 | DstReg | SrcMem16 | ModRM | Mov, | 195 | DstReg | SrcMem16 | ModRM | Mov, |
195 | /* 0xC0 - 0xCF */ | 196 | /* 0xC0 - 0xCF */ |
@@ -469,7 +470,8 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt, | |||
469 | int | 470 | int |
470 | x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) | 471 | x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) |
471 | { | 472 | { |
472 | u8 b, d, sib, twobyte = 0, rex_prefix = 0; | 473 | unsigned d; |
474 | u8 b, sib, twobyte = 0, rex_prefix = 0; | ||
473 | u8 modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0; | 475 | u8 modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0; |
474 | unsigned long *override_base = NULL; | 476 | unsigned long *override_base = NULL; |
475 | unsigned int op_bytes, ad_bytes, lock_prefix = 0, rep_prefix = 0, i; | 477 | unsigned int op_bytes, ad_bytes, lock_prefix = 0, rep_prefix = 0, i; |
@@ -726,46 +728,6 @@ done_prefixes: | |||
726 | ; | 728 | ; |
727 | } | 729 | } |
728 | 730 | ||
729 | /* Decode and fetch the destination operand: register or memory. */ | ||
730 | switch (d & DstMask) { | ||
731 | case ImplicitOps: | ||
732 | /* Special instructions do their own operand decoding. */ | ||
733 | goto special_insn; | ||
734 | case DstReg: | ||
735 | dst.type = OP_REG; | ||
736 | if ((d & ByteOp) | ||
737 | && !(twobyte_table && (b == 0xb6 || b == 0xb7))) { | ||
738 | dst.ptr = decode_register(modrm_reg, _regs, | ||
739 | (rex_prefix == 0)); | ||
740 | dst.val = *(u8 *) dst.ptr; | ||
741 | dst.bytes = 1; | ||
742 | } else { | ||
743 | dst.ptr = decode_register(modrm_reg, _regs, 0); | ||
744 | switch ((dst.bytes = op_bytes)) { | ||
745 | case 2: | ||
746 | dst.val = *(u16 *)dst.ptr; | ||
747 | break; | ||
748 | case 4: | ||
749 | dst.val = *(u32 *)dst.ptr; | ||
750 | break; | ||
751 | case 8: | ||
752 | dst.val = *(u64 *)dst.ptr; | ||
753 | break; | ||
754 | } | ||
755 | } | ||
756 | break; | ||
757 | case DstMem: | ||
758 | dst.type = OP_MEM; | ||
759 | dst.ptr = (unsigned long *)cr2; | ||
760 | dst.bytes = (d & ByteOp) ? 1 : op_bytes; | ||
761 | if (!(d & Mov) && /* optimisation - avoid slow emulated read */ | ||
762 | ((rc = ops->read_emulated((unsigned long)dst.ptr, | ||
763 | &dst.val, dst.bytes, ctxt)) != 0)) | ||
764 | goto done; | ||
765 | break; | ||
766 | } | ||
767 | dst.orig_val = dst.val; | ||
768 | |||
769 | /* | 731 | /* |
770 | * Decode and fetch the source operand: register, memory | 732 | * Decode and fetch the source operand: register, memory |
771 | * or immediate. | 733 | * or immediate. |
@@ -838,6 +800,50 @@ done_prefixes: | |||
838 | break; | 800 | break; |
839 | } | 801 | } |
840 | 802 | ||
803 | /* Decode and fetch the destination operand: register or memory. */ | ||
804 | switch (d & DstMask) { | ||
805 | case ImplicitOps: | ||
806 | /* Special instructions do their own operand decoding. */ | ||
807 | goto special_insn; | ||
808 | case DstReg: | ||
809 | dst.type = OP_REG; | ||
810 | if ((d & ByteOp) | ||
811 | && !(twobyte_table && (b == 0xb6 || b == 0xb7))) { | ||
812 | dst.ptr = decode_register(modrm_reg, _regs, | ||
813 | (rex_prefix == 0)); | ||
814 | dst.val = *(u8 *) dst.ptr; | ||
815 | dst.bytes = 1; | ||
816 | } else { | ||
817 | dst.ptr = decode_register(modrm_reg, _regs, 0); | ||
818 | switch ((dst.bytes = op_bytes)) { | ||
819 | case 2: | ||
820 | dst.val = *(u16 *)dst.ptr; | ||
821 | break; | ||
822 | case 4: | ||
823 | dst.val = *(u32 *)dst.ptr; | ||
824 | break; | ||
825 | case 8: | ||
826 | dst.val = *(u64 *)dst.ptr; | ||
827 | break; | ||
828 | } | ||
829 | } | ||
830 | break; | ||
831 | case DstMem: | ||
832 | dst.type = OP_MEM; | ||
833 | dst.ptr = (unsigned long *)cr2; | ||
834 | dst.bytes = (d & ByteOp) ? 1 : op_bytes; | ||
835 | if (d & BitOp) { | ||
836 | dst.ptr += src.val / BITS_PER_LONG; | ||
837 | dst.bytes = sizeof(long); | ||
838 | } | ||
839 | if (!(d & Mov) && /* optimisation - avoid slow emulated read */ | ||
840 | ((rc = ops->read_emulated((unsigned long)dst.ptr, | ||
841 | &dst.val, dst.bytes, ctxt)) != 0)) | ||
842 | goto done; | ||
843 | break; | ||
844 | } | ||
845 | dst.orig_val = dst.val; | ||
846 | |||
841 | if (twobyte) | 847 | if (twobyte) |
842 | goto twobyte_insn; | 848 | goto twobyte_insn; |
843 | 849 | ||
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 5432d07c074d..11108165e264 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -479,9 +479,12 @@ static int bitmap_read_sb(struct bitmap *bitmap) | |||
479 | int err = -EINVAL; | 479 | int err = -EINVAL; |
480 | 480 | ||
481 | /* page 0 is the superblock, read it... */ | 481 | /* page 0 is the superblock, read it... */ |
482 | if (bitmap->file) | 482 | if (bitmap->file) { |
483 | bitmap->sb_page = read_page(bitmap->file, 0, bitmap, PAGE_SIZE); | 483 | loff_t isize = i_size_read(bitmap->file->f_mapping->host); |
484 | else { | 484 | int bytes = isize > PAGE_SIZE ? PAGE_SIZE : isize; |
485 | |||
486 | bitmap->sb_page = read_page(bitmap->file, 0, bitmap, bytes); | ||
487 | } else { | ||
485 | bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0); | 488 | bitmap->sb_page = read_sb_page(bitmap->mddev, bitmap->offset, 0); |
486 | } | 489 | } |
487 | if (IS_ERR(bitmap->sb_page)) { | 490 | if (IS_ERR(bitmap->sb_page)) { |
@@ -877,7 +880,8 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) | |||
877 | int count; | 880 | int count; |
878 | /* unmap the old page, we're done with it */ | 881 | /* unmap the old page, we're done with it */ |
879 | if (index == num_pages-1) | 882 | if (index == num_pages-1) |
880 | count = bytes - index * PAGE_SIZE; | 883 | count = bytes + sizeof(bitmap_super_t) |
884 | - index * PAGE_SIZE; | ||
881 | else | 885 | else |
882 | count = PAGE_SIZE; | 886 | count = PAGE_SIZE; |
883 | if (index == 0) { | 887 | if (index == 0) { |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index fe7c56e10435..3668b170ea68 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1116,7 +1116,8 @@ static int __bind(struct mapped_device *md, struct dm_table *t) | |||
1116 | if (size != get_capacity(md->disk)) | 1116 | if (size != get_capacity(md->disk)) |
1117 | memset(&md->geometry, 0, sizeof(md->geometry)); | 1117 | memset(&md->geometry, 0, sizeof(md->geometry)); |
1118 | 1118 | ||
1119 | __set_size(md, size); | 1119 | if (md->suspended_bdev) |
1120 | __set_size(md, size); | ||
1120 | if (size == 0) | 1121 | if (size == 0) |
1121 | return 0; | 1122 | return 0; |
1122 | 1123 | ||
@@ -1264,6 +1265,11 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table) | |||
1264 | if (!dm_suspended(md)) | 1265 | if (!dm_suspended(md)) |
1265 | goto out; | 1266 | goto out; |
1266 | 1267 | ||
1268 | /* without bdev, the device size cannot be changed */ | ||
1269 | if (!md->suspended_bdev) | ||
1270 | if (get_capacity(md->disk) != dm_table_get_size(table)) | ||
1271 | goto out; | ||
1272 | |||
1267 | __unbind(md); | 1273 | __unbind(md); |
1268 | r = __bind(md, table); | 1274 | r = __bind(md, table); |
1269 | 1275 | ||
@@ -1341,11 +1347,14 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags) | |||
1341 | /* This does not get reverted if there's an error later. */ | 1347 | /* This does not get reverted if there's an error later. */ |
1342 | dm_table_presuspend_targets(map); | 1348 | dm_table_presuspend_targets(map); |
1343 | 1349 | ||
1344 | md->suspended_bdev = bdget_disk(md->disk, 0); | 1350 | /* bdget() can stall if the pending I/Os are not flushed */ |
1345 | if (!md->suspended_bdev) { | 1351 | if (!noflush) { |
1346 | DMWARN("bdget failed in dm_suspend"); | 1352 | md->suspended_bdev = bdget_disk(md->disk, 0); |
1347 | r = -ENOMEM; | 1353 | if (!md->suspended_bdev) { |
1348 | goto flush_and_out; | 1354 | DMWARN("bdget failed in dm_suspend"); |
1355 | r = -ENOMEM; | ||
1356 | goto flush_and_out; | ||
1357 | } | ||
1349 | } | 1358 | } |
1350 | 1359 | ||
1351 | /* | 1360 | /* |
@@ -1473,8 +1482,10 @@ int dm_resume(struct mapped_device *md) | |||
1473 | 1482 | ||
1474 | unlock_fs(md); | 1483 | unlock_fs(md); |
1475 | 1484 | ||
1476 | bdput(md->suspended_bdev); | 1485 | if (md->suspended_bdev) { |
1477 | md->suspended_bdev = NULL; | 1486 | bdput(md->suspended_bdev); |
1487 | md->suspended_bdev = NULL; | ||
1488 | } | ||
1478 | 1489 | ||
1479 | clear_bit(DMF_SUSPENDED, &md->flags); | 1490 | clear_bit(DMF_SUSPENDED, &md->flags); |
1480 | 1491 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index d1cb45f6d6a9..e8807ea5377d 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1633,7 +1633,8 @@ repeat: | |||
1633 | * and 'events' is odd, we can roll back to the previous clean state */ | 1633 | * and 'events' is odd, we can roll back to the previous clean state */ |
1634 | if (nospares | 1634 | if (nospares |
1635 | && (mddev->in_sync && mddev->recovery_cp == MaxSector) | 1635 | && (mddev->in_sync && mddev->recovery_cp == MaxSector) |
1636 | && (mddev->events & 1)) | 1636 | && (mddev->events & 1) |
1637 | && mddev->events != 1) | ||
1637 | mddev->events--; | 1638 | mddev->events--; |
1638 | else { | 1639 | else { |
1639 | /* otherwise we have to go forward and ... */ | 1640 | /* otherwise we have to go forward and ... */ |
@@ -3563,6 +3564,8 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg) | |||
3563 | char *ptr, *buf = NULL; | 3564 | char *ptr, *buf = NULL; |
3564 | int err = -ENOMEM; | 3565 | int err = -ENOMEM; |
3565 | 3566 | ||
3567 | md_allow_write(mddev); | ||
3568 | |||
3566 | file = kmalloc(sizeof(*file), GFP_KERNEL); | 3569 | file = kmalloc(sizeof(*file), GFP_KERNEL); |
3567 | if (!file) | 3570 | if (!file) |
3568 | goto out; | 3571 | goto out; |
@@ -5031,6 +5034,33 @@ void md_write_end(mddev_t *mddev) | |||
5031 | } | 5034 | } |
5032 | } | 5035 | } |
5033 | 5036 | ||
5037 | /* md_allow_write(mddev) | ||
5038 | * Calling this ensures that the array is marked 'active' so that writes | ||
5039 | * may proceed without blocking. It is important to call this before | ||
5040 | * attempting a GFP_KERNEL allocation while holding the mddev lock. | ||
5041 | * Must be called with mddev_lock held. | ||
5042 | */ | ||
5043 | void md_allow_write(mddev_t *mddev) | ||
5044 | { | ||
5045 | if (!mddev->pers) | ||
5046 | return; | ||
5047 | if (mddev->ro) | ||
5048 | return; | ||
5049 | |||
5050 | spin_lock_irq(&mddev->write_lock); | ||
5051 | if (mddev->in_sync) { | ||
5052 | mddev->in_sync = 0; | ||
5053 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
5054 | if (mddev->safemode_delay && | ||
5055 | mddev->safemode == 0) | ||
5056 | mddev->safemode = 1; | ||
5057 | spin_unlock_irq(&mddev->write_lock); | ||
5058 | md_update_sb(mddev, 0); | ||
5059 | } else | ||
5060 | spin_unlock_irq(&mddev->write_lock); | ||
5061 | } | ||
5062 | EXPORT_SYMBOL_GPL(md_allow_write); | ||
5063 | |||
5034 | static DECLARE_WAIT_QUEUE_HEAD(resync_wait); | 5064 | static DECLARE_WAIT_QUEUE_HEAD(resync_wait); |
5035 | 5065 | ||
5036 | #define SYNC_MARKS 10 | 5066 | #define SYNC_MARKS 10 |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 164b25dca101..97ee870b265d 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1266,6 +1266,11 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) | |||
1266 | sbio->bi_sector = r1_bio->sector + | 1266 | sbio->bi_sector = r1_bio->sector + |
1267 | conf->mirrors[i].rdev->data_offset; | 1267 | conf->mirrors[i].rdev->data_offset; |
1268 | sbio->bi_bdev = conf->mirrors[i].rdev->bdev; | 1268 | sbio->bi_bdev = conf->mirrors[i].rdev->bdev; |
1269 | for (j = 0; j < vcnt ; j++) | ||
1270 | memcpy(page_address(sbio->bi_io_vec[j].bv_page), | ||
1271 | page_address(pbio->bi_io_vec[j].bv_page), | ||
1272 | PAGE_SIZE); | ||
1273 | |||
1269 | } | 1274 | } |
1270 | } | 1275 | } |
1271 | } | 1276 | } |
@@ -2099,6 +2104,8 @@ static int raid1_reshape(mddev_t *mddev) | |||
2099 | return -EINVAL; | 2104 | return -EINVAL; |
2100 | } | 2105 | } |
2101 | 2106 | ||
2107 | md_allow_write(mddev); | ||
2108 | |||
2102 | raid_disks = mddev->raid_disks + mddev->delta_disks; | 2109 | raid_disks = mddev->raid_disks + mddev->delta_disks; |
2103 | 2110 | ||
2104 | if (raid_disks < conf->raid_disks) { | 2111 | if (raid_disks < conf->raid_disks) { |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index be008f034ada..467c16982d02 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -405,6 +405,8 @@ static int resize_stripes(raid5_conf_t *conf, int newsize) | |||
405 | if (newsize <= conf->pool_size) | 405 | if (newsize <= conf->pool_size) |
406 | return 0; /* never bother to shrink */ | 406 | return 0; /* never bother to shrink */ |
407 | 407 | ||
408 | md_allow_write(conf->mddev); | ||
409 | |||
408 | /* Step 1 */ | 410 | /* Step 1 */ |
409 | sc = kmem_cache_create(conf->cache_name[1-conf->active_name], | 411 | sc = kmem_cache_create(conf->cache_name[1-conf->active_name], |
410 | sizeof(struct stripe_head)+(newsize-1)*sizeof(struct r5dev), | 412 | sizeof(struct stripe_head)+(newsize-1)*sizeof(struct r5dev), |
@@ -2678,7 +2680,7 @@ static int chunk_aligned_read(request_queue_t *q, struct bio * raid_bio) | |||
2678 | mdk_rdev_t *rdev; | 2680 | mdk_rdev_t *rdev; |
2679 | 2681 | ||
2680 | if (!in_chunk_boundary(mddev, raid_bio)) { | 2682 | if (!in_chunk_boundary(mddev, raid_bio)) { |
2681 | printk("chunk_aligned_read : non aligned\n"); | 2683 | PRINTK("chunk_aligned_read : non aligned\n"); |
2682 | return 0; | 2684 | return 0; |
2683 | } | 2685 | } |
2684 | /* | 2686 | /* |
@@ -3250,6 +3252,7 @@ raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len) | |||
3250 | else | 3252 | else |
3251 | break; | 3253 | break; |
3252 | } | 3254 | } |
3255 | md_allow_write(mddev); | ||
3253 | while (new > conf->max_nr_stripes) { | 3256 | while (new > conf->max_nr_stripes) { |
3254 | if (grow_one_stripe(conf)) | 3257 | if (grow_one_stripe(conf)) |
3255 | conf->max_nr_stripes++; | 3258 | conf->max_nr_stripes++; |
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index 3482e0114d43..2bd84d351a18 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
39 | #include <linux/moduleparam.h> | 39 | #include <linux/moduleparam.h> |
40 | #include <linux/errno.h> | 40 | #include <linux/errno.h> |
41 | #include <linux/freezer.h> | ||
41 | #include <linux/kernel.h> | 42 | #include <linux/kernel.h> |
42 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
43 | #include <linux/mm.h> | 44 | #include <linux/mm.h> |
@@ -961,6 +962,7 @@ int cx88_audio_thread(void *data) | |||
961 | msleep_interruptible(1000); | 962 | msleep_interruptible(1000); |
962 | if (kthread_should_stop()) | 963 | if (kthread_should_stop()) |
963 | break; | 964 | break; |
965 | try_to_freeze(); | ||
964 | 966 | ||
965 | /* just monitor the audio status for now ... */ | 967 | /* just monitor the audio status for now ... */ |
966 | memset(&t, 0, sizeof(t)); | 968 | memset(&t, 0, sizeof(t)); |
diff --git a/drivers/media/video/ks0127.c b/drivers/media/video/ks0127.c index c1a377f797d9..b6cd21e6dab9 100644 --- a/drivers/media/video/ks0127.c +++ b/drivers/media/video/ks0127.c | |||
@@ -712,13 +712,13 @@ static int ks0127_command(struct i2c_client *client, | |||
712 | *iarg = 0; | 712 | *iarg = 0; |
713 | status = ks0127_read(ks, KS_STAT); | 713 | status = ks0127_read(ks, KS_STAT); |
714 | if (!(status & 0x20)) /* NOVID not set */ | 714 | if (!(status & 0x20)) /* NOVID not set */ |
715 | *iarg = (*iarg & DECODER_STATUS_GOOD); | 715 | *iarg = (*iarg | DECODER_STATUS_GOOD); |
716 | if ((status & 0x01)) /* CLOCK set */ | 716 | if ((status & 0x01)) /* CLOCK set */ |
717 | *iarg = (*iarg & DECODER_STATUS_COLOR); | 717 | *iarg = (*iarg | DECODER_STATUS_COLOR); |
718 | if ((status & 0x08)) /* PALDET set */ | 718 | if ((status & 0x08)) /* PALDET set */ |
719 | *iarg = (*iarg & DECODER_STATUS_PAL); | 719 | *iarg = (*iarg | DECODER_STATUS_PAL); |
720 | else | 720 | else |
721 | *iarg = (*iarg & DECODER_STATUS_NTSC); | 721 | *iarg = (*iarg | DECODER_STATUS_NTSC); |
722 | break; | 722 | break; |
723 | 723 | ||
724 | //Catch any unknown command | 724 | //Catch any unknown command |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 4dead84aff46..ae984bbe36b6 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -2570,6 +2570,7 @@ struct saa7134_board saa7134_boards[] = { | |||
2570 | .radio_type = UNSET, | 2570 | .radio_type = UNSET, |
2571 | .tuner_addr = ADDR_UNSET, | 2571 | .tuner_addr = ADDR_UNSET, |
2572 | .radio_addr = ADDR_UNSET, | 2572 | .radio_addr = ADDR_UNSET, |
2573 | .gpiomask = 1 << 21, | ||
2573 | .inputs = {{ | 2574 | .inputs = {{ |
2574 | .name = name_tv, | 2575 | .name = name_tv, |
2575 | .vmux = 1, | 2576 | .vmux = 1, |
@@ -2578,15 +2579,20 @@ struct saa7134_board saa7134_boards[] = { | |||
2578 | },{ | 2579 | },{ |
2579 | .name = name_comp1, | 2580 | .name = name_comp1, |
2580 | .vmux = 3, | 2581 | .vmux = 3, |
2581 | .amux = LINE1, | 2582 | .amux = LINE2, /* unconfirmed, taken from Philips driver */ |
2583 | },{ | ||
2584 | .name = name_comp2, | ||
2585 | .vmux = 0, /* untested, Composite over S-Video */ | ||
2586 | .amux = LINE2, | ||
2582 | },{ | 2587 | },{ |
2583 | .name = name_svideo, | 2588 | .name = name_svideo, |
2584 | .vmux = 0, | 2589 | .vmux = 8, |
2585 | .amux = LINE1, | 2590 | .amux = LINE2, |
2586 | }}, | 2591 | }}, |
2587 | .radio = { | 2592 | .radio = { |
2588 | .name = name_radio, | 2593 | .name = name_radio, |
2589 | .amux = LINE1, | 2594 | .amux = TV, |
2595 | .gpio = 0x0200000, | ||
2590 | }, | 2596 | }, |
2591 | }, | 2597 | }, |
2592 | [SAA7134_BOARD_CINERGY250PCI] = { | 2598 | [SAA7134_BOARD_CINERGY250PCI] = { |
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 2624e3f7dd29..4e7c1fa668d3 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -184,7 +184,7 @@ hauppauge_tuner[] = | |||
184 | { TUNER_ABSENT, "Thompson DTT757"}, | 184 | { TUNER_ABSENT, "Thompson DTT757"}, |
185 | /* 80-89 */ | 185 | /* 80-89 */ |
186 | { TUNER_ABSENT, "Philips FQ1216LME MK3"}, | 186 | { TUNER_ABSENT, "Philips FQ1216LME MK3"}, |
187 | { TUNER_ABSENT, "LG TAPC G701D"}, | 187 | { TUNER_LG_PAL_NEW_TAPC, "LG TAPC G701D"}, |
188 | { TUNER_LG_NTSC_NEW_TAPC, "LG TAPC H791F"}, | 188 | { TUNER_LG_NTSC_NEW_TAPC, "LG TAPC H791F"}, |
189 | { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MB 3"}, | 189 | { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MB 3"}, |
190 | { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"}, | 190 | { TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"}, |
diff --git a/drivers/media/video/usbvideo/quickcam_messenger.h b/drivers/media/video/usbvideo/quickcam_messenger.h index baab9c081b52..17ace394d981 100644 --- a/drivers/media/video/usbvideo/quickcam_messenger.h +++ b/drivers/media/video/usbvideo/quickcam_messenger.h | |||
@@ -35,27 +35,13 @@ struct rgb { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct bayL0 { | 37 | struct bayL0 { |
38 | #ifdef __BIG_ENDIAN | ||
39 | u8 r; | ||
40 | u8 g; | ||
41 | #elif __LITTLE_ENDIAN | ||
42 | u8 g; | 38 | u8 g; |
43 | u8 r; | 39 | u8 r; |
44 | #else | ||
45 | #error not byte order defined | ||
46 | #endif | ||
47 | }; | 40 | }; |
48 | 41 | ||
49 | struct bayL1 { | 42 | struct bayL1 { |
50 | #ifdef __BIG_ENDIAN | ||
51 | u8 g; | ||
52 | u8 b; | ||
53 | #elif __LITTLE_ENDIAN | ||
54 | u8 b; | 43 | u8 b; |
55 | u8 g; | 44 | u8 g; |
56 | #else | ||
57 | #error not byte order defined | ||
58 | #endif | ||
59 | }; | 45 | }; |
60 | 46 | ||
61 | struct cam_size { | 47 | struct cam_size { |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 8c7eba2a728e..7243337b771a 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -1080,7 +1080,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, | |||
1080 | int noblock = file->f_flags & O_NONBLOCK; | 1080 | int noblock = file->f_flags & O_NONBLOCK; |
1081 | unsigned long lock_flags; | 1081 | unsigned long lock_flags; |
1082 | 1082 | ||
1083 | int frmx = -1; | ||
1084 | int ret,i; | 1083 | int ret,i; |
1085 | struct usbvision_frame *frame; | 1084 | struct usbvision_frame *frame; |
1086 | 1085 | ||
@@ -1155,7 +1154,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, | |||
1155 | frame->bytes_read = 0; | 1154 | frame->bytes_read = 0; |
1156 | 1155 | ||
1157 | /* Mark it as available to be used again. */ | 1156 | /* Mark it as available to be used again. */ |
1158 | usbvision->frame[frmx].grabstate = FrameState_Unused; | 1157 | frame->grabstate = FrameState_Unused; |
1159 | /* } */ | 1158 | /* } */ |
1160 | 1159 | ||
1161 | return count; | 1160 | return count; |
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 752c82c37f55..b87d571e0463 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -90,8 +90,15 @@ MODULE_LICENSE("GPL"); | |||
90 | char *v4l2_norm_to_name(v4l2_std_id id) | 90 | char *v4l2_norm_to_name(v4l2_std_id id) |
91 | { | 91 | { |
92 | char *name; | 92 | char *name; |
93 | u32 myid = id; | ||
93 | 94 | ||
94 | switch (id) { | 95 | /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle |
96 | 64 bit comparations. So, on that architecture, with some gcc variants, | ||
97 | compilation fails. Currently, the max value is 30bit wide. | ||
98 | */ | ||
99 | BUG_ON(myid != id); | ||
100 | |||
101 | switch (myid) { | ||
95 | case V4L2_STD_PAL: | 102 | case V4L2_STD_PAL: |
96 | name="PAL"; break; | 103 | name="PAL"; break; |
97 | case V4L2_STD_PAL_BG: | 104 | case V4L2_STD_PAL_BG: |
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c index f429f49901b9..6504a5866849 100644 --- a/drivers/media/video/video-buf.c +++ b/drivers/media/video/video-buf.c | |||
@@ -700,6 +700,7 @@ videobuf_qbuf(struct videobuf_queue *q, | |||
700 | goto done; | 700 | goto done; |
701 | } | 701 | } |
702 | if (buf->state == STATE_QUEUED || | 702 | if (buf->state == STATE_QUEUED || |
703 | buf->state == STATE_PREPARED || | ||
703 | buf->state == STATE_ACTIVE) { | 704 | buf->state == STATE_ACTIVE) { |
704 | dprintk(1,"qbuf: buffer is already queued or active.\n"); | 705 | dprintk(1,"qbuf: buffer is already queued or active.\n"); |
705 | goto done; | 706 | goto done; |
@@ -1229,7 +1230,7 @@ videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr, | |||
1229 | vaddr,vma->vm_start,vma->vm_end); | 1230 | vaddr,vma->vm_start,vma->vm_end); |
1230 | if (vaddr > vma->vm_end) | 1231 | if (vaddr > vma->vm_end) |
1231 | return NOPAGE_SIGBUS; | 1232 | return NOPAGE_SIGBUS; |
1232 | page = alloc_page(GFP_USER); | 1233 | page = alloc_page(GFP_USER | __GFP_DMA32); |
1233 | if (!page) | 1234 | if (!page) |
1234 | return NOPAGE_OOM; | 1235 | return NOPAGE_OOM; |
1235 | clear_user_page(page_address(page), vaddr, page); | 1236 | clear_user_page(page_address(page), vaddr, page); |
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index bacb311b4f24..d4cf55666731 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -270,10 +270,15 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax, | |||
270 | char *p,*s,*basep; | 270 | char *p,*s,*basep; |
271 | struct page *pg; | 271 | struct page *pg; |
272 | u8 chr,r,g,b,color; | 272 | u8 chr,r,g,b,color; |
273 | unsigned long flags; | ||
274 | spinlock_t spinlock; | ||
275 | |||
276 | spin_lock_init(&spinlock); | ||
273 | 277 | ||
274 | /* Get first addr pointed to pixel position */ | 278 | /* Get first addr pointed to pixel position */ |
275 | oldpg=get_addr_pos(pos,pages,to_addr); | 279 | oldpg=get_addr_pos(pos,pages,to_addr); |
276 | pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT); | 280 | pg=pfn_to_page(sg_dma_address(to_addr[oldpg].sg) >> PAGE_SHIFT); |
281 | spin_lock_irqsave(&spinlock,flags); | ||
277 | basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset; | 282 | basep = kmap_atomic(pg, KM_BOUNCE_READ)+to_addr[oldpg].sg->offset; |
278 | 283 | ||
279 | /* We will just duplicate the second pixel at the packet */ | 284 | /* We will just duplicate the second pixel at the packet */ |
@@ -376,6 +381,8 @@ static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax, | |||
376 | 381 | ||
377 | end: | 382 | end: |
378 | kunmap_atomic(basep, KM_BOUNCE_READ); | 383 | kunmap_atomic(basep, KM_BOUNCE_READ); |
384 | spin_unlock_irqrestore(&spinlock,flags); | ||
385 | |||
379 | } | 386 | } |
380 | static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf) | 387 | static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf) |
381 | { | 388 | { |
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 6e068cf1049b..b3f28a03b6a9 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * For use with LSI Logic PCI chip/adapter(s) | 5 | * For use with LSI Logic PCI chip/adapter(s) |
6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
7 | * | 7 | * |
8 | * Copyright (c) 1999-2005 LSI Logic Corporation | 8 | * Copyright (c) 1999-2007 LSI Logic Corporation |
9 | * (mailto:mpt_linux_developer@lsil.com) | 9 | * (mailto:mpt_linux_developer@lsil.com) |
10 | * | 10 | * |
11 | */ | 11 | */ |
@@ -73,6 +73,7 @@ | |||
73 | MODULE_AUTHOR(MODULEAUTHOR); | 73 | MODULE_AUTHOR(MODULEAUTHOR); |
74 | MODULE_DESCRIPTION(my_NAME); | 74 | MODULE_DESCRIPTION(my_NAME); |
75 | MODULE_LICENSE("GPL"); | 75 | MODULE_LICENSE("GPL"); |
76 | MODULE_VERSION(my_VERSION); | ||
76 | 77 | ||
77 | /* | 78 | /* |
78 | * cmd line parameters | 79 | * cmd line parameters |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index a4afad4ecab2..e316708f76bd 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * LSIFC9xx/LSI409xx Fibre Channel | 5 | * LSIFC9xx/LSI409xx Fibre Channel |
6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
7 | * | 7 | * |
8 | * Copyright (c) 1999-2005 LSI Logic Corporation | 8 | * Copyright (c) 1999-2007 LSI Logic Corporation |
9 | * (mailto:mpt_linux_developer@lsil.com) | 9 | * (mailto:mpt_linux_developer@lsil.com) |
10 | * | 10 | * |
11 | */ | 11 | */ |
@@ -72,11 +72,11 @@ | |||
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | #ifndef COPYRIGHT | 74 | #ifndef COPYRIGHT |
75 | #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR | 75 | #define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR |
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #define MPT_LINUX_VERSION_COMMON "3.04.02" | 78 | #define MPT_LINUX_VERSION_COMMON "3.04.03" |
79 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.02" | 79 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.03" |
80 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" | 80 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" |
81 | 81 | ||
82 | #define show_mptmod_ver(s,ver) \ | 82 | #define show_mptmod_ver(s,ver) \ |
@@ -1059,7 +1059,7 @@ extern int mpt_stm_index; /* needed by mptstm.c */ | |||
1059 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1059 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1060 | #endif /* } __KERNEL__ */ | 1060 | #endif /* } __KERNEL__ */ |
1061 | 1061 | ||
1062 | #if defined(__alpha__) || defined(__sparc_v9__) || defined(__ia64__) || defined(__x86_64__) | 1062 | #if defined(__alpha__) || defined(__sparc_v9__) || defined(__ia64__) || defined(__x86_64__) || defined(__powerpc__) |
1063 | #define CAST_U32_TO_PTR(x) ((void *)(u64)x) | 1063 | #define CAST_U32_TO_PTR(x) ((void *)(u64)x) |
1064 | #define CAST_PTR_TO_U32(x) ((u32)(u64)x) | 1064 | #define CAST_PTR_TO_U32(x) ((u32)(u64)x) |
1065 | #else | 1065 | #else |
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index 30975ccd9947..504632da4347 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * For use with LSI Logic PCI chip/adapters | 4 | * For use with LSI Logic PCI chip/adapters |
5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
6 | * | 6 | * |
7 | * Copyright (c) 1999-2005 LSI Logic Corporation | 7 | * Copyright (c) 1999-2007 LSI Logic Corporation |
8 | * (mailto:mpt_linux_developer@lsil.com) | 8 | * (mailto:mpt_linux_developer@lsil.com) |
9 | * | 9 | * |
10 | */ | 10 | */ |
@@ -66,7 +66,7 @@ | |||
66 | #include <scsi/scsi_host.h> | 66 | #include <scsi/scsi_host.h> |
67 | #include <scsi/scsi_tcq.h> | 67 | #include <scsi/scsi_tcq.h> |
68 | 68 | ||
69 | #define COPYRIGHT "Copyright (c) 1999-2005 LSI Logic Corporation" | 69 | #define COPYRIGHT "Copyright (c) 1999-2007 LSI Logic Corporation" |
70 | #define MODULEAUTHOR "LSI Logic Corporation" | 70 | #define MODULEAUTHOR "LSI Logic Corporation" |
71 | #include "mptbase.h" | 71 | #include "mptbase.h" |
72 | #include "mptctl.h" | 72 | #include "mptctl.h" |
@@ -79,6 +79,7 @@ | |||
79 | MODULE_AUTHOR(MODULEAUTHOR); | 79 | MODULE_AUTHOR(MODULEAUTHOR); |
80 | MODULE_DESCRIPTION(my_NAME); | 80 | MODULE_DESCRIPTION(my_NAME); |
81 | MODULE_LICENSE("GPL"); | 81 | MODULE_LICENSE("GPL"); |
82 | MODULE_VERSION(my_VERSION); | ||
82 | 83 | ||
83 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 84 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
84 | 85 | ||
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h index 043941882c6e..e65a1cf5eb0b 100644 --- a/drivers/message/fusion/mptctl.h +++ b/drivers/message/fusion/mptctl.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * LSIFC9xx/LSI409xx Fibre Channel | 5 | * LSIFC9xx/LSI409xx Fibre Channel |
6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
7 | * | 7 | * |
8 | * Copyright (c) 1999-2005 LSI Logic Corporation | 8 | * Copyright (c) 1999-2007 LSI Logic Corporation |
9 | * (mailto:mpt_linux_developer@lsil.com) | 9 | * (mailto:mpt_linux_developer@lsil.com) |
10 | * | 10 | * |
11 | */ | 11 | */ |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index ca2f9107f145..c819c23b55b1 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * For use with LSI Logic PCI chip/adapter(s) | 3 | * For use with LSI Logic PCI chip/adapter(s) |
4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
5 | * | 5 | * |
6 | * Copyright (c) 1999-2005 LSI Logic Corporation | 6 | * Copyright (c) 1999-2007 LSI Logic Corporation |
7 | * (mailto:mpt_linux_developer@lsil.com) | 7 | * (mailto:mpt_linux_developer@lsil.com) |
8 | * | 8 | * |
9 | */ | 9 | */ |
@@ -75,6 +75,7 @@ | |||
75 | MODULE_AUTHOR(MODULEAUTHOR); | 75 | MODULE_AUTHOR(MODULEAUTHOR); |
76 | MODULE_DESCRIPTION(my_NAME); | 76 | MODULE_DESCRIPTION(my_NAME); |
77 | MODULE_LICENSE("GPL"); | 77 | MODULE_LICENSE("GPL"); |
78 | MODULE_VERSION(my_VERSION); | ||
78 | 79 | ||
79 | /* Command line args */ | 80 | /* Command line args */ |
80 | #define MPTFC_DEV_LOSS_TMO (60) | 81 | #define MPTFC_DEV_LOSS_TMO (60) |
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index b7c4407c5e3f..2936204d8ad6 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * For use with LSI Logic Fibre Channel PCI chip/adapters | 4 | * For use with LSI Logic Fibre Channel PCI chip/adapters |
5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2005 LSI Logic Corporation | 7 | * Copyright (c) 2000-2007 LSI Logic Corporation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -56,9 +56,11 @@ | |||
56 | #include <linux/module.h> | 56 | #include <linux/module.h> |
57 | #include <linux/fs.h> | 57 | #include <linux/fs.h> |
58 | 58 | ||
59 | #define my_VERSION MPT_LINUX_VERSION_COMMON | ||
59 | #define MYNAM "mptlan" | 60 | #define MYNAM "mptlan" |
60 | 61 | ||
61 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
63 | MODULE_VERSION(my_VERSION); | ||
62 | 64 | ||
63 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 65 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
64 | /* | 66 | /* |
diff --git a/drivers/message/fusion/mptlan.h b/drivers/message/fusion/mptlan.h index 3726ecba5707..70ab75e7c263 100644 --- a/drivers/message/fusion/mptlan.h +++ b/drivers/message/fusion/mptlan.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * For use with LSI Logic Fibre Channel PCI chip/adapters | 4 | * For use with LSI Logic Fibre Channel PCI chip/adapters |
5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 5 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
6 | * | 6 | * |
7 | * Copyright (c) 2000-2005 LSI Logic Corporation | 7 | * Copyright (c) 2000-2007 LSI Logic Corporation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 4f0c530e47b0..09e9a9d96410 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -3,9 +3,9 @@ | |||
3 | * For use with LSI Logic PCI chip/adapter(s) | 3 | * For use with LSI Logic PCI chip/adapter(s) |
4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
5 | * | 5 | * |
6 | * Copyright (c) 1999-2005 LSI Logic Corporation | 6 | * Copyright (c) 1999-2007 LSI Logic Corporation |
7 | * (mailto:mpt_linux_developer@lsil.com) | 7 | * (mailto:mpt_linux_developer@lsil.com) |
8 | * Copyright (c) 2005-2006 Dell | 8 | * Copyright (c) 2005-2007 Dell |
9 | */ | 9 | */ |
10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 10 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
11 | /* | 11 | /* |
@@ -75,6 +75,7 @@ | |||
75 | MODULE_AUTHOR(MODULEAUTHOR); | 75 | MODULE_AUTHOR(MODULEAUTHOR); |
76 | MODULE_DESCRIPTION(my_NAME); | 76 | MODULE_DESCRIPTION(my_NAME); |
77 | MODULE_LICENSE("GPL"); | 77 | MODULE_LICENSE("GPL"); |
78 | MODULE_VERSION(my_VERSION); | ||
78 | 79 | ||
79 | static int mpt_pt_clear; | 80 | static int mpt_pt_clear; |
80 | module_param(mpt_pt_clear, int, 0); | 81 | module_param(mpt_pt_clear, int, 0); |
@@ -245,7 +246,8 @@ static void mptsas_print_device_pg0(SasDevicePage0_t *pg0) | |||
245 | printk("Parent Handle=0x%X\n" ,le16_to_cpu(pg0->ParentDevHandle)); | 246 | printk("Parent Handle=0x%X\n" ,le16_to_cpu(pg0->ParentDevHandle)); |
246 | printk("Enclosure Handle=0x%X\n", le16_to_cpu(pg0->EnclosureHandle)); | 247 | printk("Enclosure Handle=0x%X\n", le16_to_cpu(pg0->EnclosureHandle)); |
247 | printk("Slot=0x%X\n", le16_to_cpu(pg0->Slot)); | 248 | printk("Slot=0x%X\n", le16_to_cpu(pg0->Slot)); |
248 | printk("SAS Address=0x%llX\n", le64_to_cpu(sas_address)); | 249 | printk("SAS Address=0x%llX\n", (unsigned long long) |
250 | le64_to_cpu(sas_address)); | ||
249 | printk("Target ID=0x%X\n", pg0->TargetID); | 251 | printk("Target ID=0x%X\n", pg0->TargetID); |
250 | printk("Bus=0x%X\n", pg0->Bus); | 252 | printk("Bus=0x%X\n", pg0->Bus); |
251 | /* The PhyNum field specifies the PHY number of the parent | 253 | /* The PhyNum field specifies the PHY number of the parent |
@@ -349,9 +351,9 @@ mptsas_port_delete(struct mptsas_portinfo_details * port_details) | |||
349 | phy_info = port_info->phy_info; | 351 | phy_info = port_info->phy_info; |
350 | 352 | ||
351 | dsaswideprintk((KERN_DEBUG "%s: [%p]: num_phys=%02d " | 353 | dsaswideprintk((KERN_DEBUG "%s: [%p]: num_phys=%02d " |
352 | "bitmask=0x%016llX\n", | 354 | "bitmask=0x%016llX\n", __FUNCTION__, port_details, |
353 | __FUNCTION__, port_details, port_details->num_phys, | 355 | port_details->num_phys, (unsigned long long) |
354 | port_details->phy_bitmask)); | 356 | port_details->phy_bitmask)); |
355 | 357 | ||
356 | for (i = 0; i < port_info->num_phys; i++, phy_info++) { | 358 | for (i = 0; i < port_info->num_phys; i++, phy_info++) { |
357 | if(phy_info->port_details != port_details) | 359 | if(phy_info->port_details != port_details) |
@@ -476,7 +478,7 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
476 | for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { | 478 | for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { |
477 | sas_address = phy_info->attached.sas_address; | 479 | sas_address = phy_info->attached.sas_address; |
478 | dsaswideprintk((KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n", | 480 | dsaswideprintk((KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n", |
479 | i, sas_address)); | 481 | i, (unsigned long long)sas_address)); |
480 | if (!sas_address) | 482 | if (!sas_address) |
481 | continue; | 483 | continue; |
482 | port_details = phy_info->port_details; | 484 | port_details = phy_info->port_details; |
@@ -495,8 +497,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
495 | (1 << phy_info->phy_id); | 497 | (1 << phy_info->phy_id); |
496 | phy_info->sas_port_add_phy=1; | 498 | phy_info->sas_port_add_phy=1; |
497 | dsaswideprintk((KERN_DEBUG "\t\tForming port\n\t\t" | 499 | dsaswideprintk((KERN_DEBUG "\t\tForming port\n\t\t" |
498 | "phy_id=%d sas_address=0x%018llX\n", | 500 | "phy_id=%d sas_address=0x%018llX\n", |
499 | i, sas_address)); | 501 | i, (unsigned long long)sas_address)); |
500 | phy_info->port_details = port_details; | 502 | phy_info->port_details = port_details; |
501 | } | 503 | } |
502 | 504 | ||
@@ -512,8 +514,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
512 | if (phy_info_cmp->port_details == port_details ) | 514 | if (phy_info_cmp->port_details == port_details ) |
513 | continue; | 515 | continue; |
514 | dsaswideprintk((KERN_DEBUG | 516 | dsaswideprintk((KERN_DEBUG |
515 | "\t\tphy_id=%d sas_address=0x%018llX\n", | 517 | "\t\tphy_id=%d sas_address=0x%018llX\n", |
516 | j, phy_info_cmp->attached.sas_address)); | 518 | j, (unsigned long long) |
519 | phy_info_cmp->attached.sas_address)); | ||
517 | if (phy_info_cmp->port_details) { | 520 | if (phy_info_cmp->port_details) { |
518 | port_details->rphy = | 521 | port_details->rphy = |
519 | mptsas_get_rphy(phy_info_cmp); | 522 | mptsas_get_rphy(phy_info_cmp); |
@@ -546,11 +549,10 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
546 | if (!port_details) | 549 | if (!port_details) |
547 | continue; | 550 | continue; |
548 | dsaswideprintk((KERN_DEBUG | 551 | dsaswideprintk((KERN_DEBUG |
549 | "%s: [%p]: phy_id=%02d num_phys=%02d " | 552 | "%s: [%p]: phy_id=%02d num_phys=%02d " |
550 | "bitmask=0x%016llX\n", | 553 | "bitmask=0x%016llX\n", __FUNCTION__, |
551 | __FUNCTION__, | 554 | port_details, i, port_details->num_phys, |
552 | port_details, i, port_details->num_phys, | 555 | (unsigned long long)port_details->phy_bitmask)); |
553 | port_details->phy_bitmask)); | ||
554 | dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n", | 556 | dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n", |
555 | port_details->port, port_details->rphy)); | 557 | port_details->port, port_details->rphy)); |
556 | } | 558 | } |
@@ -2079,8 +2081,10 @@ mptsas_persist_clear_table(struct work_struct *work) | |||
2079 | static void | 2081 | static void |
2080 | mptsas_reprobe_lun(struct scsi_device *sdev, void *data) | 2082 | mptsas_reprobe_lun(struct scsi_device *sdev, void *data) |
2081 | { | 2083 | { |
2084 | int rc; | ||
2085 | |||
2082 | sdev->no_uld_attach = data ? 1 : 0; | 2086 | sdev->no_uld_attach = data ? 1 : 0; |
2083 | scsi_device_reprobe(sdev); | 2087 | rc = scsi_device_reprobe(sdev); |
2084 | } | 2088 | } |
2085 | 2089 | ||
2086 | static void | 2090 | static void |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 2c72c36b8171..f0cca3ea93b2 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * For use with LSI Logic PCI chip/adapter(s) | 3 | * For use with LSI Logic PCI chip/adapter(s) |
4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
5 | * | 5 | * |
6 | * Copyright (c) 1999-2005 LSI Logic Corporation | 6 | * Copyright (c) 1999-2007 LSI Logic Corporation |
7 | * (mailto:mpt_linux_developer@lsil.com) | 7 | * (mailto:mpt_linux_developer@lsil.com) |
8 | * | 8 | * |
9 | */ | 9 | */ |
@@ -76,6 +76,7 @@ | |||
76 | MODULE_AUTHOR(MODULEAUTHOR); | 76 | MODULE_AUTHOR(MODULEAUTHOR); |
77 | MODULE_DESCRIPTION(my_NAME); | 77 | MODULE_DESCRIPTION(my_NAME); |
78 | MODULE_LICENSE("GPL"); | 78 | MODULE_LICENSE("GPL"); |
79 | MODULE_VERSION(my_VERSION); | ||
79 | 80 | ||
80 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 81 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
81 | 82 | ||
@@ -701,6 +702,17 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
701 | break; | 702 | break; |
702 | } | 703 | } |
703 | } | 704 | } |
705 | } else if (ioc->bus_type == FC) { | ||
706 | /* | ||
707 | * The FC IOC may kill a request for variety of | ||
708 | * reasons, some of which may be recovered by a | ||
709 | * retry, some which are unlikely to be | ||
710 | * recovered. Return DID_ERROR instead of | ||
711 | * DID_RESET to permit retry of the command, | ||
712 | * just not an infinite number of them | ||
713 | */ | ||
714 | sc->result = DID_ERROR << 16; | ||
715 | break; | ||
704 | } | 716 | } |
705 | 717 | ||
706 | /* | 718 | /* |
@@ -2688,7 +2700,8 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, VirtTarget *vtarget, | |||
2688 | struct scsi_device *sdev) | 2700 | struct scsi_device *sdev) |
2689 | { | 2701 | { |
2690 | dinitprintk((MYIOC_s_INFO_FMT "initTarget bus=%d id=%d lun=%d hd=%p\n", | 2702 | dinitprintk((MYIOC_s_INFO_FMT "initTarget bus=%d id=%d lun=%d hd=%p\n", |
2691 | hd->ioc->name, vtarget->bus_id, vtarget->target_id, lun, hd)); | 2703 | hd->ioc->name, vtarget->bus_id, vtarget->target_id, |
2704 | sdev->lun, hd)); | ||
2692 | 2705 | ||
2693 | /* Is LUN supported? If so, upper 2 bits will be 0 | 2706 | /* Is LUN supported? If so, upper 2 bits will be 0 |
2694 | * in first byte of inquiry data. | 2707 | * in first byte of inquiry data. |
@@ -2770,7 +2783,7 @@ mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, | |||
2770 | else { | 2783 | else { |
2771 | factor = MPT_ULTRA320; | 2784 | factor = MPT_ULTRA320; |
2772 | if (scsi_device_qas(sdev)) { | 2785 | if (scsi_device_qas(sdev)) { |
2773 | ddvtprintk((KERN_INFO "Enabling QAS due to byte56=%02x on id=%d!\n", byte56, id)); | 2786 | ddvtprintk((KERN_INFO "Enabling QAS due to byte56=%02x on id=%d!\n", scsi_device_qas(sdev), id)); |
2774 | noQas = 0; | 2787 | noQas = 0; |
2775 | } | 2788 | } |
2776 | if (sdev->type == TYPE_TAPE && | 2789 | if (sdev->type == TYPE_TAPE && |
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 14a5b6c2e2bd..187c8af0890b 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * LSIFC9xx/LSI409xx Fibre Channel | 5 | * LSIFC9xx/LSI409xx Fibre Channel |
6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 6 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
7 | * | 7 | * |
8 | * Copyright (c) 1999-2005 LSI Logic Corporation | 8 | * Copyright (c) 1999-2007 LSI Logic Corporation |
9 | * (mailto:mpt_linux_developer@lsil.com) | 9 | * (mailto:mpt_linux_developer@lsil.com) |
10 | * | 10 | * |
11 | */ | 11 | */ |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 36641da59289..203c661d2c79 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * For use with LSI Logic PCI chip/adapter(s) | 3 | * For use with LSI Logic PCI chip/adapter(s) |
4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. | 4 | * running LSI Logic Fusion MPT (Message Passing Technology) firmware. |
5 | * | 5 | * |
6 | * Copyright (c) 1999-2005 LSI Logic Corporation | 6 | * Copyright (c) 1999-2007 LSI Logic Corporation |
7 | * (mailto:mpt_linux_developer@lsil.com) | 7 | * (mailto:mpt_linux_developer@lsil.com) |
8 | * | 8 | * |
9 | */ | 9 | */ |
@@ -77,6 +77,7 @@ | |||
77 | MODULE_AUTHOR(MODULEAUTHOR); | 77 | MODULE_AUTHOR(MODULEAUTHOR); |
78 | MODULE_DESCRIPTION(my_NAME); | 78 | MODULE_DESCRIPTION(my_NAME); |
79 | MODULE_LICENSE("GPL"); | 79 | MODULE_LICENSE("GPL"); |
80 | MODULE_VERSION(my_VERSION); | ||
80 | 81 | ||
81 | /* Command line args */ | 82 | /* Command line args */ |
82 | static int mpt_saf_te = MPTSCSIH_SAF_TE; | 83 | static int mpt_saf_te = MPTSCSIH_SAF_TE; |
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index 06e7fcd19221..bfb9ff693208 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c | |||
@@ -351,9 +351,6 @@ static void imxmci_start_cmd(struct imxmci_host *host, struct mmc_command *cmd, | |||
351 | case MMC_RSP_R3: /* short */ | 351 | case MMC_RSP_R3: /* short */ |
352 | cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R3; | 352 | cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R3; |
353 | break; | 353 | break; |
354 | case MMC_RSP_R6: /* short CRC */ | ||
355 | cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R6; | ||
356 | break; | ||
357 | default: | 354 | default: |
358 | break; | 355 | break; |
359 | } | 356 | } |
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 9488408308fb..d30540b27614 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c | |||
@@ -91,7 +91,6 @@ | |||
91 | 91 | ||
92 | 92 | ||
93 | #define DRIVER_NAME "mmci-omap" | 93 | #define DRIVER_NAME "mmci-omap" |
94 | #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) | ||
95 | 94 | ||
96 | /* Specifies how often in millisecs to poll for card status changes | 95 | /* Specifies how often in millisecs to poll for card status changes |
97 | * when the cover switch is open */ | 96 | * when the cover switch is open */ |
@@ -204,18 +203,22 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd) | |||
204 | cmdtype = 0; | 203 | cmdtype = 0; |
205 | 204 | ||
206 | /* Our hardware needs to know exact type */ | 205 | /* Our hardware needs to know exact type */ |
207 | switch (RSP_TYPE(mmc_resp_type(cmd))) { | 206 | switch (mmc_resp_type(cmd)) { |
208 | case RSP_TYPE(MMC_RSP_R1): | 207 | case MMC_RSP_NONE: |
209 | /* resp 1, resp 1b */ | 208 | break; |
209 | case MMC_RSP_R1: | ||
210 | case MMC_RSP_R1B: | ||
211 | /* resp 1, 1b, 6, 7 */ | ||
210 | resptype = 1; | 212 | resptype = 1; |
211 | break; | 213 | break; |
212 | case RSP_TYPE(MMC_RSP_R2): | 214 | case MMC_RSP_R2: |
213 | resptype = 2; | 215 | resptype = 2; |
214 | break; | 216 | break; |
215 | case RSP_TYPE(MMC_RSP_R3): | 217 | case MMC_RSP_R3: |
216 | resptype = 3; | 218 | resptype = 3; |
217 | break; | 219 | break; |
218 | default: | 220 | default: |
221 | dev_err(mmc_dev(host->mmc), "Invalid response type: %04x\n", mmc_resp_type(cmd)); | ||
219 | break; | 222 | break; |
220 | } | 223 | } |
221 | 224 | ||
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index 45a9283ce498..6073d998b11f 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -171,7 +171,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, | |||
171 | 171 | ||
172 | #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) | 172 | #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE)) |
173 | switch (RSP_TYPE(mmc_resp_type(cmd))) { | 173 | switch (RSP_TYPE(mmc_resp_type(cmd))) { |
174 | case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6 */ | 174 | case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6, r7 */ |
175 | cmdat |= CMDAT_RESP_SHORT; | 175 | cmdat |= CMDAT_RESP_SHORT; |
176 | break; | 176 | break; |
177 | case RSP_TYPE(MMC_RSP_R3): | 177 | case RSP_TYPE(MMC_RSP_R3): |
diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c index f18ad998b3cb..fa4a52886b97 100644 --- a/drivers/mmc/tifm_sd.c +++ b/drivers/mmc/tifm_sd.c | |||
@@ -173,9 +173,6 @@ static unsigned int tifm_sd_op_flags(struct mmc_command *cmd) | |||
173 | case MMC_RSP_R3: | 173 | case MMC_RSP_R3: |
174 | rc |= TIFM_MMCSD_RSP_R3; | 174 | rc |= TIFM_MMCSD_RSP_R3; |
175 | break; | 175 | break; |
176 | case MMC_RSP_R6: | ||
177 | rc |= TIFM_MMCSD_RSP_R6; | ||
178 | break; | ||
179 | default: | 176 | default: |
180 | BUG(); | 177 | BUG(); |
181 | } | 178 | } |
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index f457315579db..bbf0553bdb2e 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -204,7 +204,7 @@ config MTD_ESB2ROM | |||
204 | 204 | ||
205 | config MTD_CK804XROM | 205 | config MTD_CK804XROM |
206 | tristate "BIOS flash chip on Nvidia CK804" | 206 | tristate "BIOS flash chip on Nvidia CK804" |
207 | depends on X86 && MTD_JEDECPROBE | 207 | depends on X86 && MTD_JEDECPROBE && PCI |
208 | help | 208 | help |
209 | Support for treating the BIOS flash chip on nvidia motherboards | 209 | Support for treating the BIOS flash chip on nvidia motherboards |
210 | as an MTD device - with this you can reprogram your BIOS. | 210 | as an MTD device - with this you can reprogram your BIOS. |
diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c index 238d42e88ec5..68ed02ecb2ec 100644 --- a/drivers/mtd/maps/ck804xrom.c +++ b/drivers/mtd/maps/ck804xrom.c | |||
@@ -327,7 +327,7 @@ static int __init init_ck804xrom(void) | |||
327 | pdev = NULL; | 327 | pdev = NULL; |
328 | 328 | ||
329 | for(id = ck804xrom_pci_tbl; id->vendor; id++) { | 329 | for(id = ck804xrom_pci_tbl; id->vendor; id++) { |
330 | pdev = pci_find_device(id->vendor, id->device, NULL); | 330 | pdev = pci_get_device(id->vendor, id->device, NULL); |
331 | if (pdev) | 331 | if (pdev) |
332 | break; | 332 | break; |
333 | } | 333 | } |
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 358f55a82dbe..9326a56f0fbc 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -223,7 +223,7 @@ config MTD_NAND_SHARPSL | |||
223 | 223 | ||
224 | config MTD_NAND_CAFE | 224 | config MTD_NAND_CAFE |
225 | tristate "NAND support for OLPC CAFÉ chip" | 225 | tristate "NAND support for OLPC CAFÉ chip" |
226 | depends on PCI | 226 | depends on MTD_NAND && PCI |
227 | help | 227 | help |
228 | Use NAND flash attached to the CAFÉ chip designed for the $100 | 228 | Use NAND flash attached to the CAFÉ chip designed for the $100 |
229 | laptop. | 229 | laptop. |
diff --git a/drivers/mtd/nand/cafe.c b/drivers/mtd/nand/cafe.c index b8d9b64cccc0..1e877cbe7757 100644 --- a/drivers/mtd/nand/cafe.c +++ b/drivers/mtd/nand/cafe.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/dma-mapping.h> | ||
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
18 | 19 | ||
19 | #define CAFE_NAND_CTRL1 0x00 | 20 | #define CAFE_NAND_CTRL1 0x00 |
@@ -77,8 +78,9 @@ module_param(regdebug, int, 0644); | |||
77 | static int checkecc = 1; | 78 | static int checkecc = 1; |
78 | module_param(checkecc, int, 0644); | 79 | module_param(checkecc, int, 0644); |
79 | 80 | ||
80 | static int slowtiming = 0; | 81 | static int numtimings; |
81 | module_param(slowtiming, int, 0644); | 82 | static int timing[3]; |
83 | module_param_array(timing, int, &numtimings, 0644); | ||
82 | 84 | ||
83 | /* Hrm. Why isn't this already conditional on something in the struct device? */ | 85 | /* Hrm. Why isn't this already conditional on something in the struct device? */ |
84 | #define cafe_dev_dbg(dev, args...) do { if (debug) dev_dbg(dev, ##args); } while(0) | 86 | #define cafe_dev_dbg(dev, args...) do { if (debug) dev_dbg(dev, ##args); } while(0) |
@@ -528,6 +530,7 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, | |||
528 | { | 530 | { |
529 | struct mtd_info *mtd; | 531 | struct mtd_info *mtd; |
530 | struct cafe_priv *cafe; | 532 | struct cafe_priv *cafe; |
533 | uint32_t timing1, timing2, timing3; | ||
531 | uint32_t ctrl; | 534 | uint32_t ctrl; |
532 | int err = 0; | 535 | int err = 0; |
533 | 536 | ||
@@ -579,30 +582,44 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, | |||
579 | cafe->nand.block_bad = cafe_nand_block_bad; | 582 | cafe->nand.block_bad = cafe_nand_block_bad; |
580 | } | 583 | } |
581 | 584 | ||
585 | if (numtimings && numtimings != 3) { | ||
586 | dev_warn(&cafe->pdev->dev, "%d timing register values ignored; precisely three are required\n", numtimings); | ||
587 | } | ||
588 | |||
589 | if (numtimings == 3) { | ||
590 | timing1 = timing[0]; | ||
591 | timing2 = timing[1]; | ||
592 | timing3 = timing[2]; | ||
593 | cafe_dev_dbg(&cafe->pdev->dev, "Using provided timings (%08x %08x %08x)\n", | ||
594 | timing1, timing2, timing3); | ||
595 | } else { | ||
596 | timing1 = cafe_readl(cafe, NAND_TIMING1); | ||
597 | timing2 = cafe_readl(cafe, NAND_TIMING2); | ||
598 | timing3 = cafe_readl(cafe, NAND_TIMING3); | ||
599 | |||
600 | if (timing1 | timing2 | timing3) { | ||
601 | cafe_dev_dbg(&cafe->pdev->dev, "Timing registers already set (%08x %08x %08x)\n", timing1, timing2, timing3); | ||
602 | } else { | ||
603 | dev_warn(&cafe->pdev->dev, "Timing registers unset; using most conservative defaults\n"); | ||
604 | timing1 = timing2 = timing3 = 0xffffffff; | ||
605 | } | ||
606 | } | ||
607 | |||
582 | /* Start off by resetting the NAND controller completely */ | 608 | /* Start off by resetting the NAND controller completely */ |
583 | cafe_writel(cafe, 1, NAND_RESET); | 609 | cafe_writel(cafe, 1, NAND_RESET); |
584 | cafe_writel(cafe, 0, NAND_RESET); | 610 | cafe_writel(cafe, 0, NAND_RESET); |
585 | 611 | ||
586 | cafe_writel(cafe, 0xffffffff, NAND_IRQ_MASK); | 612 | cafe_writel(cafe, timing1, NAND_TIMING1); |
613 | cafe_writel(cafe, timing2, NAND_TIMING2); | ||
614 | cafe_writel(cafe, timing3, NAND_TIMING3); | ||
587 | 615 | ||
588 | /* Timings from Marvell's test code (not verified or calculated by us) */ | ||
589 | if (!slowtiming) { | ||
590 | cafe_writel(cafe, 0x01010a0a, NAND_TIMING1); | ||
591 | cafe_writel(cafe, 0x24121212, NAND_TIMING2); | ||
592 | cafe_writel(cafe, 0x11000000, NAND_TIMING3); | ||
593 | } else { | ||
594 | cafe_writel(cafe, 0xffffffff, NAND_TIMING1); | ||
595 | cafe_writel(cafe, 0xffffffff, NAND_TIMING2); | ||
596 | cafe_writel(cafe, 0xffffffff, NAND_TIMING3); | ||
597 | } | ||
598 | cafe_writel(cafe, 0xffffffff, NAND_IRQ_MASK); | 616 | cafe_writel(cafe, 0xffffffff, NAND_IRQ_MASK); |
599 | err = request_irq(pdev->irq, &cafe_nand_interrupt, SA_SHIRQ, "CAFE NAND", mtd); | 617 | err = request_irq(pdev->irq, &cafe_nand_interrupt, SA_SHIRQ, "CAFE NAND", mtd); |
600 | if (err) { | 618 | if (err) { |
601 | dev_warn(&pdev->dev, "Could not register IRQ %d\n", pdev->irq); | 619 | dev_warn(&pdev->dev, "Could not register IRQ %d\n", pdev->irq); |
602 | |||
603 | goto out_free_dma; | 620 | goto out_free_dma; |
604 | } | 621 | } |
605 | #if 1 | 622 | |
606 | /* Disable master reset, enable NAND clock */ | 623 | /* Disable master reset, enable NAND clock */ |
607 | ctrl = cafe_readl(cafe, GLOBAL_CTRL); | 624 | ctrl = cafe_readl(cafe, GLOBAL_CTRL); |
608 | ctrl &= 0xffffeff0; | 625 | ctrl &= 0xffffeff0; |
@@ -629,32 +646,8 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev, | |||
629 | cafe_writel(cafe, 0x80000007, GLOBAL_IRQ_MASK); | 646 | cafe_writel(cafe, 0x80000007, GLOBAL_IRQ_MASK); |
630 | cafe_dev_dbg(&cafe->pdev->dev, "Control %x, IRQ mask %x\n", | 647 | cafe_dev_dbg(&cafe->pdev->dev, "Control %x, IRQ mask %x\n", |
631 | cafe_readl(cafe, GLOBAL_CTRL), cafe_readl(cafe, GLOBAL_IRQ_MASK)); | 648 | cafe_readl(cafe, GLOBAL_CTRL), cafe_readl(cafe, GLOBAL_IRQ_MASK)); |
632 | #endif | 649 | |
633 | #if 1 | 650 | /* Scan to find existence of the device */ |
634 | mtd->writesize=2048; | ||
635 | mtd->oobsize = 0x40; | ||
636 | memset(cafe->dmabuf, 0x5a, 2112); | ||
637 | cafe->nand.cmdfunc(mtd, NAND_CMD_READID, 0, -1); | ||
638 | cafe->nand.read_byte(mtd); | ||
639 | cafe->nand.read_byte(mtd); | ||
640 | cafe->nand.read_byte(mtd); | ||
641 | cafe->nand.read_byte(mtd); | ||
642 | cafe->nand.read_byte(mtd); | ||
643 | #endif | ||
644 | #if 0 | ||
645 | cafe->nand.cmdfunc(mtd, NAND_CMD_READ0, 0, 0); | ||
646 | // nand_wait_ready(mtd); | ||
647 | cafe->nand.read_byte(mtd); | ||
648 | cafe->nand.read_byte(mtd); | ||
649 | cafe->nand.read_byte(mtd); | ||
650 | cafe->nand.read_byte(mtd); | ||
651 | #endif | ||
652 | #if 0 | ||
653 | writel(0x84600070, cafe->mmio); | ||
654 | udelay(10); | ||
655 | cafe_dev_dbg(&cafe->pdev->dev, "Status %x\n", cafe_readl(cafe, NAND_NONMEM)); | ||
656 | #endif | ||
657 | /* Scan to find existance of the device */ | ||
658 | if (nand_scan_ident(mtd, 1)) { | 651 | if (nand_scan_ident(mtd, 1)) { |
659 | err = -ENXIO; | 652 | err = -ENXIO; |
660 | goto out_irq; | 653 | goto out_irq; |
@@ -758,13 +751,4 @@ module_exit(cafe_nand_exit); | |||
758 | 751 | ||
759 | MODULE_LICENSE("GPL"); | 752 | MODULE_LICENSE("GPL"); |
760 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | 753 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); |
761 | MODULE_DESCRIPTION("NAND flash driver for OLPC CAFE chip"); | 754 | MODULE_DESCRIPTION("NAND flash driver for OLPC CAFÉ chip"); |
762 | |||
763 | /* Correct ECC for 2048 bytes of 0xff: | ||
764 | 41 a0 71 65 54 27 f3 93 ec a9 be ed 0b a1 */ | ||
765 | |||
766 | /* dwmw2's B-test board, in case of completely screwing it: | ||
767 | Bad eraseblock 2394 at 0x12b40000 | ||
768 | Bad eraseblock 2627 at 0x14860000 | ||
769 | Bad eraseblock 3349 at 0x1a2a0000 | ||
770 | */ | ||
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index e2cb19b582a1..6f93a765e564 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -765,17 +765,18 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
765 | struct cp_private *cp = netdev_priv(dev); | 765 | struct cp_private *cp = netdev_priv(dev); |
766 | unsigned entry; | 766 | unsigned entry; |
767 | u32 eor, flags; | 767 | u32 eor, flags; |
768 | unsigned long intr_flags; | ||
768 | #if CP_VLAN_TAG_USED | 769 | #if CP_VLAN_TAG_USED |
769 | u32 vlan_tag = 0; | 770 | u32 vlan_tag = 0; |
770 | #endif | 771 | #endif |
771 | int mss = 0; | 772 | int mss = 0; |
772 | 773 | ||
773 | spin_lock_irq(&cp->lock); | 774 | spin_lock_irqsave(&cp->lock, intr_flags); |
774 | 775 | ||
775 | /* This is a hard error, log it. */ | 776 | /* This is a hard error, log it. */ |
776 | if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { | 777 | if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { |
777 | netif_stop_queue(dev); | 778 | netif_stop_queue(dev); |
778 | spin_unlock_irq(&cp->lock); | 779 | spin_unlock_irqrestore(&cp->lock, intr_flags); |
779 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", | 780 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", |
780 | dev->name); | 781 | dev->name); |
781 | return 1; | 782 | return 1; |
@@ -908,7 +909,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
908 | if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) | 909 | if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) |
909 | netif_stop_queue(dev); | 910 | netif_stop_queue(dev); |
910 | 911 | ||
911 | spin_unlock_irq(&cp->lock); | 912 | spin_unlock_irqrestore(&cp->lock, intr_flags); |
912 | 913 | ||
913 | cpw8(TxPoll, NormalTxPoll); | 914 | cpw8(TxPoll, NormalTxPoll); |
914 | dev->trans_start = jiffies; | 915 | dev->trans_start = jiffies; |
diff --git a/drivers/net/82596.c b/drivers/net/82596.c index 8236f26ffd46..640d7ca2ebcf 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c | |||
@@ -1066,8 +1066,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1066 | short length = skb->len; | 1066 | short length = skb->len; |
1067 | dev->trans_start = jiffies; | 1067 | dev->trans_start = jiffies; |
1068 | 1068 | ||
1069 | DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%x) called\n", dev->name, | 1069 | DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%p) called\n", |
1070 | skb->len, (unsigned int)skb->data)); | 1070 | dev->name, skb->len, skb->data)); |
1071 | 1071 | ||
1072 | if (skb->len < ETH_ZLEN) { | 1072 | if (skb->len < ETH_ZLEN) { |
1073 | if (skb_padto(skb, ETH_ZLEN)) | 1073 | if (skb_padto(skb, ETH_ZLEN)) |
@@ -1246,7 +1246,8 @@ struct net_device * __init i82596_probe(int unit) | |||
1246 | dev->priv = (void *)(dev->mem_start); | 1246 | dev->priv = (void *)(dev->mem_start); |
1247 | 1247 | ||
1248 | lp = dev->priv; | 1248 | lp = dev->priv; |
1249 | DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n", | 1249 | DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%zd bytes), " |
1250 | "lp->scb at 0x%08lx\n", | ||
1250 | dev->name, (unsigned long)lp, | 1251 | dev->name, (unsigned long)lp, |
1251 | sizeof(struct i596_private), (unsigned long)&lp->scb)); | 1252 | sizeof(struct i596_private), (unsigned long)&lp->scb)); |
1252 | memset((void *) lp, 0, sizeof(struct i596_private)); | 1253 | memset((void *) lp, 0, sizeof(struct i596_private)); |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 5eb2ec68393f..303a8d94ad4b 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -110,6 +110,11 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl); | |||
110 | 110 | ||
111 | static void b44_halt(struct b44 *); | 111 | static void b44_halt(struct b44 *); |
112 | static void b44_init_rings(struct b44 *); | 112 | static void b44_init_rings(struct b44 *); |
113 | |||
114 | #define B44_FULL_RESET 1 | ||
115 | #define B44_FULL_RESET_SKIP_PHY 2 | ||
116 | #define B44_PARTIAL_RESET 3 | ||
117 | |||
113 | static void b44_init_hw(struct b44 *, int); | 118 | static void b44_init_hw(struct b44 *, int); |
114 | 119 | ||
115 | static int dma_desc_align_mask; | 120 | static int dma_desc_align_mask; |
@@ -752,7 +757,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
752 | dest_idx * sizeof(dest_desc), | 757 | dest_idx * sizeof(dest_desc), |
753 | DMA_BIDIRECTIONAL); | 758 | DMA_BIDIRECTIONAL); |
754 | 759 | ||
755 | pci_dma_sync_single_for_device(bp->pdev, src_desc->addr, | 760 | pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr), |
756 | RX_PKT_BUF_SZ, | 761 | RX_PKT_BUF_SZ, |
757 | PCI_DMA_FROMDEVICE); | 762 | PCI_DMA_FROMDEVICE); |
758 | } | 763 | } |
@@ -884,7 +889,7 @@ static int b44_poll(struct net_device *netdev, int *budget) | |||
884 | spin_lock_irqsave(&bp->lock, flags); | 889 | spin_lock_irqsave(&bp->lock, flags); |
885 | b44_halt(bp); | 890 | b44_halt(bp); |
886 | b44_init_rings(bp); | 891 | b44_init_rings(bp); |
887 | b44_init_hw(bp, 1); | 892 | b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY); |
888 | netif_wake_queue(bp->dev); | 893 | netif_wake_queue(bp->dev); |
889 | spin_unlock_irqrestore(&bp->lock, flags); | 894 | spin_unlock_irqrestore(&bp->lock, flags); |
890 | done = 1; | 895 | done = 1; |
@@ -954,7 +959,7 @@ static void b44_tx_timeout(struct net_device *dev) | |||
954 | 959 | ||
955 | b44_halt(bp); | 960 | b44_halt(bp); |
956 | b44_init_rings(bp); | 961 | b44_init_rings(bp); |
957 | b44_init_hw(bp, 1); | 962 | b44_init_hw(bp, B44_FULL_RESET); |
958 | 963 | ||
959 | spin_unlock_irq(&bp->lock); | 964 | spin_unlock_irq(&bp->lock); |
960 | 965 | ||
@@ -1071,7 +1076,7 @@ static int b44_change_mtu(struct net_device *dev, int new_mtu) | |||
1071 | b44_halt(bp); | 1076 | b44_halt(bp); |
1072 | dev->mtu = new_mtu; | 1077 | dev->mtu = new_mtu; |
1073 | b44_init_rings(bp); | 1078 | b44_init_rings(bp); |
1074 | b44_init_hw(bp, 1); | 1079 | b44_init_hw(bp, B44_FULL_RESET); |
1075 | spin_unlock_irq(&bp->lock); | 1080 | spin_unlock_irq(&bp->lock); |
1076 | 1081 | ||
1077 | b44_enable_ints(bp); | 1082 | b44_enable_ints(bp); |
@@ -1368,12 +1373,12 @@ static int b44_set_mac_addr(struct net_device *dev, void *p) | |||
1368 | * packet processing. Invoked with bp->lock held. | 1373 | * packet processing. Invoked with bp->lock held. |
1369 | */ | 1374 | */ |
1370 | static void __b44_set_rx_mode(struct net_device *); | 1375 | static void __b44_set_rx_mode(struct net_device *); |
1371 | static void b44_init_hw(struct b44 *bp, int full_reset) | 1376 | static void b44_init_hw(struct b44 *bp, int reset_kind) |
1372 | { | 1377 | { |
1373 | u32 val; | 1378 | u32 val; |
1374 | 1379 | ||
1375 | b44_chip_reset(bp); | 1380 | b44_chip_reset(bp); |
1376 | if (full_reset) { | 1381 | if (reset_kind == B44_FULL_RESET) { |
1377 | b44_phy_reset(bp); | 1382 | b44_phy_reset(bp); |
1378 | b44_setup_phy(bp); | 1383 | b44_setup_phy(bp); |
1379 | } | 1384 | } |
@@ -1390,7 +1395,10 @@ static void b44_init_hw(struct b44 *bp, int full_reset) | |||
1390 | bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN); | 1395 | bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN); |
1391 | 1396 | ||
1392 | bw32(bp, B44_TX_WMARK, 56); /* XXX magic */ | 1397 | bw32(bp, B44_TX_WMARK, 56); /* XXX magic */ |
1393 | if (full_reset) { | 1398 | if (reset_kind == B44_PARTIAL_RESET) { |
1399 | bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | | ||
1400 | (bp->rx_offset << DMARX_CTRL_ROSHIFT))); | ||
1401 | } else { | ||
1394 | bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE); | 1402 | bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE); |
1395 | bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset); | 1403 | bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset); |
1396 | bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | | 1404 | bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | |
@@ -1401,9 +1409,6 @@ static void b44_init_hw(struct b44 *bp, int full_reset) | |||
1401 | bp->rx_prod = bp->rx_pending; | 1409 | bp->rx_prod = bp->rx_pending; |
1402 | 1410 | ||
1403 | bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ); | 1411 | bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ); |
1404 | } else { | ||
1405 | bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | | ||
1406 | (bp->rx_offset << DMARX_CTRL_ROSHIFT))); | ||
1407 | } | 1412 | } |
1408 | 1413 | ||
1409 | val = br32(bp, B44_ENET_CTRL); | 1414 | val = br32(bp, B44_ENET_CTRL); |
@@ -1420,7 +1425,7 @@ static int b44_open(struct net_device *dev) | |||
1420 | goto out; | 1425 | goto out; |
1421 | 1426 | ||
1422 | b44_init_rings(bp); | 1427 | b44_init_rings(bp); |
1423 | b44_init_hw(bp, 1); | 1428 | b44_init_hw(bp, B44_FULL_RESET); |
1424 | 1429 | ||
1425 | b44_check_phy(bp); | 1430 | b44_check_phy(bp); |
1426 | 1431 | ||
@@ -1629,7 +1634,7 @@ static int b44_close(struct net_device *dev) | |||
1629 | netif_poll_enable(dev); | 1634 | netif_poll_enable(dev); |
1630 | 1635 | ||
1631 | if (bp->flags & B44_FLAG_WOL_ENABLE) { | 1636 | if (bp->flags & B44_FLAG_WOL_ENABLE) { |
1632 | b44_init_hw(bp, 0); | 1637 | b44_init_hw(bp, B44_PARTIAL_RESET); |
1633 | b44_setup_wol(bp); | 1638 | b44_setup_wol(bp); |
1634 | } | 1639 | } |
1635 | 1640 | ||
@@ -1905,7 +1910,7 @@ static int b44_set_ringparam(struct net_device *dev, | |||
1905 | 1910 | ||
1906 | b44_halt(bp); | 1911 | b44_halt(bp); |
1907 | b44_init_rings(bp); | 1912 | b44_init_rings(bp); |
1908 | b44_init_hw(bp, 1); | 1913 | b44_init_hw(bp, B44_FULL_RESET); |
1909 | netif_wake_queue(bp->dev); | 1914 | netif_wake_queue(bp->dev); |
1910 | spin_unlock_irq(&bp->lock); | 1915 | spin_unlock_irq(&bp->lock); |
1911 | 1916 | ||
@@ -1948,7 +1953,7 @@ static int b44_set_pauseparam(struct net_device *dev, | |||
1948 | if (bp->flags & B44_FLAG_PAUSE_AUTO) { | 1953 | if (bp->flags & B44_FLAG_PAUSE_AUTO) { |
1949 | b44_halt(bp); | 1954 | b44_halt(bp); |
1950 | b44_init_rings(bp); | 1955 | b44_init_rings(bp); |
1951 | b44_init_hw(bp, 1); | 1956 | b44_init_hw(bp, B44_FULL_RESET); |
1952 | } else { | 1957 | } else { |
1953 | __b44_set_flow_ctrl(bp, bp->flags); | 1958 | __b44_set_flow_ctrl(bp, bp->flags); |
1954 | } | 1959 | } |
@@ -2304,7 +2309,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2304 | 2309 | ||
2305 | free_irq(dev->irq, dev); | 2310 | free_irq(dev->irq, dev); |
2306 | if (bp->flags & B44_FLAG_WOL_ENABLE) { | 2311 | if (bp->flags & B44_FLAG_WOL_ENABLE) { |
2307 | b44_init_hw(bp, 0); | 2312 | b44_init_hw(bp, B44_PARTIAL_RESET); |
2308 | b44_setup_wol(bp); | 2313 | b44_setup_wol(bp); |
2309 | } | 2314 | } |
2310 | pci_disable_device(pdev); | 2315 | pci_disable_device(pdev); |
@@ -2315,21 +2320,32 @@ static int b44_resume(struct pci_dev *pdev) | |||
2315 | { | 2320 | { |
2316 | struct net_device *dev = pci_get_drvdata(pdev); | 2321 | struct net_device *dev = pci_get_drvdata(pdev); |
2317 | struct b44 *bp = netdev_priv(dev); | 2322 | struct b44 *bp = netdev_priv(dev); |
2323 | int rc = 0; | ||
2318 | 2324 | ||
2319 | pci_restore_state(pdev); | 2325 | pci_restore_state(pdev); |
2320 | pci_enable_device(pdev); | 2326 | rc = pci_enable_device(pdev); |
2327 | if (rc) { | ||
2328 | printk(KERN_ERR PFX "%s: pci_enable_device failed\n", | ||
2329 | dev->name); | ||
2330 | return rc; | ||
2331 | } | ||
2332 | |||
2321 | pci_set_master(pdev); | 2333 | pci_set_master(pdev); |
2322 | 2334 | ||
2323 | if (!netif_running(dev)) | 2335 | if (!netif_running(dev)) |
2324 | return 0; | 2336 | return 0; |
2325 | 2337 | ||
2326 | if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev)) | 2338 | rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); |
2339 | if (rc) { | ||
2327 | printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); | 2340 | printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); |
2341 | pci_disable_device(pdev); | ||
2342 | return rc; | ||
2343 | } | ||
2328 | 2344 | ||
2329 | spin_lock_irq(&bp->lock); | 2345 | spin_lock_irq(&bp->lock); |
2330 | 2346 | ||
2331 | b44_init_rings(bp); | 2347 | b44_init_rings(bp); |
2332 | b44_init_hw(bp, 1); | 2348 | b44_init_hw(bp, B44_FULL_RESET); |
2333 | netif_device_attach(bp->dev); | 2349 | netif_device_attach(bp->dev); |
2334 | spin_unlock_irq(&bp->lock); | 2350 | spin_unlock_irq(&bp->lock); |
2335 | 2351 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index ca5acc4736df..ee7b75b976b5 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -57,8 +57,8 @@ | |||
57 | 57 | ||
58 | #define DRV_MODULE_NAME "bnx2" | 58 | #define DRV_MODULE_NAME "bnx2" |
59 | #define PFX DRV_MODULE_NAME ": " | 59 | #define PFX DRV_MODULE_NAME ": " |
60 | #define DRV_MODULE_VERSION "1.5.3" | 60 | #define DRV_MODULE_VERSION "1.5.5" |
61 | #define DRV_MODULE_RELDATE "January 8, 2007" | 61 | #define DRV_MODULE_RELDATE "February 1, 2007" |
62 | 62 | ||
63 | #define RUN_AT(x) (jiffies + (x)) | 63 | #define RUN_AT(x) (jiffies + (x)) |
64 | 64 | ||
@@ -1356,6 +1356,14 @@ bnx2_init_copper_phy(struct bnx2 *bp) | |||
1356 | bnx2_write_phy(bp, 0x18, 0x0400); | 1356 | bnx2_write_phy(bp, 0x18, 0x0400); |
1357 | } | 1357 | } |
1358 | 1358 | ||
1359 | if (bp->phy_flags & PHY_DIS_EARLY_DAC_FLAG) { | ||
1360 | bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS, | ||
1361 | MII_BNX2_DSP_EXPAND_REG | 0x8); | ||
1362 | bnx2_read_phy(bp, MII_BNX2_DSP_RW_PORT, &val); | ||
1363 | val &= ~(1 << 8); | ||
1364 | bnx2_write_phy(bp, MII_BNX2_DSP_RW_PORT, val); | ||
1365 | } | ||
1366 | |||
1359 | if (bp->dev->mtu > 1500) { | 1367 | if (bp->dev->mtu > 1500) { |
1360 | /* Set extended packet length bit */ | 1368 | /* Set extended packet length bit */ |
1361 | bnx2_write_phy(bp, 0x18, 0x7); | 1369 | bnx2_write_phy(bp, 0x18, 0x7); |
@@ -5845,9 +5853,11 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5845 | reg = REG_RD_IND(bp, BNX2_SHM_HDR_SIGNATURE); | 5853 | reg = REG_RD_IND(bp, BNX2_SHM_HDR_SIGNATURE); |
5846 | 5854 | ||
5847 | if ((reg & BNX2_SHM_HDR_SIGNATURE_SIG_MASK) == | 5855 | if ((reg & BNX2_SHM_HDR_SIGNATURE_SIG_MASK) == |
5848 | BNX2_SHM_HDR_SIGNATURE_SIG) | 5856 | BNX2_SHM_HDR_SIGNATURE_SIG) { |
5849 | bp->shmem_base = REG_RD_IND(bp, BNX2_SHM_HDR_ADDR_0); | 5857 | u32 off = PCI_FUNC(pdev->devfn) << 2; |
5850 | else | 5858 | |
5859 | bp->shmem_base = REG_RD_IND(bp, BNX2_SHM_HDR_ADDR_0 + off); | ||
5860 | } else | ||
5851 | bp->shmem_base = HOST_VIEW_SHMEM_BASE; | 5861 | bp->shmem_base = HOST_VIEW_SHMEM_BASE; |
5852 | 5862 | ||
5853 | /* Get the permanent MAC address. First we need to make sure the | 5863 | /* Get the permanent MAC address. First we need to make sure the |
@@ -5916,6 +5926,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5916 | } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || | 5926 | } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || |
5917 | CHIP_NUM(bp) == CHIP_NUM_5708) | 5927 | CHIP_NUM(bp) == CHIP_NUM_5708) |
5918 | bp->phy_flags |= PHY_CRC_FIX_FLAG; | 5928 | bp->phy_flags |= PHY_CRC_FIX_FLAG; |
5929 | else if (CHIP_ID(bp) == CHIP_ID_5709_A0) | ||
5930 | bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG; | ||
5919 | 5931 | ||
5920 | if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || | 5932 | if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || |
5921 | (CHIP_ID(bp) == CHIP_ID_5708_B0) || | 5933 | (CHIP_ID(bp) == CHIP_ID_5708_B0) || |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 13b6f9b11e01..ccbdf81c6599 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6288,6 +6288,10 @@ struct l2_fhdr { | |||
6288 | 6288 | ||
6289 | #define BCM5708S_TX_ACTL3 0x17 | 6289 | #define BCM5708S_TX_ACTL3 0x17 |
6290 | 6290 | ||
6291 | #define MII_BNX2_DSP_RW_PORT 0x15 | ||
6292 | #define MII_BNX2_DSP_ADDRESS 0x17 | ||
6293 | #define MII_BNX2_DSP_EXPAND_REG 0x0f00 | ||
6294 | |||
6291 | #define MIN_ETHERNET_PACKET_SIZE 60 | 6295 | #define MIN_ETHERNET_PACKET_SIZE 60 |
6292 | #define MAX_ETHERNET_PACKET_SIZE 1514 | 6296 | #define MAX_ETHERNET_PACKET_SIZE 1514 |
6293 | #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 | 6297 | #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 |
@@ -6489,6 +6493,7 @@ struct bnx2 { | |||
6489 | #define PHY_INT_MODE_MASK_FLAG 0x300 | 6493 | #define PHY_INT_MODE_MASK_FLAG 0x300 |
6490 | #define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 | 6494 | #define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 |
6491 | #define PHY_INT_MODE_LINK_READY_FLAG 0x200 | 6495 | #define PHY_INT_MODE_LINK_READY_FLAG 0x200 |
6496 | #define PHY_DIS_EARLY_DAC_FLAG 0x400 | ||
6492 | 6497 | ||
6493 | u32 chip_id; | 6498 | u32 chip_id; |
6494 | /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ | 6499 | /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ |
@@ -6512,6 +6517,7 @@ struct bnx2 { | |||
6512 | #define CHIP_ID_5708_A0 0x57080000 | 6517 | #define CHIP_ID_5708_A0 0x57080000 |
6513 | #define CHIP_ID_5708_B0 0x57081000 | 6518 | #define CHIP_ID_5708_B0 0x57081000 |
6514 | #define CHIP_ID_5708_B1 0x57081010 | 6519 | #define CHIP_ID_5708_B1 0x57081010 |
6520 | #define CHIP_ID_5709_A0 0x57090000 | ||
6515 | 6521 | ||
6516 | #define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf) | 6522 | #define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf) |
6517 | 6523 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index dc434fb6da85..0978c9ac6d2b 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -151,8 +151,8 @@ struct slave { | |||
151 | struct slave *next; | 151 | struct slave *next; |
152 | struct slave *prev; | 152 | struct slave *prev; |
153 | int delay; | 153 | int delay; |
154 | u32 jiffies; | 154 | unsigned long jiffies; |
155 | u32 last_arp_rx; | 155 | unsigned long last_arp_rx; |
156 | s8 link; /* one of BOND_LINK_XXXX */ | 156 | s8 link; /* one of BOND_LINK_XXXX */ |
157 | s8 state; /* one of BOND_STATE_XXXX */ | 157 | s8 state; /* one of BOND_STATE_XXXX */ |
158 | u32 original_flags; | 158 | u32 original_flags; |
@@ -242,7 +242,8 @@ extern inline int slave_do_arp_validate(struct bonding *bond, struct slave *slav | |||
242 | return bond->params.arp_validate & (1 << slave->state); | 242 | return bond->params.arp_validate & (1 << slave->state); |
243 | } | 243 | } |
244 | 244 | ||
245 | extern inline u32 slave_last_rx(struct bonding *bond, struct slave *slave) | 245 | extern inline unsigned long slave_last_rx(struct bonding *bond, |
246 | struct slave *slave) | ||
246 | { | 247 | { |
247 | if (slave_do_arp_validate(bond, slave)) | 248 | if (slave_do_arp_validate(bond, slave)) |
248 | return slave->last_arp_rx; | 249 | return slave->last_arp_rx; |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index c2ae2a24629b..0cefef5e3f06 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2718,12 +2718,11 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2718 | struct net_device *netdev = pci_get_drvdata(pdev); | 2718 | struct net_device *netdev = pci_get_drvdata(pdev); |
2719 | struct nic *nic = netdev_priv(netdev); | 2719 | struct nic *nic = netdev_priv(netdev); |
2720 | 2720 | ||
2721 | #ifdef CONFIG_E100_NAPI | ||
2722 | if (netif_running(netdev)) | 2721 | if (netif_running(netdev)) |
2723 | netif_poll_disable(nic->netdev); | 2722 | netif_poll_disable(nic->netdev); |
2724 | #endif | ||
2725 | del_timer_sync(&nic->watchdog); | 2723 | del_timer_sync(&nic->watchdog); |
2726 | netif_carrier_off(nic->netdev); | 2724 | netif_carrier_off(nic->netdev); |
2725 | netif_device_detach(netdev); | ||
2727 | 2726 | ||
2728 | pci_save_state(pdev); | 2727 | pci_save_state(pdev); |
2729 | 2728 | ||
@@ -2736,6 +2735,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2736 | } | 2735 | } |
2737 | 2736 | ||
2738 | pci_disable_device(pdev); | 2737 | pci_disable_device(pdev); |
2738 | free_irq(pdev->irq, netdev); | ||
2739 | pci_set_power_state(pdev, PCI_D3hot); | 2739 | pci_set_power_state(pdev, PCI_D3hot); |
2740 | 2740 | ||
2741 | return 0; | 2741 | return 0; |
@@ -2759,16 +2759,13 @@ static int e100_resume(struct pci_dev *pdev) | |||
2759 | } | 2759 | } |
2760 | #endif /* CONFIG_PM */ | 2760 | #endif /* CONFIG_PM */ |
2761 | 2761 | ||
2762 | |||
2763 | static void e100_shutdown(struct pci_dev *pdev) | 2762 | static void e100_shutdown(struct pci_dev *pdev) |
2764 | { | 2763 | { |
2765 | struct net_device *netdev = pci_get_drvdata(pdev); | 2764 | struct net_device *netdev = pci_get_drvdata(pdev); |
2766 | struct nic *nic = netdev_priv(netdev); | 2765 | struct nic *nic = netdev_priv(netdev); |
2767 | 2766 | ||
2768 | #ifdef CONFIG_E100_NAPI | ||
2769 | if (netif_running(netdev)) | 2767 | if (netif_running(netdev)) |
2770 | netif_poll_disable(nic->netdev); | 2768 | netif_poll_disable(nic->netdev); |
2771 | #endif | ||
2772 | del_timer_sync(&nic->watchdog); | 2769 | del_timer_sync(&nic->watchdog); |
2773 | netif_carrier_off(nic->netdev); | 2770 | netif_carrier_off(nic->netdev); |
2774 | 2771 | ||
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 39ad9f73d1ec..272e1ec51aa2 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <asm/io.h> | 39 | #include <asm/io.h> |
40 | 40 | ||
41 | #define DRV_NAME "ehea" | 41 | #define DRV_NAME "ehea" |
42 | #define DRV_VERSION "EHEA_0043" | 42 | #define DRV_VERSION "EHEA_0045" |
43 | 43 | ||
44 | #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | 44 | #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ |
45 | | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) | 45 | | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 83fa32f72398..9de2d38a5321 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -558,12 +558,12 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
558 | u32 qp_token; | 558 | u32 qp_token; |
559 | 559 | ||
560 | eqe = ehea_poll_eq(port->qp_eq); | 560 | eqe = ehea_poll_eq(port->qp_eq); |
561 | ehea_debug("eqe=%p", eqe); | 561 | |
562 | while (eqe) { | 562 | while (eqe) { |
563 | ehea_debug("*eqe=%lx", *(u64*)eqe); | ||
564 | eqe = ehea_poll_eq(port->qp_eq); | ||
565 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); | 563 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); |
566 | ehea_debug("next eqe=%p", eqe); | 564 | ehea_error("QP aff_err: entry=0x%lx, token=0x%x", |
565 | eqe->entry, qp_token); | ||
566 | eqe = ehea_poll_eq(port->qp_eq); | ||
567 | } | 567 | } |
568 | 568 | ||
569 | return IRQ_HANDLED; | 569 | return IRQ_HANDLED; |
@@ -575,8 +575,9 @@ static struct ehea_port *ehea_get_port(struct ehea_adapter *adapter, | |||
575 | int i; | 575 | int i; |
576 | 576 | ||
577 | for (i = 0; i < adapter->num_ports; i++) | 577 | for (i = 0; i < adapter->num_ports; i++) |
578 | if (adapter->port[i]->logical_port_id == logical_port) | 578 | if (adapter->port[i]) |
579 | return adapter->port[i]; | 579 | if (adapter->port[i]->logical_port_id == logical_port) |
580 | return adapter->port[i]; | ||
580 | return NULL; | 581 | return NULL; |
581 | } | 582 | } |
582 | 583 | ||
@@ -642,6 +643,8 @@ int ehea_sense_port_attr(struct ehea_port *port) | |||
642 | break; | 643 | break; |
643 | } | 644 | } |
644 | 645 | ||
646 | port->autoneg = 1; | ||
647 | |||
645 | /* Number of default QPs */ | 648 | /* Number of default QPs */ |
646 | port->num_def_qps = cb0->num_default_qps; | 649 | port->num_def_qps = cb0->num_default_qps; |
647 | 650 | ||
@@ -728,10 +731,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed) | |||
728 | } | 731 | } |
729 | } else { | 732 | } else { |
730 | if (hret == H_AUTHORITY) { | 733 | if (hret == H_AUTHORITY) { |
731 | ehea_info("Hypervisor denied setting port speed. Either" | 734 | ehea_info("Hypervisor denied setting port speed"); |
732 | " this partition is not authorized to set " | ||
733 | "port speed or another partition has modified" | ||
734 | " port speed first."); | ||
735 | ret = -EPERM; | 735 | ret = -EPERM; |
736 | } else { | 736 | } else { |
737 | ret = -EIO; | 737 | ret = -EIO; |
@@ -998,7 +998,7 @@ static int ehea_configure_port(struct ehea_port *port) | |||
998 | | EHEA_BMASK_SET(PXLY_RC_JUMBO_FRAME, 1); | 998 | | EHEA_BMASK_SET(PXLY_RC_JUMBO_FRAME, 1); |
999 | 999 | ||
1000 | for (i = 0; i < port->num_def_qps; i++) | 1000 | for (i = 0; i < port->num_def_qps; i++) |
1001 | cb0->default_qpn_arr[i] = port->port_res[i].qp->init_attr.qp_nr; | 1001 | cb0->default_qpn_arr[i] = port->port_res[0].qp->init_attr.qp_nr; |
1002 | 1002 | ||
1003 | if (netif_msg_ifup(port)) | 1003 | if (netif_msg_ifup(port)) |
1004 | ehea_dump(cb0, sizeof(*cb0), "ehea_configure_port"); | 1004 | ehea_dump(cb0, sizeof(*cb0), "ehea_configure_port"); |
@@ -1485,11 +1485,12 @@ out: | |||
1485 | 1485 | ||
1486 | static void ehea_promiscuous_error(u64 hret, int enable) | 1486 | static void ehea_promiscuous_error(u64 hret, int enable) |
1487 | { | 1487 | { |
1488 | ehea_info("Hypervisor denied %sabling promiscuous mode.%s", | 1488 | if (hret == H_AUTHORITY) |
1489 | enable == 1 ? "en" : "dis", | 1489 | ehea_info("Hypervisor denied %sabling promiscuous mode", |
1490 | hret != H_AUTHORITY ? "" : " Another partition owning a " | 1490 | enable == 1 ? "en" : "dis"); |
1491 | "logical port on the same physical port might have altered " | 1491 | else |
1492 | "promiscuous mode first."); | 1492 | ehea_error("failed %sabling promiscuous mode", |
1493 | enable == 1 ? "en" : "dis"); | ||
1493 | } | 1494 | } |
1494 | 1495 | ||
1495 | static void ehea_promiscuous(struct net_device *dev, int enable) | 1496 | static void ehea_promiscuous(struct net_device *dev, int enable) |
@@ -2267,6 +2268,8 @@ static void ehea_tx_watchdog(struct net_device *dev) | |||
2267 | int ehea_sense_adapter_attr(struct ehea_adapter *adapter) | 2268 | int ehea_sense_adapter_attr(struct ehea_adapter *adapter) |
2268 | { | 2269 | { |
2269 | struct hcp_query_ehea *cb; | 2270 | struct hcp_query_ehea *cb; |
2271 | struct device_node *lhea_dn = NULL; | ||
2272 | struct device_node *eth_dn = NULL; | ||
2270 | u64 hret; | 2273 | u64 hret; |
2271 | int ret; | 2274 | int ret; |
2272 | 2275 | ||
@@ -2283,7 +2286,18 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter) | |||
2283 | goto out_herr; | 2286 | goto out_herr; |
2284 | } | 2287 | } |
2285 | 2288 | ||
2286 | adapter->num_ports = cb->num_ports; | 2289 | /* Determine the number of available logical ports |
2290 | * by counting the child nodes of the lhea OFDT entry | ||
2291 | */ | ||
2292 | adapter->num_ports = 0; | ||
2293 | lhea_dn = of_find_node_by_name(lhea_dn, "lhea"); | ||
2294 | do { | ||
2295 | eth_dn = of_get_next_child(lhea_dn, eth_dn); | ||
2296 | if (eth_dn) | ||
2297 | adapter->num_ports++; | ||
2298 | } while ( eth_dn ); | ||
2299 | of_node_put(lhea_dn); | ||
2300 | |||
2287 | adapter->max_mc_mac = cb->max_mc_mac - 1; | 2301 | adapter->max_mc_mac = cb->max_mc_mac - 1; |
2288 | ret = 0; | 2302 | ret = 0; |
2289 | 2303 | ||
@@ -2302,6 +2316,7 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2302 | struct ehea_adapter *adapter = port->adapter; | 2316 | struct ehea_adapter *adapter = port->adapter; |
2303 | struct hcp_ehea_port_cb4 *cb4; | 2317 | struct hcp_ehea_port_cb4 *cb4; |
2304 | u32 *dn_log_port_id; | 2318 | u32 *dn_log_port_id; |
2319 | int jumbo = 0; | ||
2305 | 2320 | ||
2306 | sema_init(&port->port_lock, 1); | 2321 | sema_init(&port->port_lock, 1); |
2307 | port->state = EHEA_PORT_DOWN; | 2322 | port->state = EHEA_PORT_DOWN; |
@@ -2334,8 +2349,6 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2334 | 2349 | ||
2335 | INIT_LIST_HEAD(&port->mc_list->list); | 2350 | INIT_LIST_HEAD(&port->mc_list->list); |
2336 | 2351 | ||
2337 | ehea_set_portspeed(port, EHEA_SPEED_AUTONEG); | ||
2338 | |||
2339 | ret = ehea_sense_port_attr(port); | 2352 | ret = ehea_sense_port_attr(port); |
2340 | if (ret) | 2353 | if (ret) |
2341 | goto out; | 2354 | goto out; |
@@ -2345,13 +2358,25 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2345 | if (!cb4) { | 2358 | if (!cb4) { |
2346 | ehea_error("no mem for cb4"); | 2359 | ehea_error("no mem for cb4"); |
2347 | } else { | 2360 | } else { |
2348 | cb4->jumbo_frame = 1; | 2361 | hret = ehea_h_query_ehea_port(adapter->handle, |
2349 | hret = ehea_h_modify_ehea_port(adapter->handle, | 2362 | port->logical_port_id, |
2350 | port->logical_port_id, | 2363 | H_PORT_CB4, |
2351 | H_PORT_CB4, H_PORT_CB4_JUMBO, | 2364 | H_PORT_CB4_JUMBO, cb4); |
2352 | cb4); | 2365 | |
2353 | if (hret != H_SUCCESS) { | 2366 | if (hret == H_SUCCESS) { |
2354 | ehea_info("Jumbo frames not activated"); | 2367 | if (cb4->jumbo_frame) |
2368 | jumbo = 1; | ||
2369 | else { | ||
2370 | cb4->jumbo_frame = 1; | ||
2371 | hret = ehea_h_modify_ehea_port(adapter->handle, | ||
2372 | port-> | ||
2373 | logical_port_id, | ||
2374 | H_PORT_CB4, | ||
2375 | H_PORT_CB4_JUMBO, | ||
2376 | cb4); | ||
2377 | if (hret == H_SUCCESS) | ||
2378 | jumbo = 1; | ||
2379 | } | ||
2355 | } | 2380 | } |
2356 | kfree(cb4); | 2381 | kfree(cb4); |
2357 | } | 2382 | } |
@@ -2390,6 +2415,9 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2390 | goto out_free; | 2415 | goto out_free; |
2391 | } | 2416 | } |
2392 | 2417 | ||
2418 | ehea_info("%s: Jumbo frames are %sabled", dev->name, | ||
2419 | jumbo == 1 ? "en" : "dis"); | ||
2420 | |||
2393 | port->netdev = dev; | 2421 | port->netdev = dev; |
2394 | ret = 0; | 2422 | ret = 0; |
2395 | goto out; | 2423 | goto out; |
@@ -2471,14 +2499,16 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev, | |||
2471 | 2499 | ||
2472 | adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle", | 2500 | adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle", |
2473 | NULL); | 2501 | NULL); |
2474 | if (!adapter_handle) { | 2502 | if (adapter_handle) |
2503 | adapter->handle = *adapter_handle; | ||
2504 | |||
2505 | if (!adapter->handle) { | ||
2475 | dev_err(&dev->ofdev.dev, "failed getting handle for adapter" | 2506 | dev_err(&dev->ofdev.dev, "failed getting handle for adapter" |
2476 | " '%s'\n", dev->ofdev.node->full_name); | 2507 | " '%s'\n", dev->ofdev.node->full_name); |
2477 | ret = -ENODEV; | 2508 | ret = -ENODEV; |
2478 | goto out_free_ad; | 2509 | goto out_free_ad; |
2479 | } | 2510 | } |
2480 | 2511 | ||
2481 | adapter->handle = *adapter_handle; | ||
2482 | adapter->pd = EHEA_PD_ID; | 2512 | adapter->pd = EHEA_PD_ID; |
2483 | 2513 | ||
2484 | dev->ofdev.dev.driver_data = adapter; | 2514 | dev->ofdev.dev.driver_data = adapter; |
@@ -2568,6 +2598,7 @@ static int __devexit ehea_remove(struct ibmebus_dev *dev) | |||
2568 | destroy_workqueue(adapter->ehea_wq); | 2598 | destroy_workqueue(adapter->ehea_wq); |
2569 | 2599 | ||
2570 | ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter); | 2600 | ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter); |
2601 | tasklet_kill(&adapter->neq_tasklet); | ||
2571 | 2602 | ||
2572 | ehea_destroy_eq(adapter->neq); | 2603 | ehea_destroy_eq(adapter->neq); |
2573 | 2604 | ||
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c index 0cfc2bc1a27b..37716e05e808 100644 --- a/drivers/net/ehea/ehea_phyp.c +++ b/drivers/net/ehea/ehea_phyp.c | |||
@@ -94,6 +94,7 @@ static long ehea_plpar_hcall9(unsigned long opcode, | |||
94 | { | 94 | { |
95 | long ret; | 95 | long ret; |
96 | int i, sleep_msecs; | 96 | int i, sleep_msecs; |
97 | u8 cb_cat; | ||
97 | 98 | ||
98 | for (i = 0; i < 5; i++) { | 99 | for (i = 0; i < 5; i++) { |
99 | ret = plpar_hcall9(opcode, outs, | 100 | ret = plpar_hcall9(opcode, outs, |
@@ -106,7 +107,13 @@ static long ehea_plpar_hcall9(unsigned long opcode, | |||
106 | continue; | 107 | continue; |
107 | } | 108 | } |
108 | 109 | ||
109 | if (ret < H_SUCCESS) | 110 | cb_cat = EHEA_BMASK_GET(H_MEHEAPORT_CAT, arg2); |
111 | |||
112 | if ((ret < H_SUCCESS) && !(((ret == H_AUTHORITY) | ||
113 | && (opcode == H_MODIFY_HEA_PORT)) | ||
114 | && (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO) | ||
115 | || (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7) | ||
116 | && (arg3 == H_PORT_CB7_DUCQPN))))) | ||
110 | ehea_error("opcode=%lx ret=%lx" | 117 | ehea_error("opcode=%lx ret=%lx" |
111 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" | 118 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" |
112 | " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" | 119 | " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" |
@@ -120,7 +127,6 @@ static long ehea_plpar_hcall9(unsigned long opcode, | |||
120 | outs[0], outs[1], outs[2], outs[3], | 127 | outs[0], outs[1], outs[2], outs[3], |
121 | outs[4], outs[5], outs[6], outs[7], | 128 | outs[4], outs[5], outs[6], outs[7], |
122 | outs[8]); | 129 | outs[8]); |
123 | |||
124 | return ret; | 130 | return ret; |
125 | } | 131 | } |
126 | 132 | ||
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index c2c5fd419bd0..ff6839477306 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -104,9 +104,9 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
104 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); | 104 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); |
105 | if (fep->interrupt < 0) | 105 | if (fep->interrupt < 0) |
106 | return -EINVAL; | 106 | return -EINVAL; |
107 | 107 | ||
108 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 108 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
109 | fep->fec.fecp =(void*)r->start; | 109 | fep->fec.fecp = ioremap(r->start, r->end - r->start + 1); |
110 | 110 | ||
111 | if(fep->fec.fecp == NULL) | 111 | if(fep->fec.fecp == NULL) |
112 | return -EINVAL; | 112 | return -EINVAL; |
@@ -319,11 +319,14 @@ static void restart(struct net_device *dev) | |||
319 | * Clear any outstanding interrupt. | 319 | * Clear any outstanding interrupt. |
320 | */ | 320 | */ |
321 | FW(fecp, ievent, 0xffc0); | 321 | FW(fecp, ievent, 0xffc0); |
322 | #ifndef CONFIG_PPC_MERGE | ||
322 | FW(fecp, ivec, (fep->interrupt / 2) << 29); | 323 | FW(fecp, ivec, (fep->interrupt / 2) << 29); |
323 | 324 | #else | |
325 | FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29); | ||
326 | #endif | ||
324 | 327 | ||
325 | /* | 328 | /* |
326 | * adjust to speed (only for DUET & RMII) | 329 | * adjust to speed (only for DUET & RMII) |
327 | */ | 330 | */ |
328 | #ifdef CONFIG_DUET | 331 | #ifdef CONFIG_DUET |
329 | if (fpi->use_rmii) { | 332 | if (fpi->use_rmii) { |
@@ -418,6 +421,7 @@ static void stop(struct net_device *dev) | |||
418 | 421 | ||
419 | static void pre_request_irq(struct net_device *dev, int irq) | 422 | static void pre_request_irq(struct net_device *dev, int irq) |
420 | { | 423 | { |
424 | #ifndef CONFIG_PPC_MERGE | ||
421 | immap_t *immap = fs_enet_immap; | 425 | immap_t *immap = fs_enet_immap; |
422 | u32 siel; | 426 | u32 siel; |
423 | 427 | ||
@@ -431,6 +435,7 @@ static void pre_request_irq(struct net_device *dev, int irq) | |||
431 | siel &= ~(0x80000000 >> (irq & ~1)); | 435 | siel &= ~(0x80000000 >> (irq & ~1)); |
432 | out_be32(&immap->im_siu_conf.sc_siel, siel); | 436 | out_be32(&immap->im_siu_conf.sc_siel, siel); |
433 | } | 437 | } |
438 | #endif | ||
434 | } | 439 | } |
435 | 440 | ||
436 | static void post_free_irq(struct net_device *dev, int irq) | 441 | static void post_free_irq(struct net_device *dev, int irq) |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 95ec5872c507..afd7fca7c6c4 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | 122 | ||
123 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 123 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
124 | fep->scc.sccp = (void *)r->start; | 124 | fep->scc.sccp = ioremap(r->start, r->end - r->start + 1); |
125 | 125 | ||
126 | if (fep->scc.sccp == NULL) | 126 | if (fep->scc.sccp == NULL) |
127 | return -EINVAL; | 127 | return -EINVAL; |
128 | 128 | ||
129 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram"); | 129 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram"); |
130 | fep->scc.ep = (void *)r->start; | 130 | fep->scc.ep = ioremap(r->start, r->end - r->start + 1); |
131 | 131 | ||
132 | if (fep->scc.ep == NULL) | 132 | if (fep->scc.ep == NULL) |
133 | return -EINVAL; | 133 | return -EINVAL; |
@@ -397,6 +397,7 @@ static void stop(struct net_device *dev) | |||
397 | 397 | ||
398 | static void pre_request_irq(struct net_device *dev, int irq) | 398 | static void pre_request_irq(struct net_device *dev, int irq) |
399 | { | 399 | { |
400 | #ifndef CONFIG_PPC_MERGE | ||
400 | immap_t *immap = fs_enet_immap; | 401 | immap_t *immap = fs_enet_immap; |
401 | u32 siel; | 402 | u32 siel; |
402 | 403 | ||
@@ -410,6 +411,7 @@ static void pre_request_irq(struct net_device *dev, int irq) | |||
410 | siel &= ~(0x80000000 >> (irq & ~1)); | 411 | siel &= ~(0x80000000 >> (irq & ~1)); |
411 | out_be32(&immap->im_siu_conf.sc_siel, siel); | 412 | out_be32(&immap->im_siu_conf.sc_siel, siel); |
412 | } | 413 | } |
414 | #endif | ||
413 | } | 415 | } |
414 | 416 | ||
415 | static void post_free_irq(struct net_device *dev, int irq) | 417 | static void post_free_irq(struct net_device *dev, int irq) |
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig index 896aa02000d7..feb0ada7a025 100644 --- a/drivers/net/hamradio/Kconfig +++ b/drivers/net/hamradio/Kconfig | |||
@@ -113,7 +113,7 @@ config SCC_TRXECHO | |||
113 | 113 | ||
114 | config BAYCOM_SER_FDX | 114 | config BAYCOM_SER_FDX |
115 | tristate "BAYCOM ser12 fullduplex driver for AX.25" | 115 | tristate "BAYCOM ser12 fullduplex driver for AX.25" |
116 | depends on AX25 | 116 | depends on AX25 && !S390 |
117 | select CRC_CCITT | 117 | select CRC_CCITT |
118 | ---help--- | 118 | ---help--- |
119 | This is one of two drivers for Baycom style simple amateur radio | 119 | This is one of two drivers for Baycom style simple amateur radio |
@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX | |||
133 | 133 | ||
134 | config BAYCOM_SER_HDX | 134 | config BAYCOM_SER_HDX |
135 | tristate "BAYCOM ser12 halfduplex driver for AX.25" | 135 | tristate "BAYCOM ser12 halfduplex driver for AX.25" |
136 | depends on AX25 | 136 | depends on AX25 && !S390 |
137 | select CRC_CCITT | 137 | select CRC_CCITT |
138 | ---help--- | 138 | ---help--- |
139 | This is one of two drivers for Baycom style simple amateur radio | 139 | This is one of two drivers for Baycom style simple amateur radio |
@@ -181,7 +181,7 @@ config BAYCOM_EPP | |||
181 | 181 | ||
182 | config YAM | 182 | config YAM |
183 | tristate "YAM driver for AX.25" | 183 | tristate "YAM driver for AX.25" |
184 | depends on AX25 | 184 | depends on AX25 && !S390 |
185 | help | 185 | help |
186 | The YAM is a modem for packet radio which connects to the serial | 186 | The YAM is a modem for packet radio which connects to the serial |
187 | port and includes some of the functions of a Terminal Node | 187 | port and includes some of the functions of a Terminal Node |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 3ca1082ec776..340ee99652eb 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -441,25 +441,13 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
441 | goto drop; | 441 | goto drop; |
442 | } | 442 | } |
443 | 443 | ||
444 | /* Make sure there is room for IrDA-USB header. The actual | 444 | memcpy(self->tx_buff + self->header_length, skb->data, skb->len); |
445 | * allocation will be done lower in skb_push(). | ||
446 | * Also, we don't use directly skb_cow(), because it require | ||
447 | * headroom >= 16, which force unnecessary copies - Jean II */ | ||
448 | if (skb_headroom(skb) < self->header_length) { | ||
449 | IRDA_DEBUG(0, "%s(), Insuficient skb headroom.\n", __FUNCTION__); | ||
450 | if (skb_cow(skb, self->header_length)) { | ||
451 | IRDA_WARNING("%s(), failed skb_cow() !!!\n", __FUNCTION__); | ||
452 | goto drop; | ||
453 | } | ||
454 | } | ||
455 | 445 | ||
456 | /* Change setting for next frame */ | 446 | /* Change setting for next frame */ |
457 | |||
458 | if (self->capability & IUC_STIR421X) { | 447 | if (self->capability & IUC_STIR421X) { |
459 | __u8 turnaround_time; | 448 | __u8 turnaround_time; |
460 | __u8* frame; | 449 | __u8* frame = self->tx_buff; |
461 | turnaround_time = get_turnaround_time( skb ); | 450 | turnaround_time = get_turnaround_time( skb ); |
462 | frame= skb_push(skb, self->header_length); | ||
463 | irda_usb_build_header(self, frame, 0); | 451 | irda_usb_build_header(self, frame, 0); |
464 | frame[2] = turnaround_time; | 452 | frame[2] = turnaround_time; |
465 | if ((skb->len != 0) && | 453 | if ((skb->len != 0) && |
@@ -472,17 +460,17 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
472 | frame[1] = 0; | 460 | frame[1] = 0; |
473 | } | 461 | } |
474 | } else { | 462 | } else { |
475 | irda_usb_build_header(self, skb_push(skb, self->header_length), 0); | 463 | irda_usb_build_header(self, self->tx_buff, 0); |
476 | } | 464 | } |
477 | 465 | ||
478 | /* FIXME: Make macro out of this one */ | 466 | /* FIXME: Make macro out of this one */ |
479 | ((struct irda_skb_cb *)skb->cb)->context = self; | 467 | ((struct irda_skb_cb *)skb->cb)->context = self; |
480 | 468 | ||
481 | usb_fill_bulk_urb(urb, self->usbdev, | 469 | usb_fill_bulk_urb(urb, self->usbdev, |
482 | usb_sndbulkpipe(self->usbdev, self->bulk_out_ep), | 470 | usb_sndbulkpipe(self->usbdev, self->bulk_out_ep), |
483 | skb->data, IRDA_SKB_MAX_MTU, | 471 | self->tx_buff, skb->len + self->header_length, |
484 | write_bulk_callback, skb); | 472 | write_bulk_callback, skb); |
485 | urb->transfer_buffer_length = skb->len; | 473 | |
486 | /* This flag (URB_ZERO_PACKET) indicates that what we send is not | 474 | /* This flag (URB_ZERO_PACKET) indicates that what we send is not |
487 | * a continuous stream of data but separate packets. | 475 | * a continuous stream of data but separate packets. |
488 | * In this case, the USB layer will insert an empty USB frame (TD) | 476 | * In this case, the USB layer will insert an empty USB frame (TD) |
@@ -1455,6 +1443,9 @@ static inline void irda_usb_close(struct irda_usb_cb *self) | |||
1455 | /* Remove the speed buffer */ | 1443 | /* Remove the speed buffer */ |
1456 | kfree(self->speed_buff); | 1444 | kfree(self->speed_buff); |
1457 | self->speed_buff = NULL; | 1445 | self->speed_buff = NULL; |
1446 | |||
1447 | kfree(self->tx_buff); | ||
1448 | self->tx_buff = NULL; | ||
1458 | } | 1449 | } |
1459 | 1450 | ||
1460 | /********************** USB CONFIG SUBROUTINES **********************/ | 1451 | /********************** USB CONFIG SUBROUTINES **********************/ |
@@ -1524,8 +1515,6 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ | |||
1524 | 1515 | ||
1525 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", | 1516 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", |
1526 | __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); | 1517 | __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); |
1527 | /* Should be 8, 16, 32 or 64 bytes */ | ||
1528 | IRDA_ASSERT(self->bulk_out_mtu == 64, ;); | ||
1529 | 1518 | ||
1530 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); | 1519 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); |
1531 | } | 1520 | } |
@@ -1753,9 +1742,14 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1753 | 1742 | ||
1754 | memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); | 1743 | memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); |
1755 | 1744 | ||
1745 | self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length, | ||
1746 | GFP_KERNEL); | ||
1747 | if (self->tx_buff == NULL) | ||
1748 | goto err_out_4; | ||
1749 | |||
1756 | ret = irda_usb_open(self); | 1750 | ret = irda_usb_open(self); |
1757 | if (ret) | 1751 | if (ret) |
1758 | goto err_out_4; | 1752 | goto err_out_5; |
1759 | 1753 | ||
1760 | IRDA_MESSAGE("IrDA: Registered device %s\n", net->name); | 1754 | IRDA_MESSAGE("IrDA: Registered device %s\n", net->name); |
1761 | usb_set_intfdata(intf, self); | 1755 | usb_set_intfdata(intf, self); |
@@ -1766,14 +1760,14 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1766 | self->needspatch = (ret < 0); | 1760 | self->needspatch = (ret < 0); |
1767 | if (self->needspatch) { | 1761 | if (self->needspatch) { |
1768 | IRDA_ERROR("STIR421X: Couldn't upload patch\n"); | 1762 | IRDA_ERROR("STIR421X: Couldn't upload patch\n"); |
1769 | goto err_out_5; | 1763 | goto err_out_6; |
1770 | } | 1764 | } |
1771 | 1765 | ||
1772 | /* replace IrDA class descriptor with what patched device is now reporting */ | 1766 | /* replace IrDA class descriptor with what patched device is now reporting */ |
1773 | irda_desc = irda_usb_find_class_desc (self->usbintf); | 1767 | irda_desc = irda_usb_find_class_desc (self->usbintf); |
1774 | if (irda_desc == NULL) { | 1768 | if (irda_desc == NULL) { |
1775 | ret = -ENODEV; | 1769 | ret = -ENODEV; |
1776 | goto err_out_5; | 1770 | goto err_out_6; |
1777 | } | 1771 | } |
1778 | if (self->irda_desc) | 1772 | if (self->irda_desc) |
1779 | kfree (self->irda_desc); | 1773 | kfree (self->irda_desc); |
@@ -1782,9 +1776,10 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1782 | } | 1776 | } |
1783 | 1777 | ||
1784 | return 0; | 1778 | return 0; |
1785 | 1779 | err_out_6: | |
1786 | err_out_5: | ||
1787 | unregister_netdev(self->netdev); | 1780 | unregister_netdev(self->netdev); |
1781 | err_out_5: | ||
1782 | kfree(self->tx_buff); | ||
1788 | err_out_4: | 1783 | err_out_4: |
1789 | kfree(self->speed_buff); | 1784 | kfree(self->speed_buff); |
1790 | err_out_3: | 1785 | err_out_3: |
diff --git a/drivers/net/irda/irda-usb.h b/drivers/net/irda/irda-usb.h index 6b2271f18e77..e846c38224a3 100644 --- a/drivers/net/irda/irda-usb.h +++ b/drivers/net/irda/irda-usb.h | |||
@@ -156,6 +156,7 @@ struct irda_usb_cb { | |||
156 | struct irlap_cb *irlap; /* The link layer we are binded to */ | 156 | struct irlap_cb *irlap; /* The link layer we are binded to */ |
157 | struct qos_info qos; | 157 | struct qos_info qos; |
158 | char *speed_buff; /* Buffer for speed changes */ | 158 | char *speed_buff; /* Buffer for speed changes */ |
159 | char *tx_buff; | ||
159 | 160 | ||
160 | struct timeval stamp; | 161 | struct timeval stamp; |
161 | struct timeval now; | 162 | struct timeval now; |
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index c14a74634fd5..20d306fea4cb 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include <asm/byteorder.h> | 59 | #include <asm/byteorder.h> |
60 | #include <asm/unaligned.h> | 60 | #include <asm/unaligned.h> |
61 | 61 | ||
62 | MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); | 62 | MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>"); |
63 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for SigmaTel STIr4200"); | 63 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for SigmaTel STIr4200"); |
64 | MODULE_LICENSE("GPL"); | 64 | MODULE_LICENSE("GPL"); |
65 | 65 | ||
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index 18c68193bf14..e2b1af618450 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -166,7 +166,7 @@ static void vlsi_proc_pdev(struct seq_file *seq, struct pci_dev *pdev) | |||
166 | unsigned i; | 166 | unsigned i; |
167 | 167 | ||
168 | seq_printf(seq, "\n%s (vid/did: %04x/%04x)\n", | 168 | seq_printf(seq, "\n%s (vid/did: %04x/%04x)\n", |
169 | PCIDEV_NAME(pdev), (int)pdev->vendor, (int)pdev->device); | 169 | pci_name(pdev), (int)pdev->vendor, (int)pdev->device); |
170 | seq_printf(seq, "pci-power-state: %u\n", (unsigned) pdev->current_state); | 170 | seq_printf(seq, "pci-power-state: %u\n", (unsigned) pdev->current_state); |
171 | seq_printf(seq, "resources: irq=%u / io=0x%04x / dma_mask=0x%016Lx\n", | 171 | seq_printf(seq, "resources: irq=%u / io=0x%04x / dma_mask=0x%016Lx\n", |
172 | pdev->irq, (unsigned)pci_resource_start(pdev, 0), (unsigned long long)pdev->dma_mask); | 172 | pdev->irq, (unsigned)pci_resource_start(pdev, 0), (unsigned long long)pdev->dma_mask); |
@@ -1401,7 +1401,7 @@ static void vlsi_tx_timeout(struct net_device *ndev) | |||
1401 | 1401 | ||
1402 | if (vlsi_start_hw(idev)) | 1402 | if (vlsi_start_hw(idev)) |
1403 | IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", | 1403 | IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", |
1404 | __FUNCTION__, PCIDEV_NAME(idev->pdev), ndev->name); | 1404 | __FUNCTION__, pci_name(idev->pdev), ndev->name); |
1405 | else | 1405 | else |
1406 | netif_start_queue(ndev); | 1406 | netif_start_queue(ndev); |
1407 | } | 1407 | } |
@@ -1643,7 +1643,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1643 | pdev->current_state = 0; /* hw must be running now */ | 1643 | pdev->current_state = 0; /* hw must be running now */ |
1644 | 1644 | ||
1645 | IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", | 1645 | IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", |
1646 | drivername, PCIDEV_NAME(pdev)); | 1646 | drivername, pci_name(pdev)); |
1647 | 1647 | ||
1648 | if ( !pci_resource_start(pdev,0) | 1648 | if ( !pci_resource_start(pdev,0) |
1649 | || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { | 1649 | || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { |
@@ -1728,7 +1728,7 @@ static void __devexit vlsi_irda_remove(struct pci_dev *pdev) | |||
1728 | 1728 | ||
1729 | pci_set_drvdata(pdev, NULL); | 1729 | pci_set_drvdata(pdev, NULL); |
1730 | 1730 | ||
1731 | IRDA_MESSAGE("%s: %s removed\n", drivername, PCIDEV_NAME(pdev)); | 1731 | IRDA_MESSAGE("%s: %s removed\n", drivername, pci_name(pdev)); |
1732 | } | 1732 | } |
1733 | 1733 | ||
1734 | #ifdef CONFIG_PM | 1734 | #ifdef CONFIG_PM |
@@ -1748,7 +1748,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1748 | 1748 | ||
1749 | if (!ndev) { | 1749 | if (!ndev) { |
1750 | IRDA_ERROR("%s - %s: no netdevice \n", | 1750 | IRDA_ERROR("%s - %s: no netdevice \n", |
1751 | __FUNCTION__, PCIDEV_NAME(pdev)); | 1751 | __FUNCTION__, pci_name(pdev)); |
1752 | return 0; | 1752 | return 0; |
1753 | } | 1753 | } |
1754 | idev = ndev->priv; | 1754 | idev = ndev->priv; |
@@ -1759,7 +1759,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1759 | pdev->current_state = state.event; | 1759 | pdev->current_state = state.event; |
1760 | } | 1760 | } |
1761 | else | 1761 | else |
1762 | IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, PCIDEV_NAME(pdev), pdev->current_state, state.event); | 1762 | IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, pci_name(pdev), pdev->current_state, state.event); |
1763 | up(&idev->sem); | 1763 | up(&idev->sem); |
1764 | return 0; | 1764 | return 0; |
1765 | } | 1765 | } |
@@ -1787,7 +1787,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1787 | 1787 | ||
1788 | if (!ndev) { | 1788 | if (!ndev) { |
1789 | IRDA_ERROR("%s - %s: no netdevice \n", | 1789 | IRDA_ERROR("%s - %s: no netdevice \n", |
1790 | __FUNCTION__, PCIDEV_NAME(pdev)); | 1790 | __FUNCTION__, pci_name(pdev)); |
1791 | return 0; | 1791 | return 0; |
1792 | } | 1792 | } |
1793 | idev = ndev->priv; | 1793 | idev = ndev->priv; |
@@ -1795,7 +1795,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1795 | if (pdev->current_state == 0) { | 1795 | if (pdev->current_state == 0) { |
1796 | up(&idev->sem); | 1796 | up(&idev->sem); |
1797 | IRDA_WARNING("%s - %s: already resumed\n", | 1797 | IRDA_WARNING("%s - %s: already resumed\n", |
1798 | __FUNCTION__, PCIDEV_NAME(pdev)); | 1798 | __FUNCTION__, pci_name(pdev)); |
1799 | return 0; | 1799 | return 0; |
1800 | } | 1800 | } |
1801 | 1801 | ||
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h index c37f0bc4c7f9..2d3b773d8e35 100644 --- a/drivers/net/irda/vlsi_ir.h +++ b/drivers/net/irda/vlsi_ir.h | |||
@@ -41,39 +41,6 @@ | |||
41 | #define PCI_CLASS_SUBCLASS_MASK 0xffff | 41 | #define PCI_CLASS_SUBCLASS_MASK 0xffff |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* in recent 2.5 interrupt handlers have non-void return value */ | ||
45 | #ifndef IRQ_RETVAL | ||
46 | typedef void irqreturn_t; | ||
47 | #define IRQ_NONE | ||
48 | #define IRQ_HANDLED | ||
49 | #define IRQ_RETVAL(x) | ||
50 | #endif | ||
51 | |||
52 | /* some stuff need to check kernelversion. Not all 2.5 stuff was present | ||
53 | * in early 2.5.x - the test is merely to separate 2.4 from 2.5 | ||
54 | */ | ||
55 | #include <linux/version.h> | ||
56 | |||
57 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | ||
58 | |||
59 | /* PDE() introduced in 2.5.4 */ | ||
60 | #ifdef CONFIG_PROC_FS | ||
61 | #define PDE(inode) ((inode)->i_private) | ||
62 | #endif | ||
63 | |||
64 | /* irda crc16 calculation exported in 2.5.42 */ | ||
65 | #define irda_calc_crc16(fcs,buf,len) (GOOD_FCS) | ||
66 | |||
67 | /* we use this for unified pci device name access */ | ||
68 | #define PCIDEV_NAME(pdev) ((pdev)->name) | ||
69 | |||
70 | #else /* 2.5 or later */ | ||
71 | |||
72 | /* whatever we get from the associated struct device - bus:slot:dev.fn id */ | ||
73 | #define PCIDEV_NAME(pdev) (pci_name(pdev)) | ||
74 | |||
75 | #endif | ||
76 | |||
77 | /* ================================================================ */ | 44 | /* ================================================================ */ |
78 | 45 | ||
79 | /* non-standard PCI registers */ | 46 | /* non-standard PCI registers */ |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index c41ae4286eea..b3bf86422734 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -314,6 +314,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force) | |||
314 | 314 | ||
315 | while (mp->tx_desc_count > 0) { | 315 | while (mp->tx_desc_count > 0) { |
316 | spin_lock_irqsave(&mp->lock, flags); | 316 | spin_lock_irqsave(&mp->lock, flags); |
317 | |||
318 | /* tx_desc_count might have changed before acquiring the lock */ | ||
319 | if (mp->tx_desc_count <= 0) { | ||
320 | spin_unlock_irqrestore(&mp->lock, flags); | ||
321 | return released; | ||
322 | } | ||
323 | |||
317 | tx_index = mp->tx_used_desc_q; | 324 | tx_index = mp->tx_used_desc_q; |
318 | desc = &mp->p_tx_desc_area[tx_index]; | 325 | desc = &mp->p_tx_desc_area[tx_index]; |
319 | cmd_sts = desc->cmd_sts; | 326 | cmd_sts = desc->cmd_sts; |
@@ -332,13 +339,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force) | |||
332 | if (skb) | 339 | if (skb) |
333 | mp->tx_skb[tx_index] = NULL; | 340 | mp->tx_skb[tx_index] = NULL; |
334 | 341 | ||
335 | spin_unlock_irqrestore(&mp->lock, flags); | ||
336 | |||
337 | if (cmd_sts & ETH_ERROR_SUMMARY) { | 342 | if (cmd_sts & ETH_ERROR_SUMMARY) { |
338 | printk("%s: Error in TX\n", dev->name); | 343 | printk("%s: Error in TX\n", dev->name); |
339 | mp->stats.tx_errors++; | 344 | mp->stats.tx_errors++; |
340 | } | 345 | } |
341 | 346 | ||
347 | spin_unlock_irqrestore(&mp->lock, flags); | ||
348 | |||
342 | if (cmd_sts & ETH_TX_FIRST_DESC) | 349 | if (cmd_sts & ETH_TX_FIRST_DESC) |
343 | dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE); | 350 | dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE); |
344 | else | 351 | else |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 07cf574197e5..61cbd4a60446 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -71,7 +71,7 @@ | |||
71 | #include "myri10ge_mcp.h" | 71 | #include "myri10ge_mcp.h" |
72 | #include "myri10ge_mcp_gen_header.h" | 72 | #include "myri10ge_mcp_gen_header.h" |
73 | 73 | ||
74 | #define MYRI10GE_VERSION_STR "1.1.0" | 74 | #define MYRI10GE_VERSION_STR "1.2.0" |
75 | 75 | ||
76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
77 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 77 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -274,6 +274,10 @@ static int myri10ge_fill_thresh = 256; | |||
274 | module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); | 274 | module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); |
275 | MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); | 275 | MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); |
276 | 276 | ||
277 | static int myri10ge_wcfifo = 1; | ||
278 | module_param(myri10ge_wcfifo, int, S_IRUGO); | ||
279 | MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); | ||
280 | |||
277 | #define MYRI10GE_FW_OFFSET 1024*1024 | 281 | #define MYRI10GE_FW_OFFSET 1024*1024 |
278 | #define MYRI10GE_HIGHPART_TO_U32(X) \ | 282 | #define MYRI10GE_HIGHPART_TO_U32(X) \ |
279 | (sizeof (X) == 8) ? ((u32)((u64)(X) >> 32)) : (0) | 283 | (sizeof (X) == 8) ? ((u32)((u64)(X) >> 32)) : (0) |
@@ -1714,7 +1718,7 @@ static int myri10ge_open(struct net_device *dev) | |||
1714 | goto abort_with_irq; | 1718 | goto abort_with_irq; |
1715 | } | 1719 | } |
1716 | 1720 | ||
1717 | if (mgp->mtrr >= 0) { | 1721 | if (myri10ge_wcfifo && mgp->mtrr >= 0) { |
1718 | mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; | 1722 | mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; |
1719 | mgp->rx_small.wc_fifo = | 1723 | mgp->rx_small.wc_fifo = |
1720 | (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; | 1724 | (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; |
@@ -2878,7 +2882,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2878 | netdev->hard_start_xmit = myri10ge_xmit; | 2882 | netdev->hard_start_xmit = myri10ge_xmit; |
2879 | netdev->get_stats = myri10ge_get_stats; | 2883 | netdev->get_stats = myri10ge_get_stats; |
2880 | netdev->base_addr = mgp->iomem_base; | 2884 | netdev->base_addr = mgp->iomem_base; |
2881 | netdev->irq = pdev->irq; | ||
2882 | netdev->change_mtu = myri10ge_change_mtu; | 2885 | netdev->change_mtu = myri10ge_change_mtu; |
2883 | netdev->set_multicast_list = myri10ge_set_multicast_list; | 2886 | netdev->set_multicast_list = myri10ge_set_multicast_list; |
2884 | netdev->set_mac_address = myri10ge_set_mac_address; | 2887 | netdev->set_mac_address = myri10ge_set_mac_address; |
@@ -2888,6 +2891,15 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2888 | netdev->poll = myri10ge_poll; | 2891 | netdev->poll = myri10ge_poll; |
2889 | netdev->weight = myri10ge_napi_weight; | 2892 | netdev->weight = myri10ge_napi_weight; |
2890 | 2893 | ||
2894 | /* make sure we can get an irq, and that MSI can be | ||
2895 | * setup (if available). Also ensure netdev->irq | ||
2896 | * is set to correct value if MSI is enabled */ | ||
2897 | status = myri10ge_request_irq(mgp); | ||
2898 | if (status != 0) | ||
2899 | goto abort_with_firmware; | ||
2900 | netdev->irq = pdev->irq; | ||
2901 | myri10ge_free_irq(mgp); | ||
2902 | |||
2891 | /* Save configuration space to be restored if the | 2903 | /* Save configuration space to be restored if the |
2892 | * nic resets due to a parity error */ | 2904 | * nic resets due to a parity error */ |
2893 | pci_save_state(pdev); | 2905 | pci_save_state(pdev); |
@@ -2903,8 +2915,9 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2903 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); | 2915 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); |
2904 | goto abort_with_state; | 2916 | goto abort_with_state; |
2905 | } | 2917 | } |
2906 | dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n", | 2918 | dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", |
2907 | pdev->irq, mgp->tx.boundary, mgp->fw_name, | 2919 | (mgp->msi_enabled ? "MSI" : "xPIC"), |
2920 | netdev->irq, mgp->tx.boundary, mgp->fw_name, | ||
2908 | (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); | 2921 | (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); |
2909 | 2922 | ||
2910 | return 0; | 2923 | return 0; |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 6490acf05305..e8598b809228 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -63,12 +63,11 @@ | |||
63 | 63 | ||
64 | #include "netxen_nic_hw.h" | 64 | #include "netxen_nic_hw.h" |
65 | 65 | ||
66 | #define NETXEN_NIC_BUILD_NO "4" | 66 | #define NETXEN_NIC_BUILD_NO "2" |
67 | #define _NETXEN_NIC_LINUX_MAJOR 3 | 67 | #define _NETXEN_NIC_LINUX_MAJOR 3 |
68 | #define _NETXEN_NIC_LINUX_MINOR 3 | 68 | #define _NETXEN_NIC_LINUX_MINOR 3 |
69 | #define _NETXEN_NIC_LINUX_SUBVERSION 2 | 69 | #define _NETXEN_NIC_LINUX_SUBVERSION 3 |
70 | #define NETXEN_NIC_LINUX_VERSIONID "3.3.2" "-" NETXEN_NIC_BUILD_NO | 70 | #define NETXEN_NIC_LINUX_VERSIONID "3.3.3" "-" NETXEN_NIC_BUILD_NO |
71 | #define NETXEN_NIC_FW_VERSIONID "3.3.2" | ||
72 | 71 | ||
73 | #define RCV_DESC_RINGSIZE \ | 72 | #define RCV_DESC_RINGSIZE \ |
74 | (sizeof(struct rcv_desc) * adapter->max_rx_desc_count) | 73 | (sizeof(struct rcv_desc) * adapter->max_rx_desc_count) |
@@ -240,49 +239,39 @@ extern unsigned long long netxen_dma_mask; | |||
240 | 239 | ||
241 | typedef u32 netxen_ctx_msg; | 240 | typedef u32 netxen_ctx_msg; |
242 | 241 | ||
243 | #define _netxen_set_bits(config_word, start, bits, val) {\ | ||
244 | unsigned long long mask = (((1ULL << (bits)) - 1) << (start)); \ | ||
245 | unsigned long long value = (val); \ | ||
246 | (config_word) &= ~mask; \ | ||
247 | (config_word) |= (((value) << (start)) & mask); \ | ||
248 | } | ||
249 | |||
250 | #define netxen_set_msg_peg_id(config_word, val) \ | 242 | #define netxen_set_msg_peg_id(config_word, val) \ |
251 | _netxen_set_bits(config_word, 0, 2, val) | 243 | ((config_word) &= ~3, (config_word) |= val & 3) |
252 | #define netxen_set_msg_privid(config_word) \ | 244 | #define netxen_set_msg_privid(config_word) \ |
253 | set_bit(2, (unsigned long*)&config_word) | 245 | ((config_word) |= 1 << 2) |
254 | #define netxen_set_msg_count(config_word, val) \ | 246 | #define netxen_set_msg_count(config_word, val) \ |
255 | _netxen_set_bits(config_word, 3, 15, val) | 247 | ((config_word) &= ~(0x7fff<<3), (config_word) |= (val & 0x7fff) << 3) |
256 | #define netxen_set_msg_ctxid(config_word, val) \ | 248 | #define netxen_set_msg_ctxid(config_word, val) \ |
257 | _netxen_set_bits(config_word, 18, 10, val) | 249 | ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18) |
258 | #define netxen_set_msg_opcode(config_word, val) \ | 250 | #define netxen_set_msg_opcode(config_word, val) \ |
259 | _netxen_set_bits(config_word, 28, 4, val) | 251 | ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24) |
260 | 252 | ||
261 | struct netxen_rcv_context { | 253 | struct netxen_rcv_context { |
262 | u32 rcv_ring_addr_lo; | 254 | __le64 rcv_ring_addr; |
263 | u32 rcv_ring_addr_hi; | 255 | __le32 rcv_ring_size; |
264 | u32 rcv_ring_size; | 256 | __le32 rsrvd; |
265 | u32 rsrvd; | ||
266 | }; | 257 | }; |
267 | 258 | ||
268 | struct netxen_ring_ctx { | 259 | struct netxen_ring_ctx { |
269 | 260 | ||
270 | /* one command ring */ | 261 | /* one command ring */ |
271 | u64 cmd_consumer_offset; | 262 | __le64 cmd_consumer_offset; |
272 | u32 cmd_ring_addr_lo; | 263 | __le64 cmd_ring_addr; |
273 | u32 cmd_ring_addr_hi; | 264 | __le32 cmd_ring_size; |
274 | u32 cmd_ring_size; | 265 | __le32 rsrvd; |
275 | u32 rsrvd; | ||
276 | 266 | ||
277 | /* three receive rings */ | 267 | /* three receive rings */ |
278 | struct netxen_rcv_context rcv_ctx[3]; | 268 | struct netxen_rcv_context rcv_ctx[3]; |
279 | 269 | ||
280 | /* one status ring */ | 270 | /* one status ring */ |
281 | u32 sts_ring_addr_lo; | 271 | __le64 sts_ring_addr; |
282 | u32 sts_ring_addr_hi; | 272 | __le32 sts_ring_size; |
283 | u32 sts_ring_size; | ||
284 | 273 | ||
285 | u32 ctx_id; | 274 | __le32 ctx_id; |
286 | } __attribute__ ((aligned(64))); | 275 | } __attribute__ ((aligned(64))); |
287 | 276 | ||
288 | /* | 277 | /* |
@@ -306,81 +295,85 @@ struct netxen_ring_ctx { | |||
306 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) | 295 | ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) |
307 | 296 | ||
308 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 297 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ |
309 | _netxen_set_bits((cmd_desc)->flags_opcode, 0, 7, val) | 298 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ |
299 | (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) | ||
310 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ | 300 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ |
311 | _netxen_set_bits((cmd_desc)->flags_opcode, 7, 6, val) | 301 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ |
302 | (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7))) | ||
312 | 303 | ||
313 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ | 304 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ |
314 | _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 0, 8, val); | 305 | ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ |
306 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) | ||
315 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ | 307 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ |
316 | _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 8, 24, val); | 308 | ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ |
309 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24)) | ||
317 | 310 | ||
318 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ | 311 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ |
319 | (((cmd_desc)->flags_opcode >> 7) & 0x003F) | 312 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) |
320 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ | 313 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ |
321 | (((cmd_desc)->num_of_buffers_total_length >> 8) & 0x0FFFFFF) | 314 | (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) |
322 | 315 | ||
323 | struct cmd_desc_type0 { | 316 | struct cmd_desc_type0 { |
324 | u8 tcp_hdr_offset; /* For LSO only */ | 317 | u8 tcp_hdr_offset; /* For LSO only */ |
325 | u8 ip_hdr_offset; /* For LSO only */ | 318 | u8 ip_hdr_offset; /* For LSO only */ |
326 | /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ | 319 | /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ |
327 | u16 flags_opcode; | 320 | __le16 flags_opcode; |
328 | /* Bit pattern: 0-7 total number of segments, | 321 | /* Bit pattern: 0-7 total number of segments, |
329 | 8-31 Total size of the packet */ | 322 | 8-31 Total size of the packet */ |
330 | u32 num_of_buffers_total_length; | 323 | __le32 num_of_buffers_total_length; |
331 | union { | 324 | union { |
332 | struct { | 325 | struct { |
333 | u32 addr_low_part2; | 326 | __le32 addr_low_part2; |
334 | u32 addr_high_part2; | 327 | __le32 addr_high_part2; |
335 | }; | 328 | }; |
336 | u64 addr_buffer2; | 329 | __le64 addr_buffer2; |
337 | }; | 330 | }; |
338 | 331 | ||
339 | u16 reference_handle; /* changed to u16 to add mss */ | 332 | __le16 reference_handle; /* changed to u16 to add mss */ |
340 | u16 mss; /* passed by NDIS_PACKET for LSO */ | 333 | __le16 mss; /* passed by NDIS_PACKET for LSO */ |
341 | /* Bit pattern 0-3 port, 0-3 ctx id */ | 334 | /* Bit pattern 0-3 port, 0-3 ctx id */ |
342 | u8 port_ctxid; | 335 | u8 port_ctxid; |
343 | u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ | 336 | u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ |
344 | u16 conn_id; /* IPSec offoad only */ | 337 | __le16 conn_id; /* IPSec offoad only */ |
345 | 338 | ||
346 | union { | 339 | union { |
347 | struct { | 340 | struct { |
348 | u32 addr_low_part3; | 341 | __le32 addr_low_part3; |
349 | u32 addr_high_part3; | 342 | __le32 addr_high_part3; |
350 | }; | 343 | }; |
351 | u64 addr_buffer3; | 344 | __le64 addr_buffer3; |
352 | }; | 345 | }; |
353 | union { | 346 | union { |
354 | struct { | 347 | struct { |
355 | u32 addr_low_part1; | 348 | __le32 addr_low_part1; |
356 | u32 addr_high_part1; | 349 | __le32 addr_high_part1; |
357 | }; | 350 | }; |
358 | u64 addr_buffer1; | 351 | __le64 addr_buffer1; |
359 | }; | 352 | }; |
360 | 353 | ||
361 | u16 buffer1_length; | 354 | __le16 buffer1_length; |
362 | u16 buffer2_length; | 355 | __le16 buffer2_length; |
363 | u16 buffer3_length; | 356 | __le16 buffer3_length; |
364 | u16 buffer4_length; | 357 | __le16 buffer4_length; |
365 | 358 | ||
366 | union { | 359 | union { |
367 | struct { | 360 | struct { |
368 | u32 addr_low_part4; | 361 | __le32 addr_low_part4; |
369 | u32 addr_high_part4; | 362 | __le32 addr_high_part4; |
370 | }; | 363 | }; |
371 | u64 addr_buffer4; | 364 | __le64 addr_buffer4; |
372 | }; | 365 | }; |
373 | 366 | ||
374 | u64 unused; | 367 | __le64 unused; |
375 | 368 | ||
376 | } __attribute__ ((aligned(64))); | 369 | } __attribute__ ((aligned(64))); |
377 | 370 | ||
378 | /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ | 371 | /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ |
379 | struct rcv_desc { | 372 | struct rcv_desc { |
380 | u16 reference_handle; | 373 | __le16 reference_handle; |
381 | u16 reserved; | 374 | __le16 reserved; |
382 | u32 buffer_length; /* allocated buffer length (usually 2K) */ | 375 | __le32 buffer_length; /* allocated buffer length (usually 2K) */ |
383 | u64 addr_buffer; | 376 | __le64 addr_buffer; |
384 | }; | 377 | }; |
385 | 378 | ||
386 | /* opcode field in status_desc */ | 379 | /* opcode field in status_desc */ |
@@ -406,36 +399,36 @@ struct rcv_desc { | |||
406 | (((status_desc)->lro & 0x80) >> 7) | 399 | (((status_desc)->lro & 0x80) >> 7) |
407 | 400 | ||
408 | #define netxen_get_sts_port(status_desc) \ | 401 | #define netxen_get_sts_port(status_desc) \ |
409 | ((status_desc)->status_desc_data & 0x0F) | 402 | (le64_to_cpu((status_desc)->status_desc_data) & 0x0F) |
410 | #define netxen_get_sts_status(status_desc) \ | 403 | #define netxen_get_sts_status(status_desc) \ |
411 | (((status_desc)->status_desc_data >> 4) & 0x0F) | 404 | ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F) |
412 | #define netxen_get_sts_type(status_desc) \ | 405 | #define netxen_get_sts_type(status_desc) \ |
413 | (((status_desc)->status_desc_data >> 8) & 0x0F) | 406 | ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F) |
414 | #define netxen_get_sts_totallength(status_desc) \ | 407 | #define netxen_get_sts_totallength(status_desc) \ |
415 | (((status_desc)->status_desc_data >> 12) & 0xFFFF) | 408 | ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF) |
416 | #define netxen_get_sts_refhandle(status_desc) \ | 409 | #define netxen_get_sts_refhandle(status_desc) \ |
417 | (((status_desc)->status_desc_data >> 28) & 0xFFFF) | 410 | ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF) |
418 | #define netxen_get_sts_prot(status_desc) \ | 411 | #define netxen_get_sts_prot(status_desc) \ |
419 | (((status_desc)->status_desc_data >> 44) & 0x0F) | 412 | ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F) |
420 | #define netxen_get_sts_owner(status_desc) \ | 413 | #define netxen_get_sts_owner(status_desc) \ |
421 | (((status_desc)->status_desc_data >> 56) & 0x03) | 414 | ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) |
422 | #define netxen_get_sts_opcode(status_desc) \ | 415 | #define netxen_get_sts_opcode(status_desc) \ |
423 | (((status_desc)->status_desc_data >> 58) & 0x03F) | 416 | ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F) |
424 | 417 | ||
425 | #define netxen_clear_sts_owner(status_desc) \ | 418 | #define netxen_clear_sts_owner(status_desc) \ |
426 | ((status_desc)->status_desc_data &= \ | 419 | ((status_desc)->status_desc_data &= \ |
427 | ~(((unsigned long long)3) << 56 )) | 420 | ~cpu_to_le64(((unsigned long long)3) << 56 )) |
428 | #define netxen_set_sts_owner(status_desc, val) \ | 421 | #define netxen_set_sts_owner(status_desc, val) \ |
429 | ((status_desc)->status_desc_data |= \ | 422 | ((status_desc)->status_desc_data |= \ |
430 | (((unsigned long long)((val) & 0x3)) << 56 )) | 423 | cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 )) |
431 | 424 | ||
432 | struct status_desc { | 425 | struct status_desc { |
433 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length | 426 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length |
434 | 28-43 reference_handle, 44-47 protocol, 48-52 unused | 427 | 28-43 reference_handle, 44-47 protocol, 48-52 unused |
435 | 53-55 desc_cnt, 56-57 owner, 58-63 opcode | 428 | 53-55 desc_cnt, 56-57 owner, 58-63 opcode |
436 | */ | 429 | */ |
437 | u64 status_desc_data; | 430 | __le64 status_desc_data; |
438 | u32 hash_value; | 431 | __le32 hash_value; |
439 | u8 hash_type; | 432 | u8 hash_type; |
440 | u8 msg_type; | 433 | u8 msg_type; |
441 | u8 unused; | 434 | u8 unused; |
@@ -1006,9 +999,9 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port, | |||
1006 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, | 999 | void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, |
1007 | long enable); | 1000 | long enable); |
1008 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, | 1001 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, |
1009 | __le32 * readval); | 1002 | __u32 * readval); |
1010 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, | 1003 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, |
1011 | long reg, __le32 val); | 1004 | long reg, __u32 val); |
1012 | 1005 | ||
1013 | /* Functions available from netxen_nic_hw.c */ | 1006 | /* Functions available from netxen_nic_hw.c */ |
1014 | int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); | 1007 | int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 34044616b3c8..c381d77a7336 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -218,7 +218,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
218 | { | 218 | { |
219 | struct netxen_port *port = netdev_priv(dev); | 219 | struct netxen_port *port = netdev_priv(dev); |
220 | struct netxen_adapter *adapter = port->adapter; | 220 | struct netxen_adapter *adapter = port->adapter; |
221 | __le32 status; | 221 | __u32 status; |
222 | 222 | ||
223 | /* read which mode */ | 223 | /* read which mode */ |
224 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 224 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
@@ -226,7 +226,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
226 | if (adapter->phy_write | 226 | if (adapter->phy_write |
227 | && adapter->phy_write(adapter, port->portnum, | 227 | && adapter->phy_write(adapter, port->portnum, |
228 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 228 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
229 | (__le32) ecmd->autoneg) != 0) | 229 | ecmd->autoneg) != 0) |
230 | return -EIO; | 230 | return -EIO; |
231 | else | 231 | else |
232 | port->link_autoneg = ecmd->autoneg; | 232 | port->link_autoneg = ecmd->autoneg; |
@@ -279,7 +279,7 @@ static int netxen_nic_get_regs_len(struct net_device *dev) | |||
279 | } | 279 | } |
280 | 280 | ||
281 | struct netxen_niu_regs { | 281 | struct netxen_niu_regs { |
282 | __le32 reg[NETXEN_NIC_REGS_COUNT]; | 282 | __u32 reg[NETXEN_NIC_REGS_COUNT]; |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static struct netxen_niu_regs niu_registers[] = { | 285 | static struct netxen_niu_regs niu_registers[] = { |
@@ -372,7 +372,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) | |||
372 | { | 372 | { |
373 | struct netxen_port *port = netdev_priv(dev); | 373 | struct netxen_port *port = netdev_priv(dev); |
374 | struct netxen_adapter *adapter = port->adapter; | 374 | struct netxen_adapter *adapter = port->adapter; |
375 | __le32 mode, *regs_buff = p; | 375 | __u32 mode, *regs_buff = p; |
376 | void __iomem *addr; | 376 | void __iomem *addr; |
377 | int i, window; | 377 | int i, window; |
378 | 378 | ||
@@ -415,7 +415,7 @@ static u32 netxen_nic_get_link(struct net_device *dev) | |||
415 | { | 415 | { |
416 | struct netxen_port *port = netdev_priv(dev); | 416 | struct netxen_port *port = netdev_priv(dev); |
417 | struct netxen_adapter *adapter = port->adapter; | 417 | struct netxen_adapter *adapter = port->adapter; |
418 | __le32 status; | 418 | __u32 status; |
419 | 419 | ||
420 | /* read which mode */ | 420 | /* read which mode */ |
421 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 421 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
@@ -482,13 +482,13 @@ netxen_nic_get_pauseparam(struct net_device *dev, | |||
482 | { | 482 | { |
483 | struct netxen_port *port = netdev_priv(dev); | 483 | struct netxen_port *port = netdev_priv(dev); |
484 | struct netxen_adapter *adapter = port->adapter; | 484 | struct netxen_adapter *adapter = port->adapter; |
485 | __le32 val; | 485 | __u32 val; |
486 | 486 | ||
487 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 487 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
488 | /* get flow control settings */ | 488 | /* get flow control settings */ |
489 | netxen_nic_read_w0(adapter, | 489 | netxen_nic_read_w0(adapter, |
490 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), | 490 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), |
491 | (u32 *) & val); | 491 | &val); |
492 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); | 492 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); |
493 | pause->tx_pause = netxen_gb_get_tx_flowctl(val); | 493 | pause->tx_pause = netxen_gb_get_tx_flowctl(val); |
494 | /* get autoneg settings */ | 494 | /* get autoneg settings */ |
@@ -502,7 +502,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
502 | { | 502 | { |
503 | struct netxen_port *port = netdev_priv(dev); | 503 | struct netxen_port *port = netdev_priv(dev); |
504 | struct netxen_adapter *adapter = port->adapter; | 504 | struct netxen_adapter *adapter = port->adapter; |
505 | __le32 val; | 505 | __u32 val; |
506 | unsigned int autoneg; | 506 | unsigned int autoneg; |
507 | 507 | ||
508 | /* read mode */ | 508 | /* read mode */ |
@@ -522,13 +522,13 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
522 | 522 | ||
523 | netxen_nic_write_w0(adapter, | 523 | netxen_nic_write_w0(adapter, |
524 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), | 524 | NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), |
525 | *(u32 *) (&val)); | 525 | *&val); |
526 | /* set autoneg */ | 526 | /* set autoneg */ |
527 | autoneg = pause->autoneg; | 527 | autoneg = pause->autoneg; |
528 | if (adapter->phy_write | 528 | if (adapter->phy_write |
529 | && adapter->phy_write(adapter, port->portnum, | 529 | && adapter->phy_write(adapter, port->portnum, |
530 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, | 530 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
531 | (__le32) autoneg) != 0) | 531 | autoneg) != 0) |
532 | return -EIO; | 532 | return -EIO; |
533 | else { | 533 | else { |
534 | port->link_autoneg = pause->autoneg; | 534 | port->link_autoneg = pause->autoneg; |
@@ -543,7 +543,7 @@ static int netxen_nic_reg_test(struct net_device *dev) | |||
543 | struct netxen_port *port = netdev_priv(dev); | 543 | struct netxen_port *port = netdev_priv(dev); |
544 | struct netxen_adapter *adapter = port->adapter; | 544 | struct netxen_adapter *adapter = port->adapter; |
545 | u32 data_read, data_written, save; | 545 | u32 data_read, data_written, save; |
546 | __le32 mode; | 546 | __u32 mode; |
547 | 547 | ||
548 | /* | 548 | /* |
549 | * first test the "Read Only" registers by writing which mode | 549 | * first test the "Read Only" registers by writing which mode |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index c0c31d1914a7..f263232f499f 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev) | |||
95 | struct netxen_port *port = netdev_priv(netdev); | 95 | struct netxen_port *port = netdev_priv(netdev); |
96 | struct netxen_adapter *adapter = port->adapter; | 96 | struct netxen_adapter *adapter = port->adapter; |
97 | struct dev_mc_list *mc_ptr; | 97 | struct dev_mc_list *mc_ptr; |
98 | __le32 netxen_mac_addr_cntl_data = 0; | 98 | __u32 netxen_mac_addr_cntl_data = 0; |
99 | 99 | ||
100 | mc_ptr = netdev->mc_list; | 100 | mc_ptr = netdev->mc_list; |
101 | if (netdev->flags & IFF_PROMISC) { | 101 | if (netdev->flags & IFF_PROMISC) { |
@@ -236,8 +236,9 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
236 | } | 236 | } |
237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); | 237 | memset(addr, 0, sizeof(struct netxen_ring_ctx)); |
238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; | 238 | adapter->ctx_desc = (struct netxen_ring_ctx *)addr; |
239 | adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr | 239 | adapter->ctx_desc->cmd_consumer_offset = |
240 | + sizeof(struct netxen_ring_ctx); | 240 | cpu_to_le64(adapter->ctx_desc_phys_addr + |
241 | sizeof(struct netxen_ring_ctx)); | ||
241 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + | 242 | adapter->cmd_consumer = (uint32_t *) (((char *)addr) + |
242 | sizeof(struct netxen_ring_ctx)); | 243 | sizeof(struct netxen_ring_ctx)); |
243 | 244 | ||
@@ -253,11 +254,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
253 | return -ENOMEM; | 254 | return -ENOMEM; |
254 | } | 255 | } |
255 | 256 | ||
256 | adapter->ctx_desc->cmd_ring_addr_lo = | 257 | adapter->ctx_desc->cmd_ring_addr = |
257 | hw->cmd_desc_phys_addr & 0xffffffffUL; | 258 | cpu_to_le64(hw->cmd_desc_phys_addr); |
258 | adapter->ctx_desc->cmd_ring_addr_hi = | 259 | adapter->ctx_desc->cmd_ring_size = |
259 | ((u64) hw->cmd_desc_phys_addr >> 32); | 260 | cpu_to_le32(adapter->max_tx_desc_count); |
260 | adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count; | ||
261 | 261 | ||
262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; | 262 | hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; |
263 | 263 | ||
@@ -278,12 +278,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
278 | return err; | 278 | return err; |
279 | } | 279 | } |
280 | rcv_desc->desc_head = (struct rcv_desc *)addr; | 280 | rcv_desc->desc_head = (struct rcv_desc *)addr; |
281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo = | 281 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr = |
282 | rcv_desc->phys_addr & 0xffffffffUL; | 282 | cpu_to_le64(rcv_desc->phys_addr); |
283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi = | ||
284 | ((u64) rcv_desc->phys_addr >> 32); | ||
285 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = | 283 | adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = |
286 | rcv_desc->max_rx_desc_count; | 284 | cpu_to_le32(rcv_desc->max_rx_desc_count); |
287 | } | 285 | } |
288 | 286 | ||
289 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, | 287 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, |
@@ -297,11 +295,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
297 | return err; | 295 | return err; |
298 | } | 296 | } |
299 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; | 297 | recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; |
300 | adapter->ctx_desc->sts_ring_addr_lo = | 298 | adapter->ctx_desc->sts_ring_addr = |
301 | recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL; | 299 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); |
302 | adapter->ctx_desc->sts_ring_addr_hi = | 300 | adapter->ctx_desc->sts_ring_size = |
303 | ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32); | 301 | cpu_to_le32(adapter->max_rx_desc_count); |
304 | adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count; | ||
305 | 302 | ||
306 | } | 303 | } |
307 | /* Window = 1 */ | 304 | /* Window = 1 */ |
@@ -387,10 +384,6 @@ void netxen_tso_check(struct netxen_adapter *adapter, | |||
387 | } | 384 | } |
388 | adapter->stats.xmitcsummed++; | 385 | adapter->stats.xmitcsummed++; |
389 | desc->tcp_hdr_offset = skb->h.raw - skb->data; | 386 | desc->tcp_hdr_offset = skb->h.raw - skb->data; |
390 | netxen_set_cmd_desc_totallength(desc, | ||
391 | cpu_to_le32 | ||
392 | (netxen_get_cmd_desc_totallength | ||
393 | (desc))); | ||
394 | desc->ip_hdr_offset = skb->nh.raw - skb->data; | 387 | desc->ip_hdr_offset = skb->nh.raw - skb->data; |
395 | } | 388 | } |
396 | 389 | ||
@@ -867,9 +860,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off, | |||
867 | void netxen_nic_set_link_parameters(struct netxen_port *port) | 860 | void netxen_nic_set_link_parameters(struct netxen_port *port) |
868 | { | 861 | { |
869 | struct netxen_adapter *adapter = port->adapter; | 862 | struct netxen_adapter *adapter = port->adapter; |
870 | __le32 status; | 863 | __u32 status; |
871 | __le32 autoneg; | 864 | __u32 autoneg; |
872 | __le32 mode; | 865 | __u32 mode; |
873 | 866 | ||
874 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 867 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); |
875 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 868 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ |
@@ -984,7 +977,8 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter) | |||
984 | _NETXEN_NIC_LINUX_MAJOR, fw_major); | 977 | _NETXEN_NIC_LINUX_MAJOR, fw_major); |
985 | adapter->driver_mismatch = 1; | 978 | adapter->driver_mismatch = 1; |
986 | } | 979 | } |
987 | if (fw_minor != _NETXEN_NIC_LINUX_MINOR) { | 980 | if (fw_minor != _NETXEN_NIC_LINUX_MINOR && |
981 | fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) { | ||
988 | printk(KERN_ERR "The mismatch in driver version and firmware " | 982 | printk(KERN_ERR "The mismatch in driver version and firmware " |
989 | "version minor number\n" | 983 | "version minor number\n" |
990 | "Driver version minor number = %d \t" | 984 | "Driver version minor number = %d \t" |
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h index 0685633a9c1e..ab1112eb1b0d 100644 --- a/drivers/net/netxen/netxen_nic_hw.h +++ b/drivers/net/netxen/netxen_nic_hw.h | |||
@@ -124,28 +124,28 @@ typedef enum { | |||
124 | */ | 124 | */ |
125 | 125 | ||
126 | #define netxen_gb_enable_tx(config_word) \ | 126 | #define netxen_gb_enable_tx(config_word) \ |
127 | set_bit(0, (unsigned long*)(&config_word)) | 127 | ((config_word) |= 1 << 0) |
128 | #define netxen_gb_enable_rx(config_word) \ | 128 | #define netxen_gb_enable_rx(config_word) \ |
129 | set_bit(2, (unsigned long*)(&config_word)) | 129 | ((config_word) |= 1 << 2) |
130 | #define netxen_gb_tx_flowctl(config_word) \ | 130 | #define netxen_gb_tx_flowctl(config_word) \ |
131 | set_bit(4, (unsigned long*)(&config_word)) | 131 | ((config_word) |= 1 << 4) |
132 | #define netxen_gb_rx_flowctl(config_word) \ | 132 | #define netxen_gb_rx_flowctl(config_word) \ |
133 | set_bit(5, (unsigned long*)(&config_word)) | 133 | ((config_word) |= 1 << 5) |
134 | #define netxen_gb_tx_reset_pb(config_word) \ | 134 | #define netxen_gb_tx_reset_pb(config_word) \ |
135 | set_bit(16, (unsigned long*)(&config_word)) | 135 | ((config_word) |= 1 << 16) |
136 | #define netxen_gb_rx_reset_pb(config_word) \ | 136 | #define netxen_gb_rx_reset_pb(config_word) \ |
137 | set_bit(17, (unsigned long*)(&config_word)) | 137 | ((config_word) |= 1 << 17) |
138 | #define netxen_gb_tx_reset_mac(config_word) \ | 138 | #define netxen_gb_tx_reset_mac(config_word) \ |
139 | set_bit(18, (unsigned long*)(&config_word)) | 139 | ((config_word) |= 1 << 18) |
140 | #define netxen_gb_rx_reset_mac(config_word) \ | 140 | #define netxen_gb_rx_reset_mac(config_word) \ |
141 | set_bit(19, (unsigned long*)(&config_word)) | 141 | ((config_word) |= 1 << 19) |
142 | #define netxen_gb_soft_reset(config_word) \ | 142 | #define netxen_gb_soft_reset(config_word) \ |
143 | set_bit(31, (unsigned long*)(&config_word)) | 143 | ((config_word) |= 1 << 31) |
144 | 144 | ||
145 | #define netxen_gb_unset_tx_flowctl(config_word) \ | 145 | #define netxen_gb_unset_tx_flowctl(config_word) \ |
146 | clear_bit(4, (unsigned long *)(&config_word)) | 146 | ((config_word) &= ~(1 << 4)) |
147 | #define netxen_gb_unset_rx_flowctl(config_word) \ | 147 | #define netxen_gb_unset_rx_flowctl(config_word) \ |
148 | clear_bit(5, (unsigned long*)(&config_word)) | 148 | ((config_word) &= ~(1 << 5)) |
149 | 149 | ||
150 | #define netxen_gb_get_tx_synced(config_word) \ | 150 | #define netxen_gb_get_tx_synced(config_word) \ |
151 | _netxen_crb_get_bit((config_word), 1) | 151 | _netxen_crb_get_bit((config_word), 1) |
@@ -171,15 +171,15 @@ typedef enum { | |||
171 | */ | 171 | */ |
172 | 172 | ||
173 | #define netxen_gb_set_duplex(config_word) \ | 173 | #define netxen_gb_set_duplex(config_word) \ |
174 | set_bit(0, (unsigned long*)&config_word) | 174 | ((config_word) |= 1 << 0) |
175 | #define netxen_gb_set_crc_enable(config_word) \ | 175 | #define netxen_gb_set_crc_enable(config_word) \ |
176 | set_bit(1, (unsigned long*)&config_word) | 176 | ((config_word) |= 1 << 1) |
177 | #define netxen_gb_set_padshort(config_word) \ | 177 | #define netxen_gb_set_padshort(config_word) \ |
178 | set_bit(2, (unsigned long*)&config_word) | 178 | ((config_word) |= 1 << 2) |
179 | #define netxen_gb_set_checklength(config_word) \ | 179 | #define netxen_gb_set_checklength(config_word) \ |
180 | set_bit(4, (unsigned long*)&config_word) | 180 | ((config_word) |= 1 << 4) |
181 | #define netxen_gb_set_hugeframes(config_word) \ | 181 | #define netxen_gb_set_hugeframes(config_word) \ |
182 | set_bit(5, (unsigned long*)&config_word) | 182 | ((config_word) |= 1 << 5) |
183 | #define netxen_gb_set_preamblelen(config_word, val) \ | 183 | #define netxen_gb_set_preamblelen(config_word, val) \ |
184 | ((config_word) |= ((val) << 12) & 0xF000) | 184 | ((config_word) |= ((val) << 12) & 0xF000) |
185 | #define netxen_gb_set_intfmode(config_word, val) \ | 185 | #define netxen_gb_set_intfmode(config_word, val) \ |
@@ -190,9 +190,9 @@ typedef enum { | |||
190 | #define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ | 190 | #define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ |
191 | ((config_word) |= ((val) & 0x07)) | 191 | ((config_word) |= ((val) & 0x07)) |
192 | #define netxen_gb_mii_mgmt_reset(config_word) \ | 192 | #define netxen_gb_mii_mgmt_reset(config_word) \ |
193 | set_bit(31, (unsigned long*)&config_word) | 193 | ((config_word) |= 1 << 31) |
194 | #define netxen_gb_mii_mgmt_unset(config_word) \ | 194 | #define netxen_gb_mii_mgmt_unset(config_word) \ |
195 | clear_bit(31, (unsigned long*)&config_word) | 195 | ((config_word) &= ~(1 << 31)) |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) | 198 | * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) |
@@ -201,7 +201,7 @@ typedef enum { | |||
201 | */ | 201 | */ |
202 | 202 | ||
203 | #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ | 203 | #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ |
204 | set_bit(0, (unsigned long*)&config_word) | 204 | ((config_word) |= 1 << 0) |
205 | #define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ | 205 | #define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ |
206 | ((config_word) |= ((val) & 0x1F)) | 206 | ((config_word) |= ((val) & 0x1F)) |
207 | #define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ | 207 | #define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ |
@@ -274,9 +274,9 @@ typedef enum { | |||
274 | #define netxen_set_phy_speed(config_word, val) \ | 274 | #define netxen_set_phy_speed(config_word, val) \ |
275 | ((config_word) |= ((val & 0x03) << 14)) | 275 | ((config_word) |= ((val & 0x03) << 14)) |
276 | #define netxen_set_phy_duplex(config_word) \ | 276 | #define netxen_set_phy_duplex(config_word) \ |
277 | set_bit(13, (unsigned long*)&config_word) | 277 | ((config_word) |= 1 << 13) |
278 | #define netxen_clear_phy_duplex(config_word) \ | 278 | #define netxen_clear_phy_duplex(config_word) \ |
279 | clear_bit(13, (unsigned long*)&config_word) | 279 | ((config_word) &= ~(1 << 13)) |
280 | 280 | ||
281 | #define netxen_get_phy_jabber(config_word) \ | 281 | #define netxen_get_phy_jabber(config_word) \ |
282 | _netxen_crb_get_bit(config_word, 0) | 282 | _netxen_crb_get_bit(config_word, 0) |
@@ -350,11 +350,11 @@ typedef enum { | |||
350 | _netxen_crb_get_bit(config_word, 15) | 350 | _netxen_crb_get_bit(config_word, 15) |
351 | 351 | ||
352 | #define netxen_set_phy_int_link_status_changed(config_word) \ | 352 | #define netxen_set_phy_int_link_status_changed(config_word) \ |
353 | set_bit(10, (unsigned long*)&config_word) | 353 | ((config_word) |= 1 << 10) |
354 | #define netxen_set_phy_int_autoneg_completed(config_word) \ | 354 | #define netxen_set_phy_int_autoneg_completed(config_word) \ |
355 | set_bit(11, (unsigned long*)&config_word) | 355 | ((config_word) |= 1 << 11) |
356 | #define netxen_set_phy_int_speed_changed(config_word) \ | 356 | #define netxen_set_phy_int_speed_changed(config_word) \ |
357 | set_bit(14, (unsigned long*)&config_word) | 357 | ((config_word) |= 1 << 14) |
358 | 358 | ||
359 | /* | 359 | /* |
360 | * NIU Mode Register. | 360 | * NIU Mode Register. |
@@ -382,22 +382,22 @@ typedef enum { | |||
382 | */ | 382 | */ |
383 | 383 | ||
384 | #define netxen_set_gb_drop_gb0(config_word) \ | 384 | #define netxen_set_gb_drop_gb0(config_word) \ |
385 | set_bit(0, (unsigned long*)&config_word) | 385 | ((config_word) |= 1 << 0) |
386 | #define netxen_set_gb_drop_gb1(config_word) \ | 386 | #define netxen_set_gb_drop_gb1(config_word) \ |
387 | set_bit(1, (unsigned long*)&config_word) | 387 | ((config_word) |= 1 << 1) |
388 | #define netxen_set_gb_drop_gb2(config_word) \ | 388 | #define netxen_set_gb_drop_gb2(config_word) \ |
389 | set_bit(2, (unsigned long*)&config_word) | 389 | ((config_word) |= 1 << 2) |
390 | #define netxen_set_gb_drop_gb3(config_word) \ | 390 | #define netxen_set_gb_drop_gb3(config_word) \ |
391 | set_bit(3, (unsigned long*)&config_word) | 391 | ((config_word) |= 1 << 3) |
392 | 392 | ||
393 | #define netxen_clear_gb_drop_gb0(config_word) \ | 393 | #define netxen_clear_gb_drop_gb0(config_word) \ |
394 | clear_bit(0, (unsigned long*)&config_word) | 394 | ((config_word) &= ~(1 << 0)) |
395 | #define netxen_clear_gb_drop_gb1(config_word) \ | 395 | #define netxen_clear_gb_drop_gb1(config_word) \ |
396 | clear_bit(1, (unsigned long*)&config_word) | 396 | ((config_word) &= ~(1 << 1)) |
397 | #define netxen_clear_gb_drop_gb2(config_word) \ | 397 | #define netxen_clear_gb_drop_gb2(config_word) \ |
398 | clear_bit(2, (unsigned long*)&config_word) | 398 | ((config_word) &= ~(1 << 2)) |
399 | #define netxen_clear_gb_drop_gb3(config_word) \ | 399 | #define netxen_clear_gb_drop_gb3(config_word) \ |
400 | clear_bit(3, (unsigned long*)&config_word) | 400 | ((config_word) &= ~(1 << 3)) |
401 | 401 | ||
402 | /* | 402 | /* |
403 | * NIU XG MAC Config Register | 403 | * NIU XG MAC Config Register |
@@ -413,7 +413,7 @@ typedef enum { | |||
413 | */ | 413 | */ |
414 | 414 | ||
415 | #define netxen_xg_soft_reset(config_word) \ | 415 | #define netxen_xg_soft_reset(config_word) \ |
416 | set_bit(4, (unsigned long*)&config_word) | 416 | ((config_word) |= 1 << 4) |
417 | 417 | ||
418 | /* | 418 | /* |
419 | * MAC Control Register | 419 | * MAC Control Register |
@@ -433,19 +433,19 @@ typedef enum { | |||
433 | #define netxen_nic_mcr_set_id_pool0(config, val) \ | 433 | #define netxen_nic_mcr_set_id_pool0(config, val) \ |
434 | ((config) |= ((val) &0x03)) | 434 | ((config) |= ((val) &0x03)) |
435 | #define netxen_nic_mcr_set_enable_xtnd0(config) \ | 435 | #define netxen_nic_mcr_set_enable_xtnd0(config) \ |
436 | (set_bit(3, (unsigned long *)&(config))) | 436 | ((config) |= 1 << 3) |
437 | #define netxen_nic_mcr_set_id_pool1(config, val) \ | 437 | #define netxen_nic_mcr_set_id_pool1(config, val) \ |
438 | ((config) |= (((val) & 0x03) << 4)) | 438 | ((config) |= (((val) & 0x03) << 4)) |
439 | #define netxen_nic_mcr_set_enable_xtnd1(config) \ | 439 | #define netxen_nic_mcr_set_enable_xtnd1(config) \ |
440 | (set_bit(6, (unsigned long *)&(config))) | 440 | ((config) |= 1 << 6) |
441 | #define netxen_nic_mcr_set_id_pool2(config, val) \ | 441 | #define netxen_nic_mcr_set_id_pool2(config, val) \ |
442 | ((config) |= (((val) & 0x03) << 8)) | 442 | ((config) |= (((val) & 0x03) << 8)) |
443 | #define netxen_nic_mcr_set_enable_xtnd2(config) \ | 443 | #define netxen_nic_mcr_set_enable_xtnd2(config) \ |
444 | (set_bit(10, (unsigned long *)&(config))) | 444 | ((config) |= 1 << 10) |
445 | #define netxen_nic_mcr_set_id_pool3(config, val) \ | 445 | #define netxen_nic_mcr_set_id_pool3(config, val) \ |
446 | ((config) |= (((val) & 0x03) << 12)) | 446 | ((config) |= (((val) & 0x03) << 12)) |
447 | #define netxen_nic_mcr_set_enable_xtnd3(config) \ | 447 | #define netxen_nic_mcr_set_enable_xtnd3(config) \ |
448 | (set_bit(14, (unsigned long *)&(config))) | 448 | ((config) |= 1 << 14) |
449 | #define netxen_nic_mcr_set_mode_select(config, val) \ | 449 | #define netxen_nic_mcr_set_mode_select(config, val) \ |
450 | ((config) |= (((val) & 0x03) << 24)) | 450 | ((config) |= (((val) & 0x03) << 24)) |
451 | #define netxen_nic_mcr_set_enable_pool(config, val) \ | 451 | #define netxen_nic_mcr_set_enable_pool(config, val) \ |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index c3e41f368554..973af96337a9 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -690,8 +690,7 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter) | |||
690 | desc_head = recv_ctx->rcv_status_desc_head; | 690 | desc_head = recv_ctx->rcv_status_desc_head; |
691 | desc = &desc_head[consumer]; | 691 | desc = &desc_head[consumer]; |
692 | 692 | ||
693 | if (((le16_to_cpu(netxen_get_sts_owner(desc))) | 693 | if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST) |
694 | & STATUS_OWNER_HOST)) | ||
695 | return 1; | 694 | return 1; |
696 | } | 695 | } |
697 | 696 | ||
@@ -787,11 +786,11 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
787 | struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; | 786 | struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; |
788 | struct pci_dev *pdev = port->pdev; | 787 | struct pci_dev *pdev = port->pdev; |
789 | struct net_device *netdev = port->netdev; | 788 | struct net_device *netdev = port->netdev; |
790 | int index = le16_to_cpu(netxen_get_sts_refhandle(desc)); | 789 | int index = netxen_get_sts_refhandle(desc); |
791 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); | 790 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); |
792 | struct netxen_rx_buffer *buffer; | 791 | struct netxen_rx_buffer *buffer; |
793 | struct sk_buff *skb; | 792 | struct sk_buff *skb; |
794 | u32 length = le16_to_cpu(netxen_get_sts_totallength(desc)); | 793 | u32 length = netxen_get_sts_totallength(desc); |
795 | u32 desc_ctx; | 794 | u32 desc_ctx; |
796 | struct netxen_rcv_desc_ctx *rcv_desc; | 795 | struct netxen_rcv_desc_ctx *rcv_desc; |
797 | int ret; | 796 | int ret; |
@@ -918,16 +917,14 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
918 | */ | 917 | */ |
919 | while (count < max) { | 918 | while (count < max) { |
920 | desc = &desc_head[consumer]; | 919 | desc = &desc_head[consumer]; |
921 | if (! | 920 | if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) { |
922 | (le16_to_cpu(netxen_get_sts_owner(desc)) & | ||
923 | STATUS_OWNER_HOST)) { | ||
924 | DPRINTK(ERR, "desc %p ownedby %x\n", desc, | 921 | DPRINTK(ERR, "desc %p ownedby %x\n", desc, |
925 | netxen_get_sts_owner(desc)); | 922 | netxen_get_sts_owner(desc)); |
926 | break; | 923 | break; |
927 | } | 924 | } |
928 | netxen_process_rcv(adapter, ctxid, desc); | 925 | netxen_process_rcv(adapter, ctxid, desc); |
929 | netxen_clear_sts_owner(desc); | 926 | netxen_clear_sts_owner(desc); |
930 | netxen_set_sts_owner(desc, cpu_to_le16(STATUS_OWNER_PHANTOM)); | 927 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); |
931 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); | 928 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); |
932 | count++; | 929 | count++; |
933 | } | 930 | } |
@@ -1232,7 +1229,7 @@ void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx, | |||
1232 | 1229 | ||
1233 | /* make a rcv descriptor */ | 1230 | /* make a rcv descriptor */ |
1234 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1231 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1235 | pdesc->buffer_length = cpu_to_le16(rcv_desc->dma_size); | 1232 | pdesc->buffer_length = cpu_to_le32(rcv_desc->dma_size); |
1236 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); | 1233 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); |
1237 | DPRINTK(INFO, "done writing descripter\n"); | 1234 | DPRINTK(INFO, "done writing descripter\n"); |
1238 | producer = | 1235 | producer = |
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index 06847d4252c3..be366e48007c 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -79,7 +79,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno, | |||
79 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, | 79 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, |
80 | u32 enable) | 80 | u32 enable) |
81 | { | 81 | { |
82 | __le32 int_src; | 82 | __u32 int_src; |
83 | struct netxen_port *port; | 83 | struct netxen_port *port; |
84 | 84 | ||
85 | /* This should clear the interrupt source */ | 85 | /* This should clear the interrupt source */ |
@@ -110,7 +110,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, | |||
110 | /* write it down later.. */ | 110 | /* write it down later.. */ |
111 | if ((netxen_get_phy_int_speed_changed(int_src)) | 111 | if ((netxen_get_phy_int_speed_changed(int_src)) |
112 | || (netxen_get_phy_int_link_status_changed(int_src))) { | 112 | || (netxen_get_phy_int_link_status_changed(int_src))) { |
113 | __le32 status; | 113 | __u32 status; |
114 | 114 | ||
115 | DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); | 115 | DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); |
116 | 116 | ||
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 8a5792fea774..69c1b9d23a1a 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -117,7 +117,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
117 | void __iomem *mem_ptr1 = NULL; | 117 | void __iomem *mem_ptr1 = NULL; |
118 | void __iomem *mem_ptr2 = NULL; | 118 | void __iomem *mem_ptr2 = NULL; |
119 | 119 | ||
120 | u8 *db_ptr = NULL; | 120 | u8 __iomem *db_ptr = NULL; |
121 | unsigned long mem_base, mem_len, db_base, db_len; | 121 | unsigned long mem_base, mem_len, db_base, db_len; |
122 | int pci_using_dac, i, err; | 122 | int pci_using_dac, i, err; |
123 | int ring; | 123 | int ring; |
@@ -191,7 +191,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
191 | db_len); | 191 | db_len); |
192 | 192 | ||
193 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); | 193 | db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); |
194 | if (db_ptr == 0UL) { | 194 | if (!db_ptr) { |
195 | printk(KERN_ERR "%s: Failed to allocate doorbell map.", | 195 | printk(KERN_ERR "%s: Failed to allocate doorbell map.", |
196 | netxen_nic_driver_name); | 196 | netxen_nic_driver_name); |
197 | err = -EIO; | 197 | err = -EIO; |
@@ -818,7 +818,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
818 | /* Take skb->data itself */ | 818 | /* Take skb->data itself */ |
819 | pbuf = &adapter->cmd_buf_arr[producer]; | 819 | pbuf = &adapter->cmd_buf_arr[producer]; |
820 | if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { | 820 | if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { |
821 | pbuf->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | 821 | pbuf->mss = skb_shinfo(skb)->gso_size; |
822 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | 822 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); |
823 | } else { | 823 | } else { |
824 | pbuf->mss = 0; | 824 | pbuf->mss = 0; |
@@ -882,7 +882,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
882 | hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); | 882 | hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); |
883 | break; | 883 | break; |
884 | case 3: | 884 | case 3: |
885 | hwdesc->buffer4_length = temp_len; | 885 | hwdesc->buffer4_length = cpu_to_le16(temp_len); |
886 | hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); | 886 | hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); |
887 | break; | 887 | break; |
888 | } | 888 | } |
@@ -1144,7 +1144,7 @@ static int __init netxen_init_module(void) | |||
1144 | if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0) | 1144 | if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0) |
1145 | return -ENOMEM; | 1145 | return -ENOMEM; |
1146 | 1146 | ||
1147 | return pci_module_init(&netxen_driver); | 1147 | return pci_register_driver(&netxen_driver); |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | module_init(netxen_init_module); | 1150 | module_init(netxen_init_module); |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 4987dc765d99..40d7003a371c 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -89,15 +89,15 @@ static inline int phy_unlock(struct netxen_adapter *adapter) | |||
89 | * | 89 | * |
90 | */ | 90 | */ |
91 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | 91 | int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, |
92 | long reg, __le32 * readval) | 92 | long reg, __u32 * readval) |
93 | { | 93 | { |
94 | long timeout = 0; | 94 | long timeout = 0; |
95 | long result = 0; | 95 | long result = 0; |
96 | long restore = 0; | 96 | long restore = 0; |
97 | __le32 address; | 97 | __u32 address; |
98 | __le32 command; | 98 | __u32 command; |
99 | __le32 status; | 99 | __u32 status; |
100 | __le32 mac_cfg0; | 100 | __u32 mac_cfg0; |
101 | 101 | ||
102 | if (phy_lock(adapter) != 0) { | 102 | if (phy_lock(adapter) != 0) { |
103 | return -1; | 103 | return -1; |
@@ -112,7 +112,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | |||
112 | &mac_cfg0, 4)) | 112 | &mac_cfg0, 4)) |
113 | return -EIO; | 113 | return -EIO; |
114 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 114 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
115 | __le32 temp; | 115 | __u32 temp; |
116 | temp = 0; | 116 | temp = 0; |
117 | netxen_gb_tx_reset_pb(temp); | 117 | netxen_gb_tx_reset_pb(temp); |
118 | netxen_gb_rx_reset_pb(temp); | 118 | netxen_gb_rx_reset_pb(temp); |
@@ -184,15 +184,15 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, | |||
184 | * | 184 | * |
185 | */ | 185 | */ |
186 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, | 186 | int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, |
187 | long phy, long reg, __le32 val) | 187 | long phy, long reg, __u32 val) |
188 | { | 188 | { |
189 | long timeout = 0; | 189 | long timeout = 0; |
190 | long result = 0; | 190 | long result = 0; |
191 | long restore = 0; | 191 | long restore = 0; |
192 | __le32 address; | 192 | __u32 address; |
193 | __le32 command; | 193 | __u32 command; |
194 | __le32 status; | 194 | __u32 status; |
195 | __le32 mac_cfg0; | 195 | __u32 mac_cfg0; |
196 | 196 | ||
197 | /* | 197 | /* |
198 | * MII mgmt all goes through port 0 MAC interface, so it | 198 | * MII mgmt all goes through port 0 MAC interface, so it |
@@ -203,7 +203,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, | |||
203 | &mac_cfg0, 4)) | 203 | &mac_cfg0, 4)) |
204 | return -EIO; | 204 | return -EIO; |
205 | if (netxen_gb_get_soft_reset(mac_cfg0)) { | 205 | if (netxen_gb_get_soft_reset(mac_cfg0)) { |
206 | __le32 temp; | 206 | __u32 temp; |
207 | temp = 0; | 207 | temp = 0; |
208 | netxen_gb_tx_reset_pb(temp); | 208 | netxen_gb_tx_reset_pb(temp); |
209 | netxen_gb_rx_reset_pb(temp); | 209 | netxen_gb_rx_reset_pb(temp); |
@@ -269,7 +269,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter, | |||
269 | int port) | 269 | int port) |
270 | { | 270 | { |
271 | int result = 0; | 271 | int result = 0; |
272 | __le32 enable = 0; | 272 | __u32 enable = 0; |
273 | netxen_set_phy_int_link_status_changed(enable); | 273 | netxen_set_phy_int_link_status_changed(enable); |
274 | netxen_set_phy_int_autoneg_completed(enable); | 274 | netxen_set_phy_int_autoneg_completed(enable); |
275 | netxen_set_phy_int_speed_changed(enable); | 275 | netxen_set_phy_int_speed_changed(enable); |
@@ -402,7 +402,7 @@ void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, | |||
402 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | 402 | int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) |
403 | { | 403 | { |
404 | int result = 0; | 404 | int result = 0; |
405 | __le32 status; | 405 | __u32 status; |
406 | if (adapter->disable_phy_interrupts) | 406 | if (adapter->disable_phy_interrupts) |
407 | adapter->disable_phy_interrupts(adapter, port); | 407 | adapter->disable_phy_interrupts(adapter, port); |
408 | mdelay(2); | 408 | mdelay(2); |
@@ -410,7 +410,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | |||
410 | if (0 == | 410 | if (0 == |
411 | netxen_niu_gbe_phy_read(adapter, port, | 411 | netxen_niu_gbe_phy_read(adapter, port, |
412 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, | 412 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
413 | (__le32 *) & status)) { | 413 | &status)) { |
414 | if (netxen_get_phy_link(status)) { | 414 | if (netxen_get_phy_link(status)) { |
415 | if (netxen_get_phy_speed(status) == 2) { | 415 | if (netxen_get_phy_speed(status) == 2) { |
416 | netxen_niu_gbe_set_gmii_mode(adapter, port, 1); | 416 | netxen_niu_gbe_set_gmii_mode(adapter, port, 1); |
@@ -489,7 +489,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
489 | int port, long enable) | 489 | int port, long enable) |
490 | { | 490 | { |
491 | int result = 0; | 491 | int result = 0; |
492 | __le32 int_src; | 492 | __u32 int_src; |
493 | 493 | ||
494 | printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" | 494 | printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" |
495 | " (device enable = %d)\n", (int)port, (int)enable); | 495 | " (device enable = %d)\n", (int)port, (int)enable); |
@@ -530,7 +530,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
530 | printk(KERN_INFO PFX "autoneg_error "); | 530 | printk(KERN_INFO PFX "autoneg_error "); |
531 | if ((netxen_get_phy_int_speed_changed(int_src)) | 531 | if ((netxen_get_phy_int_speed_changed(int_src)) |
532 | || (netxen_get_phy_int_link_status_changed(int_src))) { | 532 | || (netxen_get_phy_int_link_status_changed(int_src))) { |
533 | __le32 status; | 533 | __u32 status; |
534 | 534 | ||
535 | printk(KERN_INFO PFX | 535 | printk(KERN_INFO PFX |
536 | "speed_changed or link status changed"); | 536 | "speed_changed or link status changed"); |
@@ -583,9 +583,9 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, | |||
583 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | 583 | int netxen_niu_macaddr_get(struct netxen_adapter *adapter, |
584 | int phy, netxen_ethernet_macaddr_t * addr) | 584 | int phy, netxen_ethernet_macaddr_t * addr) |
585 | { | 585 | { |
586 | u64 result = 0; | 586 | u32 stationhigh; |
587 | __le32 stationhigh; | 587 | u32 stationlow; |
588 | __le32 stationlow; | 588 | u8 val[8]; |
589 | 589 | ||
590 | if (addr == NULL) | 590 | if (addr == NULL) |
591 | return -EINVAL; | 591 | return -EINVAL; |
@@ -598,10 +598,10 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
598 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), | 598 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), |
599 | &stationlow, 4)) | 599 | &stationlow, 4)) |
600 | return -EIO; | 600 | return -EIO; |
601 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | ||
602 | ((__le32 *)val)[0] = cpu_to_le32(stationlow); | ||
601 | 603 | ||
602 | result = (u64) netxen_gb_get_stationaddress_low(stationlow); | 604 | memcpy(addr, val + 2, 6); |
603 | result |= (u64) stationhigh << 16; | ||
604 | memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); | ||
605 | 605 | ||
606 | return 0; | 606 | return 0; |
607 | } | 607 | } |
@@ -613,24 +613,25 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
613 | int netxen_niu_macaddr_set(struct netxen_port *port, | 613 | int netxen_niu_macaddr_set(struct netxen_port *port, |
614 | netxen_ethernet_macaddr_t addr) | 614 | netxen_ethernet_macaddr_t addr) |
615 | { | 615 | { |
616 | __le32 temp = 0; | 616 | u8 temp[4]; |
617 | u32 val; | ||
617 | struct netxen_adapter *adapter = port->adapter; | 618 | struct netxen_adapter *adapter = port->adapter; |
618 | int phy = port->portnum; | 619 | int phy = port->portnum; |
619 | unsigned char mac_addr[6]; | 620 | unsigned char mac_addr[6]; |
620 | int i; | 621 | int i; |
621 | 622 | ||
622 | for (i = 0; i < 10; i++) { | 623 | for (i = 0; i < 10; i++) { |
623 | memcpy(&temp, addr, 2); | 624 | temp[0] = temp[1] = 0; |
624 | temp <<= 16; | 625 | memcpy(temp + 2, addr, 2); |
626 | val = le32_to_cpu(*(__le32 *)temp); | ||
625 | if (netxen_nic_hw_write_wx | 627 | if (netxen_nic_hw_write_wx |
626 | (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &temp, 4)) | 628 | (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4)) |
627 | return -EIO; | 629 | return -EIO; |
628 | 630 | ||
629 | temp = 0; | 631 | memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32)); |
630 | 632 | val = le32_to_cpu(*(__le32 *)temp); | |
631 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | ||
632 | if (netxen_nic_hw_write_wx | 633 | if (netxen_nic_hw_write_wx |
633 | (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &temp, 4)) | 634 | (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) |
634 | return -2; | 635 | return -2; |
635 | 636 | ||
636 | netxen_niu_macaddr_get(adapter, phy, | 637 | netxen_niu_macaddr_get(adapter, phy, |
@@ -659,9 +660,9 @@ int netxen_niu_macaddr_set(struct netxen_port *port, | |||
659 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | 660 | int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, |
660 | int port, netxen_niu_gbe_ifmode_t mode) | 661 | int port, netxen_niu_gbe_ifmode_t mode) |
661 | { | 662 | { |
662 | __le32 mac_cfg0; | 663 | __u32 mac_cfg0; |
663 | __le32 mac_cfg1; | 664 | __u32 mac_cfg1; |
664 | __le32 mii_cfg; | 665 | __u32 mii_cfg; |
665 | 666 | ||
666 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 667 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
667 | return -EINVAL; | 668 | return -EINVAL; |
@@ -736,7 +737,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
736 | /* Disable a GbE interface */ | 737 | /* Disable a GbE interface */ |
737 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | 738 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) |
738 | { | 739 | { |
739 | __le32 mac_cfg0; | 740 | __u32 mac_cfg0; |
740 | 741 | ||
741 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 742 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
742 | return -EINVAL; | 743 | return -EINVAL; |
@@ -752,7 +753,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) | |||
752 | /* Disable an XG interface */ | 753 | /* Disable an XG interface */ |
753 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) | 754 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) |
754 | { | 755 | { |
755 | __le32 mac_cfg; | 756 | __u32 mac_cfg; |
756 | 757 | ||
757 | if (port != 0) | 758 | if (port != 0) |
758 | return -EINVAL; | 759 | return -EINVAL; |
@@ -769,7 +770,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) | |||
769 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | 770 | int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, |
770 | netxen_niu_prom_mode_t mode) | 771 | netxen_niu_prom_mode_t mode) |
771 | { | 772 | { |
772 | __le32 reg; | 773 | __u32 reg; |
773 | 774 | ||
774 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 775 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
775 | return -EINVAL; | 776 | return -EINVAL; |
@@ -826,22 +827,21 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, | |||
826 | int netxen_niu_xg_macaddr_set(struct netxen_port *port, | 827 | int netxen_niu_xg_macaddr_set(struct netxen_port *port, |
827 | netxen_ethernet_macaddr_t addr) | 828 | netxen_ethernet_macaddr_t addr) |
828 | { | 829 | { |
829 | __le32 temp = 0; | 830 | u8 temp[4]; |
831 | u32 val; | ||
830 | struct netxen_adapter *adapter = port->adapter; | 832 | struct netxen_adapter *adapter = port->adapter; |
831 | 833 | ||
832 | memcpy(&temp, addr, 2); | 834 | temp[0] = temp[1] = 0; |
833 | temp = cpu_to_le32(temp); | 835 | memcpy(temp + 2, addr, 2); |
834 | temp <<= 16; | 836 | val = le32_to_cpu(*(__le32 *)temp); |
835 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 837 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
836 | &temp, 4)) | 838 | &val, 4)) |
837 | return -EIO; | 839 | return -EIO; |
838 | 840 | ||
839 | temp = 0; | ||
840 | |||
841 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); | 841 | memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); |
842 | temp = cpu_to_le32(temp); | 842 | val = le32_to_cpu(*(__le32 *)temp); |
843 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, | 843 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
844 | &temp, 4)) | 844 | &val, 4)) |
845 | return -EIO; | 845 | return -EIO; |
846 | 846 | ||
847 | return 0; | 847 | return 0; |
@@ -854,9 +854,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_port *port, | |||
854 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | 854 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, |
855 | netxen_ethernet_macaddr_t * addr) | 855 | netxen_ethernet_macaddr_t * addr) |
856 | { | 856 | { |
857 | __le32 stationhigh; | 857 | u32 stationhigh; |
858 | __le32 stationlow; | 858 | u32 stationlow; |
859 | u64 result; | 859 | u8 val[8]; |
860 | 860 | ||
861 | if (addr == NULL) | 861 | if (addr == NULL) |
862 | return -EINVAL; | 862 | return -EINVAL; |
@@ -869,10 +869,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | |||
869 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, | 869 | if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, |
870 | &stationlow, 4)) | 870 | &stationlow, 4)) |
871 | return -EIO; | 871 | return -EIO; |
872 | ((__le32 *)val)[1] = cpu_to_le32(stationhigh); | ||
873 | ((__le32 *)val)[0] = cpu_to_le32(stationlow); | ||
872 | 874 | ||
873 | result = ((u64) stationlow) >> 16; | 875 | memcpy(addr, val + 2, 6); |
874 | result |= (u64) stationhigh << 16; | ||
875 | memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); | ||
876 | 876 | ||
877 | return 0; | 877 | return 0; |
878 | } | 878 | } |
@@ -880,7 +880,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, | |||
880 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | 880 | int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, |
881 | int port, netxen_niu_prom_mode_t mode) | 881 | int port, netxen_niu_prom_mode_t mode) |
882 | { | 882 | { |
883 | __le32 reg; | 883 | __u32 reg; |
884 | 884 | ||
885 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 885 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
886 | return -EINVAL; | 886 | return -EINVAL; |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 342f4062de0b..461e8274ef69 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -606,11 +606,14 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
606 | { | 606 | { |
607 | kio_addr_t ioaddr = dev->base_addr; | 607 | kio_addr_t ioaddr = dev->base_addr; |
608 | struct el3_private *priv = netdev_priv(dev); | 608 | struct el3_private *priv = netdev_priv(dev); |
609 | unsigned long flags; | ||
609 | 610 | ||
610 | DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " | 611 | DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " |
611 | "status %4.4x.\n", dev->name, (long)skb->len, | 612 | "status %4.4x.\n", dev->name, (long)skb->len, |
612 | inw(ioaddr + EL3_STATUS)); | 613 | inw(ioaddr + EL3_STATUS)); |
613 | 614 | ||
615 | spin_lock_irqsave(&priv->lock, flags); | ||
616 | |||
614 | priv->stats.tx_bytes += skb->len; | 617 | priv->stats.tx_bytes += skb->len; |
615 | 618 | ||
616 | /* Put out the doubleword header... */ | 619 | /* Put out the doubleword header... */ |
@@ -628,6 +631,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
628 | 631 | ||
629 | dev_kfree_skb(skb); | 632 | dev_kfree_skb(skb); |
630 | pop_tx_status(dev); | 633 | pop_tx_status(dev); |
634 | spin_unlock_irqrestore(&priv->lock, flags); | ||
631 | 635 | ||
632 | return 0; | 636 | return 0; |
633 | } | 637 | } |
@@ -729,14 +733,13 @@ static void media_check(unsigned long arg) | |||
729 | 733 | ||
730 | if (!netif_device_present(dev)) goto reschedule; | 734 | if (!netif_device_present(dev)) goto reschedule; |
731 | 735 | ||
732 | EL3WINDOW(1); | ||
733 | /* Check for pending interrupt with expired latency timer: with | 736 | /* Check for pending interrupt with expired latency timer: with |
734 | this, we can limp along even if the interrupt is blocked */ | 737 | this, we can limp along even if the interrupt is blocked */ |
735 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && | 738 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && |
736 | (inb(ioaddr + EL3_TIMER) == 0xff)) { | 739 | (inb(ioaddr + EL3_TIMER) == 0xff)) { |
737 | if (!lp->fast_poll) | 740 | if (!lp->fast_poll) |
738 | printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); | 741 | printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); |
739 | el3_interrupt(dev->irq, lp); | 742 | el3_interrupt(dev->irq, dev); |
740 | lp->fast_poll = HZ; | 743 | lp->fast_poll = HZ; |
741 | } | 744 | } |
742 | if (lp->fast_poll) { | 745 | if (lp->fast_poll) { |
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index 096d4a100bf2..86135397f430 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c | |||
@@ -349,7 +349,7 @@ static int __init fixed_init(void) | |||
349 | fixed_mdio_register_device(0, 100, 1); | 349 | fixed_mdio_register_device(0, 100, 1); |
350 | #endif | 350 | #endif |
351 | 351 | ||
352 | #ifdef CONFIX_FIXED_MII_10_FDX | 352 | #ifdef CONFIG_FIXED_MII_10_FDX |
353 | fixed_mdio_register_device(0, 10, 1); | 353 | fixed_mdio_register_device(0, 10, 1); |
354 | #endif | 354 | #endif |
355 | return 0; | 355 | return 0; |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index e175f3910b18..9765fa661467 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -286,6 +286,7 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd) | |||
286 | 286 | ||
287 | return 0; | 287 | return 0; |
288 | } | 288 | } |
289 | EXPORT_SYMBOL(phy_ethtool_sset); | ||
289 | 290 | ||
290 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) | 291 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) |
291 | { | 292 | { |
@@ -302,7 +303,7 @@ int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) | |||
302 | 303 | ||
303 | return 0; | 304 | return 0; |
304 | } | 305 | } |
305 | 306 | EXPORT_SYMBOL(phy_ethtool_gset); | |
306 | 307 | ||
307 | /* Note that this function is currently incompatible with the | 308 | /* Note that this function is currently incompatible with the |
308 | * PHYCONTROL layer. It changes registers without regard to | 309 | * PHYCONTROL layer. It changes registers without regard to |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 250cdbeefdfd..1dd66b8ea0fa 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -556,10 +556,9 @@ static int init_shared_mem(struct s2io_nic *nic) | |||
556 | } | 556 | } |
557 | } | 557 | } |
558 | 558 | ||
559 | nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL); | 559 | nic->ufo_in_band_v = kcalloc(size, sizeof(u64), GFP_KERNEL); |
560 | if (!nic->ufo_in_band_v) | 560 | if (!nic->ufo_in_band_v) |
561 | return -ENOMEM; | 561 | return -ENOMEM; |
562 | memset(nic->ufo_in_band_v, 0, size); | ||
563 | 562 | ||
564 | /* Allocation and initialization of RXDs in Rings */ | 563 | /* Allocation and initialization of RXDs in Rings */ |
565 | size = 0; | 564 | size = 0; |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index b70ed79d4121..45d91b159100 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -1562,7 +1562,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev, | |||
1562 | for (i = 0; i < MAC_ADDR_LEN / 2; i++) { | 1562 | for (i = 0; i < MAC_ADDR_LEN / 2; i++) { |
1563 | __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); | 1563 | __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); |
1564 | 1564 | ||
1565 | ((u16 *)dev->dev_addr)[0] = le16_to_cpu(w); | 1565 | ((u16 *)dev->dev_addr)[i] = le16_to_cpu(w); |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo)); | 1568 | sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo)); |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index deedfd5f8226..45283f3f95e4 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -60,7 +60,7 @@ | |||
60 | #define LINK_HZ (HZ/2) | 60 | #define LINK_HZ (HZ/2) |
61 | 61 | ||
62 | MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); | 62 | MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); |
63 | MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); | 63 | MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>"); |
64 | MODULE_LICENSE("GPL"); | 64 | MODULE_LICENSE("GPL"); |
65 | MODULE_VERSION(DRV_VERSION); | 65 | MODULE_VERSION(DRV_VERSION); |
66 | 66 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a6601e8d423c..822dd0b13133 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -3639,29 +3639,6 @@ static int sky2_resume(struct pci_dev *pdev) | |||
3639 | out: | 3639 | out: |
3640 | return err; | 3640 | return err; |
3641 | } | 3641 | } |
3642 | |||
3643 | /* BIOS resume runs after device (it's a bug in PM) | ||
3644 | * as a temporary workaround on suspend/resume leave MSI disabled | ||
3645 | */ | ||
3646 | static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state) | ||
3647 | { | ||
3648 | struct sky2_hw *hw = pci_get_drvdata(pdev); | ||
3649 | |||
3650 | free_irq(pdev->irq, hw); | ||
3651 | if (hw->msi) { | ||
3652 | pci_disable_msi(pdev); | ||
3653 | hw->msi = 0; | ||
3654 | } | ||
3655 | return 0; | ||
3656 | } | ||
3657 | |||
3658 | static int sky2_resume_early(struct pci_dev *pdev) | ||
3659 | { | ||
3660 | struct sky2_hw *hw = pci_get_drvdata(pdev); | ||
3661 | struct net_device *dev = hw->dev[0]; | ||
3662 | |||
3663 | return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw); | ||
3664 | } | ||
3665 | #endif | 3642 | #endif |
3666 | 3643 | ||
3667 | static struct pci_driver sky2_driver = { | 3644 | static struct pci_driver sky2_driver = { |
@@ -3672,8 +3649,6 @@ static struct pci_driver sky2_driver = { | |||
3672 | #ifdef CONFIG_PM | 3649 | #ifdef CONFIG_PM |
3673 | .suspend = sky2_suspend, | 3650 | .suspend = sky2_suspend, |
3674 | .resume = sky2_resume, | 3651 | .resume = sky2_resume, |
3675 | .suspend_late = sky2_suspend_late, | ||
3676 | .resume_early = sky2_resume_early, | ||
3677 | #endif | 3652 | #endif |
3678 | }; | 3653 | }; |
3679 | 3654 | ||
@@ -3691,6 +3666,6 @@ module_init(sky2_init_module); | |||
3691 | module_exit(sky2_cleanup_module); | 3666 | module_exit(sky2_cleanup_module); |
3692 | 3667 | ||
3693 | MODULE_DESCRIPTION("Marvell Yukon 2 Gigabit Ethernet driver"); | 3668 | MODULE_DESCRIPTION("Marvell Yukon 2 Gigabit Ethernet driver"); |
3694 | MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); | 3669 | MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>"); |
3695 | MODULE_LICENSE("GPL"); | 3670 | MODULE_LICENSE("GPL"); |
3696 | MODULE_VERSION(DRV_VERSION); | 3671 | MODULE_VERSION(DRV_VERSION); |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 880d9fdd7c67..43af61438449 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work) | |||
968 | * We should not be called if phy_type is zero. | 968 | * We should not be called if phy_type is zero. |
969 | */ | 969 | */ |
970 | if (lp->phy_type == 0) | 970 | if (lp->phy_type == 0) |
971 | goto smc911x_phy_configure_exit; | 971 | goto smc911x_phy_configure_exit_nolock; |
972 | 972 | ||
973 | if (smc911x_phy_reset(dev, phyaddr)) { | 973 | if (smc911x_phy_reset(dev, phyaddr)) { |
974 | printk("%s: PHY reset timed out\n", dev->name); | 974 | printk("%s: PHY reset timed out\n", dev->name); |
975 | goto smc911x_phy_configure_exit; | 975 | goto smc911x_phy_configure_exit_nolock; |
976 | } | 976 | } |
977 | spin_lock_irqsave(&lp->lock, flags); | 977 | spin_lock_irqsave(&lp->lock, flags); |
978 | 978 | ||
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work) | |||
1041 | 1041 | ||
1042 | smc911x_phy_configure_exit: | 1042 | smc911x_phy_configure_exit: |
1043 | spin_unlock_irqrestore(&lp->lock, flags); | 1043 | spin_unlock_irqrestore(&lp->lock, flags); |
1044 | smc911x_phy_configure_exit_nolock: | ||
1044 | lp->work_pending = 0; | 1045 | lp->work_pending = 0; |
1045 | } | 1046 | } |
1046 | 1047 | ||
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index ebb6aa39f9c7..8ea2fc1b96cb 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1925,6 +1925,8 @@ spider_net_stop(struct net_device *netdev) | |||
1925 | /* release chains */ | 1925 | /* release chains */ |
1926 | spider_net_release_tx_chain(card, 1); | 1926 | spider_net_release_tx_chain(card, 1); |
1927 | 1927 | ||
1928 | spider_net_free_rx_chain_contents(card); | ||
1929 | |||
1928 | spider_net_free_chain(card, &card->tx_chain); | 1930 | spider_net_free_chain(card, &card->tx_chain); |
1929 | spider_net_free_chain(card, &card->rx_chain); | 1931 | spider_net_free_chain(card, &card->rx_chain); |
1930 | 1932 | ||
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 8243150f5b05..7e4b23c7c1ba 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/fsl_devices.h> | 29 | #include <linux/fsl_devices.h> |
30 | #include <linux/ethtool.h> | 30 | #include <linux/ethtool.h> |
31 | #include <linux/mii.h> | 31 | #include <linux/mii.h> |
32 | #include <linux/workqueue.h> | ||
32 | 33 | ||
33 | #include <asm/of_platform.h> | 34 | #include <asm/of_platform.h> |
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
@@ -472,7 +473,7 @@ static void put_enet_addr_container(struct enet_addr_container *enet_addr_cont) | |||
472 | kfree(enet_addr_cont); | 473 | kfree(enet_addr_cont); |
473 | } | 474 | } |
474 | 475 | ||
475 | static int set_mac_addr(__be16 __iomem *reg, u8 *mac) | 476 | static void set_mac_addr(__be16 __iomem *reg, u8 *mac) |
476 | { | 477 | { |
477 | out_be16(®[0], ((u16)mac[5] << 8) | mac[4]); | 478 | out_be16(®[0], ((u16)mac[5] << 8) | mac[4]); |
478 | out_be16(®[1], ((u16)mac[3] << 8) | mac[2]); | 479 | out_be16(®[1], ((u16)mac[3] << 8) | mac[2]); |
@@ -3920,10 +3921,11 @@ static irqreturn_t phy_interrupt(int irq, void *dev_id) | |||
3920 | } | 3921 | } |
3921 | 3922 | ||
3922 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ | 3923 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ |
3923 | static void ugeth_phy_change(void *data) | 3924 | static void ugeth_phy_change(struct work_struct *work) |
3924 | { | 3925 | { |
3925 | struct net_device *dev = (struct net_device *)data; | 3926 | struct ucc_geth_private *ugeth = |
3926 | struct ucc_geth_private *ugeth = netdev_priv(dev); | 3927 | container_of(work, struct ucc_geth_private, tq); |
3928 | struct net_device *dev = ugeth->dev; | ||
3927 | struct ucc_geth *ug_regs; | 3929 | struct ucc_geth *ug_regs; |
3928 | int result = 0; | 3930 | int result = 0; |
3929 | 3931 | ||
@@ -4080,7 +4082,7 @@ static int ucc_geth_open(struct net_device *dev) | |||
4080 | #endif /* CONFIG_UGETH_NAPI */ | 4082 | #endif /* CONFIG_UGETH_NAPI */ |
4081 | 4083 | ||
4082 | /* Set up the PHY change work queue */ | 4084 | /* Set up the PHY change work queue */ |
4083 | INIT_WORK(&ugeth->tq, ugeth_phy_change, dev); | 4085 | INIT_WORK(&ugeth->tq, ugeth_phy_change); |
4084 | 4086 | ||
4085 | init_timer(&ugeth->phy_info_timer); | 4087 | init_timer(&ugeth->phy_info_timer); |
4086 | ugeth->phy_info_timer.function = &ugeth_phy_startup_timer; | 4088 | ugeth->phy_info_timer.function = &ugeth_phy_startup_timer; |
diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c index 5360ec05eaa3..3c86592ce03c 100644 --- a/drivers/net/ucc_geth_phy.c +++ b/drivers/net/ucc_geth_phy.c | |||
@@ -68,8 +68,31 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info); | |||
68 | static int genmii_config_aneg(struct ugeth_mii_info *mii_info); | 68 | static int genmii_config_aneg(struct ugeth_mii_info *mii_info); |
69 | static int genmii_update_link(struct ugeth_mii_info *mii_info); | 69 | static int genmii_update_link(struct ugeth_mii_info *mii_info); |
70 | static int genmii_read_status(struct ugeth_mii_info *mii_info); | 70 | static int genmii_read_status(struct ugeth_mii_info *mii_info); |
71 | u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum); | 71 | |
72 | void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val); | 72 | static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16 regnum) |
73 | { | ||
74 | u16 retval; | ||
75 | unsigned long flags; | ||
76 | |||
77 | ugphy_vdbg("%s: IN", __FUNCTION__); | ||
78 | |||
79 | spin_lock_irqsave(&mii_info->mdio_lock, flags); | ||
80 | retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); | ||
81 | spin_unlock_irqrestore(&mii_info->mdio_lock, flags); | ||
82 | |||
83 | return retval; | ||
84 | } | ||
85 | |||
86 | static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) | ||
87 | { | ||
88 | unsigned long flags; | ||
89 | |||
90 | ugphy_vdbg("%s: IN", __FUNCTION__); | ||
91 | |||
92 | spin_lock_irqsave(&mii_info->mdio_lock, flags); | ||
93 | mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); | ||
94 | spin_unlock_irqrestore(&mii_info->mdio_lock, flags); | ||
95 | } | ||
73 | 96 | ||
74 | /* Write value to the PHY for this device to the register at regnum, */ | 97 | /* Write value to the PHY for this device to the register at regnum, */ |
75 | /* waiting until the write is done before it returns. All PHY */ | 98 | /* waiting until the write is done before it returns. All PHY */ |
@@ -184,7 +207,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info) | |||
184 | advertise = mii_info->advertising; | 207 | advertise = mii_info->advertising; |
185 | 208 | ||
186 | /* Setup standard advertisement */ | 209 | /* Setup standard advertisement */ |
187 | adv = phy_read(mii_info, MII_ADVERTISE); | 210 | adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE); |
188 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); | 211 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); |
189 | if (advertise & ADVERTISED_10baseT_Half) | 212 | if (advertise & ADVERTISED_10baseT_Half) |
190 | adv |= ADVERTISE_10HALF; | 213 | adv |= ADVERTISE_10HALF; |
@@ -194,7 +217,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info) | |||
194 | adv |= ADVERTISE_100HALF; | 217 | adv |= ADVERTISE_100HALF; |
195 | if (advertise & ADVERTISED_100baseT_Full) | 218 | if (advertise & ADVERTISED_100baseT_Full) |
196 | adv |= ADVERTISE_100FULL; | 219 | adv |= ADVERTISE_100FULL; |
197 | phy_write(mii_info, MII_ADVERTISE, adv); | 220 | ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv); |
198 | } | 221 | } |
199 | 222 | ||
200 | static void genmii_setup_forced(struct ugeth_mii_info *mii_info) | 223 | static void genmii_setup_forced(struct ugeth_mii_info *mii_info) |
@@ -204,7 +227,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info) | |||
204 | 227 | ||
205 | ugphy_vdbg("%s: IN", __FUNCTION__); | 228 | ugphy_vdbg("%s: IN", __FUNCTION__); |
206 | 229 | ||
207 | ctrl = phy_read(mii_info, MII_BMCR); | 230 | ctrl = ucc_geth_phy_read(mii_info, MII_BMCR); |
208 | 231 | ||
209 | ctrl &= | 232 | ctrl &= |
210 | ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); | 233 | ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); |
@@ -234,7 +257,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info) | |||
234 | break; | 257 | break; |
235 | } | 258 | } |
236 | 259 | ||
237 | phy_write(mii_info, MII_BMCR, ctrl); | 260 | ucc_geth_phy_write(mii_info, MII_BMCR, ctrl); |
238 | } | 261 | } |
239 | 262 | ||
240 | /* Enable and Restart Autonegotiation */ | 263 | /* Enable and Restart Autonegotiation */ |
@@ -244,9 +267,9 @@ static void genmii_restart_aneg(struct ugeth_mii_info *mii_info) | |||
244 | 267 | ||
245 | ugphy_vdbg("%s: IN", __FUNCTION__); | 268 | ugphy_vdbg("%s: IN", __FUNCTION__); |
246 | 269 | ||
247 | ctl = phy_read(mii_info, MII_BMCR); | 270 | ctl = ucc_geth_phy_read(mii_info, MII_BMCR); |
248 | ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); | 271 | ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); |
249 | phy_write(mii_info, MII_BMCR, ctl); | 272 | ucc_geth_phy_write(mii_info, MII_BMCR, ctl); |
250 | } | 273 | } |
251 | 274 | ||
252 | static int gbit_config_aneg(struct ugeth_mii_info *mii_info) | 275 | static int gbit_config_aneg(struct ugeth_mii_info *mii_info) |
@@ -261,14 +284,14 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info) | |||
261 | config_genmii_advert(mii_info); | 284 | config_genmii_advert(mii_info); |
262 | advertise = mii_info->advertising; | 285 | advertise = mii_info->advertising; |
263 | 286 | ||
264 | adv = phy_read(mii_info, MII_1000BASETCONTROL); | 287 | adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL); |
265 | adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP | | 288 | adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP | |
266 | MII_1000BASETCONTROL_HALFDUPLEXCAP); | 289 | MII_1000BASETCONTROL_HALFDUPLEXCAP); |
267 | if (advertise & SUPPORTED_1000baseT_Half) | 290 | if (advertise & SUPPORTED_1000baseT_Half) |
268 | adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP; | 291 | adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP; |
269 | if (advertise & SUPPORTED_1000baseT_Full) | 292 | if (advertise & SUPPORTED_1000baseT_Full) |
270 | adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP; | 293 | adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP; |
271 | phy_write(mii_info, MII_1000BASETCONTROL, adv); | 294 | ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv); |
272 | 295 | ||
273 | /* Start/Restart aneg */ | 296 | /* Start/Restart aneg */ |
274 | genmii_restart_aneg(mii_info); | 297 | genmii_restart_aneg(mii_info); |
@@ -298,10 +321,10 @@ static int genmii_update_link(struct ugeth_mii_info *mii_info) | |||
298 | ugphy_vdbg("%s: IN", __FUNCTION__); | 321 | ugphy_vdbg("%s: IN", __FUNCTION__); |
299 | 322 | ||
300 | /* Do a fake read */ | 323 | /* Do a fake read */ |
301 | phy_read(mii_info, MII_BMSR); | 324 | ucc_geth_phy_read(mii_info, MII_BMSR); |
302 | 325 | ||
303 | /* Read link and autonegotiation status */ | 326 | /* Read link and autonegotiation status */ |
304 | status = phy_read(mii_info, MII_BMSR); | 327 | status = ucc_geth_phy_read(mii_info, MII_BMSR); |
305 | if ((status & BMSR_LSTATUS) == 0) | 328 | if ((status & BMSR_LSTATUS) == 0) |
306 | mii_info->link = 0; | 329 | mii_info->link = 0; |
307 | else | 330 | else |
@@ -329,7 +352,7 @@ static int genmii_read_status(struct ugeth_mii_info *mii_info) | |||
329 | return err; | 352 | return err; |
330 | 353 | ||
331 | if (mii_info->autoneg) { | 354 | if (mii_info->autoneg) { |
332 | status = phy_read(mii_info, MII_LPA); | 355 | status = ucc_geth_phy_read(mii_info, MII_LPA); |
333 | 356 | ||
334 | if (status & (LPA_10FULL | LPA_100FULL)) | 357 | if (status & (LPA_10FULL | LPA_100FULL)) |
335 | mii_info->duplex = DUPLEX_FULL; | 358 | mii_info->duplex = DUPLEX_FULL; |
@@ -352,9 +375,9 @@ static int marvell_init(struct ugeth_mii_info *mii_info) | |||
352 | { | 375 | { |
353 | ugphy_vdbg("%s: IN", __FUNCTION__); | 376 | ugphy_vdbg("%s: IN", __FUNCTION__); |
354 | 377 | ||
355 | phy_write(mii_info, 0x14, 0x0cd2); | 378 | ucc_geth_phy_write(mii_info, 0x14, 0x0cd2); |
356 | phy_write(mii_info, MII_BMCR, | 379 | ucc_geth_phy_write(mii_info, MII_BMCR, |
357 | phy_read(mii_info, MII_BMCR) | BMCR_RESET); | 380 | ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); |
358 | msleep(4000); | 381 | msleep(4000); |
359 | 382 | ||
360 | return 0; | 383 | return 0; |
@@ -367,13 +390,13 @@ static int marvell_config_aneg(struct ugeth_mii_info *mii_info) | |||
367 | /* The Marvell PHY has an errata which requires | 390 | /* The Marvell PHY has an errata which requires |
368 | * that certain registers get written in order | 391 | * that certain registers get written in order |
369 | * to restart autonegotiation */ | 392 | * to restart autonegotiation */ |
370 | phy_write(mii_info, MII_BMCR, BMCR_RESET); | 393 | ucc_geth_phy_write(mii_info, MII_BMCR, BMCR_RESET); |
371 | 394 | ||
372 | phy_write(mii_info, 0x1d, 0x1f); | 395 | ucc_geth_phy_write(mii_info, 0x1d, 0x1f); |
373 | phy_write(mii_info, 0x1e, 0x200c); | 396 | ucc_geth_phy_write(mii_info, 0x1e, 0x200c); |
374 | phy_write(mii_info, 0x1d, 0x5); | 397 | ucc_geth_phy_write(mii_info, 0x1d, 0x5); |
375 | phy_write(mii_info, 0x1e, 0); | 398 | ucc_geth_phy_write(mii_info, 0x1e, 0); |
376 | phy_write(mii_info, 0x1e, 0x100); | 399 | ucc_geth_phy_write(mii_info, 0x1e, 0x100); |
377 | 400 | ||
378 | gbit_config_aneg(mii_info); | 401 | gbit_config_aneg(mii_info); |
379 | 402 | ||
@@ -398,7 +421,7 @@ static int marvell_read_status(struct ugeth_mii_info *mii_info) | |||
398 | * are as set */ | 421 | * are as set */ |
399 | if (mii_info->autoneg && mii_info->link) { | 422 | if (mii_info->autoneg && mii_info->link) { |
400 | int speed; | 423 | int speed; |
401 | status = phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); | 424 | status = ucc_geth_phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); |
402 | 425 | ||
403 | /* Get the duplexity */ | 426 | /* Get the duplexity */ |
404 | if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX) | 427 | if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX) |
@@ -430,7 +453,7 @@ static int marvell_ack_interrupt(struct ugeth_mii_info *mii_info) | |||
430 | ugphy_vdbg("%s: IN", __FUNCTION__); | 453 | ugphy_vdbg("%s: IN", __FUNCTION__); |
431 | 454 | ||
432 | /* Clear the interrupts by reading the reg */ | 455 | /* Clear the interrupts by reading the reg */ |
433 | phy_read(mii_info, MII_M1011_IEVENT); | 456 | ucc_geth_phy_read(mii_info, MII_M1011_IEVENT); |
434 | 457 | ||
435 | return 0; | 458 | return 0; |
436 | } | 459 | } |
@@ -440,9 +463,9 @@ static int marvell_config_intr(struct ugeth_mii_info *mii_info) | |||
440 | ugphy_vdbg("%s: IN", __FUNCTION__); | 463 | ugphy_vdbg("%s: IN", __FUNCTION__); |
441 | 464 | ||
442 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) | 465 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) |
443 | phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); | 466 | ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); |
444 | else | 467 | else |
445 | phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); | 468 | ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); |
446 | 469 | ||
447 | return 0; | 470 | return 0; |
448 | } | 471 | } |
@@ -451,9 +474,9 @@ static int cis820x_init(struct ugeth_mii_info *mii_info) | |||
451 | { | 474 | { |
452 | ugphy_vdbg("%s: IN", __FUNCTION__); | 475 | ugphy_vdbg("%s: IN", __FUNCTION__); |
453 | 476 | ||
454 | phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, | 477 | ucc_geth_phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, |
455 | MII_CIS8201_AUXCONSTAT_INIT); | 478 | MII_CIS8201_AUXCONSTAT_INIT); |
456 | phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); | 479 | ucc_geth_phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); |
457 | 480 | ||
458 | return 0; | 481 | return 0; |
459 | } | 482 | } |
@@ -477,7 +500,7 @@ static int cis820x_read_status(struct ugeth_mii_info *mii_info) | |||
477 | if (mii_info->autoneg && mii_info->link) { | 500 | if (mii_info->autoneg && mii_info->link) { |
478 | int speed; | 501 | int speed; |
479 | 502 | ||
480 | status = phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); | 503 | status = ucc_geth_phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); |
481 | if (status & MII_CIS8201_AUXCONSTAT_DUPLEX) | 504 | if (status & MII_CIS8201_AUXCONSTAT_DUPLEX) |
482 | mii_info->duplex = DUPLEX_FULL; | 505 | mii_info->duplex = DUPLEX_FULL; |
483 | else | 506 | else |
@@ -505,7 +528,7 @@ static int cis820x_ack_interrupt(struct ugeth_mii_info *mii_info) | |||
505 | { | 528 | { |
506 | ugphy_vdbg("%s: IN", __FUNCTION__); | 529 | ugphy_vdbg("%s: IN", __FUNCTION__); |
507 | 530 | ||
508 | phy_read(mii_info, MII_CIS8201_ISTAT); | 531 | ucc_geth_phy_read(mii_info, MII_CIS8201_ISTAT); |
509 | 532 | ||
510 | return 0; | 533 | return 0; |
511 | } | 534 | } |
@@ -515,9 +538,9 @@ static int cis820x_config_intr(struct ugeth_mii_info *mii_info) | |||
515 | ugphy_vdbg("%s: IN", __FUNCTION__); | 538 | ugphy_vdbg("%s: IN", __FUNCTION__); |
516 | 539 | ||
517 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) | 540 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) |
518 | phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); | 541 | ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); |
519 | else | 542 | else |
520 | phy_write(mii_info, MII_CIS8201_IMASK, 0); | 543 | ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, 0); |
521 | 544 | ||
522 | return 0; | 545 | return 0; |
523 | } | 546 | } |
@@ -541,7 +564,7 @@ static int dm9161_read_status(struct ugeth_mii_info *mii_info) | |||
541 | /* If we aren't autonegotiating, assume speeds | 564 | /* If we aren't autonegotiating, assume speeds |
542 | * are as set */ | 565 | * are as set */ |
543 | if (mii_info->autoneg && mii_info->link) { | 566 | if (mii_info->autoneg && mii_info->link) { |
544 | status = phy_read(mii_info, MII_DM9161_SCSR); | 567 | status = ucc_geth_phy_read(mii_info, MII_DM9161_SCSR); |
545 | if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H)) | 568 | if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H)) |
546 | mii_info->speed = SPEED_100; | 569 | mii_info->speed = SPEED_100; |
547 | else | 570 | else |
@@ -572,7 +595,7 @@ static void dm9161_timer(unsigned long data) | |||
572 | { | 595 | { |
573 | struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data; | 596 | struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data; |
574 | struct dm9161_private *priv = mii_info->priv; | 597 | struct dm9161_private *priv = mii_info->priv; |
575 | u16 status = phy_read(mii_info, MII_BMSR); | 598 | u16 status = ucc_geth_phy_read(mii_info, MII_BMSR); |
576 | 599 | ||
577 | ugphy_vdbg("%s: IN", __FUNCTION__); | 600 | ugphy_vdbg("%s: IN", __FUNCTION__); |
578 | 601 | ||
@@ -599,11 +622,11 @@ static int dm9161_init(struct ugeth_mii_info *mii_info) | |||
599 | /* Reset is not done yet */ | 622 | /* Reset is not done yet */ |
600 | priv->resetdone = 0; | 623 | priv->resetdone = 0; |
601 | 624 | ||
602 | phy_write(mii_info, MII_BMCR, | 625 | ucc_geth_phy_write(mii_info, MII_BMCR, |
603 | phy_read(mii_info, MII_BMCR) | BMCR_RESET); | 626 | ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); |
604 | 627 | ||
605 | phy_write(mii_info, MII_BMCR, | 628 | ucc_geth_phy_write(mii_info, MII_BMCR, |
606 | phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); | 629 | ucc_geth_phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); |
607 | 630 | ||
608 | config_genmii_advert(mii_info); | 631 | config_genmii_advert(mii_info); |
609 | /* Start/Restart aneg */ | 632 | /* Start/Restart aneg */ |
@@ -634,7 +657,7 @@ static int dm9161_ack_interrupt(struct ugeth_mii_info *mii_info) | |||
634 | ugphy_vdbg("%s: IN", __FUNCTION__); | 657 | ugphy_vdbg("%s: IN", __FUNCTION__); |
635 | 658 | ||
636 | /* Clear the interrupts by reading the reg */ | 659 | /* Clear the interrupts by reading the reg */ |
637 | phy_read(mii_info, MII_DM9161_INTR); | 660 | ucc_geth_phy_read(mii_info, MII_DM9161_INTR); |
638 | 661 | ||
639 | 662 | ||
640 | return 0; | 663 | return 0; |
@@ -645,9 +668,9 @@ static int dm9161_config_intr(struct ugeth_mii_info *mii_info) | |||
645 | ugphy_vdbg("%s: IN", __FUNCTION__); | 668 | ugphy_vdbg("%s: IN", __FUNCTION__); |
646 | 669 | ||
647 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) | 670 | if (mii_info->interrupts == MII_INTERRUPT_ENABLED) |
648 | phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); | 671 | ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); |
649 | else | 672 | else |
650 | phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); | 673 | ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); |
651 | 674 | ||
652 | return 0; | 675 | return 0; |
653 | } | 676 | } |
@@ -718,31 +741,6 @@ static struct phy_info *phy_info[] = { | |||
718 | NULL | 741 | NULL |
719 | }; | 742 | }; |
720 | 743 | ||
721 | u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum) | ||
722 | { | ||
723 | u16 retval; | ||
724 | unsigned long flags; | ||
725 | |||
726 | ugphy_vdbg("%s: IN", __FUNCTION__); | ||
727 | |||
728 | spin_lock_irqsave(&mii_info->mdio_lock, flags); | ||
729 | retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); | ||
730 | spin_unlock_irqrestore(&mii_info->mdio_lock, flags); | ||
731 | |||
732 | return retval; | ||
733 | } | ||
734 | |||
735 | void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) | ||
736 | { | ||
737 | unsigned long flags; | ||
738 | |||
739 | ugphy_vdbg("%s: IN", __FUNCTION__); | ||
740 | |||
741 | spin_lock_irqsave(&mii_info->mdio_lock, flags); | ||
742 | mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); | ||
743 | spin_unlock_irqrestore(&mii_info->mdio_lock, flags); | ||
744 | } | ||
745 | |||
746 | /* Use the PHY ID registers to determine what type of PHY is attached | 744 | /* Use the PHY ID registers to determine what type of PHY is attached |
747 | * to device dev. return a struct phy_info structure describing that PHY | 745 | * to device dev. return a struct phy_info structure describing that PHY |
748 | */ | 746 | */ |
@@ -757,11 +755,11 @@ struct phy_info *get_phy_info(struct ugeth_mii_info *mii_info) | |||
757 | ugphy_vdbg("%s: IN", __FUNCTION__); | 755 | ugphy_vdbg("%s: IN", __FUNCTION__); |
758 | 756 | ||
759 | /* Grab the bits from PHYIR1, and put them in the upper half */ | 757 | /* Grab the bits from PHYIR1, and put them in the upper half */ |
760 | phy_reg = phy_read(mii_info, MII_PHYSID1); | 758 | phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID1); |
761 | phy_ID = (phy_reg & 0xffff) << 16; | 759 | phy_ID = (phy_reg & 0xffff) << 16; |
762 | 760 | ||
763 | /* Grab the bits from PHYIR2, and put them in the lower half */ | 761 | /* Grab the bits from PHYIR2, and put them in the lower half */ |
764 | phy_reg = phy_read(mii_info, MII_PHYSID2); | 762 | phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID2); |
765 | phy_ID |= (phy_reg & 0xffff); | 763 | phy_ID |= (phy_reg & 0xffff); |
766 | 764 | ||
767 | /* loop through all the known PHY types, and find one that */ | 765 | /* loop through all the known PHY types, and find one that */ |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 2ec2e5afce67..91b752e3d07e 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -2701,8 +2701,8 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2701 | sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); | 2701 | sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); |
2702 | 2702 | ||
2703 | /* extract core_id, core_rev, core_vendor */ | 2703 | /* extract core_id, core_rev, core_vendor */ |
2704 | core_id = (sb_id_hi & 0xFFF0) >> 4; | 2704 | core_id = (sb_id_hi & 0x8FF0) >> 4; |
2705 | core_rev = (sb_id_hi & 0xF); | 2705 | core_rev = ((sb_id_hi & 0xF) | ((sb_id_hi & 0x7000) >> 8)); |
2706 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; | 2706 | core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; |
2707 | 2707 | ||
2708 | dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", | 2708 | dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", |
@@ -2873,7 +2873,10 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm, | |||
2873 | sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); | 2873 | sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); |
2874 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; | 2874 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; |
2875 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; | 2875 | sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; |
2876 | sbimconfiglow |= 0x32; | 2876 | if (bcm->bustype == BCM43xx_BUSTYPE_PCI) |
2877 | sbimconfiglow |= 0x32; | ||
2878 | else | ||
2879 | sbimconfiglow |= 0x53; | ||
2877 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); | 2880 | bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); |
2878 | } | 2881 | } |
2879 | 2882 | ||
@@ -3077,7 +3080,7 @@ static int bcm43xx_setup_backplane_pci_connection(struct bcm43xx_private *bcm, | |||
3077 | if (err) | 3080 | if (err) |
3078 | goto out; | 3081 | goto out; |
3079 | 3082 | ||
3080 | if (bcm->current_core->rev < 6 || | 3083 | if (bcm->current_core->rev < 6 && |
3081 | bcm->current_core->id == BCM43xx_COREID_PCI) { | 3084 | bcm->current_core->id == BCM43xx_COREID_PCI) { |
3082 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); | 3085 | value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); |
3083 | value |= (1 << backplane_flag_nr); | 3086 | value |= (1 << backplane_flag_nr); |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b8d2385e29bc..92d5e8db0de7 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -150,8 +150,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | |||
150 | } | 150 | } |
151 | 151 | ||
152 | /** | 152 | /** |
153 | * pci_match_device - Tell if a PCI device structure has a matching | 153 | * pci_match_device - Tell if a PCI device structure has a matching PCI device id structure |
154 | * PCI device id structure | ||
155 | * @drv: the PCI driver to match against | 154 | * @drv: the PCI driver to match against |
156 | * @dev: the PCI device structure to match against | 155 | * @dev: the PCI device structure to match against |
157 | * | 156 | * |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 0a70943f8bb6..c913ea4e545c 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -654,19 +654,42 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vi | |||
654 | * VIA bridges which have VLink | 654 | * VIA bridges which have VLink |
655 | */ | 655 | */ |
656 | 656 | ||
657 | static const struct pci_device_id via_vlink_fixup_tbl[] = { | 657 | static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18; |
658 | /* Internal devices need IRQ line routing, pre VLink */ | 658 | |
659 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C686), 0 }, | 659 | static void quirk_via_bridge(struct pci_dev *dev) |
660 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8231), 17 }, | 660 | { |
661 | /* Devices with VLink */ | 661 | /* See what bridge we have and find the device ranges */ |
662 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233_0), 17}, | 662 | switch (dev->device) { |
663 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233A), 17 }, | 663 | case PCI_DEVICE_ID_VIA_82C686: |
664 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233C_0), 17 }, | 664 | /* The VT82C686 is special, it attaches to PCI and can have |
665 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8235), 16 }, | 665 | any device number. All its subdevices are functions of |
666 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237), 15 }, | 666 | that single device. */ |
667 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237A), 15 }, | 667 | via_vlink_dev_lo = PCI_SLOT(dev->devfn); |
668 | { 0, }, | 668 | via_vlink_dev_hi = PCI_SLOT(dev->devfn); |
669 | }; | 669 | break; |
670 | case PCI_DEVICE_ID_VIA_8237: | ||
671 | case PCI_DEVICE_ID_VIA_8237A: | ||
672 | via_vlink_dev_lo = 15; | ||
673 | break; | ||
674 | case PCI_DEVICE_ID_VIA_8235: | ||
675 | via_vlink_dev_lo = 16; | ||
676 | break; | ||
677 | case PCI_DEVICE_ID_VIA_8231: | ||
678 | case PCI_DEVICE_ID_VIA_8233_0: | ||
679 | case PCI_DEVICE_ID_VIA_8233A: | ||
680 | case PCI_DEVICE_ID_VIA_8233C_0: | ||
681 | via_vlink_dev_lo = 17; | ||
682 | break; | ||
683 | } | ||
684 | } | ||
685 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_bridge); | ||
686 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, quirk_via_bridge); | ||
687 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_0, quirk_via_bridge); | ||
688 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233A, quirk_via_bridge); | ||
689 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233C_0, quirk_via_bridge); | ||
690 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_bridge); | ||
691 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_bridge); | ||
692 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A, quirk_via_bridge); | ||
670 | 693 | ||
671 | /** | 694 | /** |
672 | * quirk_via_vlink - VIA VLink IRQ number update | 695 | * quirk_via_vlink - VIA VLink IRQ number update |
@@ -675,35 +698,20 @@ static const struct pci_device_id via_vlink_fixup_tbl[] = { | |||
675 | * If the device we are dealing with is on a PIC IRQ we need to | 698 | * If the device we are dealing with is on a PIC IRQ we need to |
676 | * ensure that the IRQ line register which usually is not relevant | 699 | * ensure that the IRQ line register which usually is not relevant |
677 | * for PCI cards, is actually written so that interrupts get sent | 700 | * for PCI cards, is actually written so that interrupts get sent |
678 | * to the right place | 701 | * to the right place. |
702 | * We only do this on systems where a VIA south bridge was detected, | ||
703 | * and only for VIA devices on the motherboard (see quirk_via_bridge | ||
704 | * above). | ||
679 | */ | 705 | */ |
680 | 706 | ||
681 | static void quirk_via_vlink(struct pci_dev *dev) | 707 | static void quirk_via_vlink(struct pci_dev *dev) |
682 | { | 708 | { |
683 | const struct pci_device_id *via_vlink_fixup; | ||
684 | static int dev_lo = -1, dev_hi = 18; | ||
685 | u8 irq, new_irq; | 709 | u8 irq, new_irq; |
686 | 710 | ||
687 | /* Check if we have VLink and cache the result */ | 711 | /* Check if we have VLink at all */ |
688 | 712 | if (via_vlink_dev_lo == -1) | |
689 | /* Checked already - no */ | ||
690 | if (dev_lo == -2) | ||
691 | return; | 713 | return; |
692 | 714 | ||
693 | /* Not checked - see what bridge we have and find the device | ||
694 | ranges */ | ||
695 | |||
696 | if (dev_lo == -1) { | ||
697 | via_vlink_fixup = pci_find_present(via_vlink_fixup_tbl); | ||
698 | if (via_vlink_fixup == NULL) { | ||
699 | dev_lo = -2; | ||
700 | return; | ||
701 | } | ||
702 | dev_lo = via_vlink_fixup->driver_data; | ||
703 | /* 82C686 is special - 0/0 */ | ||
704 | if (dev_lo == 0) | ||
705 | dev_hi = 0; | ||
706 | } | ||
707 | new_irq = dev->irq; | 715 | new_irq = dev->irq; |
708 | 716 | ||
709 | /* Don't quirk interrupts outside the legacy IRQ range */ | 717 | /* Don't quirk interrupts outside the legacy IRQ range */ |
@@ -711,8 +719,8 @@ static void quirk_via_vlink(struct pci_dev *dev) | |||
711 | return; | 719 | return; |
712 | 720 | ||
713 | /* Internal device ? */ | 721 | /* Internal device ? */ |
714 | if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > dev_hi || | 722 | if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi || |
715 | PCI_SLOT(dev->devfn) < dev_lo) | 723 | PCI_SLOT(dev->devfn) < via_vlink_dev_lo) |
716 | return; | 724 | return; |
717 | 725 | ||
718 | /* This is an internal VLink device on a PIC interrupt. The BIOS | 726 | /* This is an internal VLink device on a PIC interrupt. The BIOS |
@@ -1002,6 +1010,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | |||
1002 | case 0x186a: /* M6Ne notebook */ | 1010 | case 0x186a: /* M6Ne notebook */ |
1003 | asus_hides_smbus = 1; | 1011 | asus_hides_smbus = 1; |
1004 | } | 1012 | } |
1013 | if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) | ||
1014 | switch (dev->subsystem_device) { | ||
1015 | case 0x80f2: /* P4P800-X */ | ||
1016 | asus_hides_smbus = 1; | ||
1017 | } | ||
1005 | if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { | 1018 | if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { |
1006 | switch (dev->subsystem_device) { | 1019 | switch (dev->subsystem_device) { |
1007 | case 0x1882: /* M6V notebook */ | 1020 | case 0x1882: /* M6V notebook */ |
@@ -1249,8 +1262,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) | |||
1249 | pci_read_config_dword(pdev, 0x40, &conf); | 1262 | pci_read_config_dword(pdev, 0x40, &conf); |
1250 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ | 1263 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ |
1251 | /* Set the class codes correctly and then direct IDE 0 */ | 1264 | /* Set the class codes correctly and then direct IDE 0 */ |
1252 | conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ | 1265 | conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */ |
1253 | conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ | 1266 | conf |= 0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */ |
1254 | pci_write_config_dword(pdev, 0x40, conf); | 1267 | pci_write_config_dword(pdev, 0x40, conf); |
1255 | 1268 | ||
1256 | /* Reconfigure so that the PCI scanner discovers the | 1269 | /* Reconfigure so that the PCI scanner discovers the |
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index fab381ed853c..b2653c4afe9e 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -200,11 +200,8 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, | |||
200 | * can cause some machines to crash. So here we detect and flag that | 200 | * can cause some machines to crash. So here we detect and flag that |
201 | * situation and bail out early. | 201 | * situation and bail out early. |
202 | */ | 202 | */ |
203 | if (unlikely(list_empty(&pci_devices))) { | 203 | if (unlikely(list_empty(&pci_devices))) |
204 | printk(KERN_INFO "pci_find_subsys() called while pci_devices " | ||
205 | "is still empty\n"); | ||
206 | return NULL; | 204 | return NULL; |
207 | } | ||
208 | down_read(&pci_bus_sem); | 205 | down_read(&pci_bus_sem); |
209 | n = from ? from->global_list.next : pci_devices.next; | 206 | n = from ? from->global_list.next : pci_devices.next; |
210 | 207 | ||
@@ -278,11 +275,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device, | |||
278 | * can cause some machines to crash. So here we detect and flag that | 275 | * can cause some machines to crash. So here we detect and flag that |
279 | * situation and bail out early. | 276 | * situation and bail out early. |
280 | */ | 277 | */ |
281 | if (unlikely(list_empty(&pci_devices))) { | 278 | if (unlikely(list_empty(&pci_devices))) |
282 | printk(KERN_NOTICE "pci_get_subsys() called while pci_devices " | ||
283 | "is still empty\n"); | ||
284 | return NULL; | 279 | return NULL; |
285 | } | ||
286 | down_read(&pci_bus_sem); | 280 | down_read(&pci_bus_sem); |
287 | n = from ? from->global_list.next : pci_devices.next; | 281 | n = from ? from->global_list.next : pci_devices.next; |
288 | 282 | ||
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index e9e0934380b8..198b9f22fbff 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -492,10 +492,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) | |||
492 | 492 | ||
493 | spin_lock_irq(&rtc->lock); | 493 | spin_lock_irq(&rtc->lock); |
494 | 494 | ||
495 | /* disable alarm interrupt and clear flag */ | 495 | /* disable alarm interrupt and clear the alarm flag */ |
496 | rcr1 = readb(rtc->regbase + RCR1); | 496 | rcr1 = readb(rtc->regbase + RCR1); |
497 | rcr1 &= ~RCR1_AF; | 497 | rcr1 &= ~(RCR1_AF|RCR1_AIE); |
498 | writeb(rcr1 & ~RCR1_AIE, rtc->regbase + RCR1); | 498 | writeb(rcr1, rtc->regbase + RCR1); |
499 | 499 | ||
500 | rtc->rearm_aie = 0; | 500 | rtc->rearm_aie = 0; |
501 | 501 | ||
@@ -510,8 +510,10 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) | |||
510 | mon += 1; | 510 | mon += 1; |
511 | sh_rtc_write_alarm_value(rtc, mon, RMONAR); | 511 | sh_rtc_write_alarm_value(rtc, mon, RMONAR); |
512 | 512 | ||
513 | /* Restore interrupt activation status */ | 513 | if (wkalrm->enabled) { |
514 | writeb(rcr1, rtc->regbase + RCR1); | 514 | rcr1 |= RCR1_AIE; |
515 | writeb(rcr1, rtc->regbase + RCR1); | ||
516 | } | ||
515 | 517 | ||
516 | spin_unlock_irq(&rtc->lock); | 518 | spin_unlock_irq(&rtc->lock); |
517 | 519 | ||
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c index 9418a59fb368..2ddd0cf07140 100644 --- a/drivers/rtc/rtc-sysfs.c +++ b/drivers/rtc/rtc-sysfs.c | |||
@@ -78,7 +78,7 @@ static struct attribute_group rtc_attr_group = { | |||
78 | .attrs = rtc_attrs, | 78 | .attrs = rtc_attrs, |
79 | }; | 79 | }; |
80 | 80 | ||
81 | static int __devinit rtc_sysfs_add_device(struct class_device *class_dev, | 81 | static int rtc_sysfs_add_device(struct class_device *class_dev, |
82 | struct class_interface *class_intf) | 82 | struct class_interface *class_intf) |
83 | { | 83 | { |
84 | int err; | 84 | int err; |
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 99a259c5a0c0..e1b44d6c0c32 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c | |||
@@ -6,7 +6,7 @@ | |||
6 | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 6 | Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
7 | Brad Strand <linux@3ware.com> | 7 | Brad Strand <linux@3ware.com> |
8 | 8 | ||
9 | Copyright (C) 1999-2005 3ware Inc. | 9 | Copyright (C) 1999-2007 3ware Inc. |
10 | 10 | ||
11 | Kernel compatiblity By: Andre Hedrick <andre@suse.com> | 11 | Kernel compatiblity By: Andre Hedrick <andre@suse.com> |
12 | Non-Copyright (C) 2000 Andre Hedrick <andre@suse.com> | 12 | Non-Copyright (C) 2000 Andre Hedrick <andre@suse.com> |
@@ -191,6 +191,9 @@ | |||
191 | before shutting down card. | 191 | before shutting down card. |
192 | Change to new 'change_queue_depth' api. | 192 | Change to new 'change_queue_depth' api. |
193 | Fix 'handled=1' ISR usage, remove bogus IRQ check. | 193 | Fix 'handled=1' ISR usage, remove bogus IRQ check. |
194 | 1.26.02.002 - Free irq handler in __tw_shutdown(). | ||
195 | Turn on RCD bit for caching mode page. | ||
196 | Serialize reset code. | ||
194 | */ | 197 | */ |
195 | 198 | ||
196 | #include <linux/module.h> | 199 | #include <linux/module.h> |
@@ -214,7 +217,7 @@ | |||
214 | #include "3w-xxxx.h" | 217 | #include "3w-xxxx.h" |
215 | 218 | ||
216 | /* Globals */ | 219 | /* Globals */ |
217 | #define TW_DRIVER_VERSION "1.26.02.001" | 220 | #define TW_DRIVER_VERSION "1.26.02.002" |
218 | static TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT]; | 221 | static TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT]; |
219 | static int tw_device_extension_count = 0; | 222 | static int tw_device_extension_count = 0; |
220 | static int twe_major = -1; | 223 | static int twe_major = -1; |
@@ -226,7 +229,7 @@ MODULE_LICENSE("GPL"); | |||
226 | MODULE_VERSION(TW_DRIVER_VERSION); | 229 | MODULE_VERSION(TW_DRIVER_VERSION); |
227 | 230 | ||
228 | /* Function prototypes */ | 231 | /* Function prototypes */ |
229 | static int tw_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_reset); | 232 | static int tw_reset_device_extension(TW_Device_Extension *tw_dev); |
230 | 233 | ||
231 | /* Functions */ | 234 | /* Functions */ |
232 | 235 | ||
@@ -984,24 +987,12 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int | |||
984 | /* Now wait for the command to complete */ | 987 | /* Now wait for the command to complete */ |
985 | timeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout); | 988 | timeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout); |
986 | 989 | ||
987 | /* See if we reset while waiting for the ioctl to complete */ | ||
988 | if (test_bit(TW_IN_RESET, &tw_dev->flags)) { | ||
989 | clear_bit(TW_IN_RESET, &tw_dev->flags); | ||
990 | retval = -ERESTARTSYS; | ||
991 | goto out2; | ||
992 | } | ||
993 | |||
994 | /* We timed out, and didn't get an interrupt */ | 990 | /* We timed out, and didn't get an interrupt */ |
995 | if (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) { | 991 | if (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) { |
996 | /* Now we need to reset the board */ | 992 | /* Now we need to reset the board */ |
997 | printk(KERN_WARNING "3w-xxxx: scsi%d: Character ioctl (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, cmd); | 993 | printk(KERN_WARNING "3w-xxxx: scsi%d: Character ioctl (0x%x) timed out, resetting card.\n", tw_dev->host->host_no, cmd); |
998 | retval = -EIO; | 994 | retval = -EIO; |
999 | spin_lock_irqsave(tw_dev->host->host_lock, flags); | 995 | if (tw_reset_device_extension(tw_dev)) { |
1000 | tw_dev->state[request_id] = TW_S_COMPLETED; | ||
1001 | tw_state_request_finish(tw_dev, request_id); | ||
1002 | tw_dev->posted_request_count--; | ||
1003 | spin_unlock_irqrestore(tw_dev->host->host_lock, flags); | ||
1004 | if (tw_reset_device_extension(tw_dev, 1)) { | ||
1005 | printk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl(): Reset failed for card %d.\n", tw_dev->host->host_no); | 996 | printk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl(): Reset failed for card %d.\n", tw_dev->host->host_no); |
1006 | } | 997 | } |
1007 | goto out2; | 998 | goto out2; |
@@ -1336,7 +1327,7 @@ static void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) | |||
1336 | } /* End tw_unmap_scsi_data() */ | 1327 | } /* End tw_unmap_scsi_data() */ |
1337 | 1328 | ||
1338 | /* This function will reset a device extension */ | 1329 | /* This function will reset a device extension */ |
1339 | static int tw_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_reset) | 1330 | static int tw_reset_device_extension(TW_Device_Extension *tw_dev) |
1340 | { | 1331 | { |
1341 | int i = 0; | 1332 | int i = 0; |
1342 | struct scsi_cmnd *srb; | 1333 | struct scsi_cmnd *srb; |
@@ -1382,15 +1373,10 @@ static int tw_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_rese | |||
1382 | printk(KERN_WARNING "3w-xxxx: scsi%d: Reset sequence failed.\n", tw_dev->host->host_no); | 1373 | printk(KERN_WARNING "3w-xxxx: scsi%d: Reset sequence failed.\n", tw_dev->host->host_no); |
1383 | return 1; | 1374 | return 1; |
1384 | } | 1375 | } |
1385 | TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev); | ||
1386 | 1376 | ||
1387 | /* Wake up any ioctl that was pending before the reset */ | 1377 | TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev); |
1388 | if ((tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE) || (ioctl_reset)) { | 1378 | clear_bit(TW_IN_RESET, &tw_dev->flags); |
1389 | clear_bit(TW_IN_RESET, &tw_dev->flags); | 1379 | tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; |
1390 | } else { | ||
1391 | tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE; | ||
1392 | wake_up(&tw_dev->ioctl_wqueue); | ||
1393 | } | ||
1394 | 1380 | ||
1395 | return 0; | 1381 | return 0; |
1396 | } /* End tw_reset_device_extension() */ | 1382 | } /* End tw_reset_device_extension() */ |
@@ -1437,14 +1423,18 @@ static int tw_scsi_eh_reset(struct scsi_cmnd *SCpnt) | |||
1437 | "WARNING: Command (0x%x) timed out, resetting card.\n", | 1423 | "WARNING: Command (0x%x) timed out, resetting card.\n", |
1438 | SCpnt->cmnd[0]); | 1424 | SCpnt->cmnd[0]); |
1439 | 1425 | ||
1426 | /* Make sure we are not issuing an ioctl or resetting from ioctl */ | ||
1427 | mutex_lock(&tw_dev->ioctl_lock); | ||
1428 | |||
1440 | /* Now reset the card and some of the device extension data */ | 1429 | /* Now reset the card and some of the device extension data */ |
1441 | if (tw_reset_device_extension(tw_dev, 0)) { | 1430 | if (tw_reset_device_extension(tw_dev)) { |
1442 | printk(KERN_WARNING "3w-xxxx: scsi%d: Reset failed.\n", tw_dev->host->host_no); | 1431 | printk(KERN_WARNING "3w-xxxx: scsi%d: Reset failed.\n", tw_dev->host->host_no); |
1443 | goto out; | 1432 | goto out; |
1444 | } | 1433 | } |
1445 | 1434 | ||
1446 | retval = SUCCESS; | 1435 | retval = SUCCESS; |
1447 | out: | 1436 | out: |
1437 | mutex_unlock(&tw_dev->ioctl_lock); | ||
1448 | return retval; | 1438 | return retval; |
1449 | } /* End tw_scsi_eh_reset() */ | 1439 | } /* End tw_scsi_eh_reset() */ |
1450 | 1440 | ||
@@ -1660,9 +1650,9 @@ static int tw_scsiop_mode_sense_complete(TW_Device_Extension *tw_dev, int reques | |||
1660 | request_buffer[4] = 0x8; /* caching page */ | 1650 | request_buffer[4] = 0x8; /* caching page */ |
1661 | request_buffer[5] = 0xa; /* page length */ | 1651 | request_buffer[5] = 0xa; /* page length */ |
1662 | if (*flags & 0x1) | 1652 | if (*flags & 0x1) |
1663 | request_buffer[6] = 0x4; /* WCE on */ | 1653 | request_buffer[6] = 0x5; /* WCE on, RCD on */ |
1664 | else | 1654 | else |
1665 | request_buffer[6] = 0x0; /* WCE off */ | 1655 | request_buffer[6] = 0x1; /* WCE off, RCD on */ |
1666 | tw_transfer_internal(tw_dev, request_id, request_buffer, | 1656 | tw_transfer_internal(tw_dev, request_id, request_buffer, |
1667 | sizeof(request_buffer)); | 1657 | sizeof(request_buffer)); |
1668 | 1658 | ||
@@ -2012,6 +2002,10 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd | |||
2012 | int retval = 1; | 2002 | int retval = 1; |
2013 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; | 2003 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; |
2014 | 2004 | ||
2005 | /* If we are resetting due to timed out ioctl, report as busy */ | ||
2006 | if (test_bit(TW_IN_RESET, &tw_dev->flags)) | ||
2007 | return SCSI_MLQUEUE_HOST_BUSY; | ||
2008 | |||
2015 | /* Save done function into Scsi_Cmnd struct */ | 2009 | /* Save done function into Scsi_Cmnd struct */ |
2016 | SCpnt->scsi_done = done; | 2010 | SCpnt->scsi_done = done; |
2017 | 2011 | ||
@@ -2100,6 +2094,10 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance) | |||
2100 | 2094 | ||
2101 | handled = 1; | 2095 | handled = 1; |
2102 | 2096 | ||
2097 | /* If we are resetting, bail */ | ||
2098 | if (test_bit(TW_IN_RESET, &tw_dev->flags)) | ||
2099 | goto tw_interrupt_bail; | ||
2100 | |||
2103 | /* Check controller for errors */ | 2101 | /* Check controller for errors */ |
2104 | if (tw_check_bits(status_reg_value)) { | 2102 | if (tw_check_bits(status_reg_value)) { |
2105 | dprintk(KERN_WARNING "3w-xxxx: tw_interrupt(): Unexpected bits.\n"); | 2103 | dprintk(KERN_WARNING "3w-xxxx: tw_interrupt(): Unexpected bits.\n"); |
@@ -2276,6 +2274,9 @@ static void __tw_shutdown(TW_Device_Extension *tw_dev) | |||
2276 | /* Disable interrupts */ | 2274 | /* Disable interrupts */ |
2277 | TW_DISABLE_INTERRUPTS(tw_dev); | 2275 | TW_DISABLE_INTERRUPTS(tw_dev); |
2278 | 2276 | ||
2277 | /* Free up the IRQ */ | ||
2278 | free_irq(tw_dev->tw_pci_dev->irq, tw_dev); | ||
2279 | |||
2279 | printk(KERN_WARNING "3w-xxxx: Shutting down host %d.\n", tw_dev->host->host_no); | 2280 | printk(KERN_WARNING "3w-xxxx: Shutting down host %d.\n", tw_dev->host->host_no); |
2280 | 2281 | ||
2281 | /* Tell the card we are shutting down */ | 2282 | /* Tell the card we are shutting down */ |
@@ -2444,9 +2445,6 @@ static void tw_remove(struct pci_dev *pdev) | |||
2444 | twe_major = -1; | 2445 | twe_major = -1; |
2445 | } | 2446 | } |
2446 | 2447 | ||
2447 | /* Free up the IRQ */ | ||
2448 | free_irq(tw_dev->tw_pci_dev->irq, tw_dev); | ||
2449 | |||
2450 | /* Shutdown the card */ | 2448 | /* Shutdown the card */ |
2451 | __tw_shutdown(tw_dev); | 2449 | __tw_shutdown(tw_dev); |
2452 | 2450 | ||
diff --git a/drivers/scsi/3w-xxxx.h b/drivers/scsi/3w-xxxx.h index bbd654a2b9b1..0742e6846656 100644 --- a/drivers/scsi/3w-xxxx.h +++ b/drivers/scsi/3w-xxxx.h | |||
@@ -6,7 +6,7 @@ | |||
6 | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 6 | Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
7 | Brad Strand <linux@3ware.com> | 7 | Brad Strand <linux@3ware.com> |
8 | 8 | ||
9 | Copyright (C) 1999-2005 3ware Inc. | 9 | Copyright (C) 1999-2007 3ware Inc. |
10 | 10 | ||
11 | Kernel compatiblity By: Andre Hedrick <andre@suse.com> | 11 | Kernel compatiblity By: Andre Hedrick <andre@suse.com> |
12 | Non-Copyright (C) 2000 Andre Hedrick <andre@suse.com> | 12 | Non-Copyright (C) 2000 Andre Hedrick <andre@suse.com> |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 60f582727185..7869c34a4a3e 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -1303,7 +1303,7 @@ config SCSI_LPFC | |||
1303 | 1303 | ||
1304 | config SCSI_SEAGATE | 1304 | config SCSI_SEAGATE |
1305 | tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support" | 1305 | tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support" |
1306 | depends on X86 && ISA && SCSI && BROKEN | 1306 | depends on X86 && ISA && SCSI |
1307 | ---help--- | 1307 | ---help--- |
1308 | These are 8-bit SCSI controllers; the ST-01 is also supported by | 1308 | These are 8-bit SCSI controllers; the ST-01 is also supported by |
1309 | this driver. It is explained in section 3.9 of the SCSI-HOWTO, | 1309 | this driver. It is explained in section 3.9 of the SCSI-HOWTO, |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 359e7ddfdb47..d2cf875af59b 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -117,8 +117,8 @@ static struct pci_device_id aac_pci_tbl[] = { | |||
117 | { 0x9005, 0x0286, 0x9005, 0x029b, 0, 0, 22 }, /* AAR-2820SA (Intruder) */ | 117 | { 0x9005, 0x0286, 0x9005, 0x029b, 0, 0, 22 }, /* AAR-2820SA (Intruder) */ |
118 | { 0x9005, 0x0286, 0x9005, 0x029c, 0, 0, 23 }, /* AAR-2620SA (Intruder) */ | 118 | { 0x9005, 0x0286, 0x9005, 0x029c, 0, 0, 23 }, /* AAR-2620SA (Intruder) */ |
119 | { 0x9005, 0x0286, 0x9005, 0x029d, 0, 0, 24 }, /* AAR-2420SA (Intruder) */ | 119 | { 0x9005, 0x0286, 0x9005, 0x029d, 0, 0, 24 }, /* AAR-2420SA (Intruder) */ |
120 | { 0x9005, 0x0286, 0x9005, 0x029e, 0, 0, 25 }, /* ICP9024R0 (Lancer) */ | 120 | { 0x9005, 0x0286, 0x9005, 0x029e, 0, 0, 25 }, /* ICP9024RO (Lancer) */ |
121 | { 0x9005, 0x0286, 0x9005, 0x029f, 0, 0, 26 }, /* ICP9014R0 (Lancer) */ | 121 | { 0x9005, 0x0286, 0x9005, 0x029f, 0, 0, 26 }, /* ICP9014RO (Lancer) */ |
122 | { 0x9005, 0x0286, 0x9005, 0x02a0, 0, 0, 27 }, /* ICP9047MA (Lancer) */ | 122 | { 0x9005, 0x0286, 0x9005, 0x02a0, 0, 0, 27 }, /* ICP9047MA (Lancer) */ |
123 | { 0x9005, 0x0286, 0x9005, 0x02a1, 0, 0, 28 }, /* ICP9087MA (Lancer) */ | 123 | { 0x9005, 0x0286, 0x9005, 0x02a1, 0, 0, 28 }, /* ICP9087MA (Lancer) */ |
124 | { 0x9005, 0x0286, 0x9005, 0x02a3, 0, 0, 29 }, /* ICP5445AU (Hurricane44) */ | 124 | { 0x9005, 0x0286, 0x9005, 0x02a3, 0, 0, 29 }, /* ICP5445AU (Hurricane44) */ |
@@ -137,15 +137,15 @@ static struct pci_device_id aac_pci_tbl[] = { | |||
137 | { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 41 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ | 137 | { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 41 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ |
138 | { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 42 }, /* AAR-2610SA PCI SATA 6ch */ | 138 | { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 42 }, /* AAR-2610SA PCI SATA 6ch */ |
139 | { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 43 }, /* ASR-2240S (SabreExpress) */ | 139 | { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 43 }, /* ASR-2240S (SabreExpress) */ |
140 | { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 44 }, /* ASR-4005SAS */ | 140 | { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 44 }, /* ASR-4005 */ |
141 | { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 45 }, /* IBM 8i (AvonPark) */ | 141 | { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 45 }, /* IBM 8i (AvonPark) */ |
142 | { 0x9005, 0x0285, 0x1014, 0x0312, 0, 0, 45 }, /* IBM 8i (AvonPark Lite) */ | 142 | { 0x9005, 0x0285, 0x1014, 0x0312, 0, 0, 45 }, /* IBM 8i (AvonPark Lite) */ |
143 | { 0x9005, 0x0286, 0x1014, 0x9580, 0, 0, 46 }, /* IBM 8k/8k-l8 (Aurora) */ | 143 | { 0x9005, 0x0286, 0x1014, 0x9580, 0, 0, 46 }, /* IBM 8k/8k-l8 (Aurora) */ |
144 | { 0x9005, 0x0286, 0x1014, 0x9540, 0, 0, 47 }, /* IBM 8k/8k-l4 (Aurora Lite) */ | 144 | { 0x9005, 0x0286, 0x1014, 0x9540, 0, 0, 47 }, /* IBM 8k/8k-l4 (Aurora Lite) */ |
145 | { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 48 }, /* ASR-4000SAS (BlackBird) */ | 145 | { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 48 }, /* ASR-4000 (BlackBird) */ |
146 | { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 49 }, /* ASR-4800SAS (Marauder-X) */ | 146 | { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 49 }, /* ASR-4800SAS (Marauder-X) */ |
147 | { 0x9005, 0x0285, 0x9005, 0x029a, 0, 0, 50 }, /* ASR-4805SAS (Marauder-E) */ | 147 | { 0x9005, 0x0285, 0x9005, 0x029a, 0, 0, 50 }, /* ASR-4805SAS (Marauder-E) */ |
148 | { 0x9005, 0x0286, 0x9005, 0x02a2, 0, 0, 51 }, /* ASR-3800SAS (Hurricane44) */ | 148 | { 0x9005, 0x0286, 0x9005, 0x02a2, 0, 0, 51 }, /* ASR-3800 (Hurricane44) */ |
149 | 149 | ||
150 | { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 52 }, /* Perc 320/DC*/ | 150 | { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 52 }, /* Perc 320/DC*/ |
151 | { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 53 }, /* Adaptec 5400S (Mustang)*/ | 151 | { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 53 }, /* Adaptec 5400S (Mustang)*/ |
@@ -193,8 +193,8 @@ static struct aac_driver_ident aac_drivers[] = { | |||
193 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2820SA ", 1 }, /* AAR-2820SA (Intruder) */ | 193 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2820SA ", 1 }, /* AAR-2820SA (Intruder) */ |
194 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2620SA ", 1 }, /* AAR-2620SA (Intruder) */ | 194 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2620SA ", 1 }, /* AAR-2620SA (Intruder) */ |
195 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2420SA ", 1 }, /* AAR-2420SA (Intruder) */ | 195 | { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2420SA ", 1 }, /* AAR-2420SA (Intruder) */ |
196 | { aac_rkt_init, "aacraid", "ICP ", "ICP9024R0 ", 2 }, /* ICP9024R0 (Lancer) */ | 196 | { aac_rkt_init, "aacraid", "ICP ", "ICP9024RO ", 2 }, /* ICP9024RO (Lancer) */ |
197 | { aac_rkt_init, "aacraid", "ICP ", "ICP9014R0 ", 1 }, /* ICP9014R0 (Lancer) */ | 197 | { aac_rkt_init, "aacraid", "ICP ", "ICP9014RO ", 1 }, /* ICP9014RO (Lancer) */ |
198 | { aac_rkt_init, "aacraid", "ICP ", "ICP9047MA ", 1 }, /* ICP9047MA (Lancer) */ | 198 | { aac_rkt_init, "aacraid", "ICP ", "ICP9047MA ", 1 }, /* ICP9047MA (Lancer) */ |
199 | { aac_rkt_init, "aacraid", "ICP ", "ICP9087MA ", 1 }, /* ICP9087MA (Lancer) */ | 199 | { aac_rkt_init, "aacraid", "ICP ", "ICP9087MA ", 1 }, /* ICP9087MA (Lancer) */ |
200 | { aac_rkt_init, "aacraid", "ICP ", "ICP5445AU ", 1 }, /* ICP5445AU (Hurricane44) */ | 200 | { aac_rkt_init, "aacraid", "ICP ", "ICP5445AU ", 1 }, /* ICP5445AU (Hurricane44) */ |
@@ -212,14 +212,14 @@ static struct aac_driver_ident aac_drivers[] = { | |||
212 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2026ZCR ", 1 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ | 212 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2026ZCR ", 1 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ |
213 | { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ | 213 | { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ |
214 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ | 214 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ |
215 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4005SAS ", 1 }, /* ASR-4005SAS */ | 215 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4005 ", 1 }, /* ASR-4005 */ |
216 | { aac_rx_init, "ServeRAID","IBM ", "ServeRAID 8i ", 1 }, /* IBM 8i (AvonPark) */ | 216 | { aac_rx_init, "ServeRAID","IBM ", "ServeRAID 8i ", 1 }, /* IBM 8i (AvonPark) */ |
217 | { aac_rkt_init, "ServeRAID","IBM ", "ServeRAID 8k-l8 ", 1 }, /* IBM 8k/8k-l8 (Aurora) */ | 217 | { aac_rkt_init, "ServeRAID","IBM ", "ServeRAID 8k-l8 ", 1 }, /* IBM 8k/8k-l8 (Aurora) */ |
218 | { aac_rkt_init, "ServeRAID","IBM ", "ServeRAID 8k-l4 ", 1 }, /* IBM 8k/8k-l4 (Aurora Lite) */ | 218 | { aac_rkt_init, "ServeRAID","IBM ", "ServeRAID 8k-l4 ", 1 }, /* IBM 8k/8k-l4 (Aurora Lite) */ |
219 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4000SAS ", 1 }, /* ASR-4000SAS (BlackBird & AvonPark) */ | 219 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4000 ", 1 }, /* ASR-4000 (BlackBird & AvonPark) */ |
220 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4800SAS ", 1 }, /* ASR-4800SAS (Marauder-X) */ | 220 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4800SAS ", 1 }, /* ASR-4800SAS (Marauder-X) */ |
221 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4805SAS ", 1 }, /* ASR-4805SAS (Marauder-E) */ | 221 | { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4805SAS ", 1 }, /* ASR-4805SAS (Marauder-E) */ |
222 | { aac_rkt_init, "aacraid", "ADAPTEC ", "ASR-3800SAS ", 1 }, /* ASR-3800SAS (Hurricane44) */ | 222 | { aac_rkt_init, "aacraid", "ADAPTEC ", "ASR-3800 ", 1 }, /* ASR-3800 (Hurricane44) */ |
223 | 223 | ||
224 | { aac_rx_init, "percraid", "DELL ", "PERC 320/DC ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG }, /* Perc 320/DC*/ | 224 | { aac_rx_init, "percraid", "DELL ", "PERC 320/DC ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG }, /* Perc 320/DC*/ |
225 | { aac_sa_init, "aacraid", "ADAPTEC ", "Adaptec 5400S ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (Mustang)*/ | 225 | { aac_sa_init, "aacraid", "ADAPTEC ", "Adaptec 5400S ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (Mustang)*/ |
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 2b344356a29e..306bec355e45 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -18215,6 +18215,7 @@ AdvInquiryHandling( | |||
18215 | } | 18215 | } |
18216 | MODULE_LICENSE("Dual BSD/GPL"); | 18216 | MODULE_LICENSE("Dual BSD/GPL"); |
18217 | 18217 | ||
18218 | #ifdef CONFIG_PCI | ||
18218 | /* PCI Devices supported by this driver */ | 18219 | /* PCI Devices supported by this driver */ |
18219 | static struct pci_device_id advansys_pci_tbl[] __devinitdata = { | 18220 | static struct pci_device_id advansys_pci_tbl[] __devinitdata = { |
18220 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, | 18221 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, |
@@ -18232,4 +18233,4 @@ static struct pci_device_id advansys_pci_tbl[] __devinitdata = { | |||
18232 | { } | 18233 | { } |
18233 | }; | 18234 | }; |
18234 | MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); | 18235 | MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); |
18235 | 18236 | #endif /* CONFIG_PCI */ | |
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index d0b139cccbbc..437684084377 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -749,7 +749,7 @@ static int iscsi_scsi_data_in(struct iscsi_conn *conn) | |||
749 | if (!offset) | 749 | if (!offset) |
750 | crypto_hash_update( | 750 | crypto_hash_update( |
751 | &tcp_conn->rx_hash, | 751 | &tcp_conn->rx_hash, |
752 | &sg[i], 1); | 752 | &sg[i], sg[i].length); |
753 | else | 753 | else |
754 | partial_sg_digest_update( | 754 | partial_sg_digest_update( |
755 | &tcp_conn->rx_hash, | 755 | &tcp_conn->rx_hash, |
@@ -1777,13 +1777,13 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx) | |||
1777 | tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0, | 1777 | tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0, |
1778 | CRYPTO_ALG_ASYNC); | 1778 | CRYPTO_ALG_ASYNC); |
1779 | tcp_conn->tx_hash.flags = 0; | 1779 | tcp_conn->tx_hash.flags = 0; |
1780 | if (!tcp_conn->tx_hash.tfm) | 1780 | if (IS_ERR(tcp_conn->tx_hash.tfm)) |
1781 | goto free_tcp_conn; | 1781 | goto free_tcp_conn; |
1782 | 1782 | ||
1783 | tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0, | 1783 | tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0, |
1784 | CRYPTO_ALG_ASYNC); | 1784 | CRYPTO_ALG_ASYNC); |
1785 | tcp_conn->rx_hash.flags = 0; | 1785 | tcp_conn->rx_hash.flags = 0; |
1786 | if (!tcp_conn->rx_hash.tfm) | 1786 | if (IS_ERR(tcp_conn->rx_hash.tfm)) |
1787 | goto free_tx_tfm; | 1787 | goto free_tx_tfm; |
1788 | 1788 | ||
1789 | return cls_conn; | 1789 | return cls_conn; |
@@ -2044,13 +2044,11 @@ iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn, | |||
2044 | sk = tcp_conn->sock->sk; | 2044 | sk = tcp_conn->sock->sk; |
2045 | if (sk->sk_family == PF_INET) { | 2045 | if (sk->sk_family == PF_INET) { |
2046 | inet = inet_sk(sk); | 2046 | inet = inet_sk(sk); |
2047 | len = sprintf(buf, "%u.%u.%u.%u\n", | 2047 | len = sprintf(buf, NIPQUAD_FMT "\n", |
2048 | NIPQUAD(inet->daddr)); | 2048 | NIPQUAD(inet->daddr)); |
2049 | } else { | 2049 | } else { |
2050 | np = inet6_sk(sk); | 2050 | np = inet6_sk(sk); |
2051 | len = sprintf(buf, | 2051 | len = sprintf(buf, NIP6_FMT "\n", NIP6(np->daddr)); |
2052 | "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", | ||
2053 | NIP6(np->daddr)); | ||
2054 | } | 2052 | } |
2055 | mutex_unlock(&conn->xmitmutex); | 2053 | mutex_unlock(&conn->xmitmutex); |
2056 | break; | 2054 | break; |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index e11b23c641e2..d37048c96eab 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -260,7 +260,7 @@ static int iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr, | |||
260 | } | 260 | } |
261 | 261 | ||
262 | if (rhdr->cmd_status == SAM_STAT_CHECK_CONDITION) { | 262 | if (rhdr->cmd_status == SAM_STAT_CHECK_CONDITION) { |
263 | int senselen; | 263 | uint16_t senselen; |
264 | 264 | ||
265 | if (datalen < 2) { | 265 | if (datalen < 2) { |
266 | invalid_datalen: | 266 | invalid_datalen: |
@@ -270,12 +270,12 @@ invalid_datalen: | |||
270 | goto out; | 270 | goto out; |
271 | } | 271 | } |
272 | 272 | ||
273 | senselen = (data[0] << 8) | data[1]; | 273 | senselen = be16_to_cpu(*(uint16_t *)data); |
274 | if (datalen < senselen) | 274 | if (datalen < senselen) |
275 | goto invalid_datalen; | 275 | goto invalid_datalen; |
276 | 276 | ||
277 | memcpy(sc->sense_buffer, data + 2, | 277 | memcpy(sc->sense_buffer, data + 2, |
278 | min(senselen, SCSI_SENSE_BUFFERSIZE)); | 278 | min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE)); |
279 | debug_scsi("copied %d bytes of sense\n", | 279 | debug_scsi("copied %d bytes of sense\n", |
280 | min(senselen, SCSI_SENSE_BUFFERSIZE)); | 280 | min(senselen, SCSI_SENSE_BUFFERSIZE)); |
281 | } | 281 | } |
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c index 066292d3995a..ec3bbbde6f7a 100644 --- a/drivers/scsi/lpfc/lpfc_mem.c +++ b/drivers/scsi/lpfc/lpfc_mem.c | |||
@@ -56,6 +56,9 @@ lpfc_mem_alloc(struct lpfc_hba * phba) | |||
56 | 56 | ||
57 | pool->elements = kmalloc(sizeof(struct lpfc_dmabuf) * | 57 | pool->elements = kmalloc(sizeof(struct lpfc_dmabuf) * |
58 | LPFC_MBUF_POOL_SIZE, GFP_KERNEL); | 58 | LPFC_MBUF_POOL_SIZE, GFP_KERNEL); |
59 | if (!pool->elements) | ||
60 | goto fail_free_lpfc_mbuf_pool; | ||
61 | |||
59 | pool->max_count = 0; | 62 | pool->max_count = 0; |
60 | pool->current_count = 0; | 63 | pool->current_count = 0; |
61 | for ( i = 0; i < LPFC_MBUF_POOL_SIZE; i++) { | 64 | for ( i = 0; i < LPFC_MBUF_POOL_SIZE; i++) { |
@@ -82,10 +85,11 @@ lpfc_mem_alloc(struct lpfc_hba * phba) | |||
82 | fail_free_mbox_pool: | 85 | fail_free_mbox_pool: |
83 | mempool_destroy(phba->mbox_mem_pool); | 86 | mempool_destroy(phba->mbox_mem_pool); |
84 | fail_free_mbuf_pool: | 87 | fail_free_mbuf_pool: |
85 | while (--i) | 88 | while (i--) |
86 | pci_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, | 89 | pci_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, |
87 | pool->elements[i].phys); | 90 | pool->elements[i].phys); |
88 | kfree(pool->elements); | 91 | kfree(pool->elements); |
92 | fail_free_lpfc_mbuf_pool: | ||
89 | pci_pool_destroy(phba->lpfc_mbuf_pool); | 93 | pci_pool_destroy(phba->lpfc_mbuf_pool); |
90 | fail_free_dma_buf_pool: | 94 | fail_free_dma_buf_pool: |
91 | pci_pool_destroy(phba->lpfc_scsi_dma_buf_pool); | 95 | pci_pool_destroy(phba->lpfc_scsi_dma_buf_pool); |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 046223b4ae57..b5bdd0d7a8bf 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -13,8 +13,8 @@ | |||
13 | * Version : v00.00.03.05 | 13 | * Version : v00.00.03.05 |
14 | * | 14 | * |
15 | * Authors: | 15 | * Authors: |
16 | * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsil.com> | 16 | * Sreenivas Bagalkote <Sreenivas.Bagalkote@lsi.com> |
17 | * Sumant Patro <Sumant.Patro@lsil.com> | 17 | * Sumant Patro <Sumant.Patro@lsi.com> |
18 | * | 18 | * |
19 | * List of supported controllers | 19 | * List of supported controllers |
20 | * | 20 | * |
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
47 | MODULE_VERSION(MEGASAS_VERSION); | 47 | MODULE_VERSION(MEGASAS_VERSION); |
48 | MODULE_AUTHOR("sreenivas.bagalkote@lsil.com"); | 48 | MODULE_AUTHOR("megaraidlinux@lsi.com"); |
49 | MODULE_DESCRIPTION("LSI Logic MegaRAID SAS Driver"); | 49 | MODULE_DESCRIPTION("LSI Logic MegaRAID SAS Driver"); |
50 | 50 | ||
51 | /* | 51 | /* |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 9fb0ea5c1fb9..5b458d2478f7 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -545,8 +545,6 @@ SYM53C500_release(struct pcmcia_device *link) | |||
545 | */ | 545 | */ |
546 | if (shost->irq) | 546 | if (shost->irq) |
547 | free_irq(shost->irq, shost); | 547 | free_irq(shost->irq, shost); |
548 | if (shost->dma_channel != 0xff) | ||
549 | free_dma(shost->dma_channel); | ||
550 | if (shost->io_port && shost->n_io_port) | 548 | if (shost->io_port && shost->n_io_port) |
551 | release_region(shost->io_port, shost->n_io_port); | 549 | release_region(shost->io_port, shost->n_io_port); |
552 | 550 | ||
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 16af5b79e587..1548d42a3b43 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
@@ -1341,7 +1341,7 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp) | |||
1341 | int host_status = DID_ERROR; | 1341 | int host_status = DID_ERROR; |
1342 | uint16_t comp_status = le16_to_cpu(sts->comp_status); | 1342 | uint16_t comp_status = le16_to_cpu(sts->comp_status); |
1343 | uint16_t state_flags = le16_to_cpu(sts->state_flags); | 1343 | uint16_t state_flags = le16_to_cpu(sts->state_flags); |
1344 | uint16_t residual_length = le32_to_cpu(sts->residual_length); | 1344 | uint32_t residual_length = le32_to_cpu(sts->residual_length); |
1345 | uint16_t scsi_status = le16_to_cpu(sts->scsi_status); | 1345 | uint16_t scsi_status = le16_to_cpu(sts->scsi_status); |
1346 | #if DEBUG_QLA1280_INTR | 1346 | #if DEBUG_QLA1280_INTR |
1347 | static char *reason[] = { | 1347 | static char *reason[] = { |
@@ -1413,8 +1413,10 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp) | |||
1413 | "scsi: Underflow detected - retrying " | 1413 | "scsi: Underflow detected - retrying " |
1414 | "command.\n"); | 1414 | "command.\n"); |
1415 | host_status = DID_ERROR; | 1415 | host_status = DID_ERROR; |
1416 | } else | 1416 | } else { |
1417 | cp->resid = residual_length; | ||
1417 | host_status = DID_OK; | 1418 | host_status = DID_OK; |
1419 | } | ||
1418 | break; | 1420 | break; |
1419 | 1421 | ||
1420 | default: | 1422 | default: |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c4fc40f8e8ca..2c10130d9e03 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1602,6 +1602,7 @@ typedef struct fc_port { | |||
1602 | 1602 | ||
1603 | #define CT_REJECT_RESPONSE 0x8001 | 1603 | #define CT_REJECT_RESPONSE 0x8001 |
1604 | #define CT_ACCEPT_RESPONSE 0x8002 | 1604 | #define CT_ACCEPT_RESPONSE 0x8002 |
1605 | #define CT_REASON_INVALID_COMMAND_CODE 0x01 | ||
1605 | #define CT_REASON_CANNOT_PERFORM 0x09 | 1606 | #define CT_REASON_CANNOT_PERFORM 0x09 |
1606 | #define CT_EXPL_ALREADY_REGISTERED 0x10 | 1607 | #define CT_EXPL_ALREADY_REGISTERED 0x10 |
1607 | 1608 | ||
@@ -2079,6 +2080,7 @@ typedef struct scsi_qla_host { | |||
2079 | uint32_t msi_enabled :1; | 2080 | uint32_t msi_enabled :1; |
2080 | uint32_t msix_enabled :1; | 2081 | uint32_t msix_enabled :1; |
2081 | uint32_t disable_serdes :1; | 2082 | uint32_t disable_serdes :1; |
2083 | uint32_t gpsc_supported :1; | ||
2082 | } flags; | 2084 | } flags; |
2083 | 2085 | ||
2084 | atomic_t loop_state; | 2086 | atomic_t loop_state; |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 32ebeec45ff0..e4dd12f4b80e 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -45,7 +45,6 @@ extern void qla2x00_update_fcports(scsi_qla_host_t *); | |||
45 | extern int qla2x00_abort_isp(scsi_qla_host_t *); | 45 | extern int qla2x00_abort_isp(scsi_qla_host_t *); |
46 | 46 | ||
47 | extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); | 47 | extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *); |
48 | extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *); | ||
49 | 48 | ||
50 | extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *); | 49 | extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *); |
51 | extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *); | 50 | extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *); |
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 97fbc62ec669..ec5b2dd90d6a 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -127,8 +127,8 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt, | |||
127 | ha->host_no, routine, ms_pkt->entry_status)); | 127 | ha->host_no, routine, ms_pkt->entry_status)); |
128 | } else { | 128 | } else { |
129 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) | 129 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) |
130 | comp_status = | 130 | comp_status = le16_to_cpu( |
131 | ((struct ct_entry_24xx *)ms_pkt)->comp_status; | 131 | ((struct ct_entry_24xx *)ms_pkt)->comp_status); |
132 | else | 132 | else |
133 | comp_status = le16_to_cpu(ms_pkt->status); | 133 | comp_status = le16_to_cpu(ms_pkt->status); |
134 | switch (comp_status) { | 134 | switch (comp_status) { |
@@ -143,6 +143,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt, | |||
143 | DEBUG2_3(qla2x00_dump_buffer( | 143 | DEBUG2_3(qla2x00_dump_buffer( |
144 | (uint8_t *)&ct_rsp->header, | 144 | (uint8_t *)&ct_rsp->header, |
145 | sizeof(struct ct_rsp_hdr))); | 145 | sizeof(struct ct_rsp_hdr))); |
146 | rval = QLA_INVALID_COMMAND; | ||
146 | } else | 147 | } else |
147 | rval = QLA_SUCCESS; | 148 | rval = QLA_SUCCESS; |
148 | break; | 149 | break; |
@@ -1683,7 +1684,7 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
1683 | memset(list[i].fabric_port_name, 0, WWN_SIZE); | 1684 | memset(list[i].fabric_port_name, 0, WWN_SIZE); |
1684 | 1685 | ||
1685 | /* Prepare common MS IOCB */ | 1686 | /* Prepare common MS IOCB */ |
1686 | ms_pkt = qla2x00_prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, | 1687 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, |
1687 | GFPN_ID_RSP_SIZE); | 1688 | GFPN_ID_RSP_SIZE); |
1688 | 1689 | ||
1689 | /* Prepare CT request */ | 1690 | /* Prepare CT request */ |
@@ -1784,6 +1785,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) | |||
1784 | 1785 | ||
1785 | if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) | 1786 | if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) |
1786 | return QLA_FUNCTION_FAILED; | 1787 | return QLA_FUNCTION_FAILED; |
1788 | if (!ha->flags.gpsc_supported) | ||
1789 | return QLA_FUNCTION_FAILED; | ||
1787 | 1790 | ||
1788 | rval = qla2x00_mgmt_svr_login(ha); | 1791 | rval = qla2x00_mgmt_svr_login(ha); |
1789 | if (rval) | 1792 | if (rval) |
@@ -1813,8 +1816,19 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) | |||
1813 | /*EMPTY*/ | 1816 | /*EMPTY*/ |
1814 | DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB " | 1817 | DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB " |
1815 | "failed (%d).\n", ha->host_no, rval)); | 1818 | "failed (%d).\n", ha->host_no, rval)); |
1816 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, | 1819 | } else if ((rval = qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, |
1817 | "GPSC") != QLA_SUCCESS) { | 1820 | "GPSC")) != QLA_SUCCESS) { |
1821 | /* FM command unsupported? */ | ||
1822 | if (rval == QLA_INVALID_COMMAND && | ||
1823 | ct_rsp->header.reason_code == | ||
1824 | CT_REASON_INVALID_COMMAND_CODE) { | ||
1825 | DEBUG2(printk("scsi(%ld): GPSC command " | ||
1826 | "unsupported, disabling query...\n", | ||
1827 | ha->host_no)); | ||
1828 | ha->flags.gpsc_supported = 0; | ||
1829 | rval = QLA_FUNCTION_FAILED; | ||
1830 | break; | ||
1831 | } | ||
1818 | rval = QLA_FUNCTION_FAILED; | 1832 | rval = QLA_FUNCTION_FAILED; |
1819 | } else { | 1833 | } else { |
1820 | /* Save portname */ | 1834 | /* Save portname */ |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a823f0bc519d..b3dac26ddba3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2103,40 +2103,7 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2103 | } | 2103 | } |
2104 | } | 2104 | } |
2105 | 2105 | ||
2106 | /* | 2106 | static void |
2107 | * qla2x00_update_fcport | ||
2108 | * Updates device on list. | ||
2109 | * | ||
2110 | * Input: | ||
2111 | * ha = adapter block pointer. | ||
2112 | * fcport = port structure pointer. | ||
2113 | * | ||
2114 | * Return: | ||
2115 | * 0 - Success | ||
2116 | * BIT_0 - error | ||
2117 | * | ||
2118 | * Context: | ||
2119 | * Kernel context. | ||
2120 | */ | ||
2121 | void | ||
2122 | qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | ||
2123 | { | ||
2124 | fcport->ha = ha; | ||
2125 | fcport->login_retry = 0; | ||
2126 | fcport->port_login_retry_count = ha->port_down_retry_count * | ||
2127 | PORT_RETRY_TIME; | ||
2128 | atomic_set(&fcport->port_down_timer, ha->port_down_retry_count * | ||
2129 | PORT_RETRY_TIME); | ||
2130 | fcport->flags &= ~FCF_LOGIN_NEEDED; | ||
2131 | |||
2132 | qla2x00_iidma_fcport(ha, fcport); | ||
2133 | |||
2134 | atomic_set(&fcport->state, FCS_ONLINE); | ||
2135 | |||
2136 | qla2x00_reg_remote_port(ha, fcport); | ||
2137 | } | ||
2138 | |||
2139 | void | ||
2140 | qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | 2107 | qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) |
2141 | { | 2108 | { |
2142 | struct fc_rport_identifiers rport_ids; | 2109 | struct fc_rport_identifiers rport_ids; |
@@ -2179,6 +2146,39 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2179 | } | 2146 | } |
2180 | 2147 | ||
2181 | /* | 2148 | /* |
2149 | * qla2x00_update_fcport | ||
2150 | * Updates device on list. | ||
2151 | * | ||
2152 | * Input: | ||
2153 | * ha = adapter block pointer. | ||
2154 | * fcport = port structure pointer. | ||
2155 | * | ||
2156 | * Return: | ||
2157 | * 0 - Success | ||
2158 | * BIT_0 - error | ||
2159 | * | ||
2160 | * Context: | ||
2161 | * Kernel context. | ||
2162 | */ | ||
2163 | void | ||
2164 | qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | ||
2165 | { | ||
2166 | fcport->ha = ha; | ||
2167 | fcport->login_retry = 0; | ||
2168 | fcport->port_login_retry_count = ha->port_down_retry_count * | ||
2169 | PORT_RETRY_TIME; | ||
2170 | atomic_set(&fcport->port_down_timer, ha->port_down_retry_count * | ||
2171 | PORT_RETRY_TIME); | ||
2172 | fcport->flags &= ~FCF_LOGIN_NEEDED; | ||
2173 | |||
2174 | qla2x00_iidma_fcport(ha, fcport); | ||
2175 | |||
2176 | atomic_set(&fcport->state, FCS_ONLINE); | ||
2177 | |||
2178 | qla2x00_reg_remote_port(ha, fcport); | ||
2179 | } | ||
2180 | |||
2181 | /* | ||
2182 | * qla2x00_configure_fabric | 2182 | * qla2x00_configure_fabric |
2183 | * Setup SNS devices with loop ID's. | 2183 | * Setup SNS devices with loop ID's. |
2184 | * | 2184 | * |
@@ -3476,9 +3476,11 @@ qla24xx_nvram_config(scsi_qla_host_t *ha) | |||
3476 | 3476 | ||
3477 | /* Set host adapter parameters. */ | 3477 | /* Set host adapter parameters. */ |
3478 | ha->flags.disable_risc_code_load = 0; | 3478 | ha->flags.disable_risc_code_load = 0; |
3479 | ha->flags.enable_lip_reset = 1; | 3479 | ha->flags.enable_lip_reset = 0; |
3480 | ha->flags.enable_lip_full_login = 1; | 3480 | ha->flags.enable_lip_full_login = |
3481 | ha->flags.enable_target_reset = 1; | 3481 | le32_to_cpu(nv->host_p) & BIT_10 ? 1: 0; |
3482 | ha->flags.enable_target_reset = | ||
3483 | le32_to_cpu(nv->host_p) & BIT_11 ? 1: 0; | ||
3482 | ha->flags.enable_led_scheme = 0; | 3484 | ha->flags.enable_led_scheme = 0; |
3483 | ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; | 3485 | ha->flags.disable_serdes = le32_to_cpu(nv->host_p) & BIT_5 ? 1: 0; |
3484 | 3486 | ||
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index d3b6df4d55c8..39fd17b05be5 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -134,11 +134,11 @@ qla2300_intr_handler(int irq, void *dev_id) | |||
134 | if (stat & HSR_RISC_PAUSED) { | 134 | if (stat & HSR_RISC_PAUSED) { |
135 | hccr = RD_REG_WORD(®->hccr); | 135 | hccr = RD_REG_WORD(®->hccr); |
136 | if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8)) | 136 | if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8)) |
137 | qla_printk(KERN_INFO, ha, | 137 | qla_printk(KERN_INFO, ha, "Parity error -- " |
138 | "Parity error -- HCCR=%x.\n", hccr); | 138 | "HCCR=%x, Dumping firmware!\n", hccr); |
139 | else | 139 | else |
140 | qla_printk(KERN_INFO, ha, | 140 | qla_printk(KERN_INFO, ha, "RISC paused -- " |
141 | "RISC paused -- HCCR=%x.\n", hccr); | 141 | "HCCR=%x, Dumping firmware!\n", hccr); |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * Issue a "HARD" reset in order for the RISC | 144 | * Issue a "HARD" reset in order for the RISC |
@@ -147,6 +147,8 @@ qla2300_intr_handler(int irq, void *dev_id) | |||
147 | */ | 147 | */ |
148 | WRT_REG_WORD(®->hccr, HCCR_RESET_RISC); | 148 | WRT_REG_WORD(®->hccr, HCCR_RESET_RISC); |
149 | RD_REG_WORD(®->hccr); | 149 | RD_REG_WORD(®->hccr); |
150 | |||
151 | ha->isp_ops.fw_dump(ha, 1); | ||
150 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | 152 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); |
151 | break; | 153 | break; |
152 | } else if ((stat & HSR_RISC_INT) == 0) | 154 | } else if ((stat & HSR_RISC_INT) == 0) |
@@ -475,6 +477,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
475 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); | 477 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); |
476 | } | 478 | } |
477 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); | 479 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); |
480 | |||
481 | ha->flags.gpsc_supported = 1; | ||
478 | break; | 482 | break; |
479 | 483 | ||
480 | case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ | 484 | case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ |
@@ -1440,8 +1444,7 @@ qla24xx_intr_handler(int irq, void *dev_id) | |||
1440 | 1444 | ||
1441 | qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " | 1445 | qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " |
1442 | "Dumping firmware!\n", hccr); | 1446 | "Dumping firmware!\n", hccr); |
1443 | qla24xx_fw_dump(ha, 1); | 1447 | ha->isp_ops.fw_dump(ha, 1); |
1444 | |||
1445 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | 1448 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); |
1446 | break; | 1449 | break; |
1447 | } else if ((stat & HSRX_RISC_INT) == 0) | 1450 | } else if ((stat & HSRX_RISC_INT) == 0) |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4cde76c85cb3..077e5789beeb 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -1339,9 +1339,9 @@ qla2x00_lip_reset(scsi_qla_host_t *ha) | |||
1339 | 1339 | ||
1340 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | 1340 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { |
1341 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; | 1341 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; |
1342 | mcp->mb[1] = BIT_0; | 1342 | mcp->mb[1] = BIT_6; |
1343 | mcp->mb[2] = 0xff; | 1343 | mcp->mb[2] = 0; |
1344 | mcp->mb[3] = 0; | 1344 | mcp->mb[3] = ha->loop_reset_delay; |
1345 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 1345 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; |
1346 | } else { | 1346 | } else { |
1347 | mcp->mb[0] = MBC_LIP_RESET; | 1347 | mcp->mb[0] = MBC_LIP_RESET; |
@@ -1823,8 +1823,8 @@ qla2x00_full_login_lip(scsi_qla_host_t *ha) | |||
1823 | ha->host_no)); | 1823 | ha->host_no)); |
1824 | 1824 | ||
1825 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; | 1825 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; |
1826 | mcp->mb[1] = 0; | 1826 | mcp->mb[1] = IS_QLA24XX(ha) || IS_QLA54XX(ha) ? BIT_3: 0; |
1827 | mcp->mb[2] = 0xff; | 1827 | mcp->mb[2] = 0; |
1828 | mcp->mb[3] = 0; | 1828 | mcp->mb[3] = 0; |
1829 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 1829 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; |
1830 | mcp->in_mb = MBX_0; | 1830 | mcp->in_mb = MBX_0; |
@@ -2486,7 +2486,7 @@ qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, | |||
2486 | mcp->mb[4] = LSW(MSD(eft_dma)); | 2486 | mcp->mb[4] = LSW(MSD(eft_dma)); |
2487 | mcp->mb[5] = MSW(MSD(eft_dma)); | 2487 | mcp->mb[5] = MSW(MSD(eft_dma)); |
2488 | mcp->mb[6] = buffers; | 2488 | mcp->mb[6] = buffers; |
2489 | mcp->mb[7] = buffers; | 2489 | mcp->mb[7] = 0; |
2490 | mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; | 2490 | mcp->out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; |
2491 | } | 2491 | } |
2492 | mcp->tov = 30; | 2492 | mcp->tov = 30; |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d03523d3bf38..d6445ae841ba 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1037,48 +1037,49 @@ eh_host_reset_lock: | |||
1037 | static int | 1037 | static int |
1038 | qla2x00_loop_reset(scsi_qla_host_t *ha) | 1038 | qla2x00_loop_reset(scsi_qla_host_t *ha) |
1039 | { | 1039 | { |
1040 | int status = QLA_SUCCESS; | 1040 | int ret; |
1041 | struct fc_port *fcport; | 1041 | struct fc_port *fcport; |
1042 | 1042 | ||
1043 | if (ha->flags.enable_lip_full_login) { | ||
1044 | ret = qla2x00_full_login_lip(ha); | ||
1045 | if (ret != QLA_SUCCESS) { | ||
1046 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " | ||
1047 | "full_login_lip=%d.\n", __func__, ha->host_no, | ||
1048 | ret)); | ||
1049 | } | ||
1050 | atomic_set(&ha->loop_state, LOOP_DOWN); | ||
1051 | atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME); | ||
1052 | qla2x00_mark_all_devices_lost(ha, 0); | ||
1053 | qla2x00_wait_for_loop_ready(ha); | ||
1054 | } | ||
1055 | |||
1043 | if (ha->flags.enable_lip_reset) { | 1056 | if (ha->flags.enable_lip_reset) { |
1044 | status = qla2x00_lip_reset(ha); | 1057 | ret = qla2x00_lip_reset(ha); |
1058 | if (ret != QLA_SUCCESS) { | ||
1059 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " | ||
1060 | "lip_reset=%d.\n", __func__, ha->host_no, ret)); | ||
1061 | } | ||
1062 | qla2x00_wait_for_loop_ready(ha); | ||
1045 | } | 1063 | } |
1046 | 1064 | ||
1047 | if (status == QLA_SUCCESS && ha->flags.enable_target_reset) { | 1065 | if (ha->flags.enable_target_reset) { |
1048 | list_for_each_entry(fcport, &ha->fcports, list) { | 1066 | list_for_each_entry(fcport, &ha->fcports, list) { |
1049 | if (fcport->port_type != FCT_TARGET) | 1067 | if (fcport->port_type != FCT_TARGET) |
1050 | continue; | 1068 | continue; |
1051 | 1069 | ||
1052 | status = qla2x00_device_reset(ha, fcport); | 1070 | ret = qla2x00_device_reset(ha, fcport); |
1053 | if (status != QLA_SUCCESS) | 1071 | if (ret != QLA_SUCCESS) { |
1054 | break; | 1072 | DEBUG2_3(printk("%s(%ld): bus_reset failed: " |
1073 | "target_reset=%d d_id=%x.\n", __func__, | ||
1074 | ha->host_no, ret, fcport->d_id.b24)); | ||
1075 | } | ||
1055 | } | 1076 | } |
1056 | } | 1077 | } |
1057 | 1078 | ||
1058 | if (status == QLA_SUCCESS && | ||
1059 | ((!ha->flags.enable_target_reset && | ||
1060 | !ha->flags.enable_lip_reset) || | ||
1061 | ha->flags.enable_lip_full_login)) { | ||
1062 | |||
1063 | status = qla2x00_full_login_lip(ha); | ||
1064 | } | ||
1065 | |||
1066 | /* Issue marker command only when we are going to start the I/O */ | 1079 | /* Issue marker command only when we are going to start the I/O */ |
1067 | ha->marker_needed = 1; | 1080 | ha->marker_needed = 1; |
1068 | 1081 | ||
1069 | if (status) { | 1082 | return QLA_SUCCESS; |
1070 | /* Empty */ | ||
1071 | DEBUG2_3(printk("%s(%ld): **** FAILED ****\n", | ||
1072 | __func__, | ||
1073 | ha->host_no)); | ||
1074 | } else { | ||
1075 | /* Empty */ | ||
1076 | DEBUG3(printk("%s(%ld): exiting normally.\n", | ||
1077 | __func__, | ||
1078 | ha->host_no)); | ||
1079 | } | ||
1080 | |||
1081 | return(status); | ||
1082 | } | 1083 | } |
1083 | 1084 | ||
1084 | /* | 1085 | /* |
@@ -1413,7 +1414,9 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1413 | 1414 | ||
1414 | sht = &qla2x00_driver_template; | 1415 | sht = &qla2x00_driver_template; |
1415 | if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || | 1416 | if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || |
1416 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432) | 1417 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 || |
1418 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 || | ||
1419 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432) | ||
1417 | sht = &qla24xx_driver_template; | 1420 | sht = &qla24xx_driver_template; |
1418 | host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); | 1421 | host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); |
1419 | if (host == NULL) { | 1422 | if (host == NULL) { |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 1fa0bce6b24e..459e0d6bd2b4 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
@@ -7,7 +7,7 @@ | |||
7 | /* | 7 | /* |
8 | * Driver version | 8 | * Driver version |
9 | */ | 9 | */ |
10 | #define QLA2XXX_VERSION "8.01.07-k3" | 10 | #define QLA2XXX_VERSION "8.01.07-k4" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 1 | 13 | #define QLA_DRIVER_MINOR_VER 1 |
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index 4249e52a5592..6f4cf2dd2f4a 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h | |||
@@ -418,7 +418,6 @@ struct scsi_qla_host { | |||
418 | * concurrently. | 418 | * concurrently. |
419 | */ | 419 | */ |
420 | struct mutex mbox_sem; | 420 | struct mutex mbox_sem; |
421 | wait_queue_head_t mailbox_wait_queue; | ||
422 | 421 | ||
423 | /* temporary mailbox status registers */ | 422 | /* temporary mailbox status registers */ |
424 | volatile uint8_t mbox_status_count; | 423 | volatile uint8_t mbox_status_count; |
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h index 2122967bbf0b..e021eb5db2b2 100644 --- a/drivers/scsi/qla4xxx/ql4_glbl.h +++ b/drivers/scsi/qla4xxx/ql4_glbl.h | |||
@@ -76,4 +76,5 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host * ha, | |||
76 | extern int ql4xextended_error_logging; | 76 | extern int ql4xextended_error_logging; |
77 | extern int ql4xdiscoverywait; | 77 | extern int ql4xdiscoverywait; |
78 | extern int ql4xdontresethba; | 78 | extern int ql4xdontresethba; |
79 | extern int ql4_mod_unload; | ||
79 | #endif /* _QLA4x_GBL_H */ | 80 | #endif /* _QLA4x_GBL_H */ |
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index cc210f297a78..b907b06d72ab 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
@@ -958,25 +958,25 @@ static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) | |||
958 | return status; | 958 | return status; |
959 | } | 959 | } |
960 | 960 | ||
961 | int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a) | 961 | int ql4xxx_lock_drvr_wait(struct scsi_qla_host *ha) |
962 | { | 962 | { |
963 | #define QL4_LOCK_DRVR_WAIT 300 | 963 | #define QL4_LOCK_DRVR_WAIT 30 |
964 | #define QL4_LOCK_DRVR_SLEEP 100 | 964 | #define QL4_LOCK_DRVR_SLEEP 1 |
965 | 965 | ||
966 | int drvr_wait = QL4_LOCK_DRVR_WAIT; | 966 | int drvr_wait = QL4_LOCK_DRVR_WAIT; |
967 | while (drvr_wait) { | 967 | while (drvr_wait) { |
968 | if (ql4xxx_lock_drvr(a) == 0) { | 968 | if (ql4xxx_lock_drvr(ha) == 0) { |
969 | msleep(QL4_LOCK_DRVR_SLEEP); | 969 | ssleep(QL4_LOCK_DRVR_SLEEP); |
970 | if (drvr_wait) { | 970 | if (drvr_wait) { |
971 | DEBUG2(printk("scsi%ld: %s: Waiting for " | 971 | DEBUG2(printk("scsi%ld: %s: Waiting for " |
972 | "Global Init Semaphore...n", | 972 | "Global Init Semaphore(%d)...n", |
973 | a->host_no, | 973 | ha->host_no, |
974 | __func__)); | 974 | __func__, drvr_wait)); |
975 | } | 975 | } |
976 | drvr_wait -= QL4_LOCK_DRVR_SLEEP; | 976 | drvr_wait -= QL4_LOCK_DRVR_SLEEP; |
977 | } else { | 977 | } else { |
978 | DEBUG2(printk("scsi%ld: %s: Global Init Semaphore " | 978 | DEBUG2(printk("scsi%ld: %s: Global Init Semaphore " |
979 | "acquired.n", a->host_no, __func__)); | 979 | "acquired.n", ha->host_no, __func__)); |
980 | return QLA_SUCCESS; | 980 | return QLA_SUCCESS; |
981 | } | 981 | } |
982 | } | 982 | } |
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c index ef975e0dc87f..35b9e36a0e8d 100644 --- a/drivers/scsi/qla4xxx/ql4_isr.c +++ b/drivers/scsi/qla4xxx/ql4_isr.c | |||
@@ -433,7 +433,6 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha, | |||
433 | readl(&ha->reg->mailbox[i]); | 433 | readl(&ha->reg->mailbox[i]); |
434 | 434 | ||
435 | set_bit(AF_MBOX_COMMAND_DONE, &ha->flags); | 435 | set_bit(AF_MBOX_COMMAND_DONE, &ha->flags); |
436 | wake_up(&ha->mailbox_wait_queue); | ||
437 | } | 436 | } |
438 | } else if (mbox_status >> 12 == MBOX_ASYNC_EVENT_STATUS) { | 437 | } else if (mbox_status >> 12 == MBOX_ASYNC_EVENT_STATUS) { |
439 | /* Immediately process the AENs that don't require much work. | 438 | /* Immediately process the AENs that don't require much work. |
@@ -686,7 +685,8 @@ irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id) | |||
686 | &ha->reg->ctrl_status); | 685 | &ha->reg->ctrl_status); |
687 | readl(&ha->reg->ctrl_status); | 686 | readl(&ha->reg->ctrl_status); |
688 | 687 | ||
689 | set_bit(DPC_RESET_HA_INTR, &ha->dpc_flags); | 688 | if (!ql4_mod_unload) |
689 | set_bit(DPC_RESET_HA_INTR, &ha->dpc_flags); | ||
690 | 690 | ||
691 | break; | 691 | break; |
692 | } else if (intr_status & INTR_PENDING) { | 692 | } else if (intr_status & INTR_PENDING) { |
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index b721dc5dd711..7f28657eef3f 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
@@ -29,18 +29,30 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
29 | u_long wait_count; | 29 | u_long wait_count; |
30 | uint32_t intr_status; | 30 | uint32_t intr_status; |
31 | unsigned long flags = 0; | 31 | unsigned long flags = 0; |
32 | DECLARE_WAITQUEUE(wait, current); | ||
33 | |||
34 | mutex_lock(&ha->mbox_sem); | ||
35 | |||
36 | /* Mailbox code active */ | ||
37 | set_bit(AF_MBOX_COMMAND, &ha->flags); | ||
38 | 32 | ||
39 | /* Make sure that pointers are valid */ | 33 | /* Make sure that pointers are valid */ |
40 | if (!mbx_cmd || !mbx_sts) { | 34 | if (!mbx_cmd || !mbx_sts) { |
41 | DEBUG2(printk("scsi%ld: %s: Invalid mbx_cmd or mbx_sts " | 35 | DEBUG2(printk("scsi%ld: %s: Invalid mbx_cmd or mbx_sts " |
42 | "pointer\n", ha->host_no, __func__)); | 36 | "pointer\n", ha->host_no, __func__)); |
43 | goto mbox_exit; | 37 | return status; |
38 | } | ||
39 | /* Mailbox code active */ | ||
40 | wait_count = MBOX_TOV * 100; | ||
41 | |||
42 | while (wait_count--) { | ||
43 | mutex_lock(&ha->mbox_sem); | ||
44 | if (!test_bit(AF_MBOX_COMMAND, &ha->flags)) { | ||
45 | set_bit(AF_MBOX_COMMAND, &ha->flags); | ||
46 | mutex_unlock(&ha->mbox_sem); | ||
47 | break; | ||
48 | } | ||
49 | mutex_unlock(&ha->mbox_sem); | ||
50 | if (!wait_count) { | ||
51 | DEBUG2(printk("scsi%ld: %s: mbox_sem failed\n", | ||
52 | ha->host_no, __func__)); | ||
53 | return status; | ||
54 | } | ||
55 | msleep(10); | ||
44 | } | 56 | } |
45 | 57 | ||
46 | /* To prevent overwriting mailbox registers for a command that has | 58 | /* To prevent overwriting mailbox registers for a command that has |
@@ -73,8 +85,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
73 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 85 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
74 | 86 | ||
75 | /* Wait for completion */ | 87 | /* Wait for completion */ |
76 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
77 | add_wait_queue(&ha->mailbox_wait_queue, &wait); | ||
78 | 88 | ||
79 | /* | 89 | /* |
80 | * If we don't want status, don't wait for the mailbox command to | 90 | * If we don't want status, don't wait for the mailbox command to |
@@ -83,8 +93,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
83 | */ | 93 | */ |
84 | if (outCount == 0) { | 94 | if (outCount == 0) { |
85 | status = QLA_SUCCESS; | 95 | status = QLA_SUCCESS; |
86 | set_current_state(TASK_RUNNING); | ||
87 | remove_wait_queue(&ha->mailbox_wait_queue, &wait); | ||
88 | goto mbox_exit; | 96 | goto mbox_exit; |
89 | } | 97 | } |
90 | /* Wait for command to complete */ | 98 | /* Wait for command to complete */ |
@@ -108,8 +116,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
108 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 116 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
109 | msleep(10); | 117 | msleep(10); |
110 | } | 118 | } |
111 | set_current_state(TASK_RUNNING); | ||
112 | remove_wait_queue(&ha->mailbox_wait_queue, &wait); | ||
113 | 119 | ||
114 | /* Check for mailbox timeout. */ | 120 | /* Check for mailbox timeout. */ |
115 | if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) { | 121 | if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) { |
@@ -155,9 +161,10 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, | |||
155 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 161 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
156 | 162 | ||
157 | mbox_exit: | 163 | mbox_exit: |
164 | mutex_lock(&ha->mbox_sem); | ||
158 | clear_bit(AF_MBOX_COMMAND, &ha->flags); | 165 | clear_bit(AF_MBOX_COMMAND, &ha->flags); |
159 | clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags); | ||
160 | mutex_unlock(&ha->mbox_sem); | 166 | mutex_unlock(&ha->mbox_sem); |
167 | clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags); | ||
161 | 168 | ||
162 | return status; | 169 | return status; |
163 | } | 170 | } |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 9ef693c8809a..81fb7bd44f01 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -40,6 +40,8 @@ MODULE_PARM_DESC(ql4xextended_error_logging, | |||
40 | "Option to enable extended error logging, " | 40 | "Option to enable extended error logging, " |
41 | "Default is 0 - no logging, 1 - debug logging"); | 41 | "Default is 0 - no logging, 1 - debug logging"); |
42 | 42 | ||
43 | int ql4_mod_unload = 0; | ||
44 | |||
43 | /* | 45 | /* |
44 | * SCSI host template entry points | 46 | * SCSI host template entry points |
45 | */ | 47 | */ |
@@ -422,6 +424,9 @@ static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, | |||
422 | goto qc_host_busy; | 424 | goto qc_host_busy; |
423 | } | 425 | } |
424 | 426 | ||
427 | if (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) | ||
428 | goto qc_host_busy; | ||
429 | |||
425 | spin_unlock_irq(ha->host->host_lock); | 430 | spin_unlock_irq(ha->host->host_lock); |
426 | 431 | ||
427 | srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done); | 432 | srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done); |
@@ -707,16 +712,12 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha) | |||
707 | return stat; | 712 | return stat; |
708 | } | 713 | } |
709 | 714 | ||
710 | /** | 715 | static void qla4xxx_hw_reset(struct scsi_qla_host *ha) |
711 | * qla4xxx_soft_reset - performs soft reset. | ||
712 | * @ha: Pointer to host adapter structure. | ||
713 | **/ | ||
714 | int qla4xxx_soft_reset(struct scsi_qla_host *ha) | ||
715 | { | 716 | { |
716 | uint32_t max_wait_time; | ||
717 | unsigned long flags = 0; | ||
718 | int status = QLA_ERROR; | ||
719 | uint32_t ctrl_status; | 717 | uint32_t ctrl_status; |
718 | unsigned long flags = 0; | ||
719 | |||
720 | DEBUG2(printk(KERN_ERR "scsi%ld: %s\n", ha->host_no, __func__)); | ||
720 | 721 | ||
721 | spin_lock_irqsave(&ha->hardware_lock, flags); | 722 | spin_lock_irqsave(&ha->hardware_lock, flags); |
722 | 723 | ||
@@ -733,6 +734,20 @@ int qla4xxx_soft_reset(struct scsi_qla_host *ha) | |||
733 | readl(&ha->reg->ctrl_status); | 734 | readl(&ha->reg->ctrl_status); |
734 | 735 | ||
735 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 736 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
737 | } | ||
738 | |||
739 | /** | ||
740 | * qla4xxx_soft_reset - performs soft reset. | ||
741 | * @ha: Pointer to host adapter structure. | ||
742 | **/ | ||
743 | int qla4xxx_soft_reset(struct scsi_qla_host *ha) | ||
744 | { | ||
745 | uint32_t max_wait_time; | ||
746 | unsigned long flags = 0; | ||
747 | int status = QLA_ERROR; | ||
748 | uint32_t ctrl_status; | ||
749 | |||
750 | qla4xxx_hw_reset(ha); | ||
736 | 751 | ||
737 | /* Wait until the Network Reset Intr bit is cleared */ | 752 | /* Wait until the Network Reset Intr bit is cleared */ |
738 | max_wait_time = RESET_INTR_TOV; | 753 | max_wait_time = RESET_INTR_TOV; |
@@ -966,10 +981,12 @@ static void qla4xxx_do_dpc(struct work_struct *work) | |||
966 | struct scsi_qla_host *ha = | 981 | struct scsi_qla_host *ha = |
967 | container_of(work, struct scsi_qla_host, dpc_work); | 982 | container_of(work, struct scsi_qla_host, dpc_work); |
968 | struct ddb_entry *ddb_entry, *dtemp; | 983 | struct ddb_entry *ddb_entry, *dtemp; |
984 | int status = QLA_ERROR; | ||
969 | 985 | ||
970 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up." | 986 | DEBUG2(printk("scsi%ld: %s: DPC handler waking up." |
971 | "flags = 0x%08lx, dpc_flags = 0x%08lx\n", | 987 | "flags = 0x%08lx, dpc_flags = 0x%08lx ctrl_stat = 0x%08x\n", |
972 | ha->host_no, __func__, ha->flags, ha->dpc_flags)); | 988 | ha->host_no, __func__, ha->flags, ha->dpc_flags, |
989 | readw(&ha->reg->ctrl_status))); | ||
973 | 990 | ||
974 | /* Initialization not yet finished. Don't do anything yet. */ | 991 | /* Initialization not yet finished. Don't do anything yet. */ |
975 | if (!test_bit(AF_INIT_DONE, &ha->flags)) | 992 | if (!test_bit(AF_INIT_DONE, &ha->flags)) |
@@ -983,31 +1000,28 @@ static void qla4xxx_do_dpc(struct work_struct *work) | |||
983 | test_bit(DPC_RESET_HA, &ha->dpc_flags)) | 1000 | test_bit(DPC_RESET_HA, &ha->dpc_flags)) |
984 | qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST); | 1001 | qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST); |
985 | 1002 | ||
986 | if (test_and_clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) { | 1003 | if (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) { |
987 | uint8_t wait_time = RESET_INTR_TOV; | 1004 | uint8_t wait_time = RESET_INTR_TOV; |
988 | unsigned long flags = 0; | ||
989 | |||
990 | qla4xxx_flush_active_srbs(ha); | ||
991 | 1005 | ||
992 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
993 | while ((readw(&ha->reg->ctrl_status) & | 1006 | while ((readw(&ha->reg->ctrl_status) & |
994 | (CSR_SOFT_RESET | CSR_FORCE_SOFT_RESET)) != 0) { | 1007 | (CSR_SOFT_RESET | CSR_FORCE_SOFT_RESET)) != 0) { |
995 | if (--wait_time == 0) | 1008 | if (--wait_time == 0) |
996 | break; | 1009 | break; |
997 | |||
998 | spin_unlock_irqrestore(&ha->hardware_lock, | ||
999 | flags); | ||
1000 | |||
1001 | msleep(1000); | 1010 | msleep(1000); |
1002 | |||
1003 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
1004 | } | 1011 | } |
1005 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
1006 | |||
1007 | if (wait_time == 0) | 1012 | if (wait_time == 0) |
1008 | DEBUG2(printk("scsi%ld: %s: SR|FSR " | 1013 | DEBUG2(printk("scsi%ld: %s: SR|FSR " |
1009 | "bit not cleared-- resetting\n", | 1014 | "bit not cleared-- resetting\n", |
1010 | ha->host_no, __func__)); | 1015 | ha->host_no, __func__)); |
1016 | qla4xxx_flush_active_srbs(ha); | ||
1017 | if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) { | ||
1018 | qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS); | ||
1019 | status = qla4xxx_initialize_adapter(ha, | ||
1020 | PRESERVE_DDB_LIST); | ||
1021 | } | ||
1022 | clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags); | ||
1023 | if (status == QLA_SUCCESS) | ||
1024 | qla4xxx_enable_intrs(ha); | ||
1011 | } | 1025 | } |
1012 | } | 1026 | } |
1013 | 1027 | ||
@@ -1062,7 +1076,7 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha) | |||
1062 | 1076 | ||
1063 | /* Issue Soft Reset to put firmware in unknown state */ | 1077 | /* Issue Soft Reset to put firmware in unknown state */ |
1064 | if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) | 1078 | if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) |
1065 | qla4xxx_soft_reset(ha); | 1079 | qla4xxx_hw_reset(ha); |
1066 | 1080 | ||
1067 | /* Remove timer thread, if present */ | 1081 | /* Remove timer thread, if present */ |
1068 | if (ha->timer_active) | 1082 | if (ha->timer_active) |
@@ -1198,7 +1212,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev, | |||
1198 | INIT_LIST_HEAD(&ha->free_srb_q); | 1212 | INIT_LIST_HEAD(&ha->free_srb_q); |
1199 | 1213 | ||
1200 | mutex_init(&ha->mbox_sem); | 1214 | mutex_init(&ha->mbox_sem); |
1201 | init_waitqueue_head(&ha->mailbox_wait_queue); | ||
1202 | 1215 | ||
1203 | spin_lock_init(&ha->hardware_lock); | 1216 | spin_lock_init(&ha->hardware_lock); |
1204 | 1217 | ||
@@ -1665,6 +1678,7 @@ no_srp_cache: | |||
1665 | 1678 | ||
1666 | static void __exit qla4xxx_module_exit(void) | 1679 | static void __exit qla4xxx_module_exit(void) |
1667 | { | 1680 | { |
1681 | ql4_mod_unload = 1; | ||
1668 | pci_unregister_driver(&qla4xxx_pci_driver); | 1682 | pci_unregister_driver(&qla4xxx_pci_driver); |
1669 | iscsi_unregister_transport(&qla4xxx_iscsi_transport); | 1683 | iscsi_unregister_transport(&qla4xxx_iscsi_transport); |
1670 | kmem_cache_destroy(srb_cachep); | 1684 | kmem_cache_destroy(srb_cachep); |
diff --git a/drivers/scsi/qla4xxx/ql4_version.h b/drivers/scsi/qla4xxx/ql4_version.h index 454e19c8ad68..e5183a697d1f 100644 --- a/drivers/scsi/qla4xxx/ql4_version.h +++ b/drivers/scsi/qla4xxx/ql4_version.h | |||
@@ -5,4 +5,4 @@ | |||
5 | * See LICENSE.qla4xxx for copyright and licensing details. | 5 | * See LICENSE.qla4xxx for copyright and licensing details. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define QLA4XXX_DRIVER_VERSION "5.00.07-k" | 8 | #define QLA4XXX_DRIVER_VERSION "5.00.07-k1" |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 14e635aa44ce..96b7cbd746a8 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -133,12 +133,10 @@ struct async_scan_data { | |||
133 | /** | 133 | /** |
134 | * scsi_complete_async_scans - Wait for asynchronous scans to complete | 134 | * scsi_complete_async_scans - Wait for asynchronous scans to complete |
135 | * | 135 | * |
136 | * Asynchronous scans add themselves to the scanning_hosts list. Once | 136 | * When this function returns, any host which started scanning before |
137 | * that list is empty, we know that the scans are complete. Rather than | 137 | * this function was called will have finished its scan. Hosts which |
138 | * waking up periodically to check the state of the list, we pretend to be | 138 | * started scanning after this function was called may or may not have |
139 | * a scanning task by adding ourselves at the end of the list and going to | 139 | * finished. |
140 | * sleep. When the task before us wakes us up, we take ourselves off the | ||
141 | * list and return. | ||
142 | */ | 140 | */ |
143 | int scsi_complete_async_scans(void) | 141 | int scsi_complete_async_scans(void) |
144 | { | 142 | { |
@@ -171,6 +169,11 @@ int scsi_complete_async_scans(void) | |||
171 | 169 | ||
172 | spin_lock(&async_scan_lock); | 170 | spin_lock(&async_scan_lock); |
173 | list_del(&data->list); | 171 | list_del(&data->list); |
172 | if (!list_empty(&scanning_hosts)) { | ||
173 | struct async_scan_data *next = list_entry(scanning_hosts.next, | ||
174 | struct async_scan_data, list); | ||
175 | complete(&next->prev_finished); | ||
176 | } | ||
174 | done: | 177 | done: |
175 | spin_unlock(&async_scan_lock); | 178 | spin_unlock(&async_scan_lock); |
176 | 179 | ||
@@ -739,6 +742,14 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
739 | sdev->no_uld_attach = 1; | 742 | sdev->no_uld_attach = 1; |
740 | 743 | ||
741 | switch (sdev->type = (inq_result[0] & 0x1f)) { | 744 | switch (sdev->type = (inq_result[0] & 0x1f)) { |
745 | case TYPE_RBC: | ||
746 | /* RBC devices can return SCSI-3 compliance and yet | ||
747 | * still not support REPORT LUNS, so make them act as | ||
748 | * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is | ||
749 | * specifically set */ | ||
750 | if ((*bflags & BLIST_REPORTLUN2) == 0) | ||
751 | *bflags |= BLIST_NOREPORTLUN; | ||
752 | /* fall through */ | ||
742 | case TYPE_TAPE: | 753 | case TYPE_TAPE: |
743 | case TYPE_DISK: | 754 | case TYPE_DISK: |
744 | case TYPE_PRINTER: | 755 | case TYPE_PRINTER: |
@@ -749,11 +760,17 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
749 | case TYPE_ENCLOSURE: | 760 | case TYPE_ENCLOSURE: |
750 | case TYPE_COMM: | 761 | case TYPE_COMM: |
751 | case TYPE_RAID: | 762 | case TYPE_RAID: |
752 | case TYPE_RBC: | ||
753 | sdev->writeable = 1; | 763 | sdev->writeable = 1; |
754 | break; | 764 | break; |
755 | case TYPE_WORM: | ||
756 | case TYPE_ROM: | 765 | case TYPE_ROM: |
766 | /* MMC devices can return SCSI-3 compliance and yet | ||
767 | * still not support REPORT LUNS, so make them act as | ||
768 | * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is | ||
769 | * specifically set */ | ||
770 | if ((*bflags & BLIST_REPORTLUN2) == 0) | ||
771 | *bflags |= BLIST_NOREPORTLUN; | ||
772 | /* fall through */ | ||
773 | case TYPE_WORM: | ||
757 | sdev->writeable = 0; | 774 | sdev->writeable = 0; |
758 | break; | 775 | break; |
759 | default: | 776 | default: |
@@ -1436,6 +1453,12 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, | |||
1436 | struct device *parent = &shost->shost_gendev; | 1453 | struct device *parent = &shost->shost_gendev; |
1437 | struct scsi_target *starget; | 1454 | struct scsi_target *starget; |
1438 | 1455 | ||
1456 | if (strncmp(scsi_scan_type, "none", 4) == 0) | ||
1457 | return ERR_PTR(-ENODEV); | ||
1458 | |||
1459 | if (!shost->async_scan) | ||
1460 | scsi_complete_async_scans(); | ||
1461 | |||
1439 | starget = scsi_alloc_target(parent, channel, id); | 1462 | starget = scsi_alloc_target(parent, channel, id); |
1440 | if (!starget) | 1463 | if (!starget) |
1441 | return ERR_PTR(-ENOMEM); | 1464 | return ERR_PTR(-ENOMEM); |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 9c22f1342715..ce0d14af33c8 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -1416,7 +1416,7 @@ static __init int iscsi_transport_init(void) | |||
1416 | { | 1416 | { |
1417 | int err; | 1417 | int err; |
1418 | 1418 | ||
1419 | printk(KERN_INFO "Loading iSCSI transport class v%s.", | 1419 | printk(KERN_INFO "Loading iSCSI transport class v%s.\n", |
1420 | ISCSI_TRANSPORT_VERSION); | 1420 | ISCSI_TRANSPORT_VERSION); |
1421 | 1421 | ||
1422 | err = class_register(&iscsi_transport_class); | 1422 | err = class_register(&iscsi_transport_class); |
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 3fded4831460..014d7fea1ff3 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -122,7 +122,7 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, | |||
122 | if (!sshdr) | 122 | if (!sshdr) |
123 | sshdr = &sshdr_tmp; | 123 | sshdr = &sshdr_tmp; |
124 | 124 | ||
125 | if (scsi_normalize_sense(sense, sizeof(*sense), | 125 | if (scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, |
126 | sshdr) | 126 | sshdr) |
127 | && sshdr->sense_key == UNIT_ATTENTION) | 127 | && sshdr->sense_key == UNIT_ATTENTION) |
128 | continue; | 128 | continue; |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 978bfc1e0c6a..b781a90d6699 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1647,16 +1647,6 @@ static int sd_probe(struct device *dev) | |||
1647 | if (error) | 1647 | if (error) |
1648 | goto out_put; | 1648 | goto out_put; |
1649 | 1649 | ||
1650 | class_device_initialize(&sdkp->cdev); | ||
1651 | sdkp->cdev.dev = &sdp->sdev_gendev; | ||
1652 | sdkp->cdev.class = &sd_disk_class; | ||
1653 | strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE); | ||
1654 | |||
1655 | if (class_device_add(&sdkp->cdev)) | ||
1656 | goto out_put; | ||
1657 | |||
1658 | get_device(&sdp->sdev_gendev); | ||
1659 | |||
1660 | sdkp->device = sdp; | 1650 | sdkp->device = sdp; |
1661 | sdkp->driver = &sd_template; | 1651 | sdkp->driver = &sd_template; |
1662 | sdkp->disk = gd; | 1652 | sdkp->disk = gd; |
@@ -1670,6 +1660,16 @@ static int sd_probe(struct device *dev) | |||
1670 | sdp->timeout = SD_MOD_TIMEOUT; | 1660 | sdp->timeout = SD_MOD_TIMEOUT; |
1671 | } | 1661 | } |
1672 | 1662 | ||
1663 | class_device_initialize(&sdkp->cdev); | ||
1664 | sdkp->cdev.dev = &sdp->sdev_gendev; | ||
1665 | sdkp->cdev.class = &sd_disk_class; | ||
1666 | strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE); | ||
1667 | |||
1668 | if (class_device_add(&sdkp->cdev)) | ||
1669 | goto out_put; | ||
1670 | |||
1671 | get_device(&sdp->sdev_gendev); | ||
1672 | |||
1673 | gd->major = sd_major((index & 0xf0) >> 4); | 1673 | gd->major = sd_major((index & 0xf0) >> 4); |
1674 | gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00); | 1674 | gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00); |
1675 | gd->minors = 16; | 1675 | gd->minors = 16; |
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index 5ffec2721b28..ff62e9708e1c 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c | |||
@@ -114,6 +114,7 @@ | |||
114 | #define DPRINTK( when, msg... ) do { if ( (DEBUG & (when)) == (when) ) printk( msg ); } while (0) | 114 | #define DPRINTK( when, msg... ) do { if ( (DEBUG & (when)) == (when) ) printk( msg ); } while (0) |
115 | #else | 115 | #else |
116 | #define DPRINTK( when, msg... ) do { } while (0) | 116 | #define DPRINTK( when, msg... ) do { } while (0) |
117 | #define DEBUG 0 | ||
117 | #endif | 118 | #endif |
118 | #define DANY( msg... ) DPRINTK( 0xffff, msg ); | 119 | #define DANY( msg... ) DPRINTK( 0xffff, msg ); |
119 | 120 | ||
@@ -523,7 +524,7 @@ int __init seagate_st0x_detect (struct scsi_host_template * tpnt) | |||
523 | #ifdef ARBITRATE | 524 | #ifdef ARBITRATE |
524 | " ARBITRATE" | 525 | " ARBITRATE" |
525 | #endif | 526 | #endif |
526 | #ifdef DEBUG | 527 | #if DEBUG |
527 | " DEBUG" | 528 | " DEBUG" |
528 | #endif | 529 | #endif |
529 | #ifdef FAST | 530 | #ifdef FAST |
@@ -733,7 +734,7 @@ static int internal_command (unsigned char target, unsigned char lun, | |||
733 | unsigned char *data = NULL; | 734 | unsigned char *data = NULL; |
734 | struct scatterlist *buffer = NULL; | 735 | struct scatterlist *buffer = NULL; |
735 | int clock, temp, nobuffs = 0, done = 0, len = 0; | 736 | int clock, temp, nobuffs = 0, done = 0, len = 0; |
736 | #ifdef DEBUG | 737 | #if DEBUG |
737 | int transfered = 0, phase = 0, newphase; | 738 | int transfered = 0, phase = 0, newphase; |
738 | #endif | 739 | #endif |
739 | register unsigned char status_read; | 740 | register unsigned char status_read; |
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index fae6e95a6298..89e9b36b1788 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -468,7 +468,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd, | |||
468 | } | 468 | } |
469 | 469 | ||
470 | ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg); | 470 | ret = cdrom_ioctl(file, &cd->cdi, inode, cmd, arg); |
471 | if (ret != ENOSYS) | 471 | if (ret != -ENOSYS) |
472 | return ret; | 472 | return ret; |
473 | 473 | ||
474 | /* | 474 | /* |
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index e016e0906e1a..488ec7948a57 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -2816,15 +2816,18 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon | |||
2816 | 2816 | ||
2817 | if (cmd_in == MTWEOF && | 2817 | if (cmd_in == MTWEOF && |
2818 | cmdstatp->have_sense && | 2818 | cmdstatp->have_sense && |
2819 | (cmdstatp->flags & SENSE_EOM) && | 2819 | (cmdstatp->flags & SENSE_EOM)) { |
2820 | (cmdstatp->sense_hdr.sense_key == NO_SENSE || | 2820 | if (cmdstatp->sense_hdr.sense_key == NO_SENSE || |
2821 | cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) && | 2821 | cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) { |
2822 | undone == 0) { | 2822 | ioctl_result = 0; /* EOF(s) written successfully at EOM */ |
2823 | ioctl_result = 0; /* EOF written successfully at EOM */ | 2823 | STps->eof = ST_NOEOF; |
2824 | if (fileno >= 0) | 2824 | } else { /* Writing EOF(s) failed */ |
2825 | fileno++; | 2825 | if (fileno >= 0) |
2826 | fileno -= undone; | ||
2827 | if (undone < arg) | ||
2828 | STps->eof = ST_NOEOF; | ||
2829 | } | ||
2826 | STps->drv_file = fileno; | 2830 | STps->drv_file = fileno; |
2827 | STps->eof = ST_NOEOF; | ||
2828 | } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) { | 2831 | } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) { |
2829 | if (fileno >= 0) | 2832 | if (fileno >= 0) |
2830 | STps->drv_file = fileno - undone; | 2833 | STps->drv_file = fileno - undone; |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 61db6973755a..f69bd097166e 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
@@ -589,6 +589,8 @@ static int __init pl010_console_setup(struct console *co, char *options) | |||
589 | */ | 589 | */ |
590 | if (co->index >= UART_NR) | 590 | if (co->index >= UART_NR) |
591 | co->index = 0; | 591 | co->index = 0; |
592 | if (!amba_ports[co->index]) | ||
593 | return -ENODEV; | ||
592 | port = &amba_ports[co->index]->port; | 594 | port = &amba_ports[co->index]->port; |
593 | 595 | ||
594 | if (options) | 596 | if (options) |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 9a3b374b2a08..44639e71372a 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -661,6 +661,8 @@ static int __init pl011_console_setup(struct console *co, char *options) | |||
661 | if (co->index >= UART_NR) | 661 | if (co->index >= UART_NR) |
662 | co->index = 0; | 662 | co->index = 0; |
663 | uap = amba_ports[co->index]; | 663 | uap = amba_ports[co->index]; |
664 | if (!uap) | ||
665 | return -ENODEV; | ||
664 | 666 | ||
665 | uap->port.uartclk = clk_get_rate(uap->clk); | 667 | uap->port.uartclk = clk_get_rate(uap->clk); |
666 | 668 | ||
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index ed7f7209ea59..881f886b91c6 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -689,9 +689,9 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct | |||
689 | struct atmel_uart_data *data = pdev->dev.platform_data; | 689 | struct atmel_uart_data *data = pdev->dev.platform_data; |
690 | 690 | ||
691 | port->iotype = UPIO_MEM; | 691 | port->iotype = UPIO_MEM; |
692 | port->flags = UPF_BOOT_AUTOCONF; | 692 | port->flags = UPF_BOOT_AUTOCONF; |
693 | port->ops = &atmel_pops; | 693 | port->ops = &atmel_pops; |
694 | port->fifosize = 1; | 694 | port->fifosize = 1; |
695 | port->line = pdev->id; | 695 | port->line = pdev->id; |
696 | port->dev = &pdev->dev; | 696 | port->dev = &pdev->dev; |
697 | 697 | ||
@@ -890,7 +890,6 @@ static int atmel_serial_suspend(struct platform_device *pdev, pm_message_t state | |||
890 | if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock()) | 890 | if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock()) |
891 | enable_irq_wake(port->irq); | 891 | enable_irq_wake(port->irq); |
892 | else { | 892 | else { |
893 | disable_irq_wake(port->irq); | ||
894 | uart_suspend_port(&atmel_uart, port); | 893 | uart_suspend_port(&atmel_uart, port); |
895 | atmel_port->suspended = 1; | 894 | atmel_port->suspended = 1; |
896 | } | 895 | } |
@@ -907,6 +906,8 @@ static int atmel_serial_resume(struct platform_device *pdev) | |||
907 | uart_resume_port(&atmel_uart, port); | 906 | uart_resume_port(&atmel_uart, port); |
908 | atmel_port->suspended = 0; | 907 | atmel_port->suspended = 0; |
909 | } | 908 | } |
909 | else | ||
910 | disable_irq_wake(port->irq); | ||
910 | 911 | ||
911 | return 0; | 912 | return 0; |
912 | } | 913 | } |
diff --git a/drivers/serial/atmel_serial.h b/drivers/serial/atmel_serial.h index fe1763b2a6d5..11b44360e108 100644 --- a/drivers/serial/atmel_serial.h +++ b/drivers/serial/atmel_serial.h | |||
@@ -106,7 +106,7 @@ | |||
106 | #define ATMEL_US_CSR 0x14 /* Channel Status Register */ | 106 | #define ATMEL_US_CSR 0x14 /* Channel Status Register */ |
107 | #define ATMEL_US_RHR 0x18 /* Receiver Holding Register */ | 107 | #define ATMEL_US_RHR 0x18 /* Receiver Holding Register */ |
108 | #define ATMEL_US_THR 0x1c /* Transmitter Holding Register */ | 108 | #define ATMEL_US_THR 0x1c /* Transmitter Holding Register */ |
109 | #define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [SAM9 only] */ | 109 | #define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [AT91SAM9261 only] */ |
110 | 110 | ||
111 | #define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */ | 111 | #define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */ |
112 | #define ATMEL_US_CD (0xffff << 0) /* Clock Divider */ | 112 | #define ATMEL_US_CD (0xffff << 0) /* Clock Divider */ |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 6ed3f1da9296..8b41f9cc2560 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -1169,8 +1169,9 @@ static int setup(struct spi_device *spi) | |||
1169 | spi->bits_per_word - 16 : spi->bits_per_word) | 1169 | spi->bits_per_word - 16 : spi->bits_per_word) |
1170 | | SSCR0_SSE | 1170 | | SSCR0_SSE |
1171 | | (spi->bits_per_word > 16 ? SSCR0_EDSS : 0); | 1171 | | (spi->bits_per_word > 16 ? SSCR0_EDSS : 0); |
1172 | chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) << 4) | 1172 | chip->cr1 &= ~(SSCR1_SPO | SSCR1_SPH); |
1173 | | (((spi->mode & SPI_CPOL) != 0) << 3); | 1173 | chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) ? SSCR1_SPH : 0) |
1174 | | (((spi->mode & SPI_CPOL) != 0) ? SSCR1_SPO : 0); | ||
1174 | 1175 | ||
1175 | /* NOTE: PXA25x_SSP _could_ use external clocking ... */ | 1176 | /* NOTE: PXA25x_SSP _could_ use external clocking ... */ |
1176 | if (drv_data->ssp_type != PXA25x_SSP) | 1177 | if (drv_data->ssp_type != PXA25x_SSP) |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 270e6211c2e3..6307428d2c94 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -366,7 +366,6 @@ spi_alloc_master(struct device *dev, unsigned size) | |||
366 | 366 | ||
367 | class_device_initialize(&master->cdev); | 367 | class_device_initialize(&master->cdev); |
368 | master->cdev.class = &spi_master_class; | 368 | master->cdev.class = &spi_master_class; |
369 | kobj_set_kset_s(&master->cdev, spi_master_class.subsys); | ||
370 | master->cdev.dev = get_device(dev); | 369 | master->cdev.dev = get_device(dev); |
371 | spi_master_set_devdata(master, &master[1]); | 370 | spi_master_set_devdata(master, &master[1]); |
372 | 371 | ||
@@ -466,14 +465,20 @@ EXPORT_SYMBOL_GPL(spi_unregister_master); | |||
466 | */ | 465 | */ |
467 | struct spi_master *spi_busnum_to_master(u16 bus_num) | 466 | struct spi_master *spi_busnum_to_master(u16 bus_num) |
468 | { | 467 | { |
469 | char name[9]; | 468 | struct class_device *cdev; |
470 | struct kobject *bus; | 469 | struct spi_master *master = NULL; |
471 | 470 | struct spi_master *m; | |
472 | snprintf(name, sizeof name, "spi%u", bus_num); | 471 | |
473 | bus = kset_find_obj(&spi_master_class.subsys.kset, name); | 472 | down(&spi_master_class.sem); |
474 | if (bus) | 473 | list_for_each_entry(cdev, &spi_master_class.children, node) { |
475 | return container_of(bus, struct spi_master, cdev.kobj); | 474 | m = container_of(cdev, struct spi_master, cdev); |
476 | return NULL; | 475 | if (m->bus_num == bus_num) { |
476 | master = spi_master_get(m); | ||
477 | break; | ||
478 | } | ||
479 | } | ||
480 | up(&spi_master_class.sem); | ||
481 | return master; | ||
477 | } | 482 | } |
478 | EXPORT_SYMBOL_GPL(spi_busnum_to_master); | 483 | EXPORT_SYMBOL_GPL(spi_busnum_to_master); |
479 | 484 | ||
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 8ca08713528e..651379c51ae6 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -10,9 +10,6 @@ | |||
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | 12 | ||
13 | |||
14 | //#define DEBUG | ||
15 | |||
16 | #include <linux/init.h> | 13 | #include <linux/init.h> |
17 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
18 | #include <linux/workqueue.h> | 15 | #include <linux/workqueue.h> |
@@ -44,6 +41,9 @@ struct s3c24xx_spi { | |||
44 | int len; | 41 | int len; |
45 | int count; | 42 | int count; |
46 | 43 | ||
44 | int (*set_cs)(struct s3c2410_spi_info *spi, | ||
45 | int cs, int pol); | ||
46 | |||
47 | /* data buffers */ | 47 | /* data buffers */ |
48 | const unsigned char *tx; | 48 | const unsigned char *tx; |
49 | unsigned char *rx; | 49 | unsigned char *rx; |
@@ -64,6 +64,11 @@ static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev) | |||
64 | return spi_master_get_devdata(sdev->master); | 64 | return spi_master_get_devdata(sdev->master); |
65 | } | 65 | } |
66 | 66 | ||
67 | static void s3c24xx_spi_gpiocs(struct s3c2410_spi_info *spi, int cs, int pol) | ||
68 | { | ||
69 | s3c2410_gpio_setpin(spi->pin_cs, pol); | ||
70 | } | ||
71 | |||
67 | static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | 72 | static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) |
68 | { | 73 | { |
69 | struct s3c24xx_spi *hw = to_hw(spi); | 74 | struct s3c24xx_spi *hw = to_hw(spi); |
@@ -72,10 +77,7 @@ static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | |||
72 | 77 | ||
73 | switch (value) { | 78 | switch (value) { |
74 | case BITBANG_CS_INACTIVE: | 79 | case BITBANG_CS_INACTIVE: |
75 | if (hw->pdata->set_cs) | 80 | hw->pdata->set_cs(hw->pdata, spi->chip_select, cspol^1); |
76 | hw->pdata->set_cs(hw->pdata, value, cspol); | ||
77 | else | ||
78 | s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol ^ 1); | ||
79 | break; | 81 | break; |
80 | 82 | ||
81 | case BITBANG_CS_ACTIVE: | 83 | case BITBANG_CS_ACTIVE: |
@@ -96,14 +98,9 @@ static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | |||
96 | /* write new configration */ | 98 | /* write new configration */ |
97 | 99 | ||
98 | writeb(spcon, hw->regs + S3C2410_SPCON); | 100 | writeb(spcon, hw->regs + S3C2410_SPCON); |
99 | 101 | hw->pdata->set_cs(hw->pdata, spi->chip_select, cspol); | |
100 | if (hw->pdata->set_cs) | ||
101 | hw->pdata->set_cs(hw->pdata, value, cspol); | ||
102 | else | ||
103 | s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol); | ||
104 | 102 | ||
105 | break; | 103 | break; |
106 | |||
107 | } | 104 | } |
108 | } | 105 | } |
109 | 106 | ||
@@ -330,9 +327,12 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) | |||
330 | /* setup any gpio we can */ | 327 | /* setup any gpio we can */ |
331 | 328 | ||
332 | if (!hw->pdata->set_cs) { | 329 | if (!hw->pdata->set_cs) { |
330 | hw->set_cs = s3c24xx_spi_gpiocs; | ||
331 | |||
333 | s3c2410_gpio_setpin(hw->pdata->pin_cs, 1); | 332 | s3c2410_gpio_setpin(hw->pdata->pin_cs, 1); |
334 | s3c2410_gpio_cfgpin(hw->pdata->pin_cs, S3C2410_GPIO_OUTPUT); | 333 | s3c2410_gpio_cfgpin(hw->pdata->pin_cs, S3C2410_GPIO_OUTPUT); |
335 | } | 334 | } else |
335 | hw->set_cs = hw->pdata->set_cs; | ||
336 | 336 | ||
337 | /* register our spi controller */ | 337 | /* register our spi controller */ |
338 | 338 | ||
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index f8324d8d06ac..3e66b2a9974a 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -72,22 +72,6 @@ config USB_SUSPEND | |||
72 | 72 | ||
73 | If you are unsure about this, say N here. | 73 | If you are unsure about this, say N here. |
74 | 74 | ||
75 | config USB_MULTITHREAD_PROBE | ||
76 | bool "USB Multi-threaded probe (EXPERIMENTAL)" | ||
77 | depends on USB && EXPERIMENTAL | ||
78 | default n | ||
79 | help | ||
80 | Say Y here if you want the USB core to spawn a new thread for | ||
81 | every USB device that is probed. This can cause a small speedup | ||
82 | in boot times on systems with a lot of different USB devices. | ||
83 | |||
84 | This option should be safe to enable, but if any odd probing | ||
85 | problems are found, please disable it, or dynamically turn it | ||
86 | off in the /sys/module/usbcore/parameters/multithread_probe | ||
87 | file | ||
88 | |||
89 | When in doubt, say N. | ||
90 | |||
91 | config USB_OTG | 75 | config USB_OTG |
92 | bool | 76 | bool |
93 | depends on USB && EXPERIMENTAL | 77 | depends on USB && EXPERIMENTAL |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 2651c2e2a89f..1988224b362b 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -88,14 +88,7 @@ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); | |||
88 | static struct task_struct *khubd_task; | 88 | static struct task_struct *khubd_task; |
89 | 89 | ||
90 | /* multithreaded probe logic */ | 90 | /* multithreaded probe logic */ |
91 | static int multithread_probe = | 91 | static int multithread_probe = 0; |
92 | #ifdef CONFIG_USB_MULTITHREAD_PROBE | ||
93 | 1; | ||
94 | #else | ||
95 | 0; | ||
96 | #endif | ||
97 | module_param(multithread_probe, bool, S_IRUGO); | ||
98 | MODULE_PARM_DESC(multithread_probe, "Run each USB device probe in a new thread"); | ||
99 | 92 | ||
100 | /* cycle leds on hubs that aren't blinking for attention */ | 93 | /* cycle leds on hubs that aren't blinking for attention */ |
101 | static int blinkenlights = 0; | 94 | static int blinkenlights = 0; |
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 43ae696b2ec2..3348b07f0fe5 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c | |||
@@ -169,7 +169,7 @@ static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev) | |||
169 | static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) | 169 | static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) |
170 | { | 170 | { |
171 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 171 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
172 | struct ochi_hcd *ohci = hcd_to_ohci(hcd); | 172 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
173 | 173 | ||
174 | if (time_before(jiffies, ohci->next_statechange)) | 174 | if (time_before(jiffies, ohci->next_statechange)) |
175 | msleep(5); | 175 | msleep(5); |
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig index 258a5d09d3dc..c7d887540d8d 100644 --- a/drivers/usb/input/Kconfig +++ b/drivers/usb/input/Kconfig | |||
@@ -7,7 +7,7 @@ comment "USB Input Devices" | |||
7 | config USB_HID | 7 | config USB_HID |
8 | tristate "USB Human Interface Device (full HID) support" | 8 | tristate "USB Human Interface Device (full HID) support" |
9 | default y | 9 | default y |
10 | depends on USB | 10 | depends on USB && INPUT |
11 | select HID | 11 | select HID |
12 | ---help--- | 12 | ---help--- |
13 | Say Y here if you want full HID support to connect USB keyboards, | 13 | Say Y here if you want full HID support to connect USB keyboards, |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 89fa6885709b..c6c9e72e5fd9 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -56,11 +56,6 @@ static unsigned int hid_mousepoll_interval; | |||
56 | module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); | 56 | module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); |
57 | MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); | 57 | MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); |
58 | 58 | ||
59 | static int usbhid_pb_fnmode = 1; | ||
60 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); | ||
61 | MODULE_PARM_DESC(pb_fnmode, | ||
62 | "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); | ||
63 | |||
64 | /* | 59 | /* |
65 | * Input submission and I/O error handler. | 60 | * Input submission and I/O error handler. |
66 | */ | 61 | */ |
@@ -106,18 +101,18 @@ static void hid_reset(struct work_struct *work) | |||
106 | 101 | ||
107 | if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { | 102 | if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { |
108 | dev_dbg(&usbhid->intf->dev, "clear halt\n"); | 103 | dev_dbg(&usbhid->intf->dev, "clear halt\n"); |
109 | rc = usb_clear_halt(to_usb_device(hid->dev), usbhid->urbin->pipe); | 104 | rc = usb_clear_halt(hid_to_usb_dev(hid), usbhid->urbin->pipe); |
110 | clear_bit(HID_CLEAR_HALT, &usbhid->iofl); | 105 | clear_bit(HID_CLEAR_HALT, &usbhid->iofl); |
111 | hid_start_in(hid); | 106 | hid_start_in(hid); |
112 | } | 107 | } |
113 | 108 | ||
114 | else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { | 109 | else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { |
115 | dev_dbg(&usbhid->intf->dev, "resetting device\n"); | 110 | dev_dbg(&usbhid->intf->dev, "resetting device\n"); |
116 | rc = rc_lock = usb_lock_device_for_reset(to_usb_device(hid->dev), usbhid->intf); | 111 | rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf); |
117 | if (rc_lock >= 0) { | 112 | if (rc_lock >= 0) { |
118 | rc = usb_reset_composite_device(to_usb_device(hid->dev), usbhid->intf); | 113 | rc = usb_reset_composite_device(hid_to_usb_dev(hid), usbhid->intf); |
119 | if (rc_lock) | 114 | if (rc_lock) |
120 | usb_unlock_device(to_usb_device(hid->dev)); | 115 | usb_unlock_device(hid_to_usb_dev(hid)); |
121 | } | 116 | } |
122 | clear_bit(HID_RESET_PENDING, &usbhid->iofl); | 117 | clear_bit(HID_RESET_PENDING, &usbhid->iofl); |
123 | } | 118 | } |
@@ -129,8 +124,8 @@ static void hid_reset(struct work_struct *work) | |||
129 | break; | 124 | break; |
130 | default: | 125 | default: |
131 | err("can't reset device, %s-%s/input%d, status %d", | 126 | err("can't reset device, %s-%s/input%d, status %d", |
132 | to_usb_device(hid->dev)->bus->bus_name, | 127 | hid_to_usb_dev(hid)->bus->bus_name, |
133 | to_usb_device(hid->dev)->devpath, | 128 | hid_to_usb_dev(hid)->devpath, |
134 | usbhid->ifnum, rc); | 129 | usbhid->ifnum, rc); |
135 | /* FALLTHROUGH */ | 130 | /* FALLTHROUGH */ |
136 | case -EHOSTUNREACH: | 131 | case -EHOSTUNREACH: |
@@ -217,8 +212,8 @@ static void hid_irq_in(struct urb *urb) | |||
217 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 212 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
218 | if (status != -EPERM) { | 213 | if (status != -EPERM) { |
219 | err("can't resubmit intr, %s-%s/input%d, status %d", | 214 | err("can't resubmit intr, %s-%s/input%d, status %d", |
220 | to_usb_device(hid->dev)->bus->bus_name, | 215 | hid_to_usb_dev(hid)->bus->bus_name, |
221 | to_usb_device(hid->dev)->devpath, | 216 | hid_to_usb_dev(hid)->devpath, |
222 | usbhid->ifnum, status); | 217 | usbhid->ifnum, status); |
223 | hid_io_error(hid); | 218 | hid_io_error(hid); |
224 | } | 219 | } |
@@ -251,7 +246,7 @@ static int hid_submit_out(struct hid_device *hid) | |||
251 | 246 | ||
252 | hid_output_report(report, usbhid->outbuf); | 247 | hid_output_report(report, usbhid->outbuf); |
253 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 248 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
254 | usbhid->urbout->dev = to_usb_device(hid->dev); | 249 | usbhid->urbout->dev = hid_to_usb_dev(hid); |
255 | 250 | ||
256 | dbg("submitting out urb"); | 251 | dbg("submitting out urb"); |
257 | 252 | ||
@@ -276,13 +271,13 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
276 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 271 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
277 | if (dir == USB_DIR_OUT) { | 272 | if (dir == USB_DIR_OUT) { |
278 | hid_output_report(report, usbhid->ctrlbuf); | 273 | hid_output_report(report, usbhid->ctrlbuf); |
279 | usbhid->urbctrl->pipe = usb_sndctrlpipe(to_usb_device(hid->dev), 0); | 274 | usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0); |
280 | usbhid->urbctrl->transfer_buffer_length = len; | 275 | usbhid->urbctrl->transfer_buffer_length = len; |
281 | } else { | 276 | } else { |
282 | int maxpacket, padlen; | 277 | int maxpacket, padlen; |
283 | 278 | ||
284 | usbhid->urbctrl->pipe = usb_rcvctrlpipe(to_usb_device(hid->dev), 0); | 279 | usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0); |
285 | maxpacket = usb_maxpacket(to_usb_device(hid->dev), usbhid->urbctrl->pipe, 0); | 280 | maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0); |
286 | if (maxpacket > 0) { | 281 | if (maxpacket > 0) { |
287 | padlen = (len + maxpacket - 1) / maxpacket; | 282 | padlen = (len + maxpacket - 1) / maxpacket; |
288 | padlen *= maxpacket; | 283 | padlen *= maxpacket; |
@@ -292,7 +287,7 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
292 | padlen = 0; | 287 | padlen = 0; |
293 | usbhid->urbctrl->transfer_buffer_length = padlen; | 288 | usbhid->urbctrl->transfer_buffer_length = padlen; |
294 | } | 289 | } |
295 | usbhid->urbctrl->dev = to_usb_device(hid->dev); | 290 | usbhid->urbctrl->dev = hid_to_usb_dev(hid); |
296 | 291 | ||
297 | usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; | 292 | usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; |
298 | usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; | 293 | usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; |
@@ -582,6 +577,7 @@ void usbhid_init_reports(struct hid_device *hid) | |||
582 | } | 577 | } |
583 | 578 | ||
584 | #define USB_VENDOR_ID_GTCO 0x078c | 579 | #define USB_VENDOR_ID_GTCO 0x078c |
580 | #define USB_VENDOR_ID_GTCO_IPANEL_2 0x5543 | ||
585 | #define USB_DEVICE_ID_GTCO_90 0x0090 | 581 | #define USB_DEVICE_ID_GTCO_90 0x0090 |
586 | #define USB_DEVICE_ID_GTCO_100 0x0100 | 582 | #define USB_DEVICE_ID_GTCO_100 0x0100 |
587 | #define USB_DEVICE_ID_GTCO_101 0x0101 | 583 | #define USB_DEVICE_ID_GTCO_101 0x0101 |
@@ -627,6 +623,8 @@ void usbhid_init_reports(struct hid_device *hid) | |||
627 | #define USB_DEVICE_ID_GTCO_1004 0x1004 | 623 | #define USB_DEVICE_ID_GTCO_1004 0x1004 |
628 | #define USB_DEVICE_ID_GTCO_1005 0x1005 | 624 | #define USB_DEVICE_ID_GTCO_1005 0x1005 |
629 | #define USB_DEVICE_ID_GTCO_1006 0x1006 | 625 | #define USB_DEVICE_ID_GTCO_1006 0x1006 |
626 | #define USB_DEVICE_ID_GTCO_8 0x0008 | ||
627 | #define USB_DEVICE_ID_GTCO_d 0x000d | ||
630 | 628 | ||
631 | #define USB_VENDOR_ID_WACOM 0x056a | 629 | #define USB_VENDOR_ID_WACOM 0x056a |
632 | 630 | ||
@@ -791,6 +789,9 @@ void usbhid_init_reports(struct hid_device *hid) | |||
791 | #define USB_VENDOR_ID_LOGITECH 0x046d | 789 | #define USB_VENDOR_ID_LOGITECH 0x046d |
792 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 | 790 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 |
793 | 791 | ||
792 | #define USB_VENDOR_ID_IMATION 0x0718 | ||
793 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | ||
794 | |||
794 | /* | 795 | /* |
795 | * Alphabetically sorted blacklist by quirk type. | 796 | * Alphabetically sorted blacklist by quirk type. |
796 | */ | 797 | */ |
@@ -875,6 +876,9 @@ static const struct hid_blacklist { | |||
875 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, | 876 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, |
876 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, | 877 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, |
877 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, | 878 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, |
879 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, | ||
880 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, | ||
881 | { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, | ||
878 | { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, | 882 | { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, |
879 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, | 883 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, |
880 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, | 884 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, |
@@ -951,7 +955,7 @@ static const struct hid_blacklist { | |||
951 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, | 955 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
952 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, | 956 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
953 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, | 957 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, |
954 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, | 958 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, |
955 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, | 959 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, |
956 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | 960 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, |
957 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, | 961 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, |
@@ -1187,7 +1191,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1187 | 1191 | ||
1188 | hid->version = le16_to_cpu(hdesc->bcdHID); | 1192 | hid->version = le16_to_cpu(hdesc->bcdHID); |
1189 | hid->country = hdesc->bCountryCode; | 1193 | hid->country = hdesc->bCountryCode; |
1190 | hid->dev = &dev->dev; | 1194 | hid->dev = &intf->dev; |
1191 | usbhid->intf = intf; | 1195 | usbhid->intf = intf; |
1192 | usbhid->ifnum = interface->desc.bInterfaceNumber; | 1196 | usbhid->ifnum = interface->desc.bInterfaceNumber; |
1193 | 1197 | ||
@@ -1237,10 +1241,6 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1237 | hid->hiddev_hid_event = hiddev_hid_event; | 1241 | hid->hiddev_hid_event = hiddev_hid_event; |
1238 | hid->hiddev_report_event = hiddev_report_event; | 1242 | hid->hiddev_report_event = hiddev_report_event; |
1239 | #endif | 1243 | #endif |
1240 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | ||
1241 | hid->pb_fnmode = usbhid_pb_fnmode; | ||
1242 | #endif | ||
1243 | |||
1244 | return hid; | 1244 | return hid; |
1245 | 1245 | ||
1246 | fail: | 1246 | fail: |
@@ -1282,7 +1282,7 @@ static void hid_disconnect(struct usb_interface *intf) | |||
1282 | usb_free_urb(usbhid->urbctrl); | 1282 | usb_free_urb(usbhid->urbctrl); |
1283 | usb_free_urb(usbhid->urbout); | 1283 | usb_free_urb(usbhid->urbout); |
1284 | 1284 | ||
1285 | hid_free_buffers(to_usb_device(hid->dev), hid); | 1285 | hid_free_buffers(hid_to_usb_dev(hid), hid); |
1286 | hid_free_device(hid); | 1286 | hid_free_device(hid); |
1287 | } | 1287 | } |
1288 | 1288 | ||
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index f8f660ee3fac..59ed65e7a621 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/usb.h> | 33 | #include <linux/usb.h> |
34 | 34 | ||
35 | #include <linux/hid.h> | 35 | #include <linux/hid.h> |
36 | #include "usbhid.h" | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * This table contains pointers to initializers. To add support for new | 39 | * This table contains pointers to initializers. To add support for new |
@@ -70,8 +71,8 @@ static struct hid_ff_initializer inits[] = { | |||
70 | int hid_ff_init(struct hid_device* hid) | 71 | int hid_ff_init(struct hid_device* hid) |
71 | { | 72 | { |
72 | struct hid_ff_initializer *init; | 73 | struct hid_ff_initializer *init; |
73 | int vendor = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idVendor); | 74 | int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor); |
74 | int product = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idProduct); | 75 | int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct); |
75 | 76 | ||
76 | for (init = inits; init->idVendor; init++) | 77 | for (init = inits; init->idVendor; init++) |
77 | if (init->idVendor == vendor && init->idProduct == product) | 78 | if (init->idVendor == vendor && init->idProduct == product) |
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 114d6c9f64b1..a8b3d66cd498 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c | |||
@@ -384,7 +384,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd | |||
384 | struct hiddev_list *list = file->private_data; | 384 | struct hiddev_list *list = file->private_data; |
385 | struct hiddev *hiddev = list->hiddev; | 385 | struct hiddev *hiddev = list->hiddev; |
386 | struct hid_device *hid = hiddev->hid; | 386 | struct hid_device *hid = hiddev->hid; |
387 | struct usb_device *dev = to_usb_device(hid->dev); | 387 | struct usb_device *dev = hid_to_usb_dev(hid); |
388 | struct hiddev_collection_info cinfo; | 388 | struct hiddev_collection_info cinfo; |
389 | struct hiddev_report_info rinfo; | 389 | struct hiddev_report_info rinfo; |
390 | struct hiddev_field_info finfo; | 390 | struct hiddev_field_info finfo; |
diff --git a/drivers/usb/input/usbhid.h b/drivers/usb/input/usbhid.h index 830107e5251f..0023f96d4294 100644 --- a/drivers/usb/input/usbhid.h +++ b/drivers/usb/input/usbhid.h | |||
@@ -80,5 +80,8 @@ struct usbhid_device { | |||
80 | 80 | ||
81 | }; | 81 | }; |
82 | 82 | ||
83 | #define hid_to_usb_dev(hid_dev) \ | ||
84 | container_of(hid_dev->dev->parent, struct usb_device, dev) | ||
85 | |||
83 | #endif | 86 | #endif |
84 | 87 | ||
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index 7f3c57da9bc0..86e37a20f8e5 100644 --- a/drivers/usb/input/usbtouchscreen.c +++ b/drivers/usb/input/usbtouchscreen.c | |||
@@ -66,7 +66,7 @@ struct usbtouch_device_info { | |||
66 | 66 | ||
67 | void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); | 67 | void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); |
68 | int (*get_pkt_len) (unsigned char *pkt, int len); | 68 | int (*get_pkt_len) (unsigned char *pkt, int len); |
69 | int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); | 69 | int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); |
70 | int (*init) (struct usbtouch_usb *usbtouch); | 70 | int (*init) (struct usbtouch_usb *usbtouch); |
71 | }; | 71 | }; |
72 | 72 | ||
@@ -85,6 +85,9 @@ struct usbtouch_usb { | |||
85 | struct usbtouch_device_info *type; | 85 | struct usbtouch_device_info *type; |
86 | char name[128]; | 86 | char name[128]; |
87 | char phys[64]; | 87 | char phys[64]; |
88 | |||
89 | int x, y; | ||
90 | int touch, press; | ||
88 | }; | 91 | }; |
89 | 92 | ||
90 | 93 | ||
@@ -161,14 +164,14 @@ static struct usb_device_id usbtouch_devices[] = { | |||
161 | #define EGALAX_PKT_TYPE_REPT 0x80 | 164 | #define EGALAX_PKT_TYPE_REPT 0x80 |
162 | #define EGALAX_PKT_TYPE_DIAG 0x0A | 165 | #define EGALAX_PKT_TYPE_DIAG 0x0A |
163 | 166 | ||
164 | static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 167 | static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
165 | { | 168 | { |
166 | if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) | 169 | if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) |
167 | return 0; | 170 | return 0; |
168 | 171 | ||
169 | *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); | 172 | dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); |
170 | *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); | 173 | dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); |
171 | *touch = pkt[0] & 0x01; | 174 | dev->touch = pkt[0] & 0x01; |
172 | 175 | ||
173 | return 1; | 176 | return 1; |
174 | } | 177 | } |
@@ -195,11 +198,11 @@ static int egalax_get_pkt_len(unsigned char *buf, int len) | |||
195 | * PanJit Part | 198 | * PanJit Part |
196 | */ | 199 | */ |
197 | #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT | 200 | #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT |
198 | static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 201 | static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
199 | { | 202 | { |
200 | *x = ((pkt[2] & 0x0F) << 8) | pkt[1]; | 203 | dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; |
201 | *y = ((pkt[4] & 0x0F) << 8) | pkt[3]; | 204 | dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3]; |
202 | *touch = pkt[0] & 0x01; | 205 | dev->touch = pkt[0] & 0x01; |
203 | 206 | ||
204 | return 1; | 207 | return 1; |
205 | } | 208 | } |
@@ -215,11 +218,11 @@ static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int | |||
215 | #define MTOUCHUSB_RESET 7 | 218 | #define MTOUCHUSB_RESET 7 |
216 | #define MTOUCHUSB_REQ_CTRLLR_ID 10 | 219 | #define MTOUCHUSB_REQ_CTRLLR_ID 10 |
217 | 220 | ||
218 | static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 221 | static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
219 | { | 222 | { |
220 | *x = (pkt[8] << 8) | pkt[7]; | 223 | dev->x = (pkt[8] << 8) | pkt[7]; |
221 | *y = (pkt[10] << 8) | pkt[9]; | 224 | dev->y = (pkt[10] << 8) | pkt[9]; |
222 | *touch = (pkt[2] & 0x40) ? 1 : 0; | 225 | dev->touch = (pkt[2] & 0x40) ? 1 : 0; |
223 | 226 | ||
224 | return 1; | 227 | return 1; |
225 | } | 228 | } |
@@ -260,14 +263,32 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
260 | * ITM Part | 263 | * ITM Part |
261 | */ | 264 | */ |
262 | #ifdef CONFIG_USB_TOUCHSCREEN_ITM | 265 | #ifdef CONFIG_USB_TOUCHSCREEN_ITM |
263 | static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 266 | static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
264 | { | 267 | { |
265 | *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); | 268 | int touch; |
266 | *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); | 269 | /* |
267 | *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); | 270 | * ITM devices report invalid x/y data if not touched. |
268 | *touch = ~pkt[7] & 0x20; | 271 | * if the screen was touched before but is not touched any more |
272 | * report touch as 0 with the last valid x/y data once. then stop | ||
273 | * reporting data until touched again. | ||
274 | */ | ||
275 | dev->press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); | ||
276 | |||
277 | touch = ~pkt[7] & 0x20; | ||
278 | if (!touch) { | ||
279 | if (dev->touch) { | ||
280 | dev->touch = 0; | ||
281 | return 1; | ||
282 | } | ||
269 | 283 | ||
270 | return *touch; | 284 | return 0; |
285 | } | ||
286 | |||
287 | dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); | ||
288 | dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); | ||
289 | dev->touch = touch; | ||
290 | |||
291 | return 1; | ||
271 | } | 292 | } |
272 | #endif | 293 | #endif |
273 | 294 | ||
@@ -276,7 +297,7 @@ static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *pr | |||
276 | * eTurboTouch part | 297 | * eTurboTouch part |
277 | */ | 298 | */ |
278 | #ifdef CONFIG_USB_TOUCHSCREEN_ETURBO | 299 | #ifdef CONFIG_USB_TOUCHSCREEN_ETURBO |
279 | static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 300 | static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
280 | { | 301 | { |
281 | unsigned int shift; | 302 | unsigned int shift; |
282 | 303 | ||
@@ -285,9 +306,9 @@ static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int | |||
285 | return 0; | 306 | return 0; |
286 | 307 | ||
287 | shift = (6 - (pkt[0] & 0x03)); | 308 | shift = (6 - (pkt[0] & 0x03)); |
288 | *x = ((pkt[3] << 7) | pkt[4]) >> shift; | 309 | dev->x = ((pkt[3] << 7) | pkt[4]) >> shift; |
289 | *y = ((pkt[1] << 7) | pkt[2]) >> shift; | 310 | dev->y = ((pkt[1] << 7) | pkt[2]) >> shift; |
290 | *touch = (pkt[0] & 0x10) ? 1 : 0; | 311 | dev->touch = (pkt[0] & 0x10) ? 1 : 0; |
291 | 312 | ||
292 | return 1; | 313 | return 1; |
293 | } | 314 | } |
@@ -307,14 +328,14 @@ static int eturbo_get_pkt_len(unsigned char *buf, int len) | |||
307 | * Gunze part | 328 | * Gunze part |
308 | */ | 329 | */ |
309 | #ifdef CONFIG_USB_TOUCHSCREEN_GUNZE | 330 | #ifdef CONFIG_USB_TOUCHSCREEN_GUNZE |
310 | static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 331 | static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
311 | { | 332 | { |
312 | if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) | 333 | if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) |
313 | return 0; | 334 | return 0; |
314 | 335 | ||
315 | *x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); | 336 | dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); |
316 | *y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); | 337 | dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); |
317 | *touch = pkt[0] & 0x20; | 338 | dev->touch = pkt[0] & 0x20; |
318 | 339 | ||
319 | return 1; | 340 | return 1; |
320 | } | 341 | } |
@@ -383,11 +404,11 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch) | |||
383 | } | 404 | } |
384 | 405 | ||
385 | 406 | ||
386 | static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) | 407 | static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
387 | { | 408 | { |
388 | *x = ((pkt[2] & 0x03) << 8) | pkt[1]; | 409 | dev->x = ((pkt[2] & 0x03) << 8) | pkt[1]; |
389 | *y = ((pkt[4] & 0x03) << 8) | pkt[3]; | 410 | dev->y = ((pkt[4] & 0x03) << 8) | pkt[3]; |
390 | *touch = pkt[0] & 0x01; | 411 | dev->touch = pkt[0] & 0x01; |
391 | 412 | ||
392 | return 1; | 413 | return 1; |
393 | } | 414 | } |
@@ -492,23 +513,22 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
492 | static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, | 513 | static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, |
493 | unsigned char *pkt, int len) | 514 | unsigned char *pkt, int len) |
494 | { | 515 | { |
495 | int x, y, touch, press; | ||
496 | struct usbtouch_device_info *type = usbtouch->type; | 516 | struct usbtouch_device_info *type = usbtouch->type; |
497 | 517 | ||
498 | if (!type->read_data(pkt, &x, &y, &touch, &press)) | 518 | if (!type->read_data(usbtouch, pkt)) |
499 | return; | 519 | return; |
500 | 520 | ||
501 | input_report_key(usbtouch->input, BTN_TOUCH, touch); | 521 | input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch); |
502 | 522 | ||
503 | if (swap_xy) { | 523 | if (swap_xy) { |
504 | input_report_abs(usbtouch->input, ABS_X, y); | 524 | input_report_abs(usbtouch->input, ABS_X, usbtouch->y); |
505 | input_report_abs(usbtouch->input, ABS_Y, x); | 525 | input_report_abs(usbtouch->input, ABS_Y, usbtouch->x); |
506 | } else { | 526 | } else { |
507 | input_report_abs(usbtouch->input, ABS_X, x); | 527 | input_report_abs(usbtouch->input, ABS_X, usbtouch->x); |
508 | input_report_abs(usbtouch->input, ABS_Y, y); | 528 | input_report_abs(usbtouch->input, ABS_Y, usbtouch->y); |
509 | } | 529 | } |
510 | if (type->max_press) | 530 | if (type->max_press) |
511 | input_report_abs(usbtouch->input, ABS_PRESSURE, press); | 531 | input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press); |
512 | input_sync(usbtouch->input); | 532 | input_sync(usbtouch->input); |
513 | } | 533 | } |
514 | 534 | ||
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c index f538013965b0..896449f0cf85 100644 --- a/drivers/usb/net/asix.c +++ b/drivers/usb/net/asix.c | |||
@@ -898,7 +898,7 @@ static int ax88772_link_reset(struct usbnet *dev) | |||
898 | 898 | ||
899 | static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) | 899 | static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) |
900 | { | 900 | { |
901 | int ret; | 901 | int ret, embd_phy; |
902 | void *buf; | 902 | void *buf; |
903 | u16 rx_ctl; | 903 | u16 rx_ctl; |
904 | struct asix_data *data = (struct asix_data *)&dev->data; | 904 | struct asix_data *data = (struct asix_data *)&dev->data; |
@@ -919,13 +919,15 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) | |||
919 | AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) | 919 | AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) |
920 | goto out2; | 920 | goto out2; |
921 | 921 | ||
922 | /* 0x10 is the phy id of the embedded 10/100 ethernet phy */ | ||
923 | embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0); | ||
922 | if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, | 924 | if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, |
923 | 1, 0, 0, buf)) < 0) { | 925 | embd_phy, 0, 0, buf)) < 0) { |
924 | dbg("Select PHY #1 failed: %d", ret); | 926 | dbg("Select PHY #1 failed: %d", ret); |
925 | goto out2; | 927 | goto out2; |
926 | } | 928 | } |
927 | 929 | ||
928 | if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0) | 930 | if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0) |
929 | goto out2; | 931 | goto out2; |
930 | 932 | ||
931 | msleep(150); | 933 | msleep(150); |
@@ -933,8 +935,14 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) | |||
933 | goto out2; | 935 | goto out2; |
934 | 936 | ||
935 | msleep(150); | 937 | msleep(150); |
936 | if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0) | 938 | if (embd_phy) { |
937 | goto out2; | 939 | if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0) |
940 | goto out2; | ||
941 | } | ||
942 | else { | ||
943 | if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0) | ||
944 | goto out2; | ||
945 | } | ||
938 | 946 | ||
939 | msleep(150); | 947 | msleep(150); |
940 | rx_ctl = asix_read_rx_ctl(dev); | 948 | rx_ctl = asix_read_rx_ctl(dev); |
diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c index ea5f44de3de2..a322a16d9cf8 100644 --- a/drivers/usb/net/rndis_host.c +++ b/drivers/usb/net/rndis_host.c | |||
@@ -379,6 +379,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) | |||
379 | { | 379 | { |
380 | int retval; | 380 | int retval; |
381 | struct net_device *net = dev->net; | 381 | struct net_device *net = dev->net; |
382 | struct cdc_state *info = (void *) &dev->data; | ||
382 | union { | 383 | union { |
383 | void *buf; | 384 | void *buf; |
384 | struct rndis_msg_hdr *header; | 385 | struct rndis_msg_hdr *header; |
@@ -397,7 +398,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) | |||
397 | return -ENOMEM; | 398 | return -ENOMEM; |
398 | retval = usbnet_generic_cdc_bind(dev, intf); | 399 | retval = usbnet_generic_cdc_bind(dev, intf); |
399 | if (retval < 0) | 400 | if (retval < 0) |
400 | goto done; | 401 | goto fail; |
401 | 402 | ||
402 | net->hard_header_len += sizeof (struct rndis_data_hdr); | 403 | net->hard_header_len += sizeof (struct rndis_data_hdr); |
403 | 404 | ||
@@ -412,10 +413,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) | |||
412 | if (unlikely(retval < 0)) { | 413 | if (unlikely(retval < 0)) { |
413 | /* it might not even be an RNDIS device!! */ | 414 | /* it might not even be an RNDIS device!! */ |
414 | dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); | 415 | dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); |
415 | fail: | 416 | goto fail_and_release; |
416 | usb_driver_release_interface(driver_of(intf), | ||
417 | ((struct cdc_state *)&(dev->data))->data); | ||
418 | goto done; | ||
419 | } | 417 | } |
420 | dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size); | 418 | dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size); |
421 | /* REVISIT: peripheral "alignment" request is ignored ... */ | 419 | /* REVISIT: peripheral "alignment" request is ignored ... */ |
@@ -431,7 +429,7 @@ fail: | |||
431 | retval = rndis_command(dev, u.header); | 429 | retval = rndis_command(dev, u.header); |
432 | if (unlikely(retval < 0)) { | 430 | if (unlikely(retval < 0)) { |
433 | dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); | 431 | dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); |
434 | goto fail; | 432 | goto fail_and_release; |
435 | } | 433 | } |
436 | tmp = le32_to_cpu(u.get_c->offset); | 434 | tmp = le32_to_cpu(u.get_c->offset); |
437 | if (unlikely((tmp + 8) > (1024 - ETH_ALEN) | 435 | if (unlikely((tmp + 8) > (1024 - ETH_ALEN) |
@@ -439,7 +437,7 @@ fail: | |||
439 | dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n", | 437 | dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n", |
440 | tmp, le32_to_cpu(u.get_c->len)); | 438 | tmp, le32_to_cpu(u.get_c->len)); |
441 | retval = -EDOM; | 439 | retval = -EDOM; |
442 | goto fail; | 440 | goto fail_and_release; |
443 | } | 441 | } |
444 | memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN); | 442 | memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN); |
445 | 443 | ||
@@ -455,11 +453,18 @@ fail: | |||
455 | retval = rndis_command(dev, u.header); | 453 | retval = rndis_command(dev, u.header); |
456 | if (unlikely(retval < 0)) { | 454 | if (unlikely(retval < 0)) { |
457 | dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); | 455 | dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); |
458 | goto fail; | 456 | goto fail_and_release; |
459 | } | 457 | } |
460 | 458 | ||
461 | retval = 0; | 459 | retval = 0; |
462 | done: | 460 | |
461 | kfree(u.buf); | ||
462 | return retval; | ||
463 | |||
464 | fail_and_release: | ||
465 | usb_set_intfdata(info->data, NULL); | ||
466 | usb_driver_release_interface(driver_of(intf), info->data); | ||
467 | fail: | ||
463 | kfree(u.buf); | 468 | kfree(u.buf); |
464 | return retval; | 469 | return retval; |
465 | } | 470 | } |
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c index e0eecda78ec1..670262a38a0f 100644 --- a/drivers/usb/net/rtl8150.c +++ b/drivers/usb/net/rtl8150.c | |||
@@ -284,7 +284,8 @@ static int write_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 reg) | |||
284 | u8 data[3], tmp; | 284 | u8 data[3], tmp; |
285 | 285 | ||
286 | data[0] = phy; | 286 | data[0] = phy; |
287 | *(data + 1) = cpu_to_le16p(®); | 287 | data[1] = reg & 0xff; |
288 | data[2] = (reg >> 8) & 0xff; | ||
288 | tmp = indx | PHY_WRITE | PHY_GO; | 289 | tmp = indx | PHY_WRITE | PHY_GO; |
289 | i = 0; | 290 | i = 0; |
290 | 291 | ||
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c index 31501c9361b9..2bebd63d5ed1 100644 --- a/drivers/usb/serial/funsoft.c +++ b/drivers/usb/serial/funsoft.c | |||
@@ -27,7 +27,7 @@ MODULE_DEVICE_TABLE(usb, id_table); | |||
27 | static int funsoft_ioctl(struct usb_serial_port *port, struct file *file, | 27 | static int funsoft_ioctl(struct usb_serial_port *port, struct file *file, |
28 | unsigned int cmd, unsigned long arg) | 28 | unsigned int cmd, unsigned long arg) |
29 | { | 29 | { |
30 | struct termios t; | 30 | struct ktermios t; |
31 | 31 | ||
32 | dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd); | 32 | dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd); |
33 | 33 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5ca04e82ea19..0fed43a96871 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -78,6 +78,7 @@ static int option_send_setup(struct usb_serial_port *port); | |||
78 | #define OPTION_PRODUCT_FUSION2 0x6300 | 78 | #define OPTION_PRODUCT_FUSION2 0x6300 |
79 | #define OPTION_PRODUCT_COBRA 0x6500 | 79 | #define OPTION_PRODUCT_COBRA 0x6500 |
80 | #define OPTION_PRODUCT_COBRA2 0x6600 | 80 | #define OPTION_PRODUCT_COBRA2 0x6600 |
81 | #define OPTION_PRODUCT_GTMAX36 0x6701 | ||
81 | #define HUAWEI_PRODUCT_E600 0x1001 | 82 | #define HUAWEI_PRODUCT_E600 0x1001 |
82 | #define HUAWEI_PRODUCT_E220 0x1003 | 83 | #define HUAWEI_PRODUCT_E220 0x1003 |
83 | #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 | 84 | #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 |
@@ -90,6 +91,7 @@ static struct usb_device_id option_ids[] = { | |||
90 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, | 91 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, |
91 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, | 92 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, |
92 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, | 93 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, |
94 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, | ||
93 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 95 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
94 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, | 96 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, |
95 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, | 97 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, |
@@ -104,6 +106,7 @@ static struct usb_device_id option_ids1[] = { | |||
104 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, | 106 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, |
105 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, | 107 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, |
106 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, | 108 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, |
109 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, | ||
107 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 110 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
108 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, | 111 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, |
109 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, | 112 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index cddef3efba0a..b49f2a78189e 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -197,6 +197,13 @@ UNUSUAL_DEV( 0x0421, 0x047c, 0x0370, 0x0370, | |||
197 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 197 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
198 | US_FL_MAX_SECTORS_64 ), | 198 | US_FL_MAX_SECTORS_64 ), |
199 | 199 | ||
200 | /* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */ | ||
201 | UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452, | ||
202 | "Nokia", | ||
203 | "Nokia 6233", | ||
204 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
205 | US_FL_MAX_SECTORS_64 ), | ||
206 | |||
200 | /* Reported by Alex Corcoles <alex@corcoles.net> */ | 207 | /* Reported by Alex Corcoles <alex@corcoles.net> */ |
201 | UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, | 208 | UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, |
202 | "Nokia", | 209 | "Nokia", |
@@ -254,6 +261,18 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101, | |||
254 | US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), | 261 | US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), |
255 | #endif | 262 | #endif |
256 | 263 | ||
264 | /* | ||
265 | * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) | ||
266 | * Reported by Pete Zaitcev <zaitcev@redhat.com> | ||
267 | * This device chokes on both version of MODE SENSE which we have, so | ||
268 | * use_10_for_ms is not effective, and we use US_FL_NO_WP_DETECT. | ||
269 | */ | ||
270 | UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x0100, | ||
271 | "AMI", | ||
272 | "Virtual Floppy", | ||
273 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
274 | US_FL_NO_WP_DETECT), | ||
275 | |||
257 | /* Patch submitted by Philipp Friedrich <philipp@void.at> */ | 276 | /* Patch submitted by Philipp Friedrich <philipp@void.at> */ |
258 | UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, | 277 | UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, |
259 | "Kyocera", | 278 | "Kyocera", |