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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B892EC43331 for ; Thu, 26 Mar 2020 14:28:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CD3E2073E for ; Thu, 26 Mar 2020 14:28:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OlGh4gA1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="s0AYeRSm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CD3E2073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hqw1kfAdiw9f4W0vcQl52DIpf93M2A0/ZQYFLG0ITpc=; b=OlGh4gA11raR2B 59NBl7RBvISGfkGaE/q69ep9rspF12rwH2pQtRdJXuWC6XO048A2jpdXORUB+Pc1HsOTMvEFCH08M K/uMJ252+AdDJpnkR9pseAZeUs6NAhY9uw8O+nXSl4kqUfUMDwTTBhQnsgtB2m2NheAZI11HGASHZ L9qQc2Tdln5+ubpdq9YOAHRTgqPSSASBmS+1GJ4pIr6iUyV0afMBjP38JAoMbmYZX1pvXO42Y5PfT QSmzRx89xvL/h0pG7OXh5gSebzcTSwWi2fmBakU39DIq5G9qBpG2HwMSYaAKkrAyFy81b3Wg5cGt8 UFIxTcPw5BMYktR8MMbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHTUO-00029F-AB; Thu, 26 Mar 2020 14:28:08 +0000 Received: from mail-vs1-xe43.google.com ([2607:f8b0:4864:20::e43]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jHTUL-00028I-69 for linux-arm-kernel@lists.infradead.org; Thu, 26 Mar 2020 14:28:06 +0000 Received: by mail-vs1-xe43.google.com with SMTP id o3so3953490vsd.4 for ; Thu, 26 Mar 2020 07:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Nwrqr8fUwcczi1tkKbhoCAaTj0Lz9vANHD/lv6450Ik=; b=s0AYeRSme5ZYMG5Hj00MtSphy+ZF1hJEIT/x2laNKAPH6uwyawibNxjdwbP2n3VcAz csHlsS0gxGoa5DicQVyRyza5fvlnbU7gXob7YwmrF1iP6Arowk1BTPlr0kz4O3XeecgF 1zk9ZTQ+jv4zeHagRLkhqZrvKEFdH+oNeK135nUnNRS91hY2ue714O+FEjcV14/4YNSF LfEKcr0FypAkSBknWreQBXQ7JbSB7qSlCdDz+6IHoDYmn4ebQwicF5K71DOR0GD0cCFh bCHWHd0BIGOXrsyTGs9lNM+SLJBnuSpHOhufi/2mLRvJCbJQ5z5/y/CztJiv8Q92tTQi xs6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nwrqr8fUwcczi1tkKbhoCAaTj0Lz9vANHD/lv6450Ik=; b=IOtBX9TApiJyHn+xrfkdGNA2wk592ZRbREH2GyWE4U1YwjDVW3uToAwLdgO7ENcnU9 K4LA/BLB7+Rt3CK7fcWvjDgtlWj4Da9a7zKYlhIPiCdl/x2Oj0o5uWE3aim1svpN0o7X iTkWQvmYS+VsKehcZmhZwjw0hGfiFoOa8ERX9IhKK/8GCvs2bt2iVaAQ5uKE/3GfkrX5 fg4HwOtW4zoQnANjTMCnR0SBBOBFp/nAFfzoBgpG1NmaRb2TY7qP4BZmybaX8+zOZS5y 7ydJQZVKJSQe26IaWLLeDevfF1ldAXl6MO/klNoVl/6B1EJDTwbEBeUi/efzpvFzFjMg SFxA== X-Gm-Message-State: ANhLgQ37CBdXrFnW6CaWuYItELlcGowJOZIPF0yCiHUKef2VLkVswbIn KYEllCdiaTzPRHKAh0Afi2k0C9ovcq+b5ggvIAxeRQ== X-Google-Smtp-Source: ADFU+vsDl0E1ShxlqFNIKGgRphr3dXzKQ2BouqsiqJSyqwn2BTjEQZNw7vYZJmX1XaoteUXkIePuQWywtUNQtEW50KM= X-Received: by 2002:a67:2ec6:: with SMTP id u189mr7072856vsu.200.1585232883289; Thu, 26 Mar 2020 07:28:03 -0700 (PDT) MIME-Version: 1.0 References: <20200325143409.13005-1-ludovic.barre@st.com> <20200325143409.13005-3-ludovic.barre@st.com> In-Reply-To: <20200325143409.13005-3-ludovic.barre@st.com> From: Ulf Hansson Date: Thu, 26 Mar 2020 15:27:27 +0100 Message-ID: Subject: Re: [PATCH V2 2/2] mmc: mmci: initialize pwr|clk|datactrl_reg with their hardware values To: Ludovic Barre X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200326_072805_241665_E2E48082 X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: DTML , Alexandre Torgue , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , Rob Herring , Srini Kandagatla , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 25 Mar 2020 at 15:34, Ludovic Barre wrote: > > In mmci_write_pwr|clk|datactrlreg functions, if the desired value > is equal to corresponding variable (pwr_reg|clk_reg|datactrl_reg), > the value is not written in the register. > > At probe pwr|clk|datactrl_reg of mmci_host structure are initialized > to 0 (kzalloc of mmc_alloc_host). But they does not necessarily reflect > hardware value of these registers, if they are used while boot level. > This is problematic, if we want to write 0 in these registers. It could be, but I don't see that we ever needs to do that - at least not before we have written some other non-zero values to them (through the helper functions). > > This patch initializes pwr|clk|datactrl_reg variables with their > hardware values while probing. Hmm, so in principle this change seems quite okay, but I am hesitant to pick it up - unless it really addresses a problem that you have observed. The reason is, this change may lead to avoiding to re-write the register with the same value it got during boot - and who knows what is best here. Kind regards Uffe > > Signed-off-by: Ludovic Barre > --- > drivers/mmc/host/mmci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c > index 647567def612..f378ae18d5dc 100644 > --- a/drivers/mmc/host/mmci.c > +++ b/drivers/mmc/host/mmci.c > @@ -2085,6 +2085,10 @@ static int mmci_probe(struct amba_device *dev, > else if (plat->ocr_mask) > dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); > > + host->pwr_reg = readl_relaxed(host->base + MMCIPOWER); > + host->clk_reg = readl_relaxed(host->base + MMCICLOCK); > + host->datactrl_reg = readl_relaxed(host->base + MMCIDATACTRL); > + > /* We support these capabilities. */ > mmc->caps |= MMC_CAP_CMD23; > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel