Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp566974ybl; Thu, 23 Jan 2020 04:02:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxVCZGk6n5SJSyzbP1OcnJvQFltRloBJmWsvLCfi+pyTHJsGK+H8BYcy6Jfw5+0vpItv/P3 X-Received: by 2002:aca:db41:: with SMTP id s62mr10136961oig.87.1579780949695; Thu, 23 Jan 2020 04:02:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579780949; cv=none; d=google.com; s=arc-20160816; b=zaWzaHCng5mNB7TPvi/ZPf2Pj2cETK1fdyM4JMnfgmYTYPZFChnEnBwgOdIOAUXUx6 y7on0H0zQLIi4xXrMp5OFZRiYazd7btYdU2e0EtOB/3DlBjZ6b7QAQ5YCDmkNSg8iQwF pGKBpKCRxH08LLkeGERkyJzey6cmWfFjbb87c+EzxVc0Git4I8OaT2w6ecwowx+qbv7p TS3ZTmhQuLYylNsJqpSL3LY5DXX3k7HuVddnhwPYjoD/NzNEFi/Svg9QgAkJGMQdAoON vDNr4ZuaIRqL1QvN/PEagF1RiEv8Yc5fyHL26JYYMY0HeQDTEpFqab1YRsV+6Oxu7SWf VlsQ== 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:dkim-signature; bh=xsupKns0vCTM3WeJcGkVjDP+YbP5uYoNms0JHy0fvAM=; b=KkF+P5WcScK2Cw3wOxKRayq/1Fp09sQpwHXcbCXHTP2GxPqq5zN+lQz1AdQqEMCup6 CbjaC1L+WgaeJidH1vjgFHa1y0drhSExzPsHdR3GqD+EDHoIeFbOWIvsYmkf7M1cg7V9 AmOtGJ8uUB5DZiShdANgIV4xCc8Z7ESOfbiY6EObxypzoIcLf7cVbHL2VuiAOcYABCih EIfMitj0T0QTwTURsbFUEfXLEP1NknFtVqdVJ7zxWGgsqI5ZYkBlEAd3g6WcHWacR5bz bJVLQYw32fNEQRqCn8BxsBJNd8MRjcJjoM15YLUbAw5zA2LVf9F+MSIpUkrAcsE6prKI HUwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dHB/RV9/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si1060305otk.120.2020.01.23.04.02.15; Thu, 23 Jan 2020 04:02:29 -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; dkim=pass header.i=@linaro.org header.s=google header.b="dHB/RV9/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727480AbgAWMA7 (ORCPT + 99 others); Thu, 23 Jan 2020 07:00:59 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37452 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbgAWMA7 (ORCPT ); Thu, 23 Jan 2020 07:00:59 -0500 Received: by mail-pg1-f195.google.com with SMTP id q127so1280523pga.4 for ; Thu, 23 Jan 2020 04:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xsupKns0vCTM3WeJcGkVjDP+YbP5uYoNms0JHy0fvAM=; b=dHB/RV9/Z0x+PyahfYcA/w3hi0IXq91YXf34XiKLEBPH7PVcQB3ly2nZNmJIfFosSh tfju8Bz7/ljCBPKPqeFO2RXN6V9nqsdtEK3slMAXurUXxdfgbJyrwE++vJRJjX4jSogo od+wWoDNC7GcaB18EqZrn5BTX0VP53HsxAlE6A5YVRZnnMpEnp+uF5Y222hDXRIZIykC vYcz3MlH2qI0q3+XyRu74FTf/21m/WHahvQXdDXMzsO5fobC0Y54Dd2WAXwgs/bl5wGU sTRwq7LDAK5xkzv8cnenJLCs2emZOsrU6U9TE8EOkYafvUVEP9l89bPXkAjgBnptMStZ yCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xsupKns0vCTM3WeJcGkVjDP+YbP5uYoNms0JHy0fvAM=; b=KxTEo4EEgcM11TK2125wr/nzW/8dPPiHT93J7rL1VpqTrAJRmwfLhI6LzmTVOzKKwN WlKinbM/zrm8UmJE0v+IWWKrwJKK8+wDt0zEd4oSG4g1t3FoNUUvcXtKouoO4kdMBM7p N/tytkLD6kUkaOHpWezBHH3STG81zaPGXo0MPojkEBMklNuNwkD6Pw2Js7NjghHkQJF0 +yLISGyGK5W8C3mIr9nH8lI+bJlTXJepl1ezeMH8fFXxuXVi8UqAiQxe6eO48dMJlQfV ZQqwh4nj2/pSAwycCDmVVsREsydql6TAaVPx+qXTy4L76pdh4EETk/UUuXSodEInASlZ M/tA== X-Gm-Message-State: APjAAAU+uCDD9UvL1ZEeaoALIj9ey7gI+HFIO1f8kFo9uwwGRo6hciuA wYznV7uzIP1BP3hqQeMzAtQO X-Received: by 2002:a63:6ac1:: with SMTP id f184mr3524288pgc.133.1579780858733; Thu, 23 Jan 2020 04:00:58 -0800 (PST) Received: from mani ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id k23sm2602114pgg.7.2020.01.23.04.00.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jan 2020 04:00:58 -0800 (PST) Date: Thu, 23 Jan 2020 17:30:50 +0530 From: Manivannan Sadhasivam To: Arnd Bergmann Cc: gregkh , smohanad@codeaurora.org, Jeffrey Hugo , Kalle Valo , Bjorn Andersson , hemantk@codeaurora.org, linux-arm-msm , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 05/16] bus: mhi: core: Add support for ringing channel/event ring doorbells Message-ID: <20200123120050.GB8937@mani> References: <20200123111836.7414-1-manivannan.sadhasivam@linaro.org> <20200123111836.7414-6-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hi Arnd, On Thu, Jan 23, 2020 at 12:39:06PM +0100, Arnd Bergmann wrote: > On Thu, Jan 23, 2020 at 12:19 PM Manivannan Sadhasivam > wrote: > > > +int __must_check mhi_read_reg(struct mhi_controller *mhi_cntrl, > > + void __iomem *base, u32 offset, u32 *out) > > +{ > > + u32 tmp = readl_relaxed(base + offset); > .... > > +void mhi_write_reg(struct mhi_controller *mhi_cntrl, void __iomem *base, > > + u32 offset, u32 val) > > +{ > > + writel_relaxed(val, base + offset); > > Please avoid using _relaxed accessors by default, and use the regular > ones instead. There are a number of things that can go wrong with > the relaxed version, so ideally each caller should have a comment > explaining why this instance is safe without the barriers and why it > matters to not have it. > > If there are performance critical callers of mhi_read_reg/mhi_write_reg, > you could add mhi_read_reg_relaxed/mhi_write_reg_relaxed for those > and apply the same rules there. > > Usually most mmio accesses are only needed for reconfiguration or > other slow paths. > Fair point. I'll defer to readl/writel APIs and I also need to add le32_to_cpu/cpu_to_le32 to them. Thanks, Mani > Arnd