From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 25E69531B0E; Wed, 23 Sep 2026 14:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173807; cv=none; b=ag3swOBW4ULOYV/RvUqEmx7/fHx+OEHpjh18MrjvRndksVV1Inwus5yRWk/9RjSap0acrjt4Qp3WIGD050qcDJrVwlnqUa6+ZDI9zCDMcfIF3rFkjIBto3OU3vBxY5b5TlgbZIlT5twHIvDgzQ+61UXxUcWhv7XY+y/gmm0yLOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173807; c=relaxed/simple; bh=P4td8dWbJbD7s/tECUrIdmtH3xO9W5Hz60sz5XAeADc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mRvdakQk+dELsbV20K1R6+Lhwb4GvFoPF8nwpb88+iH4NdvuQdFNuex8iZy3pQlxWrkZ4/nZVuOYBG74iSfDELrwJVR8CddSdDH7GjHqLmctHjep3fz6hbEi7y0N8maN2DZCw65uKlMJZRoepgHxyUSHqg3r/7qZu79J8NwYBak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SxLK8pAN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SxLK8pAN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B2451F00893; Wed, 23 Sep 2026 14:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790173805; bh=bumQrx6itgBB9H9+HMh8mdJW8VQLcPjUz+OVlBfE+d4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SxLK8pAN+dVEZHoqnPuFUTsDugsIYhm/o20AqqxEATQxU0NyORP5Xg4/6HxeWzqwU g+lgUYFBxpUtRQnkpd/ySTXzOyAim1aU8jMX34fqmD1nDnUoEvWb1a+7o0o7sifB7o 6iTusf/RXFpDm+ySQeuJqZsKG0blMlk2VXABpHDM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Diogo Ivo (Schneider Electric)" , Judith Mendez , Adrian Hunter , Ulf Hansson Subject: [PATCH 7.2 349/438] mmc: sdhci_am654: Move tuning_loop to local variable Date: Wed, 23 Sep 2026 16:06:10 +0200 Message-ID: <20260923140653.868644172@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140644.756254324@linuxfoundation.org> References: <20260923140644.756254324@linuxfoundation.org> User-Agent: quilt/0.69 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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Diogo Ivo (Schneider Electric) commit ff894dced1a7ad7523f9c65dbdb53d02474cca0f upstream. The tuning_loop field in struct sdhci_am654_data is only used within sdhci_am654_platform_execute_tuning() as a loop counter that is initialized to 0 in sdhci_am654_init(). Since it shouldn't persist across function calls, otherwise every failure expends its "budget", move it to a local variable and remove the struct field along with the now-unnecessary initialization. Signed-off-by: Diogo Ivo (Schneider Electric) Reviewed-by: Judith Mendez Acked-by: Adrian Hunter Fixes: de31f6ab68a3 ("mmc: sdhci_am654: Reset Command and Data line after tuning") Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci_am654.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -151,7 +151,6 @@ struct sdhci_am654_data { u32 flags; u32 quirks; bool dll_enable; - u32 tuning_loop; #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0) #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1) @@ -576,13 +575,14 @@ static int sdhci_am654_platform_execute_ struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); unsigned char timing = host->mmc->ios.timing; struct device *dev = mmc_dev(host->mmc); + unsigned int tuning_loop = 0; int itapdly; do { itapdly = sdhci_am654_do_tuning(host, opcode); if (itapdly >= 0) break; - } while (++sdhci_am654->tuning_loop < RETRY_TUNING_MAX); + } while (++tuning_loop < RETRY_TUNING_MAX); if (itapdly < 0) { dev_err(dev, "Failed to find itapdly, fail tuning\n"); @@ -806,9 +806,6 @@ static int sdhci_am654_init(struct sdhci regmap_update_bits(sdhci_am654->base, CTL_CFG_3, TUNINGFORSDR50_MASK, TUNINGFORSDR50_MASK); - /* Use to re-execute tuning */ - sdhci_am654->tuning_loop = 0; - ret = sdhci_setup_host(host); if (ret) return ret;