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 9C0C6335BA3; Mon, 18 Aug 2025 13:52:41 +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=1755525161; cv=none; b=Se23cT46cS2PaHV1zKa8wIY51R67ECjcaxQBxoCybyle1Q9dSlcbGiCaRqzCmDl/sTBzz/4zVCL7RkYKzewjc1yIQbkz6HaYn6qb1dNOCehVlbKjxKgoKVm4JhwoDlFyfuSUpzSLf5Ka7fBvGX14vZyHnuE2pSX+UFchJaHuPrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755525161; c=relaxed/simple; bh=CACJyo/dWcnIkYoMgryXpD97bs6U5DcqA10uzcpESNE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PBWg+o5WMIiNqvRhf9toR6eaz38gpvDW12j0ymPFf+tiwVHX6mib2BqTtCbBKZYpGWdK6z5mffKjVyiHofCOVOrfttSLKJxlc2fqXyhngCODD4W/t/Z6VuM/GKmIGllx4uSyH6WL98AW/75LWa6XfQWS0I6tbqGjdnoWfrTPknI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NoFRgitB; 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="NoFRgitB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 019DEC4CEEB; Mon, 18 Aug 2025 13:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755525161; bh=CACJyo/dWcnIkYoMgryXpD97bs6U5DcqA10uzcpESNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NoFRgitBZp7PKQoOozS/iP5eQMgK3y/CKyrL+i5DU8l/dUdOWXJOF65UclnDUR27f OFN7/TrMrWJgyaAItMLT0tZuHOYJNFSIEIvbDzLR2BBuTb8TGz6ncnwVR8ovrHIx99 P6piOVtflVw4aMOBk/c80RDCAAwvHxqvM3QxgmUg= 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 6.16 178/570] mmc: rtsx_usb_sdmmc: Fix error-path in sd_set_power_mode() Date: Mon, 18 Aug 2025 14:42:45 +0200 Message-ID: <20250818124512.654632057@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124505.781598737@linuxfoundation.org> References: <20250818124505.781598737@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 6.16-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 d229c2b83ea9..8c35cb85a9c0 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1029,9 +1029,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