Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp730052ybl; Thu, 23 Jan 2020 06:47:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxTjYQhNGe/15YmgTy7kcnTlqumCSXxJdmjbxB/NmHArCbKBsKbdeLPHqbLtxCapTTi4kPD X-Received: by 2002:a05:6830:15ca:: with SMTP id j10mr11853561otr.190.1579790827873; Thu, 23 Jan 2020 06:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579790827; cv=none; d=google.com; s=arc-20160816; b=Um0LKhmsojxWS/rfpq/+/VD4+hjDzQpQG1w5MdmVdE+rE4a6tPQXc04vANCgH/ZpZL 0LtZag0JoOsBT585J5SN5i6h0Leje5qHbN2j4wXcrEu5GzsetsTU+DBjGpysq46xygqO 61s+0M+qbwXQ0wW4bC1MctUOmOcny4MQxx8WrdtCOSrMPaQEcLW9CuKRuGatCnU5UrR/ SfP3csG46jc1elGiN1c9kQDZTJFlZVkgdesVhUiRj2P10dUdTbGA8/brIQLEQjXTIXEG G2bGTGSZ2jqZWRMwSrzwMEv8HqFGi7vNEaFFOH2ka6sd5Z/WC8vnK+NzvEABXd6Nn3xZ 8Xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=HcX2Aw1GwJmH4+E7kYExxM1bSry4/2ZTDPoiiydnMe8=; b=UfHheXRu4b2kq3NywHQ8caTbV2yLumhjiTVtVLJG8IaDPWYMkPfFdyEYRJqrZseiH6 KV6cASd2QSaVIl6yU/fybX/htN3dXK9ACiwI+x9RfqgK6NpIbYdq0D59S5B12+cu4fLk 77TLolLN0EfFbeYpo+uW2Z7/8PqGfQyKYGwTNQ9lPv++BoiQ/sTfPMBHAC9Ayysnt0nJ vL/x9E+Fc+ZG8x9gsOOqplLzj1hjiz+mtI1UZUjXWtsIcZQ34PzOrxLhlKqMA9OZGrxK RXDRonErsvYbOUa0ss23FZlhVzfozIZ/sCfqWCl7YDOHdcuYMEVgnYM3lwFGToLL3Igs 6MGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=gx7tlueO; 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 f9si1253204otp.111.2020.01.23.06.46.55; Thu, 23 Jan 2020 06:47:07 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=gx7tlueO; 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 S1728921AbgAWOoW (ORCPT + 99 others); Thu, 23 Jan 2020 09:44:22 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:29595 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726240AbgAWOoW (ORCPT ); Thu, 23 Jan 2020 09:44:22 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579790661; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=HcX2Aw1GwJmH4+E7kYExxM1bSry4/2ZTDPoiiydnMe8=; b=gx7tlueOv0dBKjKqD+jeArrBqXavWie2cB/sbrndOmpYADlAswLD6HdX4PwYo6oPP77xoIg5 aFjyOfu4UrTMbfBm9/55593i/d1/S8VmGv3SUus1XyOHcDd5dy/S+GHCPxXQmsLMe5nx1LHT sBlK8Mf1GiUH52ihtvVqp5vk+yk= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e29b141.7f18538746c0-smtp-out-n03; Thu, 23 Jan 2020 14:44:17 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6827FC447A1; Thu, 23 Jan 2020 14:44:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.226.58.28] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo) by smtp.codeaurora.org (Postfix) with ESMTPSA id F378CC43383; Thu, 23 Jan 2020 14:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F378CC43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH 05/16] bus: mhi: core: Add support for ringing channel/event ring doorbells To: Manivannan Sadhasivam , Arnd Bergmann Cc: gregkh , smohanad@codeaurora.org, Kalle Valo , Bjorn Andersson , hemantk@codeaurora.org, linux-arm-msm , "linux-kernel@vger.kernel.org" References: <20200123111836.7414-1-manivannan.sadhasivam@linaro.org> <20200123111836.7414-6-manivannan.sadhasivam@linaro.org> <20200123120050.GB8937@mani> From: Jeffrey Hugo Message-ID: Date: Thu, 23 Jan 2020 07:44:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200123120050.GB8937@mani> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/23/2020 5:00 AM, Manivannan Sadhasivam wrote: > 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. I would expect we would be using these in the "hot" path. I'm a bit confused, I thought the convention was to put a comment why a barrier was necessary, now we should be putting a comment why a barrier is not necessary? -- Jeffrey Hugo Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.