From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org, albertcc@tw.ibm.com, alan@lxorguk.ukuu.org.uk
Subject: Re: [PATCH 1/5] libata: make ata_dev_knobble() per-device
Date: Thu, 26 Jan 2006 23:33:36 -0500 [thread overview]
Message-ID: <43D9A2A0.2080801@pobox.com> (raw)
In-Reply-To: <11382890432663-git-send-email-htejun@gmail.com>
Tejun Heo wrote:
> ata_dev_knobble() unconditionally used the first device of the port to
> determine whether a device is bridged or not. This causes bridge
> limit to be incorrectly applied or unapplied for hosts with slave
> devices (e.g. ata_piix).
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
>
> ---
>
> drivers/scsi/libata-core.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> 315dd661a46e94e44c6f9481465bac93f8ea84ef
> diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
> index f6511bd..c92f96f 100644
> --- a/drivers/scsi/libata-core.c
> +++ b/drivers/scsi/libata-core.c
> @@ -1483,9 +1483,10 @@ err_out:
> }
>
>
> -static inline u8 ata_dev_knobble(const struct ata_port *ap)
> +static inline u8 ata_dev_knobble(const struct ata_port *ap,
> + struct ata_device *dev)
> {
> - return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
> + return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id)));
> }
>
> /**
> @@ -1500,9 +1501,9 @@ static inline u8 ata_dev_knobble(const s
> void ata_dev_config(struct ata_port *ap, unsigned int i)
> {
> /* limit bridge transfers to udma5, 200 sectors */
> - if (ata_dev_knobble(ap)) {
> + if (ata_dev_knobble(ap, &ap->device[i])) {
> printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
> - ap->id, ap->device->devno);
> + ap->id, i);
patch is OK, but at the same time you should
1) remove the inline, its out of fashion
2) make ata_dev_knobble() return [machine] int rather than u8. It's
really just a bool.
BTW, if you were bored one day, it would be nice to figure out how to
use gcc's [and C99's] bool type for stuff like this.
next prev parent reply other threads:[~2006-01-27 4:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-26 15:24 [PATCHSET] libata: fixes regarding configuration Tejun Heo
2006-01-26 15:24 ` [PATCH 5/5] libata: kill sht->max_sectors Tejun Heo
2006-01-26 15:24 ` [PATCH 2/5] libata: don't do EDD handling if ->probe_reset is used Tejun Heo
2006-01-27 4:30 ` Jeff Garzik
2006-01-26 15:24 ` [PATCH 4/5] libata: add per-device max_sectors Tejun Heo
2006-01-26 15:24 ` [PATCH 1/5] libata: make ata_dev_knobble() per-device Tejun Heo
2006-01-27 4:33 ` Jeff Garzik [this message]
2006-01-26 15:24 ` [PATCH 3/5] libata: move cdb_len for host to device Tejun Heo
2006-01-27 4:36 ` Jeff Garzik
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=43D9A2A0.2080801@pobox.com \
--to=jgarzik@pobox.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=htejun@gmail.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).