Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73225
b: refs/heads/master
c: 6bbfd53
h: refs/heads/master
i:
  73223: 61dc8da
v: v3
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Nov 5, 2007
1 parent 7c94d5d commit 401192f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73946f9fc5be1433f1e182d11303188390ff242f
refs/heads/master: 6bbfd53d47abd1fb20d7c93a9b19a75970b66f49
21 changes: 20 additions & 1 deletion trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4241,6 +4241,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "ST340823A", NULL, ATA_HORKAGE_HPA_SIZE, },
{ "ST320413A", NULL, ATA_HORKAGE_HPA_SIZE, },

/* Devices which get the IVB wrong */
{ "QUANTUM FIREBALLlct10 05", "A03.0900", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202J", "SB00", ATA_HORKAGE_IVB, },

/* End Marker */
{ }
};
Expand Down Expand Up @@ -4301,6 +4305,21 @@ static int ata_dma_blacklisted(const struct ata_device *dev)
return (dev->horkage & ATA_HORKAGE_NODMA) ? 1 : 0;
}

/**
* ata_is_40wire - check drive side detection
* @dev: device
*
* Perform drive side detection decoding, allowing for device vendors
* who can't follow the documentation.
*/

static int ata_is_40wire(struct ata_device *dev)
{
if (dev->horkage & ATA_HORKAGE_IVB)
return ata_drive_40wire_relaxed(dev->id);
return ata_drive_40wire(dev->id);
}

/**
* ata_dev_xfermask - Compute supported xfermask of the given device
* @dev: Device to compute xfermask for
Expand Down Expand Up @@ -4370,7 +4389,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
if (xfer_mask & (0xF8 << ATA_SHIFT_UDMA))
/* UDMA/44 or higher would be available */
if ((ap->cbl == ATA_CBL_PATA40) ||
(ata_drive_40wire(dev->id) &&
(ata_is_40wire(dev) &&
(ap->cbl == ATA_CBL_PATA_UNK ||
ap->cbl == ATA_CBL_PATA80))) {
ata_dev_printk(dev, KERN_WARNING,
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/ata.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,15 @@ static inline int ata_drive_40wire(const u16 *dev_id)
return 1;
}

static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
{
if (ata_id_is_sata(dev_id))
return 0; /* SATA */
if ((dev_id[93] & 0x2000) == 0x2000)
return 0; /* 80 wire */
return 1;
}

static inline int atapi_cdb_len(const u16 *dev_id)
{
u16 tmp = dev_id[0] & 0x3;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ enum {
ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */
ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */
ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */
ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */

/* DMA mask for user DMA control: User visible values; DO NOT
renumber */
Expand Down

0 comments on commit 401192f

Please sign in to comment.