Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp334422ybt; Fri, 10 Jul 2020 00:41:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbMemZQHmMVcY7BgWXOPtUBZKK16jicljhqDWCsRVBwuWo8v6kkAMOTJ2324640RQkyall X-Received: by 2002:a17:906:9348:: with SMTP id p8mr38432596ejw.467.1594366866620; Fri, 10 Jul 2020 00:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594366866; cv=none; d=google.com; s=arc-20160816; b=qpsmiDrMIgr8fsfgjyweF7qt9fu4sB3UUYkawP1wqPqfW8KZWONQ/Ib+Ff+RDme+M2 kCJMEH1KkL0DzRPNGiOsaSOt1/ZZyqtKtgKENQPPbIZcWM/AlhKL7MZ/f61QZIkKV+q7 Q35pgifRpr+sI/dNfRPxP5LHLYzD4VkldhGvQhlQ3fl+s52aYabOKa7MtabCbRHLQaZB JtFUA+SOfDd7VfYNSmbeOS+IZLrxI/Znbql81cKs9HzuGnq7WKny7pzg7KLgqoIoLbJP 2Q/N/TuKRcbwXBcWS/z8cYwZkKhZRyBtimfpmBMOfkfWNftKI3UXdTvG1Hv2dZAjXk71 ktfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HbS7NrT88QQtzei4LIhV4jR15fEzmmczH+EWwTkx0Gc=; b=0D85qn4rjVGggobBch0pljy5sX0f0lxfSQop+GOW5Ib7aqCYPuoI+ltfL51N5eHvoQ 2ukSRJwm2wP71P8mAl1F0mINTamx6j504S/iMn+VMfLySmjztzNTwn758MIc7J9NBKmD LzUr1a+uIWWiTApTd4rSIJsNMPZbQ3lapoo+SKDRwpde48N0bzyi6Dno4I0Y7D7URWcQ YwWRhu2QudYku+aQD14SUCFDhjk/yFgCGxk18AB3Li8KHYfklZ1So7Oao2anvJE4PZGA qRTwcbZD/6UdSimPU4Qtm2mDbyQ0dACj7DLOsFcD8mrudYfJm0CsJn/ve+NusdhjzJR4 ZFPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S0F2RZ5t; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si3678770edq.301.2020.07.10.00.40.43; Fri, 10 Jul 2020 00:41:06 -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; dkim=pass header.i=@linaro.org header.s=google header.b=S0F2RZ5t; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbgGJHkI (ORCPT + 99 others); Fri, 10 Jul 2020 03:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgGJHkH (ORCPT ); Fri, 10 Jul 2020 03:40:07 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D4A4C08C5DC for ; Fri, 10 Jul 2020 00:40:07 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id m18so588071vkk.7 for ; Fri, 10 Jul 2020 00:40:07 -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=HbS7NrT88QQtzei4LIhV4jR15fEzmmczH+EWwTkx0Gc=; b=S0F2RZ5t6lwxkw0gw10S2nKQUqUR0kxq+ZFgzWnIqbArWFmnoTIFp2hoE/n9I7TMky UYZxYZK76jZwCpPuHolcsFVyPUMHA/+MlyQc3nc9K49PXc1HHJRP2te9zTe7Qx9ZOYXq JYZ5feuoHQe7fDKQWVsCTR6dfMeyB+3XY1zkE4ZO72ud1Amar4cIJdogSEFH61EhsRhS jUAPqyFz2z0LpzxYyhj+RqU8Luqkw8U373G+XHNw+qKcPlIynK/QTWK3Leeuyfx9nirz LsOQU4T9vHmstut2VpQ7BIlLmnsDqTQWC2SnM/4ThTrMvOkcceh/YR6rpBwyTAT5DSlu xetQ== 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=HbS7NrT88QQtzei4LIhV4jR15fEzmmczH+EWwTkx0Gc=; b=ozDpeTEQ4BZEFPTA6sjx4FxyrZrSBpjATP/W5xdW6YSuGNWX37BPCJBOdEd0xXPDMi bam+DGczVn9ch0XnCvMtcoTjS8egOM1bqXTz6aZFpowUbigotQVnLoUyR8ECZ7o1muKB 9wrxORrjABsOfQr5JPofL0FTxo4Jt/A6te3m5kIUxpctmgVR9pIWmyFvGr1aWmrQE7M+ CeSPyHXOYzHkq7ZI71/73ox21sAvE6kM/Ls9K2kGEi0rKeXsB2shuEVzJaY2LO/UaGRI qzRTUjvUZ3zXic1WmEjMvb4qxfrsYVJ6zwojp2uD8op5s8afq0j9WWHD7FCR0ubm+e91 8Wow== X-Gm-Message-State: AOAM531GFYfQsA1eUoyWmiCZM27LxxA0soBdtJwcqD8Fe4FG+fZzCvHI zjBcVJuiUpZacmDuAxEwal0Ff8VDjiFtbhoJyBDu3A== X-Received: by 2002:a1f:3f0f:: with SMTP id m15mr49715254vka.53.1594366806470; Fri, 10 Jul 2020 00:40:06 -0700 (PDT) MIME-Version: 1.0 References: <20200709195706.12741-1-eajames@linux.ibm.com> <20200709195706.12741-3-eajames@linux.ibm.com> In-Reply-To: <20200709195706.12741-3-eajames@linux.ibm.com> From: Ulf Hansson Date: Fri, 10 Jul 2020 09:39:30 +0200 Message-ID: Subject: Re: [PATCH 2/2] mmc: sdhci-of-aspeed: Fix clock divider calculation To: Eddie James Cc: linux-clk , Linux Kernel Mailing List , linux-aspeed , "linux-mmc@vger.kernel.org" , Andrew Jeffery , Joel Stanley , Adrian Hunter , Stephen Boyd , Mike Turquette Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Jul 2020 at 21:57, 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 Looks like I can pick this for fixes, as a standalone fix without patch1? No? Kind regards Uffe > --- > 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; > } > -- > 2.24.0 >