Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4879611pjb; Mon, 27 Jul 2020 07:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVfUp09bOp014nFd3T2mab+nBVpLtWMIYlnRhqiwzcY0mMh4gA5wVzaW8BOTcAnLpslrkk X-Received: by 2002:a17:906:af72:: with SMTP id os18mr14553790ejb.43.1595860068883; Mon, 27 Jul 2020 07:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860068; cv=none; d=google.com; s=arc-20160816; b=Ivz5wWKikMV/JZz5owNH0LyXfhI27o2UFxLPx7H6PkED2UgXF30QaGVDG7m4aRnEif 3SVzs3JjZWPw4JO1jEqah0lc8IkzQmqXjdzxYMtZvFEHkJCsVOzyhjpJeXvToMormflA 3olMKajw5maIIG2EJjgzNf1OvCfJxOY/aYZaQWtwe3YuZ/m/iMW42heYn5K9xSKqc19Z S8JBBOs+0Quds1xxtxqDmS/JqICx9atpWCoBQ6enSgqkophAmISNH5VpYjqxsnT+yPUu ENH6MBE/UNnHOjl6mLYDS4dTfDliBqnuT74qTeLk4VLuJAHTAHuoIFoD4J2YfykPFwrg Xe4g== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q0L2lnSdOU4E71JUnCY0tQmiEAJuW/BN4GHjhocrCWU=; b=pI7vFXkVxdGjxNiFXF6ygnabOxwBXNWrxSTkbWYqObZQcse9wGxLcAjofVjJSPzS1l t/MYkCV4PjRPFAZ7SY+PRtMR7FHnAPuZHE6b8CR/NJ81FpIISakDGNAPYwLnZpE1xtES aMbKk4CmkJUqDMwqAgKGmX5sNhO0p3u67Qwj/Htfttk8uaib4nrUlRohQgyAM7Gzo8o7 zk7aqZY2MKdhYfX/4jm1fvW5duo5NYjHXo83kqlWciPJjXUwm2EtU3Llc9KhO8cwBLCn 7MI7YZhm4alfSVjvmNMVLrfYO0y7i9PeijpFjCk9fZMCzTWpaUFBi8vTd9A+SBfA+qg5 +dtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xamtOT0S; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si5614610ejp.629.2020.07.27.07.27.26; Mon, 27 Jul 2020 07:27:48 -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=@kernel.org header.s=default header.b=xamtOT0S; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732501AbgG0OZq (ORCPT + 99 others); Mon, 27 Jul 2020 10:25:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731876AbgG0OZo (ORCPT ); Mon, 27 Jul 2020 10:25:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8421207FC; Mon, 27 Jul 2020 14:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859944; bh=aH9N2X8cK9yWknxgS/kGhUdLd4Tp5DOTt7iEgW0I6Q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xamtOT0S8Nwv2Wew5yJ23K4cw2cz6n9PQ6JLdTtynZDEWRG/p41TFNwwCrfTxG5Gl Gfivwlo3G3KMNzBX08DMkESfWX/43zC6WtQNNmhdCwhf1eJPKhP77hdNz0AnfrJaBH dro+dIntJzxKDKToopaLcDI8D71qdb4LqN2IPiyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eddie James , Andrew Jeffery , Joel Stanley , Adrian Hunter , Ulf Hansson Subject: [PATCH 5.7 166/179] mmc: sdhci-of-aspeed: Fix clock divider calculation Date: Mon, 27 Jul 2020 16:05:41 +0200 Message-Id: <20200727134940.746906590@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eddie James commit ebd4050c6144b38098d8eed34df461e5e3fa82a9 upstream. 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 Reviewed-by: Andrew Jeffery Acked-by: Joel Stanley Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20200709195706.12741-3-eajames@linux.ibm.com Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-of-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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(struc 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; }