Received: by 2002:a9d:718f:0:b0:616:ae3a:c5b5 with SMTP id o15csp2112845otj; Sat, 2 Jul 2022 10:04:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u3sslZWl0YYfItLzHYJz9O5RcHnJZVmxROaSR7A0OmGSUFvyG5Mh+o3HEwhit5K01/yOhb X-Received: by 2002:a17:90b:17c3:b0:1ed:157:b9f1 with SMTP id me3-20020a17090b17c300b001ed0157b9f1mr23882276pjb.205.1656781469271; Sat, 02 Jul 2022 10:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656781469; cv=none; d=google.com; s=arc-20160816; b=PU+0HUyTe9VaRsrBUqiZ1DUrnbcXpe/HvJHJKJN9bKO3tdGzaeutZm3UapktuYiupP cm1K8Y1I4GxXwTv6WCzQ9rAdrJpQ04g7Y6HBYMEeBTVlYjQ4kc7T2Pj7MErJeSDOdSPw m2xYWUHDZ61MUwWkLrkxGqVMrjB3e2a4kUjey8l59VzO+8EqVacSNJzE8MiI+jUsIdWD Xwbb5pXRp12NhgYNrTU9n7Hn9ECxORke3E3FF6myOnyNrYbGb2/UFyVS4siFUR7w3LEE Tk/I86Lgv1IaFyTX5NcI0IkYUlU+QzAfxTxppsb2pOMZn07kMskw3ym6YYh1iYg+1RpW gh0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=7Y6x/IjySSpdmCiA4J6Og9N/8GwFYtNL/KY51w5QySY=; b=YFD6aiqo9oDGWA168YOT1B/GyTQ5LpNZ4Qck0oqWPqW6ArOvHvmxV+Vs1nRyK65jwj wH4lmIVTOSp5Yay3FPY7yxbfgIV2VIg64dWPscYPPAXtW8+kvzzQmNr0vGOaASGjFb00 0pWnx5PKeWjUGoxYDPwF9nbPB9sCce+s05Enb/cvflFMPX5usNX9biI/Jt1DAeva7eT7 0y0QnQyVvQdktIMVhjwyT/jjVN+sbnH9qUyJ86C+780JM4ImiA8QrpukbZA4A6u7Qufm PPM2VEcefdCIbxslp9HGUBZDkt0NtuJrvn2B6b8gcAKus/qWYB6nZDegTQaPddrdgjAT k+dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fxT1bj+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn11-20020a17090b38cb00b001ed58091fdbsi12531532pjb.66.2022.07.02.10.04.00; Sat, 02 Jul 2022 10:04:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fxT1bj+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232302AbiGBQve (ORCPT + 99 others); Sat, 2 Jul 2022 12:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232116AbiGBQvc (ORCPT ); Sat, 2 Jul 2022 12:51:32 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD9E2DEA7; Sat, 2 Jul 2022 09:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656780691; x=1688316691; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=h7voj+BdHoDXvLIKv/HQlK6DZFrt0N8+nXagOZ9WsGY=; b=fxT1bj+TLMhE1l4nIxuLnU+EQCoK6vHpuYYM4fyJC8Eq/xvKQMd720t6 kOTWWNRfsK+yGRzuUsR62O9Q+rmbaVzszGv4bFAQhZJ7LEJUzo5vVckZs r0de6fQ1CKWo8BaGaxiG2XfhqGRwe0gGPywL7BTykbqUk9U+wEBrhLP/I wcNSTXk9DFn6EJIrdeb8ODXOqs7xVta2j5B1ZcOwRzP2rXnPSAJBPH+cm IDONItKlLMPicQQh1pXxn+nHfyqDWuq05VK/RcDad0Cm7Q+c6pAu4bYbR K3uYwxJLi+L0zt2ZbxFnAZHHWQNbFc0FMyVjuWyX+kEf2euwT3f+iFyQi g==; X-IronPort-AV: E=McAfee;i="6400,9594,10396"; a="280405822" X-IronPort-AV: E=Sophos;i="5.92,240,1650956400"; d="scan'208";a="280405822" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2022 09:51:31 -0700 X-IronPort-AV: E=Sophos;i="5.92,240,1650956400"; d="scan'208";a="648788101" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.32.83]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2022 09:51:29 -0700 Message-ID: Date: Sat, 2 Jul 2022 19:51:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.9.1 Subject: Re: [PATCH] mmc: sdhci-of-at91: fix set_uhs_signaling rewriting of MC1R Content-Language: en-US To: Eugen Hristev , ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Karl Olsen References: <20220630090926.15061-1-eugen.hristev@microchip.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20220630090926.15061-1-eugen.hristev@microchip.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/06/22 12:09, Eugen Hristev wrote: > In set_uhs_signaling, the DDR bit is being set by fully writing the MC1R > register. > This can lead to accidental erase of certain bits in this register. > Avoid this by doing a read-modify-write operation. > > Fixes: d0918764c17b ("mmc: sdhci-of-at91: fix MMC_DDR_52 timing selection") > Signed-off-by: Eugen Hristev > Tested-by: Karl Olsen Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-of-at91.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c > index 10fb4cb2c731..cd0134580a90 100644 > --- a/drivers/mmc/host/sdhci-of-at91.c > +++ b/drivers/mmc/host/sdhci-of-at91.c > @@ -100,8 +100,13 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock) > static void sdhci_at91_set_uhs_signaling(struct sdhci_host *host, > unsigned int timing) > { > - if (timing == MMC_TIMING_MMC_DDR52) > - sdhci_writeb(host, SDMMC_MC1R_DDR, SDMMC_MC1R); > + u8 mc1r; > + > + if (timing == MMC_TIMING_MMC_DDR52) { > + mc1r = sdhci_readb(host, SDMMC_MC1R); > + mc1r |= SDMMC_MC1R_DDR; > + sdhci_writeb(host, mc1r, SDMMC_MC1R); > + } > sdhci_set_uhs_signaling(host, timing); > } >