From: Tejun Heo <tj@kernel.org>
To: Jian Peng <jipeng2005@gmail.com>
Cc: Valdis.Kletnieks@vt.edu, "Rafael J. Wysocki" <rjw@sisk.pl>,
Jeff Garzik <jgarzik@pobox.com>,
Michael Leun <lkml20100708@newton.leun.net>,
linux-ide@vger.kernel.org,
Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2.6.38-rc7] Revert "libata: ahci_start_engine compliant to AHCI spec"
Date: Mon, 23 May 2011 14:13:10 +0200 [thread overview]
Message-ID: <20110523121310.GA24439@htj.dyndns.org> (raw)
In-Reply-To: <BANLkTi=iNjWsaYCJqP057FkhAXtab5nS=Q@mail.gmail.com>
Hello,
On Fri, May 20, 2011 at 10:02:56AM -0700, Jian Peng wrote:
> Hi, Tejun/Valdis,
>
> Since this is an interoperability issue of SATA host controller, the first
> step I want to try it to make sure the tweak that MAKE my controller WORK
> does not break other controllers.
> You are both right that adding this majic 5ms delay at this place should not
> be the final solution.
>
> If this magic 5ms delay works on other affected systems, I plan to post a
> new patch that inside ahci_start_engine(), still perform same check, and
> show warning message if failed, but will set a flag, then still set START
> bit, and if there is such failure flag, add 5ms delay.
Yeah, sounds like a plan but please add ample comment explaining
what's going on for which controller including link to the mailing
list threads. As we're basically adding a black magic, I would still
like to enable it only for the affected controllers so that we don't
have to worry whether there are controllers which are affected by this
problem but we don't know about.
> --- a/drivers/ata/libahci.c 2011-05-18 14:23:36.564665643 -0700
> +++ c/drivers/ata/libahci.c 2011-05-20 09:48:06.194663506 -0700
> @@ -540,6 +540,7 @@
> void __iomem *port_mmio = ahci_port_base(ap);
> u32 tmp;
> u8 status;
> + int err = 0;
I think
bool stat_failed = false;
would be more in line with recent coding style.
> status = readl(port_mmio + PORT_TFDATA) & 0xFF;
>
> @@ -553,12 +554,12 @@
> * specific controller will fail under this condition
> */
> if (status & (ATA_BUSY | ATA_DRQ))
> - return;
> + err = 1;
> else {
> ahci_scr_read(&ap->link, SCR_STATUS, &tmp);
>
> if ((tmp & 0xf) != 0x3)
> - return;
> + err = 1;
> }
>
> /* start DMA */
> @@ -566,6 +567,13 @@
> tmp |= PORT_CMD_START;
> writel(tmp, port_mmio + PORT_CMD);
> readl(port_mmio + PORT_CMD); /* flush */
> +
> + /* Some controllers need longer time to be ready */
> + if(err) {
> + printk(KERN_WARNING
> + "Controller in wrong state when setting START bit\n");
> + msleep(5);
ata_port_printk()?
Thanks.
--
tejun
next prev parent reply other threads:[~2011-05-23 12:13 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 22:25 AHCI driver problem on SB700/SB800 w/ Acer Ferrari One Rafael J. Wysocki
2011-05-13 12:37 ` AHCI driver problem on ICH (Re: AHCI driver problem on SB700/SB800 w/ Acer Ferrari One) Michael Leun
2011-05-13 16:56 ` Rafael J. Wysocki
2011-05-13 17:39 ` Tejun Heo
2011-05-13 19:54 ` Michael Leun
2011-05-13 20:20 ` Rafael J. Wysocki
2011-05-13 20:22 ` Rafael J. Wysocki
2011-05-13 20:44 ` Rafael J. Wysocki
2011-05-14 2:08 ` Robert Hancock
2011-05-14 10:18 ` Tejun Heo
2011-05-14 10:28 ` [PATCH v2.6.38-rc7] Revert "libata: ahci_start_engine compliant to AHCI spec" Tejun Heo
2011-05-14 17:47 ` Linus Torvalds
2011-05-14 18:49 ` Jeff Garzik
[not found] ` <BANLkTik1nFKX1Eyov_o0Xd0rr01Si5hSqA@mail.gmail.com>
2011-05-15 9:25 ` Rafael J. Wysocki
2011-05-15 12:20 ` Michael Leun
2011-05-16 17:02 ` Valdis.Kletnieks
[not found] ` <BANLkTin7NgUMXSVyKn6P0TCrFZ5uaaRL1w@mail.gmail.com>
2011-05-18 19:44 ` Rafael J. Wysocki
[not found] ` <BANLkTimZ9pe-FhkJYHTG1Jx8MUPrMHSFbA@mail.gmail.com>
[not found] ` <BANLkTim9_1Xt8oE4awbCO1iKUW96YUOv_A@mail.gmail.com>
2011-05-19 10:19 ` Rafael J. Wysocki
[not found] ` <BANLkTin6+2obBm=+5Kd5Za1Lq-n4UQ-STw@mail.gmail.com>
2011-05-19 21:32 ` Rafael J. Wysocki
[not found] ` <BANLkTikR2E2vb=9_ftLS4pcq0ysje7Rqyg@mail.gmail.com>
2011-05-19 22:03 ` Rafael J. Wysocki
2011-05-20 15:40 ` Valdis.Kletnieks
2011-05-20 15:43 ` Tejun Heo
2011-05-20 18:21 ` Jian Peng
[not found] ` <BANLkTi=iNjWsaYCJqP057FkhAXtab5nS=Q@mail.gmail.com>
2011-05-20 18:25 ` Valdis.Kletnieks
2011-05-22 2:00 ` Jian Peng
2011-05-23 12:13 ` Tejun Heo [this message]
2011-05-24 1:04 ` Jian Peng
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=20110523121310.GA24439@htj.dyndns.org \
--to=tj@kernel.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=jgarzik@pobox.com \
--cc=jipeng2005@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=lkml20100708@newton.leun.net \
--cc=rjw@sisk.pl \
/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
all inboxes | Powered by JetHome®