Re: [PATCH #upstream-fixes 2/3] pata_hpt366: fix cable detection

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

 



Hello, I wrote:

hpt366 is strange in that its cable detection register uses the higher
bit for master, so the testing should be 2 >> port_no instead of 1 <<

  For primary -- the cable bits are per-channel, not per-device.

port_no.  Fix it.

Info provided by Alan Cox.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>

Acked-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

I have to NAK this. HPT366 design is just too brain damaged for both IDE and libata drivers to get it right so far.

Index: work/drivers/ata/pata_hpt366.c
===================================================================
--- work.orig/drivers/ata/pata_hpt366.c
+++ work/drivers/ata/pata_hpt366.c
@@ -215,7 +215,7 @@ static int hpt36x_cable_detect(struct at
     struct pci_dev *pdev = to_pci_dev(ap->host->dev);
pci_read_config_byte(pdev, 0x5A, &ata66);
-    if (ata66 & (1 << ap->port_no))
+    if (ata66 & (2 >> ap->port_no))

  HPT36x are single channel per function, so the shift can be removed.

   It should be replaced by more sophisticated logic for function 1 in fact...

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