From: Aaron Lu <aaron.lu@intel.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jgarzik@pobox.com>, Borislav Petkov <bp@alien8.de>,
Dutra Julio <dutra.julio@gmail.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Tejun Heo <tj@kernel.org>, Szymon Janc <szymon@janc.net.pl>,
Bernd Buschinski <b.buschinski@googlemail.com>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] libata: fix ata_dma_enabled
Date: Mon, 3 Dec 2012 09:35:49 +0800 [thread overview]
Message-ID: <20121203013548.GA1396@mint-spring.sh.intel.com> (raw)
In-Reply-To: <20121203012225.00e0c121@pyramind.ukuu.org.uk>
On Mon, Dec 03, 2012 at 01:22:25AM +0000, Alan Cox wrote:
> On Mon, 03 Dec 2012 09:04:20 +0800
> Aaron Lu <aaron.lu@intel.com> wrote:
>
> >
> > ata_dma_enabled should check if device is either using multi word DMA
> > or ultra DMA instead of checking 0xff, as dma_mode 0 is not a valid dma
> > mode either.
> >
> > This patch fixes the following bug:
> > https://bugzilla.kernel.org/show_bug.cgi?id=49151
>
> NAK
>
> dma_mode should *NEVER* be zero. If it's getting set to zero you have
> another bug and that needs fixing instead
The ata_dev->dma_mode is initialized as zero after we allocate the
ata_device structure, and we did not set this field until the set mode
function.
If you think it should _never_ be zero, probably my previous patch did
the job: it sets ata_dev->dma_mode to 0xff in the reset operation:
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9426423..d772d66 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2657,6 +2657,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
* bus as we may be talking too fast.
*/
dev->pio_mode = XFER_PIO_0;
+ dev->dma_mode = 0xff;
/* If the controller has a pio mode setup function
* then use it to set the chipset to rights. Don't
So do you prefer this?
Thanks,
Aaron
>
> Alan
next prev parent reply other threads:[~2012-12-03 1:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 1:04 [PATCH] libata: fix ata_dma_enabled Aaron Lu
2012-12-03 1:22 ` Alan Cox
2012-12-03 1:35 ` Aaron Lu [this message]
2012-12-03 1:46 ` Alan Cox
2012-12-03 3:35 ` [PATCH] libata: set dma_mode to 0xff in reset Aaron Lu
2012-12-03 9:43 ` Alan Cox
2012-12-03 10:07 ` 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=20121203013548.GA1396@mint-spring.sh.intel.com \
--to=aaron.lu@intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=b.buschinski@googlemail.com \
--cc=bp@alien8.de \
--cc=dutra.julio@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=phillip.wood@dunelm.org.uk \
--cc=szymon@janc.net.pl \
--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 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.