From: Tejun Heo <tj@kernel.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "David Müller" <dave.mueller@gmx.ch>,
jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata: Fix a large collection of DMA mode mismatches
Date: Sun, 03 Aug 2008 13:45:51 +0900 [thread overview]
Message-ID: <489537FF.7050106@kernel.org> (raw)
In-Reply-To: <20080801091834.5ca39334@lxorguk.ukuu.org.uk>
Hello, Alan.
Yeap, this approach looks much better. Just few nits.
Alan Cox wrote:
> @@ -1427,6 +1427,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies,
> return from_jiffies + msecs_to_jiffies(timeout_msecs);
> }
>
> +/* Don't open code these in drivers as there are traps. Firstly the range may
> + change in future hardware and specs, secondly 0xFF means 'no DMA' but is
> + > UDMA_0. Dyma ddreigiau */
I suppose "Dyma ddreigiau" is just contamination? Also, can you please
use similar patch formatting as other comments for consistency?
> +static inline int ata_using_mwdma(struct ata_device *adev)
> +{
> + if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4)
> + return 1;
> + return 0;
> +}
> +
> +static inline int ata_using_udma(struct ata_device *adev)
> +{
> + if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7)
> + return 1;
> + return 0;
> +}
> +
> +static inline int ata_dma_enabled(struct ata_device *adev)
> +{
> + return (adev->dma_mode == 0xFF ? 0 : 1);
> +}
Wouldn't it be better to use ata_using_dma() instead like the other two?
Thanks.
--
tejun
next prev parent reply other threads:[~2008-08-03 4:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 8:18 [PATCH] libata: Fix a large collection of DMA mode mismatches Alan Cox
2008-08-01 11:56 ` David Müller
2008-08-01 22:42 ` Alan Cox
2008-08-03 4:45 ` Tejun Heo [this message]
2008-08-03 13:08 ` Alan Cox
2008-08-03 14:02 ` Tejun Heo
2008-08-22 6:28 ` 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=489537FF.7050106@kernel.org \
--to=tj@kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dave.mueller@gmx.ch \
--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).