All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Avery Pennarun <apenwarr@gmail.com>
Cc: Adrian Chadd <adrian@freebsd.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: Missing memory barriers
Date: Thu, 6 Mar 2014 15:34:34 +0200	[thread overview]
Message-ID: <8761nrsb6d.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CAHqTa-0L5oJKSuJ9XEsprKJciMsEa5aFfLpaBLZ4Jsxw59XAmQ@mail.gmail.com> (Avery Pennarun's message of "Thu, 27 Feb 2014 22:10:31 -0800")

Avery Pennarun <apenwarr@gmail.com> writes:

> On Thu, Feb 27, 2014 at 7:48 AM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Avery Pennarun <apenwarr@gmail.com> writes:
>>> - there are definitely some missing memory barriers in here; in a few
>>> cases you can clearly see a write getting done before the read that
>>> came before it.  Looking at the definitions for iowrite32 and
>>> ioread32, and for rmb() and wmb(), we can see that the use of rmb()
>>> and wmb() do not work properly (at least on ARM) when you care about
>>> the ordering between reads and writes.  However, I don't think this
>>> actually causes the problem.
>>
>> Can you tell more about this, please? Did you find out where we are
>> actually doing it wrong?
>
> Sure.  It's been a while since I wrote the above and it was with an
> older version of the ath10k driver, but basically what happens is as
> follows.

[...]

> The bad news is that, while inserting the extra barrier did clean up
> my bus trace, it didn't fix the underlying problem.  When the chip
> dies due to this cold reset operation, the inability to read the
> status register is only a symptom, not the cause.  In the end it's
> harmless that we end up doing the first read before the write
> operation finishes.  What happens isn't what the code says, but I
> don't think that matters in this case.

Thanks for the excellent write up, I understand this better now. I
wasn't expecting that this would fix the cold reset issue, but these
kind of issues should be good to fix anyway. You never know what kind of
bugs they might cause in the future.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2014-03-06 13:35 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 17:18 ath10k driver crashes whenever firmware crashes on ARM SoC Avery Pennarun
2014-01-28 18:20 ` Ben Greear
2014-01-28 18:34   ` Avery Pennarun
2014-01-28 19:01     ` Ben Greear
2014-01-28 19:11       ` Avery Pennarun
2014-01-28 20:10     ` Janusz Dziedzic
2014-01-28 20:51       ` Avery Pennarun
2014-01-29 16:44     ` Kalle Valo
     [not found] ` <CAJ-VmokorbJ2iU4rGNYdRj+A22NR9cV-5h-tDN0pD2FCurZDpA@mail.gmail.com>
2014-01-28 20:55   ` Avery Pennarun
2014-01-29 16:41 ` Kalle Valo
2014-01-29 18:44   ` Adrian Chadd
2014-01-30  2:41     ` Avery Pennarun
2014-02-09  8:00       ` Avery Pennarun
2014-02-27 15:48         ` Missing memory barriers Kalle Valo
2014-02-28  6:10           ` Avery Pennarun
2014-03-06 13:34             ` Kalle Valo [this message]
2014-03-11  7:33         ` ath10k driver crashes whenever firmware crashes on ARM SoC Kalle Valo
2014-03-11  7:40           ` Avery Pennarun
2014-03-11  7:52             ` Adrian Chadd
2014-03-11  7:59               ` Avery Pennarun
2014-03-11  8:13               ` Kalle Valo
2014-03-11  8:37                 ` Michal Kazior
2014-03-11  8:10             ` Kalle Valo
2014-03-11 19:01           ` Ben Greear
2014-03-12  8:22             ` Kalle Valo
2014-03-12 16:01               ` Ben Greear
2014-03-12 23:28                 ` Avery Pennarun
2014-03-13  5:09                   ` Kalle Valo
2014-03-13 17:34                     ` Adrian Chadd
2014-03-13 17:39                       ` Kalle Valo
2014-03-13 17:42                       ` Ben Greear
2014-03-14  6:26                         ` Kalle Valo

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=8761nrsb6d.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=adrian@freebsd.org \
    --cc=apenwarr@gmail.com \
    --cc=ath10k@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 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.