linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Mark Lord <liml@rtr.ca>,
	rob.opensuse.linux@googlemail.com
Subject: Re: [PATCH #upstream-fixes 1/3] pata_hpt366: fix cable detection,
Date: Tue, 09 Dec 2008 18:14:20 +0300	[thread overview]
Message-ID: <493E8B4C.4090604@ru.mvista.com> (raw)
In-Reply-To: <493E289F.1010000@kernel.org>

Tejun Heo wrote:

> pata_hpt366 is strange in that its two channels occupy two PCI
> functions and both are primary channels and bit1 of PCI configuration
> register 0x5A indicates cable for both channels.

> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>

    Alas, NAK.

> Index: work/drivers/ata/pata_hpt366.c
> ===================================================================
> --- work.orig/drivers/ata/pata_hpt366.c
> +++ work/drivers/ata/pata_hpt366.c
> @@ -211,11 +211,15 @@ static u32 hpt36x_find_mode(struct ata_p
>  
>  static int hpt36x_cable_detect(struct ata_port *ap)
>  {
> -	u8 ata66;
>  	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
> +	u8 ata66;
>  
> +	/*
> +	 * Each channel of pata_hpt366 occupies separate PCI function
> +	 * as the primary channel and bit1 indicates the cable type.
> +	 */

    No, it doesn't for the secondary channel (which is fucntion 1).

>  	pci_read_config_byte(pdev, 0x5A, &ata66);
> -	if (ata66 & (1 << ap->port_no))
> +	if (ata66 & 2)

    You need to use (pdev->devfn & 1) as a right shift count instead. Not very 
sophisticated indeed. :-)

MBR, Sergei

  parent reply	other threads:[~2008-12-09 15:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09  8:13 [PATCH #upstream-fixes 1/3] pata_hpt366: fix cable detection, Tejun Heo
2008-12-09  8:14 ` [PATCH #upstream-fixes 2/3] pata_hpt366: no ATAPI DMA Tejun Heo
2008-12-09  8:14   ` [PATCH #upstream-fixes 3/3] pata_hpt366: reimplement mode programming Tejun Heo
2008-12-10 12:01     ` Sergei Shtylyov
2008-12-09 10:28   ` [PATCH #upstream-fixes 2/3] pata_hpt366: no ATAPI DMA Alan Cox
2008-12-09  8:15 ` [PATCH #upstream-fixes 1/3] pata_hpt366: fix cable detection, Tejun Heo
2008-12-09 18:50   ` Sergei Shtylyov
2008-12-09 15:14 ` Sergei Shtylyov [this message]
2008-12-09 18:56   ` Sergei Shtylyov
2008-12-10  1:58     ` Tejun Heo
2008-12-16 10:41 ` Jeff Garzik
2008-12-16 11:15   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493E8B4C.4090604@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=rob.opensuse.linux@googlemail.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).