All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: Peter Oh <poh@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: Replace ioread with wmb for data sync
Date: Tue, 27 Jan 2015 23:30:05 -0500	[thread overview]
Message-ID: <20150128043005.GB24933@localhost> (raw)
In-Reply-To: <54C824DC.5080804@qca.qualcomm.com>

On Tue, Jan 27, 2015 at 03:53:00PM -0800, Peter Oh wrote:
> >>-	/* IMPORTANT: this extra read transaction is required to
> >>-	 * flush the posted write buffer. */
> >>-	(void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
> >>-				PCIE_INTR_ENABLE_ADDRESS);
> >>+	/* invoke data sync barrier */
> >>+	wmb();
> >>  }
> >I am no expert in arcane PCI matters, but that looks suspicious to me.  I seem
> >to recall wmb() only enforced ordering, and maybe not even memory-IO ordering
> >on all platforms.  If you want to disable an irq, it really seems like you
> >would want to flush posted writes so you know the hardware has seen it.
> enforced ordering is happened by flush write buffer and wmb is
> commonly used to flush write buffer.
> so that wmb guarantees ordering by flush write buffer. That's why
> it's called a memory barrier.

Ok, sure, but I/O ordering two different writes, and ensuring device
has seen a posted write, are related but different things, no?  So if
you are disabling an interrupt and want to be really sure interrupts
are off when function returns, I think you still want the read.

Anyway, it's your driver, just pointing out that the "IMPORTANT"
read might still be important to someone.

-- 
Bob Copeland %% http://bobcopeland.com/

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

WARNING: multiple messages have this Message-ID (diff)
From: Bob Copeland <me@bobcopeland.com>
To: Peter Oh <poh@qca.qualcomm.com>
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k: Replace ioread with wmb for data sync
Date: Tue, 27 Jan 2015 23:30:05 -0500	[thread overview]
Message-ID: <20150128043005.GB24933@localhost> (raw)
In-Reply-To: <54C824DC.5080804@qca.qualcomm.com>

On Tue, Jan 27, 2015 at 03:53:00PM -0800, Peter Oh wrote:
> >>-	/* IMPORTANT: this extra read transaction is required to
> >>-	 * flush the posted write buffer. */
> >>-	(void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
> >>-				PCIE_INTR_ENABLE_ADDRESS);
> >>+	/* invoke data sync barrier */
> >>+	wmb();
> >>  }
> >I am no expert in arcane PCI matters, but that looks suspicious to me.  I seem
> >to recall wmb() only enforced ordering, and maybe not even memory-IO ordering
> >on all platforms.  If you want to disable an irq, it really seems like you
> >would want to flush posted writes so you know the hardware has seen it.
> enforced ordering is happened by flush write buffer and wmb is
> commonly used to flush write buffer.
> so that wmb guarantees ordering by flush write buffer. That's why
> it's called a memory barrier.

Ok, sure, but I/O ordering two different writes, and ensuring device
has seen a posted write, are related but different things, no?  So if
you are disabling an interrupt and want to be really sure interrupts
are off when function returns, I think you still want the read.

Anyway, it's your driver, just pointing out that the "IMPORTANT"
read might still be important to someone.

-- 
Bob Copeland %% http://bobcopeland.com/

  reply	other threads:[~2015-01-28  4:30 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 22:25 [PATCH] ath10k: Replace ioread with wmb for data sync Peter Oh
2015-01-26 22:25 ` Peter Oh
2015-01-27 21:33 ` Bob Copeland
2015-01-27 21:33   ` Bob Copeland
2015-01-27 23:53   ` Peter Oh
2015-01-27 23:53     ` Peter Oh
2015-01-28  4:30     ` Bob Copeland [this message]
2015-01-28  4:30       ` Bob Copeland
2015-01-28  5:39       ` Peter Oh
2015-01-28  5:39         ` Peter Oh
2015-01-28  7:37         ` Johannes Berg
2015-01-28  7:37           ` Johannes Berg
2015-01-30 22:53           ` Peter Oh
2015-01-30 22:53             ` Peter Oh
2015-01-31  1:16             ` Sujith Manoharan
2015-01-31  1:16               ` Sujith Manoharan
2015-01-31  1:56               ` Peter Oh
2015-01-31  1:56                 ` Peter Oh
2015-01-31  2:06                 ` Sujith Manoharan
2015-01-31  2:06                   ` Sujith Manoharan
2015-02-02 17:25                   ` Peter Oh
2015-02-02 17:25                     ` Peter Oh
2015-02-02 22:26                   ` Adrian Chadd
2015-02-02 22:26                     ` Adrian Chadd
2015-02-02 23:04                     ` Peter Oh
2015-02-02 23:04                       ` Peter Oh
2015-02-02 13:02             ` Johannes Berg
2015-02-02 13:02               ` Johannes Berg
2015-02-02 17:33               ` Peter Oh
2015-02-02 17:33                 ` Peter Oh
2015-02-02 18:54                 ` Johannes Berg
2015-02-02 18:54                   ` Johannes Berg
2015-02-02 19:15                   ` Peter Oh
2015-02-02 19:15                     ` Peter Oh
2015-02-02 19:22                     ` Johannes Berg
2015-02-02 19:22                       ` Johannes Berg
2015-02-02 19:36                       ` Peter Oh
2015-02-02 19:36                         ` Peter Oh
2015-02-02 19:47                         ` Johannes Berg
2015-02-02 19:47                           ` Johannes Berg
2015-02-02 22:06                           ` Peter Oh
2015-02-02 22:06                             ` Peter Oh
2015-02-02 22:15                             ` Peter Oh
2015-02-02 23:25                             ` Florian Fainelli
2015-02-02 23:25                               ` Florian Fainelli
2015-02-02 23:49                               ` Peter Oh
2015-02-02 23:49                                 ` Peter Oh

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=20150128043005.GB24933@localhost \
    --to=me@bobcopeland.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=poh@qca.qualcomm.com \
    /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.