diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-02 12:14:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-02 12:14:48 -0500 |
commit | e47fddf2470feb228e1d3ff41fc78dad4cfbbcc6 (patch) | |
tree | be16dc950dda26f44aaa09455879acbca7efbcae | |
parent | 222335b755726f539c4a056ce119e017aa4166c4 (diff) | |
parent | 49c8042996c84f0df6c49ea2e28a7ef38cd7d773 (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:
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
-rw-r--r-- | drivers/ata/libata-core.c | 1 | ||||
-rw-r--r-- | drivers/ata/pata_atiixp.c | 11 | ||||
-rw-r--r-- | drivers/ata/pata_jmicron.c | 18 | ||||
-rw-r--r-- | drivers/ata/pata_via.c | 3 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 4 | ||||
-rw-r--r-- | include/linux/libata.h | 2 |
6 files changed, 21 insertions, 18 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index cf707029352e..667acd283364 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -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; |
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_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_via.c b/drivers/ata/pata_via.c index 0219419cae97..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 |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index dcc0c1ab95ed..c913ea4e545c 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1262,8 +1262,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) | |||
1262 | pci_read_config_dword(pdev, 0x40, &conf); | 1262 | pci_read_config_dword(pdev, 0x40, &conf); |
1263 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ | 1263 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ |
1264 | /* Set the class codes correctly and then direct IDE 0 */ | 1264 | /* Set the class codes correctly and then direct IDE 0 */ |
1265 | conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ | 1265 | conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */ |
1266 | conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ | 1266 | conf |= 0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */ |
1267 | pci_write_config_dword(pdev, 0x40, conf); | 1267 | pci_write_config_dword(pdev, 0x40, conf); |
1268 | 1268 | ||
1269 | /* Reconfigure so that the PCI scanner discovers the | 1269 | /* Reconfigure so that the PCI scanner discovers the |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 22aa69e20905..91bb8ceef0b5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1054,6 +1054,8 @@ static inline void ata_pause(struct ata_port *ap) | |||
1054 | /** | 1054 | /** |
1055 | * ata_busy_wait - Wait for a port status register | 1055 | * ata_busy_wait - Wait for a port status register |
1056 | * @ap: Port to wait for. | 1056 | * @ap: Port to wait for. |
1057 | * @bits: bits that must be clear | ||
1058 | * @max: number of 10uS waits to perform | ||
1057 | * | 1059 | * |
1058 | * Waits up to max*10 microseconds for the selected bits in the port's | 1060 | * Waits up to max*10 microseconds for the selected bits in the port's |
1059 | * status register to be cleared. | 1061 | * status register to be cleared. |