From 08ebd43d6b9b63de681b8f255c0fabae8033527c Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sun, 2 Sep 2007 21:01:32 +0200 Subject: Fix broken pata_via cable detection via_do_set_mode overwrites 80-wire cable detection bits. Let's preserve them. Signed-off-by: Laurent Riffard Acked-by: Alan Cox Signed-off-by: Jeff Garzik --- drivers/ata/pata_via.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index ea18e33f50ef..1b0acafad1a6 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -243,7 +243,6 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo int ut; int offset = 3 - (2*ap->port_no) - adev->devno; - /* Calculate the timing values we require */ ata_timing_compute(adev, mode, &t, T, UT); @@ -290,9 +289,17 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07; break; } + /* Set UDMA unless device is not UDMA capable */ - if (udma_type) - pci_write_config_byte(pdev, 0x50 + offset, ut); + if (udma_type) { + u8 cable80_status; + + /* Get 80-wire cable detection bit */ + pci_read_config_byte(pdev, 0x50 + offset, &cable80_status); + cable80_status &= 0x10; + + pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status); + } } static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) -- cgit v1.2.3 From bce7d5e0e1fc0c1f1251b7f21a19cb48207408b6 Mon Sep 17 00:00:00 2001 From: Jeff Norden Date: Tue, 4 Sep 2007 11:07:20 -0500 Subject: pata_it821x: fix lost interrupt with atapi devices Fix "lost" interrupt problem when using dma with CD/DVD drives in some configurations. This problem can make installing linux from media impossible for distro's that have switched to libata-only configurations. The simple fix is to eliminate the use of dma for reading drive status, etc, by checking the number of bytes to transferred. This change will only affect the behavior of atapi devices, not disks. There is more info at http://bugzilla.redhat.com/show_bug.cgi?id=242229 This patch is for 2.6.22.1 Signed-off-by: Jeff Norden Reviewed-by: Alan Cox Signed-off-by: Jeff Garzik --- drivers/ata/pata_it821x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index ed637ae33ece..5d8b91e70ecd 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -533,6 +533,10 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc) struct ata_port *ap = qc->ap; struct it821x_dev *itdev = ap->private_data; + /* Only use dma for transfers to/from the media. */ + if (qc->nbytes < 2048) + return -EOPNOTSUPP; + /* No ATAPI DMA in smart mode */ if (itdev->smart) return -EOPNOTSUPP; -- cgit v1.2.3 From b311ec4ae82b1dc337689e966dcf9c5f6a53877e Mon Sep 17 00:00:00 2001 From: Joseph Chan Date: Mon, 10 Sep 2007 22:06:01 -0400 Subject: [libata, IDE] add new VIA bridge to VIA PATA drivers Signed-off-by: Joseph Chan Signed-off-by: Jeff Garzik --- drivers/ata/pata_via.c | 1 + drivers/ide/pci/via82cxxx.c | 1 + include/linux/pci_ids.h | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 1b0acafad1a6..636c4f1a0b24 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -97,6 +97,7 @@ static const struct via_isa_bridge { u8 rev_max; u16 flags; } via_isa_bridges[] = { + { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 581316f9581d..8c539381d622 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -74,6 +74,7 @@ static struct via_isa_bridge { u8 udma_mask; u8 flags; } via_isa_bridges[] = { + { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 17168f3cc73f..d41747b9fd15 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1343,6 +1343,7 @@ #define PCI_DEVICE_ID_VIA_8231_4 0x8235 #define PCI_DEVICE_ID_VIA_8365_1 0x8305 #define PCI_DEVICE_ID_VIA_CX700 0x8324 +#define PCI_DEVICE_ID_VIA_VX800 0x8353 #define PCI_DEVICE_ID_VIA_8371_1 0x8391 #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 #define PCI_DEVICE_ID_VIA_838X_1 0xB188 -- cgit v1.2.3 From 3dcc323fe8d7158bd662c04d41ba8b25fa3ce27b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 3 Sep 2007 12:20:11 +0900 Subject: libata clear horkage on ata_dev_init() dev->horkage should be cleared over device hotunplug/plug. Clear it in ata_dev_init(). Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/ata/libata-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a3ee087223de..c43de9a710db 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6035,6 +6035,7 @@ void ata_dev_init(struct ata_device *dev) */ spin_lock_irqsave(ap->lock, flags); dev->flags &= ~ATA_DFLAG_INIT_MASK; + dev->horkage = 0; spin_unlock_irqrestore(ap->lock, flags); memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0, -- cgit v1.2.3