Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp391374ybt; Fri, 10 Jul 2020 02:31:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2mR/XMDiSke0dqrTWxvyn7+bZLA5hPfh8PK5qu8SDKa7fVcn87OI5a7hNV5J7Ij9UMSBk X-Received: by 2002:a05:6402:174e:: with SMTP id v14mr62062745edx.153.1594373463438; Fri, 10 Jul 2020 02:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594373463; cv=none; d=google.com; s=arc-20160816; b=UWgN63v6gc3NuicqngMyJp3mJ7gLnnwlvlwFOale1j77H/JtSFyu4nnAJ86NyxASUb KnrD/YfbLwih5Jh1A+aKF+lvMwPADRksf/DvC3tZgG9ecfxNPDBmFZfiaDPQrrTF9g+M 7gHUba9Xc+cOY3aRtdAIRBJM/LEghHpmmqHxVkxZUaGoPaidGASmprWeKasJYwGDK+MI VQGW4INnsNADJ3VibMiWNyI+uGE7h7n/OHLChq0XhdE6TcaMBfIioRB0hMa/M3FDy9xw giEXY5S+zrJOxLxO2SUicKLnXJK0DTuFmeg09eLySZwQtEeb7NI2sxP2wytU7txEGoKB TwgA== 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=MOW30LWGVGgHDsxnHhurzdv0a/FILHUvG2/DHcNZoI4=; b=RYhFrTuFisZA6GdTl2qc0sxHxuxYXIj0lBa6m0RhCX8iRYsLNRaJQMv7uAk++kRR66 sK3vE8TJwIjFpyvVlt+MGtDQ/n8miGM4xIIjIIxCzQXYDNcO9jRpiXU79q9uNHzVZ0gD HI9KnWxlqvNQ0xDLLjvk+yYFAyxRD1ShwpEzGLsro5/HZWRf9mcdF0RlxXiNXesGDls/ 1rQQD9yNuaOC6cKXZeO1rFJB4gIjOItu9Hk9y177HbEjkNHseELHYpeutgKPVFhO8u8H tdvDyFZre+PC6WsDr/sqhXUZtD9u5bohR07TX4kBr7poE6dCO/6GKOWn0PVqy+fnZETg rU6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bnzvDGU7; 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 qp2si3655248ejb.598.2020.07.10.02.30.40; Fri, 10 Jul 2020 02:31:03 -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=bnzvDGU7; 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 S1727910AbgGJJ2j (ORCPT + 99 others); Fri, 10 Jul 2020 05:28:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727828AbgGJJ2g (ORCPT ); Fri, 10 Jul 2020 05:28:36 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58980C08C5DD for ; Fri, 10 Jul 2020 02:28:36 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id k7so1604865uan.13 for ; Fri, 10 Jul 2020 02:28:36 -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=MOW30LWGVGgHDsxnHhurzdv0a/FILHUvG2/DHcNZoI4=; b=bnzvDGU7zXPbziIdRdVi4TSs+noharSMJVfDTIbjqh3RuVKK0nJ/VBqVGTnruLQFrY vmR4ws08bcS0UMCkkHbGcBXfdnkR+npTr64BVmBubl8z4WwpMcjFUcwHYJj93aKf4FsJ QEj9jZ1WNwB+nj5QMKwXZr5B7oVkw9qdSc9ly0GTwz1qV6LcsRGQ/2ge18PSuOSniSZB baYZCaXWJFE6BvQl53n3P9QVXZZWmoituUaX997p1PsqkypK8K+4/5bXQk/ECjb8kY+A +VprU+YP1ApyUjZlgGBpCkkk++TTfNmGpn+fbjEAKQ+AtAJKQkbxmHKvjlOAHONidE64 kliw== 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=MOW30LWGVGgHDsxnHhurzdv0a/FILHUvG2/DHcNZoI4=; b=CYvULI6Vg/2PLaVAvVAj94sdJv5qPsHl0HBj66/va81g9MhRtOFKeDBLF8LNBKutQF g5zuBEew3/FenLfST12meZPASL5caSIgB0SBufUJbYgeRpa4d0LjtDH3Vof9D6S5bXxn XePwditOcORcXvVKHkGUnznNkcuE2NXpw7sUBkF6q+/u8gFQCpx8g7rQWPL2zWTwKq+x dwPwUwkt0ZwHpLuM99/UiZMVan4C25hIStcdLeto8oQkBmTwkNQsdvgqqAm/oljiX6xi 3SGp5Jk1uhqc66ojQTPpov+yyW5EzK925cowQmyuqIWNTl/MDpUhIO3n71VmRD7zKCt/ MhWg== X-Gm-Message-State: AOAM533Tc3Eb/aOmZrQ/nZysndbi7EQ2KeRLitGSFyNlyB0leHHqrrks ubOYd/nK+dRjRjebBhPZljMlvLAouKj2XnYRSsKQ8afw1DCIow== X-Received: by 2002:ab0:4e98:: with SMTP id l24mr17930390uah.15.1594373315479; Fri, 10 Jul 2020 02:28:35 -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 11:27:59 +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 Applied for fixes and by adding a stable tag for v5.4+, thanks! 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 >