Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2028595ima; Thu, 25 Oct 2018 08:31:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5cbNHHf6tD9H25/JNpJYUt6wWZHIxKxIQeZ1AJH6indZFYx0tqBAysaCJQWFRvTswATuj6T X-Received: by 2002:a63:bf46:: with SMTP id i6-v6mr1922285pgo.378.1540481468655; Thu, 25 Oct 2018 08:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540481468; cv=none; d=google.com; s=arc-20160816; b=AEiMNm2GStuuaAaFM5Xxod+xqFuuhVzgRz44Oz7ELQ/qeqCYuAxlpfwL3/f4DpQ62O Z/jhRT44cxL/9Zu+MVudfhpMYnDwX9qvjYepOy27t/2A5nAiQalGX604EdUnaWNRQGu6 dd+qOi3vS0xnVqwVlcvz3+8AmRbweNEEEmo9ORFfJABcsl6PJdKKWfpDjm2TaUmmnIKZ cyskV8cHLJOJu7J99BQ9ynNYRfAVD5USAg/P7tyOeazfbTMFV6HLm+rw0D6I2SZ6SHv5 9tbBFX66Ec2FS7FEl2Nw4S64A2UsNf2EBDE56lGsKjlWcj8MMdWbO1N0pXO47AzS/9p4 J6QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=OIf2DakP0oD5Tq7VvybGtzKfYwkFrt1ppRVPuLM3Xag=; b=iHZpuB835bAN38ecmsGvhH4MytNizMvZuUUr9CIr/3nku2UTAOWexEWVTDdVBpB31Q nMuxdHlA7Wn2yhplqYEhCBgIoZlDo6qhQpuHCbcf7yZEcTozLd5ez82GiGUYA7OBJatc 7TOJzyxt3L0zpuErg3rXqvC1BI/h55Mm3v4UWUxWssGiGgQ0LJaiM+Zefv1emxOADIGL ou1jn7W5qMIfIzg+QGS5jEUk5h/1yoglIj9K+f+dyKAhBkXR5ENg/ohtGM1zKbTfp+pr X4sDpOdr9pKLhjpOJl5ONsJMUEBDmtcQ5iI1bw2k2J39T3/Dxk8rDpUzKbcSuCwWkrtO spzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WlDIQe57; 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 v23-v6si8120881pgh.581.2018.10.25.08.30.52; Thu, 25 Oct 2018 08:31:08 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WlDIQe57; 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 S1727633AbeJZADp (ORCPT + 99 others); Thu, 25 Oct 2018 20:03:45 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33366 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbeJZADo (ORCPT ); Thu, 25 Oct 2018 20:03:44 -0400 Received: by mail-qk1-f194.google.com with SMTP id o89so5982974qko.0; Thu, 25 Oct 2018 08:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OIf2DakP0oD5Tq7VvybGtzKfYwkFrt1ppRVPuLM3Xag=; b=WlDIQe57gP9tk72uPFahoq9XcJwdY6/4AdHtFgoBHrwgY1mdNX188rF5c3MrZbB0mo Sdd+ZVVsJjb57v5P6xhu2pxNZKIIxMdN3JqgdyVWs7Znr/s9j6cFnyhVky/XNHA1wiyv Ruhj0AQP7HeaGxM5t7/KWU1c8bEU+RfPNR9t0domp24grMSGUWxtM4Idr/WX7iGSFRbR UkCITaDWtP2qoT4hDnJjLu5ZzgczarNkzrAHBpsvW+biDxsWZLpLWcfcmsScqGcXY1bJ +hlvKpuZTIeiH4i7DsJGK3qLPtBnuDDp9saioLasDy7DYrAUWKRwzVC9mRHcO88yBww7 45Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OIf2DakP0oD5Tq7VvybGtzKfYwkFrt1ppRVPuLM3Xag=; b=kTVREk1pNHKItf/lxpQJLDwRrhwpOk60aDqmB4YVDX7P95DTmOwWF+IhV6QdK47yfG 7W+03TSmmyPn98JRK0pekXWZSVpfpWqgyJ6MzekVroDLMlRwtyj2qQjlUS2e2Dws0jgN ZO1SKk94pIfHyoZ0Bm2h8ROUBLwrTRwR1qo0a/0K86gimEfZe7SXrYqsuNtgsd22z6l5 t0K/vaiZ95+4SbRt7FirHdY4tUnAm2typyBCDPiTLBtQqwm6gZQ3hhuaslm5xuiKa/y2 RSzOrZQI/YxIF1KctWIx2POjU5E7MptyyfTTw+6Ti3FQwxtV2V8IGnS1TxUxrXOWjVot JYyA== X-Gm-Message-State: AGRZ1gIFVmhErY1GPh2sJbPw9WZtcFgNNpbJrtW8vIijWl9NIXRZ8shS 1lZwIGEPk8RmHkkwbRvSTMSJfF7F7kTLXwFhFFw= X-Received: by 2002:a37:e21a:: with SMTP id g26-v6mr1886738qki.330.1540481427236; Thu, 25 Oct 2018 08:30:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:fd83:0:0:0:0:0 with HTTP; Thu, 25 Oct 2018 08:30:26 -0700 (PDT) In-Reply-To: <20181024202048.7e3534f7@bbrezillon> References: <20181022133404.2061-1-boris.brezillon@bootlin.com> <20181022133404.2061-7-boris.brezillon@bootlin.com> <20181024202048.7e3534f7@bbrezillon> From: Arnd Bergmann Date: Thu, 25 Oct 2018 17:30:26 +0200 X-Google-Sender-Auth: ToJ4qwdkh9WaZwbtqufApwNto38 Message-ID: Subject: Re: [PATCH v9 6/9] i3c: master: Add driver for Cadence IP To: Boris Brezillon Cc: Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Greg Kroah-Hartman , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24/18, Boris Brezillon wrote: > 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); > } Could we maybe mandate that the buffer itself must be aligned here? What would be a reason why we see an unaligned target buffer? The open-coded loop should generally work (maybe a little slower), but it does seem error-prone to use __raw_readl() in general. Arnd