aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-16 12:54:23 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-16 12:54:23 -0500
commit99f5e9718185f07458ae70c2282c2153a2256c91 (patch)
treede0565dcc4fdabf40352b6bc0c80cc6634748f15
parenta08727bae727fc2ca3a6ee9506d77786b71070b3 (diff)
parent5c9a76118d24f044b8d8ee721dbbf4e5c7db3dbb (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [PATCH] pata_via: Cable detect error [PATCH] Fix help text for CONFIG_ATA_PIIX [PATCH] initializer entry defined twice in pata_rz1000 [PATCH] ata: fix platform_device_register_simple() error check [PATCH] ahci: do not mangle saved HOST_CAP while resetting controller [PATCH] libata: don't initialize sg in ata_exec_internal() if DMA_NONE (take #2) [libata] sata_svw: Disable ATAPI DMA on current boards (errata workaround) [libata] use kmap_atomic(KM_IRQ0) in SCSI simulator [PATCH] ata_piix: use piix_host_stop() in ich_pata_ops [PATCH] ata_piix: IDE mode SATA patch for Intel ICH9
-rw-r--r--drivers/ata/Kconfig6
-rw-r--r--drivers/ata/ahci.c2
-rw-r--r--drivers/ata/ata_piix.c22
-rw-r--r--drivers/ata/libata-core.c14
-rw-r--r--drivers/ata/libata-scsi.c4
-rw-r--r--drivers/ata/pata_legacy.c4
-rw-r--r--drivers/ata/pata_qdi.c4
-rw-r--r--drivers/ata/pata_rz1000.c2
-rw-r--r--drivers/ata/pata_via.c9
-rw-r--r--drivers/ata/pata_winbond.c4
-rw-r--r--drivers/ata/sata_svw.c41
11 files changed, 80 insertions, 32 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 984ab284382a..b34e0a958d0f 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -40,9 +40,9 @@ config ATA_PIIX
40 tristate "Intel PIIX/ICH SATA support" 40 tristate "Intel PIIX/ICH SATA support"
41 depends on PCI 41 depends on PCI
42 help 42 help
43 This option enables support for ICH5/6/7/8 Serial ATA. 43 This option enables support for ICH5/6/7/8 Serial ATA
44 If PATA support was enabled previously, this enables 44 and support for PATA on the Intel PIIX3/PIIX4/ICH series
45 support for select Intel PIIX/ICH PATA host controllers. 45 PATA host controllers.
46 46
47 If unsure, say N. 47 If unsure, say N.
48 48
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index f36da488a2c1..dbae6d971041 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -645,8 +645,6 @@ static int ahci_reset_controller(void __iomem *mmio, struct pci_dev *pdev)
645 u32 cap_save, impl_save, tmp; 645 u32 cap_save, impl_save, tmp;
646 646
647 cap_save = readl(mmio + HOST_CAP); 647 cap_save = readl(mmio + HOST_CAP);
648 cap_save &= ( (1<<28) | (1<<17) );
649 cap_save |= (1 << 27);
650 impl_save = readl(mmio + HOST_PORTS_IMPL); 648 impl_save = readl(mmio + HOST_PORTS_IMPL);
651 649
652 /* global controller reset */ 650 /* global controller reset */
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index c7de0bb1591f..47701b286f8b 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -226,14 +226,26 @@ static const struct pci_device_id piix_pci_tbl[] = {
226 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 226 { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
227 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */ 227 /* 2801GBM/GHM (ICH7M, identical to ICH6M) */
228 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, 228 { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci },
229 /* Enterprise Southbridge 2 (where's the datasheet?) */ 229 /* Enterprise Southbridge 2 (631xESB/632xESB) */
230 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, 230 { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },
231 /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ 231 /* SATA Controller 1 IDE (ICH8) */
232 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 232 { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
233 /* SATA Controller 2 IDE (ICH8, ditto) */ 233 /* SATA Controller 2 IDE (ICH8) */
234 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 234 { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
235 /* Mobile SATA Controller IDE (ICH8M, ditto) */ 235 /* Mobile SATA Controller IDE (ICH8M) */
236 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 236 { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
237 /* SATA Controller IDE (ICH9) */
238 { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
239 /* SATA Controller IDE (ICH9) */
240 { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
241 /* SATA Controller IDE (ICH9) */
242 { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
243 /* SATA Controller IDE (ICH9M) */
244 { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
245 /* SATA Controller IDE (ICH9M) */
246 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
247 /* SATA Controller IDE (ICH9M) */
248 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
237 249
238 { } /* terminate list */ 250 { } /* terminate list */
239}; 251};
@@ -330,7 +342,7 @@ static const struct ata_port_operations ich_pata_ops = {
330 342
331 .port_start = ata_port_start, 343 .port_start = ata_port_start,
332 .port_stop = ata_port_stop, 344 .port_stop = ata_port_stop,
333 .host_stop = ata_host_stop, 345 .host_stop = piix_host_stop,
334}; 346};
335 347
336static const struct ata_port_operations piix_sata_ops = { 348static const struct ata_port_operations piix_sata_ops = {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 011c0a8a2dcc..0d51d13b16bf 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1332,7 +1332,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
1332} 1332}
1333 1333
1334/** 1334/**
1335 * ata_exec_internal_sg - execute libata internal command 1335 * ata_exec_internal - execute libata internal command
1336 * @dev: Device to which the command is sent 1336 * @dev: Device to which the command is sent
1337 * @tf: Taskfile registers for the command and the result 1337 * @tf: Taskfile registers for the command and the result
1338 * @cdb: CDB for packet command 1338 * @cdb: CDB for packet command
@@ -1353,11 +1353,17 @@ unsigned ata_exec_internal(struct ata_device *dev,
1353 struct ata_taskfile *tf, const u8 *cdb, 1353 struct ata_taskfile *tf, const u8 *cdb,
1354 int dma_dir, void *buf, unsigned int buflen) 1354 int dma_dir, void *buf, unsigned int buflen)
1355{ 1355{
1356 struct scatterlist sg; 1356 struct scatterlist *psg = NULL, sg;
1357 unsigned int n_elem = 0;
1357 1358
1358 sg_init_one(&sg, buf, buflen); 1359 if (dma_dir != DMA_NONE) {
1360 WARN_ON(!buf);
1361 sg_init_one(&sg, buf, buflen);
1362 psg = &sg;
1363 n_elem++;
1364 }
1359 1365
1360 return ata_exec_internal_sg(dev, tf, cdb, dma_dir, &sg, 1); 1366 return ata_exec_internal_sg(dev, tf, cdb, dma_dir, psg, n_elem);
1361} 1367}
1362 1368
1363/** 1369/**
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 664e1377b54c..a4790be41d1c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1539,7 +1539,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out)
1539 struct scatterlist *sg; 1539 struct scatterlist *sg;
1540 1540
1541 sg = (struct scatterlist *) cmd->request_buffer; 1541 sg = (struct scatterlist *) cmd->request_buffer;
1542 buf = kmap_atomic(sg->page, KM_USER0) + sg->offset; 1542 buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
1543 buflen = sg->length; 1543 buflen = sg->length;
1544 } else { 1544 } else {
1545 buf = cmd->request_buffer; 1545 buf = cmd->request_buffer;
@@ -1567,7 +1567,7 @@ static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
1567 struct scatterlist *sg; 1567 struct scatterlist *sg;
1568 1568
1569 sg = (struct scatterlist *) cmd->request_buffer; 1569 sg = (struct scatterlist *) cmd->request_buffer;
1570 kunmap_atomic(buf - sg->offset, KM_USER0); 1570 kunmap_atomic(buf - sg->offset, KM_IRQ0);
1571 } 1571 }
1572} 1572}
1573 1573
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index c7d1738e4e69..e7bf9d89c8ee 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -698,8 +698,10 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl
698 goto fail_io; 698 goto fail_io;
699 699
700 pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0); 700 pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0);
701 if (pdev == NULL) 701 if (IS_ERR(pdev)) {
702 ret = PTR_ERR(pdev);
702 goto fail_dev; 703 goto fail_dev;
704 }
703 705
704 if (ht6560a & mask) { 706 if (ht6560a & mask) {
705 ops = &ht6560a_port_ops; 707 ops = &ht6560a_port_ops;
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index 36f621abc390..afc0d990e7d6 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -247,8 +247,8 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
247 */ 247 */
248 248
249 pdev = platform_device_register_simple(DRV_NAME, nr_qdi_host, NULL, 0); 249 pdev = platform_device_register_simple(DRV_NAME, nr_qdi_host, NULL, 0);
250 if (pdev == NULL) 250 if (IS_ERR(pdev))
251 return -ENOMEM; 251 return PTR_ERR(pdev);
252 252
253 memset(&ae, 0, sizeof(struct ata_probe_ent)); 253 memset(&ae, 0, sizeof(struct ata_probe_ent));
254 INIT_LIST_HEAD(&ae.node); 254 INIT_LIST_HEAD(&ae.node);
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index 3677c642c9f9..adf4cc134f25 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -105,8 +105,6 @@ static struct ata_port_operations rz1000_port_ops = {
105 .exec_command = ata_exec_command, 105 .exec_command = ata_exec_command,
106 .dev_select = ata_std_dev_select, 106 .dev_select = ata_std_dev_select,
107 107
108 .error_handler = rz1000_error_handler,
109
110 .bmdma_setup = ata_bmdma_setup, 108 .bmdma_setup = ata_bmdma_setup,
111 .bmdma_start = ata_bmdma_start, 109 .bmdma_start = ata_bmdma_start,
112 .bmdma_stop = ata_bmdma_stop, 110 .bmdma_stop = ata_bmdma_stop,
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index cc09d47fb927..ff93e8f71cf8 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -161,10 +161,15 @@ static int via_pre_reset(struct ata_port *ap)
161 return -ENOENT; 161 return -ENOENT;
162 } 162 }
163 163
164 if ((config->flags & VIA_UDMA) >= VIA_UDMA_66) 164 if ((config->flags & VIA_UDMA) >= VIA_UDMA_100)
165 ap->cbl = via_cable_detect(ap); 165 ap->cbl = via_cable_detect(ap);
166 else 166 /* The UDMA66 series has no cable detect so do drive side detect */
167 else if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
167 ap->cbl = ATA_CBL_PATA40; 168 ap->cbl = ATA_CBL_PATA40;
169 else
170 ap->cbl = ATA_CBL_PATA_UNK;
171
172
168 return ata_std_prereset(ap); 173 return ata_std_prereset(ap);
169} 174}
170 175
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 3ea345cde52e..5d1f518e1cc7 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -206,8 +206,8 @@ static __init int winbond_init_one(unsigned long port)
206 */ 206 */
207 207
208 pdev = platform_device_register_simple(DRV_NAME, nr_winbond_host, NULL, 0); 208 pdev = platform_device_register_simple(DRV_NAME, nr_winbond_host, NULL, 0);
209 if (pdev == NULL) 209 if (IS_ERR(pdev))
210 return -ENOMEM; 210 return PTR_ERR(pdev);
211 211
212 memset(&ae, 0, sizeof(struct ata_probe_ent)); 212 memset(&ae, 0, sizeof(struct ata_probe_ent));
213 INIT_LIST_HEAD(&ae.node); 213 INIT_LIST_HEAD(&ae.node);
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index db32d15b7fa1..d89c9590b845 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -56,6 +56,8 @@
56#define DRV_VERSION "2.0" 56#define DRV_VERSION "2.0"
57 57
58enum { 58enum {
59 K2_FLAG_NO_ATAPI_DMA = (1 << 29),
60
59 /* Taskfile registers offsets */ 61 /* Taskfile registers offsets */
60 K2_SATA_TF_CMD_OFFSET = 0x00, 62 K2_SATA_TF_CMD_OFFSET = 0x00,
61 K2_SATA_TF_DATA_OFFSET = 0x00, 63 K2_SATA_TF_DATA_OFFSET = 0x00,
@@ -83,11 +85,33 @@ enum {
83 85
84 /* Port stride */ 86 /* Port stride */
85 K2_SATA_PORT_OFFSET = 0x100, 87 K2_SATA_PORT_OFFSET = 0x100,
88
89 board_svw4 = 0,
90 board_svw8 = 1,
91};
92
93static const struct k2_board_info {
94 unsigned int n_ports;
95 unsigned long port_flags;
96} k2_board_info[] = {
97 /* board_svw4 */
98 { 4, K2_FLAG_NO_ATAPI_DMA },
99
100 /* board_svw8 */
101 { 8, K2_FLAG_NO_ATAPI_DMA },
86}; 102};
87 103
88static u8 k2_stat_check_status(struct ata_port *ap); 104static u8 k2_stat_check_status(struct ata_port *ap);
89 105
90 106
107static int k2_sata_check_atapi_dma(struct ata_queued_cmd *qc)
108{
109 if (qc->ap->flags & K2_FLAG_NO_ATAPI_DMA)
110 return -1; /* ATAPI DMA not supported */
111
112 return 0;
113}
114
91static u32 k2_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) 115static u32 k2_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
92{ 116{
93 if (sc_reg > SCR_CONTROL) 117 if (sc_reg > SCR_CONTROL)
@@ -313,6 +337,7 @@ static const struct ata_port_operations k2_sata_ops = {
313 .check_status = k2_stat_check_status, 337 .check_status = k2_stat_check_status,
314 .exec_command = ata_exec_command, 338 .exec_command = ata_exec_command,
315 .dev_select = ata_std_dev_select, 339 .dev_select = ata_std_dev_select,
340 .check_atapi_dma = k2_sata_check_atapi_dma,
316 .bmdma_setup = k2_bmdma_setup_mmio, 341 .bmdma_setup = k2_bmdma_setup_mmio,
317 .bmdma_start = k2_bmdma_start_mmio, 342 .bmdma_start = k2_bmdma_start_mmio,
318 .bmdma_stop = ata_bmdma_stop, 343 .bmdma_stop = ata_bmdma_stop,
@@ -359,6 +384,8 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
359 struct ata_probe_ent *probe_ent = NULL; 384 struct ata_probe_ent *probe_ent = NULL;
360 unsigned long base; 385 unsigned long base;
361 void __iomem *mmio_base; 386 void __iomem *mmio_base;
387 const struct k2_board_info *board_info =
388 &k2_board_info[ent->driver_data];
362 int pci_dev_busy = 0; 389 int pci_dev_busy = 0;
363 int rc; 390 int rc;
364 int i; 391 int i;
@@ -424,7 +451,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
424 451
425 probe_ent->sht = &k2_sata_sht; 452 probe_ent->sht = &k2_sata_sht;
426 probe_ent->port_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 453 probe_ent->port_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
427 ATA_FLAG_MMIO; 454 ATA_FLAG_MMIO | board_info->port_flags;
428 probe_ent->port_ops = &k2_sata_ops; 455 probe_ent->port_ops = &k2_sata_ops;
429 probe_ent->n_ports = 4; 456 probe_ent->n_ports = 4;
430 probe_ent->irq = pdev->irq; 457 probe_ent->irq = pdev->irq;
@@ -441,7 +468,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
441 /* different controllers have different number of ports - currently 4 or 8 */ 468 /* different controllers have different number of ports - currently 4 or 8 */
442 /* All ports are on the same function. Multi-function device is no 469 /* All ports are on the same function. Multi-function device is no
443 * longer available. This should not be seen in any system. */ 470 * longer available. This should not be seen in any system. */
444 for (i = 0; i < ent->driver_data; i++) 471 for (i = 0; i < board_info->n_ports; i++)
445 k2_sata_setup_port(&probe_ent->port[i], base + i * K2_SATA_PORT_OFFSET); 472 k2_sata_setup_port(&probe_ent->port[i], base + i * K2_SATA_PORT_OFFSET);
446 473
447 pci_set_master(pdev); 474 pci_set_master(pdev);
@@ -469,11 +496,11 @@ err_out:
469 * controller 496 * controller
470 * */ 497 * */
471static const struct pci_device_id k2_sata_pci_tbl[] = { 498static const struct pci_device_id k2_sata_pci_tbl[] = {
472 { PCI_VDEVICE(SERVERWORKS, 0x0240), 4 }, 499 { PCI_VDEVICE(SERVERWORKS, 0x0240), board_svw4 },
473 { PCI_VDEVICE(SERVERWORKS, 0x0241), 4 }, 500 { PCI_VDEVICE(SERVERWORKS, 0x0241), board_svw4 },
474 { PCI_VDEVICE(SERVERWORKS, 0x0242), 8 }, 501 { PCI_VDEVICE(SERVERWORKS, 0x0242), board_svw8 },
475 { PCI_VDEVICE(SERVERWORKS, 0x024a), 4 }, 502 { PCI_VDEVICE(SERVERWORKS, 0x024a), board_svw4 },
476 { PCI_VDEVICE(SERVERWORKS, 0x024b), 4 }, 503 { PCI_VDEVICE(SERVERWORKS, 0x024b), board_svw4 },
477 504
478 { } 505 { }
479}; 506};