Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp928374ima; Wed, 24 Oct 2018 11:21:42 -0700 (PDT) X-Google-Smtp-Source: AJdET5dcXaOZfCYpZRfCVRfr9jYfaFTHDNrYQ5i4UlH7pKpZ2SbnF/fzHMN4lbr5s+jxv6j+ePnN X-Received: by 2002:a63:a35c:: with SMTP id v28mr3474396pgn.205.1540405302476; Wed, 24 Oct 2018 11:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540405302; cv=none; d=google.com; s=arc-20160816; b=nKGcJr0xp2Y6fpThn3zX9loOjlgziIF0U9AlEqGfd8FPFWMXhZTf9WM3R/ic4W1VaH /6ugllqA8R26zdFsHaZwDnYX8zUqgEaXYPmm4iJBaLrMz5emE6IcRJ+R3oXi9qZYWGu2 xGJK5ypvozWJF0AFsCJyDWs9Sb9z1auSWPs+cZaUmXtbn6Aj9RiZxPLb34rMT16j5uj5 MmAP2QzuEHullLYO9d5giBV8siv5QNIVxuGO5ikTU/kxCUzEnbOZpNYMIOwNbfIBRSJf AJ4jtE5POe3b2ay5ZRo9ZkAmGiR3+dv8HhSesS/fkSB0sGJjWuqGReTd4RiyF6VZ68mM 9YQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=NDVkSWuVaC53P+NQ4J75nIEuWXNPB7HmsuhKGcRM3zM=; b=tvjY+YSvaFBTcNu2+IbCu60DVDww1vWqNJx1VUqhc5Og51nZy2ARa8whTaqxmIC/3K aWUX7qJ76UUZRnNhGWwYPUbpzREq9nXYJ+/LimiqG6driOS6OYV+wtMD7QUDUUwvID66 LgyZe7Baf3FJN5O+BwgbcMasGzTzjwZsKnj4XAZtI1tWllry8cpMTLGo2o24IHWbPFIu z8erRvDU5ZpvPYmDJ2ZFRY8lSyqE7KJmY/veSLZnZTLBcoq4B5WRGKzwEZ6rVZ5JdON2 wjOIM3foMYcirPf26EPFmA4Q+ff9lOnMCDjgne6cU/rMlDIcpASPDazu/ngGdNIBwm93 F6gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f26-v6si5544264pge.549.2018.10.24.11.21.25; Wed, 24 Oct 2018 11:21:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727089AbeJYCuI (ORCPT + 99 others); Wed, 24 Oct 2018 22:50:08 -0400 Received: from mail.bootlin.com ([62.4.15.54]:53024 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbeJYCuI (ORCPT ); Wed, 24 Oct 2018 22:50:08 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id E912E208B5; Wed, 24 Oct 2018 20:20:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 2598F20379; Wed, 24 Oct 2018 20:20:49 +0200 (CEST) Date: Wed, 24 Oct 2018 20:20:48 +0200 From: Boris Brezillon To: Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann Cc: 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 , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , linux-gpio@vger.kernel.org, Sekhar Nori , Przemyslaw Gaj , Peter Rosin , Mike Shettel , Stephen Boyd , Joe Perches Subject: Re: [PATCH v9 6/9] i3c: master: Add driver for Cadence IP Message-ID: <20181024202048.7e3534f7@bbrezillon> In-Reply-To: <20181022133404.2061-7-boris.brezillon@bootlin.com> References: <20181022133404.2061-1-boris.brezillon@bootlin.com> <20181022133404.2061-7-boris.brezillon@bootlin.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, 22 Oct 2018 15:34:01 +0200 Boris Brezillon wrote: > + > +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); Vitor reported a problem with readsl(): this function expects the 2nd argument to be aligned on 32-bit, which is not guaranteed here. Unless you see a better solution, I'll switch back to a loop doing: for (i = 0; i < nbytes; i += 4) { u32 tmp = __raw_readl(...); memcpy(bytes + i, &tmp, nbytes - i > 4 ? 4 : nbytes - i); } > + if (nbytes & 3) { > + u32 tmp; > + > + readsl(master->regs + RX_FIFO, &tmp, 1); > + memcpy(bytes + (nbytes & ~3), &tmp, nbytes & 3); > + } > +} Regards, Boris