Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp305654ybt; Thu, 9 Jul 2020 23:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8sARKrve+buEXvtPLHmQurB+gNulJ5xYKk1Bi24xPlsXwOtBcYxYa8yf/9d9gOuEQFmp8 X-Received: by 2002:a50:fe18:: with SMTP id f24mr76046174edt.14.1594363377137; Thu, 09 Jul 2020 23:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594363377; cv=none; d=google.com; s=arc-20160816; b=FrA6nVpXN3xYjeNNfVFckwRbRLerNo5ozYAKzp+ebolhfCuXDyqUvd7GgIMBwS7PJF rrUt6YbxrzKP6sBgLx9CINJ30xupzkKiAtxFePGhw90N/OMIBdPBaGjufyev9pD0qiik tpc5pihmwGxAzU+TqqfUfu7KVXYMjviu4y4YcRTnboYmMeKUjICvcjoz8/TK8JOODnrk OVLja8WUHIFprX/kjfWV5J9weQ3wNnjclUAm6fzFZ64hdODhYTaZSDkpMB2Juc5VQdd9 Sbx/J0xBmKfNIn9prRCX8MpSnfZGUULUJ5F5XDOl+80y5JcRhjwWUxW/MtScerb4yHfs /kTg== 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:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=4Kp95xcLvejct59XRcNPlQi9Vmg8YjhG5ibMKzj49Gk=; b=dN2b+AYgI2M7FaW+z4RXdZrB7+pAAkcX21p3AVhgAPpw3tkyp9rSfSYdRdJo72IfSs M7g2COFF0UTlxSC/0JZXIWfFbTAgEWwXMgGdnX7gHiZ2ekbjpW0Ik9ewSCxRmrqac2dG 1thCvC9KPRBl2Ka025Y/uSdkKMYmUPLsGltjyxl+YMMrl16JBcNbmMO+yNBoi0y7scQG 6ZWFzQkge6a1GGvonvJcGhEAp4zDVNMgD5kdvxDamC/2+FbVT82EG+FeR4xqyEAQT9e/ 3mbTaUqF4iGYkRdhEYziY53fDEKM/zSWY3hhbruH4r2IC2+uH6O9hzAFqCXwQheeD9Fq CjKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k27si3300665ejs.676.2020.07.09.23.42.34; Thu, 09 Jul 2020 23:42:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbgGJGmV (ORCPT + 99 others); Fri, 10 Jul 2020 02:42:21 -0400 Received: from mga12.intel.com ([192.55.52.136]:11563 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbgGJGmU (ORCPT ); Fri, 10 Jul 2020 02:42:20 -0400 IronPort-SDR: goCKN8fJFrRqUYMG8LSHBGlNkDBlj6eVldNjYymrP4hBzEVLqaT7Fi0UAsG+Qb5UuEVD4O23Mb qiUSDMNVU8FQ== X-IronPort-AV: E=McAfee;i="6000,8403,9677"; a="127751004" X-IronPort-AV: E=Sophos;i="5.75,334,1589266800"; d="scan'208";a="127751004" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2020 23:42:20 -0700 IronPort-SDR: OdJt/DPOJXTDMtl6BzBoR7MaAS7AcbsrG9FJ0PXw5fygo6H4LpeFs/7DaaQQ4xt/62Ii+Vx3wz VKyUNZcouXUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,334,1589266800"; d="scan'208";a="389396441" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.73]) ([10.237.72.73]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2020 23:42:13 -0700 Subject: Re: [PATCH 2/2] mmc: sdhci-of-aspeed: Fix clock divider calculation To: Eddie James , linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-mmc@vger.kernel.org, andrew@aj.id.au, joel@jms.id.au, ulf.hansson@linaro.org, sboyd@kernel.org, mturquette@baylibre.com References: <20200709195706.12741-1-eajames@linux.ibm.com> <20200709195706.12741-3-eajames@linux.ibm.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Fri, 10 Jul 2020 09:41:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200709195706.12741-3-eajames@linux.ibm.com> Content-Type: text/plain; charset=utf-8 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 9/07/20 10:57 pm, Eddie James wrote: > When calculating the clock divider, start dividing at 2 instead of 1. > The divider is divided by two at the end of the calculation, so starting > at 1 may result in a divider of 0, which shouldn't happen. > > Signed-off-by: Eddie James Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-of-aspeed.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > index 56912e30c47e..a1bcc0f4ba9e 100644 > --- a/drivers/mmc/host/sdhci-of-aspeed.c > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > @@ -68,7 +68,7 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) > if (WARN_ON(clock > host->max_clk)) > clock = host->max_clk; > > - for (div = 1; div < 256; div *= 2) { > + for (div = 2; div < 256; div *= 2) { > if ((parent / div) <= clock) > break; > } >