From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76453208A7; Sun, 1 Sep 2024 16:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725209690; cv=none; b=gqr8bKEVcRc+5MRxQD5kFTv9v7SDVz3Yd2Tj3tHlUSxh0EWu/OC8z4llYGTrCfKsiIbYVpztYs2ifbD+5onQcsnZv911kvRRTyP1JFeKbZuqs5rskusOJrrBTS1Yp2wNdf62J+9qjOTNOXRXMW3Ripr7I34qxmPB9MseDzYWiWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725209690; c=relaxed/simple; bh=p7RpoQeqGGYCL+2dgULjvTYWlkuSJ1dqR17aZXx8Qdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6f35mh6ven5FnyoJtgGMX6K12+ZHt32QTb4q4QmjMEatb6IdXVcW/c+NpPUMGLOtb472aoP2deIAhVBwX+zj13jboQdewasbbdQ6Oevb7PsTVLcmvsJp8W7Es9716HFxjuvFKYezpiroy5MAZj2+jQx3YYl0zuRb9mrF5IZsSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jVMbunCH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jVMbunCH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77D6DC4CEC3; Sun, 1 Sep 2024 16:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725209690; bh=p7RpoQeqGGYCL+2dgULjvTYWlkuSJ1dqR17aZXx8Qdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVMbunCH8k5uLzlpAJPWTFHWbZtueXKxlkmEBPMOx86MoV6uBoPc70Xfohp+aJFDm AjkTeT/bYQ2rk44dV85nAWxH059OL+Td6IFEVQRP2OklgP3R8obHsKYnd2AWIQnHFG Bc5CzQnVlzNbAH/BWAFy5sY88sJz6kLgX4ySb0xc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ben Whitten , Ulf Hansson Subject: [PATCH 5.10 114/151] mmc: dw_mmc: allow biu and ciu clocks to defer Date: Sun, 1 Sep 2024 18:17:54 +0200 Message-ID: <20240901160818.398411511@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901160814.090297276@linuxfoundation.org> References: <20240901160814.090297276@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Whitten commit 6275c7bc8dd07644ea8142a1773d826800f0f3f7 upstream. Fix a race condition if the clock provider comes up after mmc is probed, this causes mmc to fail without retrying. When given the DEFER error from the clk source, pass it on up the chain. Fixes: f90a0612f0e1 ("mmc: dw_mmc: lookup for optional biu and ciu clocks") Signed-off-by: Ben Whitten Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240811212212.123255-1-ben.whitten@gmail.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/dw_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3171,6 +3171,10 @@ int dw_mci_probe(struct dw_mci *host) host->biu_clk = devm_clk_get(host->dev, "biu"); if (IS_ERR(host->biu_clk)) { dev_dbg(host->dev, "biu clock not available\n"); + ret = PTR_ERR(host->biu_clk); + if (ret == -EPROBE_DEFER) + return ret; + } else { ret = clk_prepare_enable(host->biu_clk); if (ret) { @@ -3182,6 +3186,10 @@ int dw_mci_probe(struct dw_mci *host) host->ciu_clk = devm_clk_get(host->dev, "ciu"); if (IS_ERR(host->ciu_clk)) { dev_dbg(host->dev, "ciu clock not available\n"); + ret = PTR_ERR(host->ciu_clk); + if (ret == -EPROBE_DEFER) + goto err_clk_biu; + host->bus_hz = host->pdata->bus_hz; } else { ret = clk_prepare_enable(host->ciu_clk);