From: Jeff Garzik <jgarzik@pobox.com>
To: Brad Campbell <brad@wasp.net.au>
Cc: linux-ide@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] libata ATA vs SATA detection and workaround.
Date: Mon, 30 Aug 2004 12:06:58 -0400 [thread overview]
Message-ID: <413350A2.1000003@pobox.com> (raw)
In-Reply-To: <41334058.4050902@wasp.net.au>
Brad Campbell wrote:
> + /* limit bridge transfers to udma5, 200 sectors */
> + if ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device))) {
> + printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
> + ap->id, ap->device->devno);
> + ap->udma_mask &= ATA_UDMA5;
> + ap->host->max_sectors = ATA_MAX_SECTORS;
> + ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
> + ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
> + }
> if (ap->ops->dev_config)
> ap->ops->dev_config(ap, &ap->device[i]);
Close! Please move the entire quoted section, including the two lines
of code calling ->dev_config(), into a new function 'ata_dev_config'.
Export it (bottom of libata-core.c) and prototype it (libata.h) as well.
I'm still pondering what Alan was hinting at, a bit. You (Brad) are
correct in pointing out that this code should only trigger for the
correct situations (lba48, etc.) which are only present on modern
drives, but... there is still a chance that word 93 will be zero on
some weird (probably non-compliant) device.
However, Alan's comment is actually more relevant for unrelated sections
of libata. Whenever we test a feature bit in words 82-87, we should
check for "word != 0 && word != 0xffff" which is how one knows the word
is implemented. There are no feature bits indicating that feature bits
exist :)
Jeff
next prev parent reply other threads:[~2004-08-30 16:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-29 17:09 libata dev_config call order wrong Brad Campbell
2004-08-29 17:29 ` Jeff Garzik
2004-08-29 17:47 ` Brad Campbell
2004-08-29 17:59 ` Jeff Garzik
2004-08-29 18:25 ` Jeff Garzik
2004-08-29 18:59 ` Alan Cox
2004-08-30 9:12 ` Brad Campbell
2004-08-30 13:22 ` Alan Cox
2004-08-30 14:38 ` Brad Campbell
2004-08-30 14:42 ` [PATCH] libata ATA vs SATA detection and workaround Brad Campbell
2004-08-30 14:57 ` Brad Campbell
2004-08-30 14:57 ` Brad Campbell
2004-08-30 16:06 ` Jeff Garzik [this message]
2004-08-30 16:34 ` Brad Campbell
2004-08-30 16:37 ` Jeff Garzik
2004-08-30 17:17 ` Brad Campbell
2004-08-30 17:59 ` Jeff Garzik
2004-08-31 7:47 ` Brad Campbell
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=413350A2.1000003@pobox.com \
--to=jgarzik@pobox.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=brad@wasp.net.au \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.