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 10818C433FE for ; Tue, 30 Nov 2021 08:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239832AbhK3I4J (ORCPT ); Tue, 30 Nov 2021 03:56:09 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37798 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbhK3I4I (ORCPT ); Tue, 30 Nov 2021 03:56:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF386B817E9; Tue, 30 Nov 2021 08:52:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89E5CC53FC1; Tue, 30 Nov 2021 08:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638262367; bh=ih3AY0QPfJoKRjmKwA/yOEv7T4sdxUirO4pl6SrDYzU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PIuX3CH2rcz9AqYbc/PJapM8CcozDdOZZWZlRi8YbaH0L2Fd898QyRIOcc5oShB6z uKGXZzwysAd2G2Popa/ywdGEz51BBdnX0pQGuFnLPfO4JEjhKrwoDRdsle/KX5A5BB 4/JGl58N7T1TueUd3RImMwz2RKWxrMoixiw770vXemBs6bUl7xfWRI17f3lALXOLSb vIBfPo1iO7T5NqtFC6x9AZOk42L+8hDdS/CCNXeEgJlv0SDuJrc5hiC+DVadqQuQj1 mQlVvPIac5ON/R4pGaa4A4SVJbifGbJagjKsBBczJPmUNn4V+6EqxmRf3Bj+etd6cK edqLppEKzhpLw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mrysX-008p33-Kt; Tue, 30 Nov 2021 08:52:45 +0000 Date: Tue, 30 Nov 2021 08:52:45 +0000 Message-ID: <87ilwam3du.wl-maz@kernel.org> From: Marc Zyngier To: Shawn Guo Cc: Maulik Shah , Thomas Gleixner , Bjorn Andersson , Rob Herring , Loic Poulain , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] irqchip: Add Qualcomm MPM controller driver In-Reply-To: <20211130083143.GF10105@dragon> References: <20211126093529.31661-1-shawn.guo@linaro.org> <20211126093529.31661-3-shawn.guo@linaro.org> <87czmmbu8k.wl-maz@kernel.org> <20211129133308.GB10105@dragon> <87pmqjm1c8.wl-maz@kernel.org> <20211130023151.GD10105@dragon> <2e821841-a921-3fda-9ee6-3d5127653033@quicinc.com> <20211130083143.GF10105@dragon> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: shawn.guo@linaro.org, quic_mkshah@quicinc.com, tglx@linutronix.de, bjorn.andersson@linaro.org, robh+dt@kernel.org, loic.poulain@linaro.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Nov 2021 08:31:44 +0000, Shawn Guo wrote: > > On Tue, Nov 30, 2021 at 01:19:48PM +0530, Maulik Shah wrote: > > Hi Shawn, > > > > On 11/30/2021 8:01 AM, Shawn Guo wrote: > > > > + do { > > + r_val = readl(priv->base + offset); > > + udelay(5); > > + } while (r_val != val); > > > > What? Is this waiting for a bit to clear? Why isn't this one of the > > read*_poll_timeout*() function instead? Surely you can't wait forever > > here. > > > > This is taken from downstream, and it seems to double check the written > > value by reading it back. But to be honest, I'm not really this is > > necessary. I will do some testing with the read-back check dropped. > > > > How about asking for specs instead? There are QC people on Cc, and > > many more reading the list. Hopefully they can explain what this is > > all about. > > > > Maulik, > > > > If you have some information about this, that would be great. > > > > This can be converted to read poll_timeout(). This was introduced in > > place of wmb() to make sure writes are completed. > > Hmm, in this case, writel() will just do the right thing, as it wraps > wmb() there. Or am I missing something? writel() places the wmb() *before* the MMIO access. This is use for ordering with RAM access if the device is DMA capable, for example. I seriously doubt this is the case. My understanding of Maulik's comment is that there is a requirement for the MMIO access to complete. And for that, a barrier *after* the write is the right tool for the job. M. -- Without deviation from the norm, progress is not possible.