linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <vineet.gupta1@synopsys.com>
To: Jose Abreu <jose.abreu@synopsys.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>,
	Joao Pinto <joao.pinto@synopsys.com>,
	Vitor Soares <vitor.soares@synopsys.com>,
	David Laight <David.Laight@ACULAB.COM>
Subject: Re: [PATCH v3] ARC: io.h: Implement reads{x}()/writes{x}()
Date: Fri, 30 Nov 2018 19:29:44 +0000	[thread overview]
Message-ID: <C2D7FE5348E1B147BCA15975FBA23075014641A449@US01WEMBX2.internal.synopsys.com> (raw)
In-Reply-To: 244eba764469e8493f2d0c85a6d965aad6cd8128.1543571088.git.joabreu@synopsys.com

On 11/30/18 1:47 AM, Jose Abreu wrote:
> Some ARC CPU's do not support unaligned loads/stores. Currently, generic
> implementation of reads{b/w/l}()/writes{b/w/l}() is being used with ARC.
> This can lead to misfunction of some drivers as generic functions do a
> plain dereference of a pointer that can be unaligned.
>
> Let's use {get/put}_unaligned() helpers instead of plain dereference of
> pointer in order to fix. The helpers allow to get and store data from an
> unaligned address whilst preserving the CPU internal alignment.
> According to [1], the use of these helpers are costly in terms of
> performance so we added an initial check for a buffer already aligned so
> that the usage of the helpers can be avoided, when possible.
>
> [1] Documentation/unaligned-memory-access.txt
>
> Changes from v2:
> - Rework commit msg (Vineet)
> - Check if count is 0 and return (Vineet)
> - Use two different loops (Vineet)
>
> Changes from v1:
> - Check if buffer is already aligned (David)
> - Remove 64 bit mention (Alexey)
>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Tested-by: Vitor Soares <soares@synopsys.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Vitor Soares <soares@synopsys.com>
> Cc: David Laight <David.Laight@ACULAB.COM>

Applied to for-curr after some minor chg (added a comment about accessor)

Thx,
-Vineet

      reply	other threads:[~2018-11-30 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30  9:47 [PATCH v3] ARC: io.h: Implement reads{x}()/writes{x}() Jose Abreu
2018-11-30 19:29 ` Vineet Gupta [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=C2D7FE5348E1B147BCA15975FBA23075014641A449@US01WEMBX2.internal.synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=alexey.brodkin@synopsys.com \
    --cc=joao.pinto@synopsys.com \
    --cc=jose.abreu@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=vitor.soares@synopsys.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 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).