Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3836881ybl; Mon, 13 Jan 2020 03:32:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxnavjPudIT2R3PG7bIbHjS5F52AWSRpB4In6WtXU793MpqzAxp7A/THg8j0k3IBztn2Y79 X-Received: by 2002:aca:ed81:: with SMTP id l123mr12802925oih.129.1578915174800; Mon, 13 Jan 2020 03:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578915174; cv=none; d=google.com; s=arc-20160816; b=uEDdQpNR3hHUB6ygc0CAoQJTqmZ6jgfQAqxUqNFusFlD4VANGnrfHBl514zXaPfWmM PebjkjG3edeik0RP0I+UCU4y58pbLZKcjgn21fc1iLC2IAsLlu/ahtSypr+YWCsexgRZ WrRlCD1T6OJ8psNofh3kFD7MD6W9XPZR7c7GCjYxwd9i/V/K4zjCr8/xglro92QKWzum XRfDNEYFHehvSZ1pudaFXhix5jx4Tti1WXZGQk7bzun9KTB8HbLZ28Kfdv7MURbPD+AU gc3ilhwxq8P4V1x8F6Wp3pauP3L9u4MoEZyeUWBMVyTu4htm2iF5xRols6vqtQEcRXbK SUhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=V9Wz5q6OpvQAQc9dxIIarp/pkP+cgJcdqg5SW5iLm9Y=; b=THQ6I/CdcFhmANpgfJSbZsBfMfxDELXQIZ7Bf3eQzqKDyvXX8Hh3fRN1XdysAxzXtM t/uOZaPjG8mdjR9SaXQFwp9K3quShgG095eEEbNc5acmncabTBYHSnVJT59wKfUjhDrL s9R5Xoci85CFMjYeNqfqmJ/B693x5/crQy5FzSovSZpMvmdcwZnAA/e4YxnEQHvIVrqn JSuDu34DnqEAXBG2VuKsddlU1ZG0S4tslvitAS99Z5hh2ZrgZE/YniEYxJKORDGI8UOU GyC760tr1UiYIf2v4CQ16fxqte5jXaeij/HTanXbXmejTz/fn/p/XgKXy+IX/Mygmwqu YclQ== 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 z15si8180916otj.235.2020.01.13.03.32.42; Mon, 13 Jan 2020 03:32:54 -0800 (PST) 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 S1727014AbgAMLbi (ORCPT + 99 others); Mon, 13 Jan 2020 06:31:38 -0500 Received: from foss.arm.com ([217.140.110.172]:38102 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725992AbgAMLbi (ORCPT ); Mon, 13 Jan 2020 06:31:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 95C6113D5; Mon, 13 Jan 2020 03:31:37 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DA5453F6C4; Mon, 13 Jan 2020 03:31:36 -0800 (PST) Date: Mon, 13 Jan 2020 11:31:35 +0000 From: Andrew Murray To: "Z.q. Hou" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "arnd@arndb.de" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , "m.karthikeyan@mobiveil.co.in" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Subject: Re: [PATCHv9 08/12] PCI: mobiveil: Add 8-bit and 16-bit CSR register accessors Message-ID: <20200113113135.GN42593@e119886-lin.cambridge.arm.com> References: <20191120034451.30102-1-Zhiqiang.Hou@nxp.com> <20191120034451.30102-9-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191120034451.30102-9-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 20, 2019 at 03:46:10AM +0000, Z.q. Hou wrote: > From: Hou Zhiqiang > > There are some 8-bit and 16-bit registers in PCIe configuration > space, so add these accessors accordingly. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > Reviewed-by: Subrahmanya Lingappa > --- > V9: > - No change > > .../pci/controller/mobiveil/pcie-mobiveil.h | 23 +++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > index 37116c2a19fe..750a7fd95bc1 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > @@ -182,10 +182,33 @@ static inline u32 mobiveil_csr_readl(struct mobiveil_pcie *pcie, u32 off) > return mobiveil_csr_read(pcie, off, 0x4); > } > > +static inline u32 mobiveil_csr_readw(struct mobiveil_pcie *pcie, u32 off) > +{ > + return mobiveil_csr_read(pcie, off, 0x2); > +} > + > +static inline u32 mobiveil_csr_readb(struct mobiveil_pcie *pcie, u32 off) > +{ > + return mobiveil_csr_read(pcie, off, 0x1); > +} Do you think the above two return types should reflect the size of the access? Thanks, Andrew Murray > + > + > static inline void mobiveil_csr_writel(struct mobiveil_pcie *pcie, u32 val, > u32 off) > { > mobiveil_csr_write(pcie, val, off, 0x4); > } > > +static inline void mobiveil_csr_writew(struct mobiveil_pcie *pcie, u32 val, > + u32 off) > +{ > + mobiveil_csr_write(pcie, val, off, 0x2); > +} > + > +static inline void mobiveil_csr_writeb(struct mobiveil_pcie *pcie, u32 val, > + u32 off) > +{ > + mobiveil_csr_write(pcie, val, off, 0x1); > +} > + > #endif /* _PCIE_MOBIVEIL_H */ > -- > 2.17.1 >