All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [GIT PULL v3] updates to qbman (soc drivers) to support arm/arm64
Date: Fri, 23 Jun 2017 16:55:40 +0100	[thread overview]
Message-ID: <20170623155539.GT4902@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170623152227.GA21989@leverpostej>

On Fri, Jun 23, 2017 at 04:22:27PM +0100, Mark Rutland wrote:
> The prior discussion on that front were largely to do with teh
> shareability of that memory, which is an orthogonal concern.
> 
> If these are actually MMIO registers, a Device memory type must be used,
> rather than a Normal memory type. There are a number of things that
> could go wrong due to relaxations permitted for Normal memory, such as
> speculative reads, the potential set of access sizes, memory
> transactions that the endpoint might not understand, etc.

Well, we have:

        dma_wmb();
        mc->cr->_ncw_verb = myverb | mc->vbit;
        dpaa_flush(mc->cr);

and we also have:

        mc->cr = portal->addr.ce + BM_CL_CR;
        mc->rridx = (__raw_readb(&mc->cr->_ncw_verb) & BM_MCC_VERB_VBIT) ?
                    0 : 1;

and:

        dpaa_zero(mc->cr);

which is just another name for a 64-byte memset() which doesn't have
any flushing.

Note that this is memory obtained from the ioremap() family of functions,
so all of these pointers _should_ have __iomem annotations (but don't.)
However, if this isn't iomem, then it shouldn't be using the ioremap()
family of functions, and should be using memremap() instead.

Without really having an understanding of what this chunk of code is
doing (and abuse like the above makes it harder than necessary) no one
can really say from just reading through the code... which brings up
another problem - that of long term maintanability.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2017-06-23 15:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 17:27 [GIT PULL v3] updates to qbman (soc drivers) to support arm/arm64 Leo Li
2017-06-23 14:56 ` Arnd Bergmann
2017-06-23 15:22   ` Mark Rutland
2017-06-23 15:55     ` Russell King - ARM Linux [this message]
2017-06-23 16:23       ` Mark Rutland
2017-06-23 19:39       ` Roy Pledge
2017-06-23 18:58     ` Roy Pledge
2017-06-24 12:10       ` Russell King - ARM Linux
2017-06-27 18:36         ` Roy Pledge
2017-06-27  7:17       ` Arnd Bergmann
2017-06-27  8:17         ` Russell King - ARM Linux
2017-06-27  9:05           ` Arnd Bergmann
2017-06-27  9:10             ` Russell King - ARM Linux
2017-06-27 10:35               ` Arnd Bergmann
2017-06-27 19:03                 ` Roy Pledge
2017-06-27 18:59         ` Roy Pledge
2017-06-23 15:38   ` Russell King - ARM Linux
2017-06-23 19:25     ` Roy Pledge

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=20170623155539.GT4902@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --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 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.