Re: Question about PATA Sil680 Bus Reset Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Fajun Chen wrote:

Could someone help me interpret the code snippet below:
static int sil680_bus_reset(struct ata_port *ap,unsigned int *classes)
{
       struct pci_dev *pdev = to_pci_dev(ap->host->dev);
       unsigned long addr = sil680_selreg(ap, 0);
       u8 reset;

       pci_read_config_byte(pdev, addr, &reset);
       pci_write_config_byte(pdev, addr, reset | 0x03);   // ?

       udelay(25);
       pci_write_config_byte(pdev, addr, reset);
       return ata_std_softreset(ap, classes);
}

Based on Sil680 data sheet, channel reset bit is bit 2,  why the reset
code above is not "pci_write_config_byte(pdev, addr, reset | 0x04);"?

   I guess it's been blindly copied over form drivers/ide/pci/siimage.c...
The code indeed does seem meaningless. For the libata it could make sense to set bit 2 for the hardreset -- but then sil680_error_handler() needs to be turn into ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, sil680_bus_reset, ata_std_postreset)... For the legacy driver, this function needs to be converted to something sane too...

Thanks in advance!

MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux