All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Matt Weber <matthew.weber@rockwellcollins.com>,
	linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] map-ram chip driver: 16-bit block transfer
Date: Fri, 11 Aug 2017 16:03:32 -0500	[thread overview]
Message-ID: <CAB0kKmyBEVWXvNBiFsFXSxz21mEFu8WVW69DWoes9oKsYEM0Vw@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a3W2Dw_CHDbBXPaX9=mNA1kPXdFDR1F4HLbtuLUVHjUKw@mail.gmail.com>

On Fri, Aug 11, 2017 at 2:41 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Fri, Aug 11, 2017 at 6:50 PM, Sanjay Tandel
> <sanjay.tandel@rockwellcollins.com> wrote:
>> On Wed, Aug 9, 2017 at 1:10 PM, Boris Brezillon
>> <boris.brezillon@free-electrons.com> wrote:
>>> Le Fri,  4 Aug 2017 08:02:20 -0500,
>>> Matt Weber <matthew.weber@rockwellcollins.com> a écrit :
>>>
>>>> From: sgtandel <sanjay.tandel@rockwellcollins.com>
>>>>
>>>> This patch adds 16-bit I/O memory write function (map_copy_to16) in map-ram
>>>> driver. map-ram driver's block write function(i.e map_copy_to) uses
>>>> memcpy_toio() function for block transfer. memcpy_toio() is limited to do
>>>> single byte write, irrespective of bankwidth.
>>>
>>> That's not true. Depending on the platform (+ config options)
>>> memcpy_to/fromio() can be a simple redirection to memcpy, and
>>> memcpy is likely to be optimized to do 32bit or 64bit accesses when
>>> possible (IOW, when alignment allows it).
>>>
>> Agree with you on memcpy_toio/_fromio.
>> but map-ram driver's map_copy_to/map_copy_from aren't based on bank-width
>> provided for specific chip.It relies on memcpy_toio, which is dependent on arch,
>> alignment and size.For example - like in our case of accessing 16-bit
>> flash, despite
>> of chip's bank-width being 16-bit, map_copy_to ends up accessing 8-bit using
>> memcpy_toio, because memcpy_toio for ARM arch always does 8-bit accesses.
>
> On almost all ARM platforms, it would use 32-bit accesses these days. On what
> kernel version, ARM platform and endianess do you see memcpy_toio() use 8-bit
> access?
>

We use version 4.1.8 with Freescale LS1021A( cortex-a7 core, little-endian).
With the newer versions of kernel also, I can see same 8-bit
implementation for 32-bit ARM arch.

BTW, for other arch also memcpy_toio()  uses combination of  32-bit(or
64-bit) and 8-bit accesses,
which may not work here.Because we need all accesses to be of same
size(bank-width).


>        Arnd

  reply	other threads:[~2017-08-11 21:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 13:02 [PATCH] map-ram chip driver: 16-bit block transfer Matt Weber
2017-08-09 18:10 ` Boris Brezillon
2017-08-09 19:51   ` Arnd Bergmann
2017-08-11 17:57     ` Sanjay Tandel
2017-08-11 19:42       ` Arnd Bergmann
2017-08-11 16:50   ` Sanjay Tandel
2017-08-11 19:41     ` Arnd Bergmann
2017-08-11 21:03       ` Sanjay Tandel [this message]
2017-08-11 21:30         ` Arnd Bergmann
2017-08-11 23:42           ` Sanjay Tandel
2017-08-12 17:39             ` Boris Brezillon
2017-08-14  8:08               ` Arnd Bergmann
2017-08-14 16:33                 ` Sanjay Tandel
2017-08-29  2:23                 ` Matthew Weber
2017-08-29  7:12                   ` Boris Brezillon

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=CAB0kKmyBEVWXvNBiFsFXSxz21mEFu8WVW69DWoes9oKsYEM0Vw@mail.gmail.com \
    --to=sanjay.tandel@rockwellcollins.com \
    --cc=arnd@arndb.de \
    --cc=boris.brezillon@free-electrons.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthew.weber@rockwellcollins.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.