Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8328729imu; Thu, 15 Nov 2018 09:49:25 -0800 (PST) X-Google-Smtp-Source: AJdET5cD5qfMg8SIOrUjoV66ATaiu4J1pAMRUniCzAchKViYWlXPbdtohjtz+51vfjAxrFcdbJgL X-Received: by 2002:a63:5c22:: with SMTP id q34mr6613242pgb.417.1542304165498; Thu, 15 Nov 2018 09:49:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542304165; cv=none; d=google.com; s=arc-20160816; b=0oSj3gJdiQrx+wkd1L4VBczg5XIUd0804UGvfracmj3A1hXW/FIiJSIDLpaHB1InGf PKX2RmMXw7N4HEcenfAAhETnA/9UcDQ+EuZaDJNYTuj9ZN0S8S2AL0ruXg4j0mzPZqux xZu/mdNRRp5gf/iM4Cs9t2E3ELwot4K2sodl0Pb4iDKXiGcJPBkjWLu88R/hms43aJ0f aywMoz+ngAo6baakzpBlL9IePABeKct7OHzJtXYN5z+fmVWzcPGjpWMrVGED313RSMGH LzK7ht31Ejv+eyWb+iok/RoxKHpNCjzNcIYqaM+MeAyAYaOl9WVIxe59ABwOArfZPW65 6Jyg== 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=e6l2fyXGz1E45TKWqNiXChEfJW/ramJx38Hkq6ibdxU=; b=HIs55bg+af6f+kI+oIBeseTg2rEY1fHqwa6IInnb+7hIDOf5dVJqdrIf0aDgO9YHJ0 cH390u8EpHac14zyc+SULUp2wDPnbc2H1IOy9NPuU3lcegbhXYBz1JCOSEvFFijztafu EK+mZkEEdG7fnMG9/dwZgBS629UaIbFEvwIUoiTBRdMlcZxOrqeT1GOUKi+nkYZlzmhW +v1Pysw+pBgioXJzGcgqfb5+fLjNF4Pbqq+ThlsBH7K4PJRZlDdkbW3TsI7ORwHP3G7m 6sikITfvGiVRk3LhjIKfCgr7h7qBYCSPn7w8ZF30FBm1Kig6Ds7TIX8i7ifGBX+lpdq0 FqfA== 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 18si25662993pgo.331.2018.11.15.09.49.01; Thu, 15 Nov 2018 09:49:25 -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 S2388661AbeKPD4w (ORCPT + 99 others); Thu, 15 Nov 2018 22:56:52 -0500 Received: from foss.arm.com ([217.140.101.70]:38812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbeKPD4w (ORCPT ); Thu, 15 Nov 2018 22:56:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 086DD80D; Thu, 15 Nov 2018 09:48:05 -0800 (PST) Received: from brain-police (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A88BA3F718; Thu, 15 Nov 2018 09:48:04 -0800 (PST) Date: Thu, 15 Nov 2018 17:48:03 +0000 From: Will Deacon To: Yinbo Zhu Cc: Catalin Marinas , linux-kernel@vger.kernel.org, xiaobo.xie@nxp.com, ran.wang_1@nxp.com, linux-arm-kernel@lists.infradead.org, Rajesh Bhagat Subject: Re: [PATCH v1] arch: arm64: add ARM64 specific fucntions required for ehci fsl driver Message-ID: <20181115174802.GB3087@brain-police> References: <20181115092357.1556-1-yinbo.zhu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115092357.1556-1-yinbo.zhu@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 05:23:57PM +0800, Yinbo Zhu wrote: > From: Rajesh Bhagat > > Add set/clear bits functions for ARM platform which are used by ehci fsl > driver > > Signed-off-by: Rajesh Bhagat > Signed-off-by: Yinbo Zhu > --- > arch/arm64/include/asm/io.h | 29 +++++++++++++++++++++++++++++ > 1 files changed, 29 insertions(+), 0 deletions(-) > > diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h > index e97b861..0dc4334 100644 > --- a/arch/arm64/include/asm/io.h > +++ b/arch/arm64/include/asm/io.h > @@ -185,6 +185,35 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); > #define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force __u32)cpu_to_be32(v), p); }) > #define iowrite64be(v,p) ({ __iowmb(); __raw_writeq((__force __u64)cpu_to_be64(v), p); }) > > +/* access ports */ > +#define setbits32(_addr, _v) iowrite32be(ioread32be(_addr) | (_v), (_addr)) > +#define clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr)) > + > +#define setbits16(_addr, _v) iowrite16be(ioread16be(_addr) | (_v), (_addr)) > +#define clrbits16(_addr, _v) iowrite16be(ioread16be(_addr) & ~(_v), (_addr)) > + > +#define setbits8(_addr, _v) iowrite8(ioread8(_addr) | (_v), (_addr)) > +#define clrbits8(_addr, _v) iowrite8(ioread8(_addr) & ~(_v), (_addr)) Why isn't this defined in the driver? Adding it to the arch-code leads to duplication of the definitions and encourages other drivers to start using this weird interface. So no, I don't want this in the arch code. Will