From: "Dorau, Lukasz" <lukasz.dorau@intel.com>
To: Tejun Heo <tj@kernel.org>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] libahci: fix turning on LEDs in ahci_start_port()
Date: Mon, 14 Oct 2013 16:15:55 +0000 [thread overview]
Message-ID: <D9FFE20C522965449E182ACE73889AEB1A6639D7@IRSMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <20131014132049.GB4722@htj.dyndns.org>
On Monday, October 14, 2013 3:21 PM Tejun Heo <tj@kernel.org> wrote:
> On Mon, Oct 14, 2013 at 02:58:19PM +0200, Lukasz Dorau wrote:
> > If EM Transmit bit is busy during init ata_msleep() is called.
> > It is wrong - msleep() should be used instead of ata_msleep(), because
> > if EM Transmit bit is busy for one port, it will be busy for all other
> > ports too, so using ata_msleep() causes wasting tries for another
> > ports.
> >
> > The most common scenario looks like that now (six ports try to
> > transmit a LED meaasege):
> > - port #0 tries for the 1st time and succeeds
> > - ports #1-5 try for the 1st time and sleeps
> > - port #1 tries for the 2nd time and succeeds
> > - ports #2-5 try for the 2nd time and sleeps
> > - port #2 tries for the 3rd time and succeeds
> > - ports #3-5 try for the 3rd time and sleeps
> > - port #3 tries for the 4th time and succeeds
> > - ports #4-5 try for the 4th time and sleeps
> > - port #4 tries for the 5th time and succeeds
> > - port #5 tries for the 5th time and sleeps At this moment port #5
> > wasted all its five tries and failed to initialize.
> > Because there are only 5 (EM_MAX_RETRY) tries available usually only
> > five ports succeed to initialize. The sixth port and next ones usually will fail.
> >
> > If msleep() is used instead of ata_msleep() the first port succeeds to
> > initialize in the first try and next ones usually succeed to initialize in the second
> try.
>
> Ah, interesting.
>
> > Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
> > ---
> > drivers/ata/libahci.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index
> > acfd0f7..cf38692 100644
> > --- a/drivers/ata/libahci.c
> > +++ b/drivers/ata/libahci.c
> > @@ -779,7 +779,7 @@ static void ahci_start_port(struct ata_port *ap)
> > emp->led_state,
> > 4);
> > if (rc == -EBUSY)
> > - ata_msleep(ap, 1);
> > + msleep(1);
>
> This is so unobvious. Can you please add a comment explaining what's going
> on?
>
OK, I will send the second version of the patch soon.
Thanks,
Lukasz
prev parent reply other threads:[~2013-10-14 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 12:58 Lukasz Dorau
2013-10-14 13:20 ` Tejun Heo
2013-10-14 16:15 ` Dorau, Lukasz [this message]
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=D9FFE20C522965449E182ACE73889AEB1A6639D7@IRSMSX105.ger.corp.intel.com \
--to=lukasz.dorau@intel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 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®