From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on archive.lwn.net X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by archive.lwn.net (Postfix) with ESMTP id B95797D082 for ; Mon, 8 Oct 2018 10:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbeJHRcR (ORCPT ); Mon, 8 Oct 2018 13:32:17 -0400 Received: from mail.bootlin.com ([62.4.15.54]:39551 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbeJHRcR (ORCPT ); Mon, 8 Oct 2018 13:32:17 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 298852072D; Mon, 8 Oct 2018 12:21:14 +0200 (CEST) Received: from bbrezillon (AAubervilliers-681-1-28-153.w90-88.abo.wanadoo.fr [90.88.148.153]) by mail.bootlin.com (Postfix) with ESMTPSA id 5951A208B7; Mon, 8 Oct 2018 12:21:01 +0200 (CEST) Date: Mon, 8 Oct 2018 12:21:01 +0200 From: Boris Brezillon To: Arnd Bergmann Cc: Wolfram Sang , Linux I2C , Jonathan Corbet , "open list:DOCUMENTATION" , gregkh , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , DTML , Linux Kernel Mailing List , Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , "open list:GPIO SUBSYSTEM" , Sekhar Nori , Przemyslaw Gaj , Peter Rosin , mshettel@codeaurora.org, swboyd@chromium.org Subject: Re: [PATCH v8 07/10] i3c: master: Add driver for Cadence IP Message-ID: <20181008122101.7b391070@bbrezillon> In-Reply-To: References: <20181003132212.12619-1-boris.brezillon@bootlin.com> <20181003132212.12619-8-boris.brezillon@bootlin.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Mon, 8 Oct 2018 12:06:30 +0200 Arnd Bergmann wrote: > On Wed, Oct 3, 2018 at 3:22 PM Boris Brezillon > wrote: > > > > Add a driver for Cadence I3C master IP. > > > > Signed-off-by: Boris Brezillon > > --- > > > 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. Well, we started patching 2 archs (ia64 and sparc) based on kbuild robots failure report, and then I received other reports (still from kbuild robots) long after the initial ones. I can't tell for sure which archs are not implementing those functions, hence the conservative approach taken 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); I'm fine with that, assuming it does the same thing :-).