Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172860
b: refs/heads/master
c: 10734fc
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Dec 3, 2009
1 parent cd6ecf3 commit ee32d31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 294264a94215f5a16a92e8e6b05252ed22fed249
refs/heads/master: 10734fc8d5fbf89e88519d72e58cce83be21941a
27 changes: 27 additions & 0 deletions trunk/drivers/ata/pata_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,32 @@ static void via_set_dmamode(struct ata_port *ap, struct ata_device *adev)
via_do_set_mode(ap, adev, adev->dma_mode, tclock[mode], set_ast, udma[mode]);
}

/**
* via_mode_filter - filter buggy device/mode pairs
* @dev: ATA device
* @mask: Mode bitmask
*
* We need to apply some minimal filtering for old controllers and at least
* one breed of Transcend SSD. Return the updated mask.
*/

static unsigned long via_mode_filter(struct ata_device *dev, unsigned long mask)
{
struct ata_host *host = dev->link->ap->host;
const struct via_isa_bridge *config = host->private_data;
unsigned char model_num[ATA_ID_PROD_LEN + 1];

if (config->id == PCI_DEVICE_ID_VIA_82C586_0) {
ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
if (strcmp(model_num, "TS64GSSD25-M") == 0) {
ata_dev_printk(dev, KERN_WARNING,
"disabling UDMA mode due to reported lockups with this device.\n");
mask &= ~ ATA_MASK_UDMA;
}
}
return ata_bmdma_mode_filter(dev, mask);
}

/**
* via_tf_load - send taskfile registers to host controller
* @ap: Port to which output is sent
Expand Down Expand Up @@ -427,6 +453,7 @@ static struct ata_port_operations via_port_ops = {
.prereset = via_pre_reset,
.sff_tf_load = via_tf_load,
.port_start = via_port_start,
.mode_filter = via_mode_filter,
};

static struct ata_port_operations via_port_ops_noirq = {
Expand Down

0 comments on commit ee32d31

Please sign in to comment.