linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	gregkh <gregkh@linuxfoundation.org>,
	Przemyslaw Sroka <psroka@cadence.com>,
	Arkadiusz Golec <agolec@cadence.com>,
	Alan Douglas <adouglas@cadence.com>,
	Bartosz Folta <bfolta@cadence.com>, Damian Kos <dkos@cadence.com>,
	Alicja Jurasik-Urbaniak <alicja@cadence.com>,
	Cyprian Wronka <cwronka@cadence.com>,
	Suresh Punnoose <sureshp@cadence.com>,
	Rafal Ciepiela <rafalc@cadence.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Nishanth Menon <nm@ti.com>, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	DTML <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Vitor Soares <Vitor.Soares@synopsys.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Xiang Lin <Xiang.Lin@synaptics.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Sekhar Nori <nsekhar@ti.com>, Przemyslaw Gaj <pgaj@cadence.com>,
	Peter Rosin <peda@axentia.se>,
	mshettel@codeaurora.org, swboyd@chromium.org
Subject: Re: [PATCH v8 07/10] i3c: master: Add driver for Cadence IP
Date: Mon, 8 Oct 2018 12:06:30 +0200	[thread overview]
Message-ID: <CAK8P3a21t7pQ2uYWgu2+VZZNYc+pz_w3WCL7YVUEzqqyOFLvnA@mail.gmail.com> (raw)
In-Reply-To: <20181003132212.12619-8-boris.brezillon@bootlin.com>

On Wed, Oct 3, 2018 at 3:22 PM Boris Brezillon
<boris.brezillon@bootlin.com> wrote:
>
> Add a driver for Cadence I3C master IP.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---

> Changes in v7:
> - Fix readsl/writesl() usage
> - Add a depends on ARM || ARM64 || XTENSA to forbid selection of this
>   driver on platforms that are not implementing readsl/writesl

Most architectures include asm-generic/io.h, which contains a generic
implementation of readsl(). Maybe that #ifdef could be extended here?
I remember discussing this with you not so long ago, which led to
commit 0bbf47eab469 ("ia64: use asm-generic/io.h"). Do we have
a list of architectures that don't include asm-generic/io.h? Maybe
the 'depends on' could be for the set of architectures that fail here.

> +static void cdns_i3c_master_rd_from_rx_fifo(struct cdns_i3c_master *master,
> +                                           u8 *bytes, int nbytes)
> +{
> +       readsl(master->regs + RX_FIFO, bytes, nbytes / 4);
> +       if (nbytes & 3) {
> +               u32 tmp = __raw_readl(master->regs + RX_FIFO);
> +
> +               memcpy(bytes + (nbytes & ~3), &tmp, nbytes & 3);
> +       }
> +}

The __raw_readl() is probably correct here (I can't think of any
architecture on which it is not), but it still makes me feel uneasy
about possible endianess or other issues.

Maybe make this:?

        readsl(master->regs + RX_FIFO, &tmp, 1);


     Arnd

  reply	other threads:[~2018-10-08 10:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 13:22 [PATCH v8 00/10] Add the I3C subsystem Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 01/10] i3c: Add core I3C infrastructure Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 02/10] docs: driver-api: Add I3C documentation Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 03/10] i3c: Add sysfs ABI spec Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 04/10] dt-bindings: i3c: Document core bindings Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 05/10] dt-bindings: i3c: Add macros to help fill I3C/I2C device's reg property Boris Brezillon
2018-10-03 18:37   ` Joe Perches
2018-10-03 18:45     ` Geert Uytterhoeven
2018-10-03 19:02       ` Joe Perches
2018-10-03 18:59     ` Boris Brezillon
2018-10-03 19:06       ` Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 06/10] MAINTAINERS: Add myself as the I3C subsystem maintainer Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 07/10] i3c: master: Add driver for Cadence IP Boris Brezillon
2018-10-08 10:06   ` Arnd Bergmann [this message]
2018-10-08 10:21     ` Boris Brezillon
2018-10-08 10:36       ` Arnd Bergmann
2018-10-08 12:05         ` Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 08/10] dt-bindings: i3c: Document Cadence I3C master bindings Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 09/10] gpio: Add a driver for Cadence I3C GPIO expander Boris Brezillon
2018-10-03 13:22 ` [PATCH v8 10/10] dt-bindings: gpio: Add bindings for Cadence I3C gpio expander Boris Brezillon
2018-10-04  8:35   ` Linus Walleij
2018-10-08 10:47 ` [PATCH v8 00/10] Add the I3C subsystem Arnd Bergmann
2018-10-17 13:18   ` 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=CAK8P3a21t7pQ2uYWgu2+VZZNYc+pz_w3WCL7YVUEzqqyOFLvnA@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=Vitor.Soares@synopsys.com \
    --cc=Xiang.Lin@synaptics.com \
    --cc=adouglas@cadence.com \
    --cc=agolec@cadence.com \
    --cc=alicja@cadence.com \
    --cc=bfolta@cadence.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=corbet@lwn.net \
    --cc=cwronka@cadence.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dkos@cadence.com \
    --cc=galak@codeaurora.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mshettel@codeaurora.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=peda@axentia.se \
    --cc=pgaj@cadence.com \
    --cc=psroka@cadence.com \
    --cc=rafalc@cadence.com \
    --cc=robh+dt@kernel.org \
    --cc=sureshp@cadence.com \
    --cc=swboyd@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa@the-dreams.de \
    /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).