Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp567088imm; Wed, 11 Jul 2018 07:22:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdeFLGnP0A2QtjRrH96aGr0VlgB3zSW7pOITYZEG66cPqdtm1RzDalgVVd+rMwLUbYlkfSx X-Received: by 2002:a17:902:a508:: with SMTP id s8-v6mr8228475plq.223.1531318939234; Wed, 11 Jul 2018 07:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531318939; cv=none; d=google.com; s=arc-20160816; b=r04Ve3sgEEgFJNTyx9z7Z21PvFfPpUf/rwTFGyZq4xiu/DUfQLPNxLXhTqGBujQEW5 kZks0dSQtH3sTtphF4QiuVe+uf3cepwGAEKmd4mLIbyqXvxnplV2EB8Cw4woT0nB9EL0 Z/Gg+MVH0r+s6rkjdiFFaiFN6+EoI7J7tWZ6LioPuI7ry9FXWTxqelO0+plQdND86ucA RDQfAaiJx+Kqahid2FV3EQG6RJMFtmjgyXLDRlMsx0sVSWztSFQJxf6k1lN1pFIzHtGl 1HSNbi8gCl2S2f0XcpsoloCBxqslSlBL2XfTmEx51YbHU9qMJJ16UX4vhrf6cOoJ+Qtc PNRw== 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 :arc-authentication-results; bh=9kD0h0ojMpxdIm6YnKzBydpVy5fC/ZqR71yRp0phxGE=; b=e6nwe72sOWpxbIJH5TC/CF7DFd77UFQWcuwy9O4y7/um7FMmXk/zr1ViQk7E4YaRGe zBgOJ4iuPT+4cee1yjwUSl7hlgJbatAz6sP1m2pzMP0/bvBnQKLzQb2z1vPQZjtbCTDi msbsqCwhyLcUoZ0FhAcQqF2BaqSyIfWAp2lrUrg/QsK0Kex3OY+Sq5AA+Gk22IEsJwMJ dUi6fPrf1nPP0Eu0VpuoZbrq15itg5Qhs/Bk6qyXwz2/MLLgZcbPZcaLRHzUH53q8XBg ahb2P/WlGcfJASgbRgFK1mSVbc/24t02e3o13Kg7Tjb5sKD/VHS9wWTePl19dMedGTOJ Rc9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tRWFbLVl; 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 k38-v6si19011371pgm.335.2018.07.11.07.22.03; Wed, 11 Jul 2018 07:22:19 -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=tRWFbLVl; 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 S2388528AbeGKOY3 (ORCPT + 99 others); Wed, 11 Jul 2018 10:24:29 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35649 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387834AbeGKOY3 (ORCPT ); Wed, 11 Jul 2018 10:24:29 -0400 Received: by mail-lf0-f66.google.com with SMTP id f18-v6so5329096lfc.2; Wed, 11 Jul 2018 07:19:53 -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=9kD0h0ojMpxdIm6YnKzBydpVy5fC/ZqR71yRp0phxGE=; b=tRWFbLVlTrASofW6UTGxOqLSUSCM6lHFeCB7AmyE95WMVv/66qvgNP9KJbVLjHBlMR anZJTGbXqkceYDWwGPrSGmpD4kTJzqOOGV/+5eg9P5/z8bTxEEvGXduKuaoRJNHNVFjy Pw4Ec2+QXpleGsfbXIqZKbpt7kqOhVQAFPQX8DOJrRawtRme+L1hKFSV1r1guvEDFgra A/TIKjkeiP45/3PxwEJtOGYOXbNCXXTHmQ2BY4Ob2N6+BinYi3Qmnaq0zIWe1lmKKrS1 Etwu9SAC8JsdqShvG63hjlGAUuryMtBEiCLgXmfg8EiEdiBA10NNKftZopk9MDc+N/Zs zIpA== 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=9kD0h0ojMpxdIm6YnKzBydpVy5fC/ZqR71yRp0phxGE=; b=JpxKOE81oHXJwS6K/SdxOuNO7XZ2QRZTqMjpup8tp+NpMdCuap0jrB2nHu3hguMN0g ElkSW/ywVznn1beIR88Z7Vs9ZWveH8T8yQZU09kyVwt+9cePp6w4/LeUfAcGD+fw9PF4 ZD64LADwb5PAWdca+fCWahYL4746f7YQmhUi55A59MJi/pegTbvjXjJYlLk/7czW/jpS 5XasjS97T9aNS3x3FIUnGNOOd5Yf8xhCevFfsIl/e2OCv3cZtmOmYsRoYvMIRTG9oGaq 5Bmei8WzD+24Yq4322QvgduaMDOJqRob9KRUZbFGkB3F2ZsC4j/YDoYXoo7Pqe0ORFzw QeZg== X-Gm-Message-State: APt69E1sP6702+9R8RcG5ecKBQJsMXGQKcBublRIe/WRGck/q70w261F 1pcu0cjpwCiypmlgS4a3w67uvZLOGAKJXmeEPAA= X-Received: by 2002:a19:5c06:: with SMTP id q6-v6mr6347166lfb.6.1531318792127; Wed, 11 Jul 2018 07:19:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:41c1:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 07:19:51 -0700 (PDT) In-Reply-To: <20180622104930.32050-8-boris.brezillon@bootlin.com> References: <20180622104930.32050-1-boris.brezillon@bootlin.com> <20180622104930.32050-8-boris.brezillon@bootlin.com> From: Arnd Bergmann Date: Wed, 11 Jul 2018 16:19:51 +0200 X-Google-Sender-Auth: yO1xIOtW0l90GzrJ5ArgB_WWrtY Message-ID: Subject: Re: [PATCH v5 07/10] i3c: master: Add driver for Cadence IP To: Boris Brezillon Cc: Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , "open list:DOCUMENTATION" , 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 , DTML , Linux Kernel Mailing List , Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , linux-gpio@vger.kernel.org, Sekhar Nori , Przemyslaw Gaj 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 Fri, Jun 22, 2018 at 12:49 PM, Boris Brezillon wrote: > Add a driver for Cadence I3C master IP. The driver seems very well-written and shows that the framework got that side of the interface right. Just one thing I noticed: > + > +static void cdns_i3c_master_handle_ibi(struct cdns_i3c_master *master, > + u32 ibir) > + > + for (i = 0; i < IBIR_XFER_BYTES(ibir); i += 4) { > + u32 tmp = readl(master->regs + IBI_DATA_FIFO); > + > + for (j = 0; j < 4 && i + j < dev->ibi->max_payload_len; j++) > + buf[i + j] = tmp >> (j * 8); > + } This seems to be a rather inefficient way to open-code a readsl(). I suppose you need to handle length that is not a multiple of 4, right? Maybe do it like size_t length = IBIR_XFER_BYTES(ibir); readsl(master->regs + IBI_DATA_FIFO, buf, length & ~3); if (length & 3) { u32 tmp = __raw_readl(master->regs + IBI_DATA_FIFO); memcpy(buf + length & ~3, length & 3); } Arnd