Re: [PATCH] ide: fix drive side 80c cable check

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

 



On Mon, 5 Feb 2007 16:47:13 +0900
Tejun Heo <htejun@xxxxxxxxx> wrote:

> The 80c wire bit is bit 13, not 14.  This increases the chance of
> incorrect wire detection especially because host side cable detection
> is often unreliable and we sometimes soley depend on drive side cable
> detection.  Fix it.
> 
> Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
> ---
> Please consider for -stable.
> 
>  drivers/ide/ide-iops.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: work/drivers/ide/ide-iops.c
> ===================================================================
> --- work.orig/drivers/ide/ide-iops.c
> +++ work/drivers/ide/ide-iops.c
> @@ -604,7 +604,7 @@ u8 eighty_ninty_three (ide_drive_t *driv
>  	if (!(drive->id->hw_config & 0x6000))
>  		return 0;
>  #ifndef CONFIG_IDEDMA_IVB
> -	if(!(drive->id->hw_config & 0x4000))
> +	if (!(drive->id->hw_config & 0x2000))
>  		return 0;
>  #endif /* CONFIG_IDEDMA_IVB */

NAK

While the old code is a mess, your changes don't fix it. The code above
is correct before you touch it as far as I can tell. Incomplete but
correct as far as it went.

The logic in the function as far as it goes is correct

If neither valid bit nor 80pin bit set -> 40pin		[00]
If checking valid bit && valid bit clear -> 40pin	[0x]

The 0x2000 test is needed as an additional test (as per the
ide_ata66_check function directly below)		[10] v [11]

Without this an id value of 0x2000 will trigger 80pin but is not valid.

(the IDEDMA_IVB check is more relaxted to handle some confused ATA4
drives, and is probably something we don't want in libata anyway, or
should blacklist the afflicted for this)

Alan
-
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