From: Tejun Heo <htejun@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: akpm@osdl.org, jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata: Handle SATA bridges better
Date: Mon, 21 May 2007 16:22:24 +0200 [thread overview]
Message-ID: <4651AB20.7070103@gmail.com> (raw)
In-Reply-To: <20070521151332.4ec9ea1d@the-village.bc.nu>
Alan Cox wrote:
> In some situations we find that SATA devices are attached via PATA/SATA
> bridges. When we find this we need to change a couple of bits of behaviour
>
> - Error changedown behaviour for SATA is different - no point
> dropping to PIO
> - 40/80 wire cable detection testing cannot be done.
>
> Thus we need to detect this case and update the cable type accordingly.
>
> Signed-off-by: Alan Cox <alan@redhat.com>
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc1-mm1/drivers/ata/libata-core.c linux-2.6.22-rc1-mm1/drivers/ata/libata-core.c
> --- linux.vanilla-2.6.22-rc1-mm1/drivers/ata/libata-core.c 2007-05-18 16:22:53.000000000 +0100
> +++ linux-2.6.22-rc1-mm1/drivers/ata/libata-core.c 2007-05-18 16:40:23.000000000 +0100
> @@ -2186,6 +2186,16 @@
> if (ap->ops->cable_detect)
> ap->cbl = ap->ops->cable_detect(ap);
>
> + /* We may have SATA bridge glue hiding here irrespective of the
> + reported cable types and sensed types */
> + for (i = 0; i < ATA_MAX_DEVICES; i++) {
> + dev = &ap->device[i];
> + if (!ata_dev_enabled(dev))
> + continue;
> + if (ata_id_is_sata(dev->id))
> + ap->cbl = ATA_CBL_SATA;
> + }
> +
I'm not sure this is correct. The SATA bridge can be at the far side of
PATA cable near to the drive. ie.
PATA host <========= PATA cable ==========> P/SATA bridge : SATA drive
In this case, most of the cable is PATA and cable detection matters.
Another problem is that there are still codes which interpret ap->cbl ==
ATA_CBL_SATA as SATA host port. They need to be fixed first before
using ap->cbl for the actual cable type.
--
tejun
next prev parent reply other threads:[~2007-05-21 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-21 14:13 [PATCH] libata: Handle SATA bridges better Alan Cox
2007-05-21 14:22 ` Tejun Heo [this message]
2007-05-21 14:47 ` Alan Cox
2007-05-21 14:52 ` Tejun Heo
2007-05-21 16:14 ` Alan Cox
2007-05-21 16:12 ` 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=4651AB20.7070103@gmail.com \
--to=htejun@gmail.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.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).