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 BF7B0350D46; Tue, 26 Aug 2025 13:50:00 +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=1756216200; cv=none; b=ZPnE2ArTIRcley2rB/V2rIK4TO3BsUqiDED0feHq9KWlgZ/zyheQutiik8K3zAQfxth3vRl3VXQzlYnZh1aAVDVxOFHQy4RwWia5Gbqs1yFZpY0FK1GIbyUhW6WwKpcrHBFcplT57xl+fIGv5Ld4JKYZZfaaCAEVsN+Z8ZRuJFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216200; c=relaxed/simple; bh=Gl//hmvBv5AwloJVO5vRWcYMl4IV+gAdJq0dZpWQaDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dS17lbMUBM+lIClt1Ik3HDTUdpUrDd9UUdotfFAapD4du/htMEf/1JyyV49FMD7/ACqJsbkHlqCuGtT1R6ZxkudeTz3IkC0BxheI+nRpmkikz22RwyCejqGHIhTjjZXzcwineNXfqxXPQq8KHAKO7x04ZS+O+6UhcAaPJv7ACrs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YMPBt0Fx; 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="YMPBt0Fx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29439C4CEF1; Tue, 26 Aug 2025 13:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216200; bh=Gl//hmvBv5AwloJVO5vRWcYMl4IV+gAdJq0dZpWQaDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMPBt0Fxjz+jWBx6QgGdcTUpI0pfxmmPoAkPS96a5mv1UKlJ5zXxQQdKJ6vC5Ocme tV0+vi5j7F4ghMNeKB/YLBulyYtOP4Cccl0axBYxRSN9jyw5E02MCEaRGLT3+SPYZX o9FwsTe1c/kVEwgM5TsyK/lRiAm8//E7/kXyLY2w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Avri Altman , Ulf Hansson , Ricky Wu , Sasha Levin Subject: [PATCH 5.15 322/644] mmc: rtsx_usb_sdmmc: Fix error-path in sd_set_power_mode() Date: Tue, 26 Aug 2025 13:06:53 +0200 Message-ID: <20250826110954.363793885@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ulf Hansson [ Upstream commit 47a255f7d2eabee06cfbf5b1c2379749442fd01d ] In the error path of sd_set_power_mode() we don't update host->power_mode, which could lead to an imbalance of the runtime PM usage count. Fix this by always updating host->power_mode. Reviewed-by: Avri Altman Signed-off-by: Ulf Hansson Acked-by: Ricky Wu Link: https://lore.kernel.org/r/20250610111633.504366-2-ulf.hansson@linaro.org Signed-off-by: Sasha Levin --- drivers/mmc/host/rtsx_usb_sdmmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index 1be3a355f10d..ab7023d956eb 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1032,9 +1032,7 @@ static int sd_set_power_mode(struct rtsx_usb_sdmmc *host, err = sd_power_on(host); } - if (!err) - host->power_mode = power_mode; - + host->power_mode = power_mode; return err; } -- 2.39.5