Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269321
b: refs/heads/master
c: f30f9a5
h: refs/heads/master
i:
  269319: 338158b
v: v3
  • Loading branch information
Dan McGee authored and Jeff Garzik committed Oct 8, 2011
1 parent 86f3d8e commit d6e61ec
Show file tree
Hide file tree
Showing 2 changed files with 27 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: 023a0175ad4beaa14b303e133963c971ad31c338
refs/heads/master: f30f9a5e7bc130c727712342dd064ae8d188b170
27 changes: 26 additions & 1 deletion trunk/drivers/ata/pata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,27 @@ static void sis_133_set_dmamode (struct ata_port *ap, struct ata_device *adev)
pci_write_config_dword(pdev, port, t1);
}

/**
* sis_133_mode_filter - mode selection filter
* @adev: ATA device
*
* Block UDMA6 on devices that do not support it.
*/

static unsigned long sis_133_mode_filter(struct ata_device *adev, unsigned long mask)
{
struct ata_port *ap = adev->link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int port = sis_port_base(adev);
u32 t1;

pci_read_config_dword(pdev, port, &t1);
/* if ATA133 is disabled, mask it out */
if (!(t1 & 0x08))
mask &= ~(0xC0 << ATA_SHIFT_UDMA);
return mask;
}

static struct scsi_host_template sis_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
Expand All @@ -530,6 +551,7 @@ static struct ata_port_operations sis_133_ops = {
.set_piomode = sis_133_set_piomode,
.set_dmamode = sis_133_set_dmamode,
.cable_detect = sis_133_cable_detect,
.mode_filter = sis_133_mode_filter,
};

static struct ata_port_operations sis_133_early_ops = {
Expand Down Expand Up @@ -779,10 +801,13 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)

switch(trueid) {
case 0x5518: /* SIS 962/963 */
dev_info(&pdev->dev,
"SiS 962/963 MuTIOL IDE UDMA133 controller\n");
chipset = &sis133;
if ((idemisc & 0x40000000) == 0) {
pci_write_config_dword(pdev, 0x54, idemisc | 0x40000000);
printk(KERN_INFO "SIS5513: Switching to 5513 register mapping\n");
dev_info(&pdev->dev,
"Switching to 5513 register mapping\n");
}
break;
case 0x0180: /* SIS 965/965L */
Expand Down

0 comments on commit d6e61ec

Please sign in to comment.