From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93446C433EF for ; Mon, 6 Dec 2021 11:12:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242267AbhLFLPl (ORCPT ); Mon, 6 Dec 2021 06:15:41 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:52862 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242265AbhLFLPk (ORCPT ); Mon, 6 Dec 2021 06:15:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1638789132; x=1670325132; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Yw4Zezs+y7lDK2bNlODq+I1zoWPnIUpzHgGlHcO8b1k=; b=RnFMhzeEyyF5Y/iBeImCysVIr5ZGxOoBljeJudK+japQCNgzFnQBiqh3 57X0IgIVCqzB+f+n87Tl+cQdbJFFCMKU+EzwUttNlZnwkahnCndg6bZ2c 262VByZ0E3w6cvPkKJqwPwNRGuGgWPx0LELGgdTm/EAwiGaYbWjY/hcgJ 4=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 06 Dec 2021 03:12:11 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 03:12:11 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 6 Dec 2021 03:12:11 -0800 Received: from [10.50.43.186] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Mon, 6 Dec 2021 03:12:06 -0800 Message-ID: <7b2b5888-c2ca-2ca0-8c0c-32128fcb37d2@quicinc.com> Date: Mon, 6 Dec 2021 16:42:01 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors Content-Language: en-US To: Arnd Bergmann CC: Will Deacon , Catalin Marinas , Steven Rostedt , Marc Zyngier , gregkh , Linux Kernel Mailing List , Linux ARM , linux-arm-msm , References: From: Sai Prakash Ranjan In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 12/6/2021 2:20 PM, Arnd Bergmann wrote: > On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan > wrote: >> Remove custom arm64 MMIO accessors read{b,w,l,q} and their relaxed >> versions in support to use asm-generic ones. Also define arm64 >> barrier macros to override the asm-generic defined barriers. >> >> Suggested-by: Arnd Bergmann >> Signed-off-by: Sai Prakash Ranjan > This looks correct, but I would change one detail: > >> +#define __io_ar(v) __io_par(v) >> +#define __io_bw() __iowmb() >> +#define __io_br(v) >> +#define __io_aw(v) > The default __io_par() is defined in terms of __io_ar(), so it would > be more logical > to remove the custom __io_par() and just define __io_ar() here. Makes sense, will do this. > I think it would be even better to flip these around and make the low-level > definitions __io_ar() and __io_bw(), and then defining the arm64 specific > macros based on those: > > /* arm64-specific, don't use in portable drivers */ > #define __iormb(v) __io_ar(v) > #define __iowmb() __io_bw() > #define __iomb() dma_mb() > > So __iormb on arm64 has some dummy control dependency stuff as well based on ("arm64: io: Ensure calls to delay routines are ordered against prior readX()") and then we would need to change __iormb definition to __io_ar which doesn't seem like __iormb definition to be exact right? Thanks, Sai