From: ming.lei@canonical.com (Ming Lei)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: ehci: fix update qtd->token in qh_append_tds
Date: Sun, 28 Aug 2011 00:57:16 +0800 [thread overview]
Message-ID: <CACVXFVNz_ic_PPM_vNn1Dz85A2z94kRFso4rcqrvJfuLSqRSCg@mail.gmail.com> (raw)
In-Reply-To: <20110827160746.GA11076@kroah.com>
Hi,
Thanks for your comment.
On Sun, Aug 28, 2011 at 12:07 AM, Greg KH <greg@kroah.com> wrote:
>> As Santosh pointed out, mb on ARM will flush L2 write buffer. The
>> description here is wrong.
>
> Then this can't be accepted as-is :)
Yes, I will update it in v1, :-)
>> I think the below should make the writing reach into memory on all
>> ARCH after ' token = dummy->hw_token;' is executed.
>>
>> ? ? ? ? ? ? ? ? ? ? ? ?dummy->hw_token = token;
>> ? ? ? ? ? ? ? ? ? ? ? ?mb()
>> ? ? ? ? ? ? ? ? ? ? ? ?token = dummy->hw_token;
>>
>> The above is the idea introduced to fix the problem.
>
> Are you sure? ?Have you read the documentation about memory barriers to
> confirm this?
I read the doc again, :-), and it mentions few about mb/wmb/rmb, I think
my above description is still not correct. Generally speaking, mb only
means there is a order between two accesses.
Now I think only one mb() after 'dummy->hw_token = token;' is enough:
HC will read the up-to-date value of qtd->hw_token after mb() is executed
because of the effect of the mb(), which should be guaranteed by mb.
> I mean others, please read the the last 3 lines of the comment and
> compare that to the code lines you added.
I see now, the comment of the last 3 lines is wrong, should be
* inside L2 cache. 'token = dummy->hw_token'
* after mb() is added for obeying correct mb()
* usage.
But the 'token = dummy->hw_token' after mb() isn't needed any
more as described above, is it?
thanks,
--
Ming Lei
next prev parent reply other threads:[~2011-08-27 16:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-27 14:48 [PATCH] usb: ehci: fix update qtd->token in qh_append_tds ming.lei at canonical.com
2011-08-27 15:03 ` Santosh
2011-08-27 15:18 ` Ming Lei
2011-08-27 15:46 ` Santosh
2011-08-27 15:13 ` Greg KH
2011-08-27 15:33 ` Ming Lei
2011-08-27 16:07 ` Greg KH
2011-08-27 16:57 ` Ming Lei [this message]
2011-08-27 17:20 ` Ming Lei
2011-08-27 20:11 ` Alan Stern
2011-08-28 3:35 ` Ming Lei
2011-08-27 20:06 ` Alan Stern
2011-08-28 3:13 ` Ming Lei
2011-08-28 17:00 ` Alan Stern
2011-08-28 23:36 ` Russell King - ARM Linux
2011-08-29 1:51 ` Alan Stern
2011-08-29 8:52 ` Russell King - ARM Linux
2011-08-29 13:57 ` Alan Stern
2011-08-29 15:55 ` Ming Lei
2011-08-29 16:24 ` Mark Salter
2011-08-29 14:25 ` Ming Lei
2011-08-29 15:03 ` Alan Stern
2011-08-29 15:21 ` Ming Lei
2011-08-29 16:33 ` Alan Stern
2011-08-30 14:02 ` Ming Lei
2011-08-27 16:31 ` Sergei Shtylyov
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=CACVXFVNz_ic_PPM_vNn1Dz85A2z94kRFso4rcqrvJfuLSqRSCg@mail.gmail.com \
--to=ming.lei@canonical.com \
--cc=linux-arm-kernel@lists.infradead.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).