History

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: libata: Initialize nbytes for internal sg commands libata: Fix ata_busy_wait() kernel docs pata_via: Correct missing comments pata_atiixp: propogate cable detection hack from drivers/ide to the new driver ahci/pata_jmicron: fix JMicron quirk

Linus Torvalds committed 19 years ago

Commit e47fddf2 parents 222335b 49c80426 files · +21 −18Browse files

Unified · Split

6 files
  1. drivers/ata/libata-core.c +1 −0
  2. drivers/ata/pata_atiixp.c +9 −2
  3. drivers/ata/pata_jmicron.c +5 −13
  4. drivers/ata/pata_via.c +2 −1
  5. drivers/pci/quirks.c +2 −2
  6. include/linux/libata.h +2 −0
drivers/ata/libata-core.c+1−0
@@ -1250,6 +1250,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, · 1249 unmodified lines
12501250
12511251 ata_sg_init(qc, sg, n_elem);
12521252 qc->nsect = buflen / ATA_SECT_SIZE;
1253+ qc->nbytes = buflen;
12531254 }
12541255
12551256 qc->private_data = &wait;
drivers/ata/pata_atiixp.c+9−2
@@ -36,15 +36,22 @@ enum { · 35 unmodified lines
3636 static int atiixp_pre_reset(struct ata_port *ap)
3737 {
3838 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[] = {
4040 { 0x48, 1, 0x01, 0x00 },
4141 { 0x48, 1, 0x08, 0x00 }
4242 };
43+ u8 udma;
4344
4445 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
4546 return -ENOENT;
4647
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;
4855 return ata_std_prereset(ap);
4956 }
5057
drivers/ata/pata_jmicron.c+5−13
@@ -204,20 +204,12 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i · 203 unmodified lines
204204
205205 u32 reg;
206206
207− if (id->driver_data != 368) {
208− /* Put the controller into AHCI mode in case the AHCI driver
209− has not yet been loaded. This can be done with either
210− function present */
207+ /* PATA controller is fn 1, AHCI is fn 0 */
208+ if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
209+ return -ENODEV;
211210
212− /* FIXME: We may want a way to override this in future */
213− pci_write_config_byte(pdev, 0x41, 0xa1);
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 */
211+ /* The 365/66 have two PATA channels, redirect the second */
212+ if (id->driver_data == 365 || id->driver_data == 366) {
221213 pci_read_config_dword(pdev, 0x80, &reg);
222214 reg |= (1 << 24); /* IDE1 to PATA IDE secondary */
223215 pci_write_config_dword(pdev, 0x80, reg);
drivers/ata/pata_via.c+2−1
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 * VIA VT8233c - UDMA100
2424 * VIA VT8235 - UDMA133
2525 * VIA VT8237 - UDMA133
26+ * VIA VT8237S - UDMA133
2627 * VIA VT8251 - UDMA133
2728 *
2829 * Most registers remain compatible across chips. Others start reserved
@@ -61,7 +62,7 @@ · 32 unmodified lines
6162 #include <linux/libata.h>
6263
6364 #define DRV_NAME "pata_via"
64−#define DRV_VERSION "0.2.0"
65+#define DRV_VERSION "0.2.1"
6566
6667 /*
6768 * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
drivers/pci/quirks.c+2−2
@@ -1262,8 +1262,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) · 1261 unmodified lines
12621262 pci_read_config_dword(pdev, 0x40, &conf);
12631263 /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
12641264 /* Set the class codes correctly and then direct IDE 0 */
1265− conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */
1266− conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */
1265+ conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */
1266+ conf |= 0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */
12671267 pci_write_config_dword(pdev, 0x40, conf);
12681268
12691269 /* Reconfigure so that the PCI scanner discovers the
include/linux/libata.h+2−0
@@ -1054,6 +1054,8 @@ static inline void ata_pause(struct ata_port *ap) · 1053 unmodified lines
10541054 /**
10551055 * ata_busy_wait - Wait for a port status register
10561056 * @ap: Port to wait for.
1057+ * @bits: bits that must be clear
1058+ * @max: number of 10uS waits to perform
10571059 *
10581060 * Waits up to max*10 microseconds for the selected bits in the port's
10591061 * status register to be cleared.