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 0CCEC42CAF3; Thu, 16 Jul 2026 14:32:10 +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=1784212333; cv=none; b=nRlYqRX1vcv/WhpEq2d7qGF2KsuZmDFx8IfXpBQD+kQPTKKzlak9cAvcM89pGVzGUKwtLqNmJ6rLa5Y0x+q4QxdL6Ln42sfUX9iBB0xrwYywkjqO5uROVnI9ULL4rOjCC/fnpejopJOV5WCpb4fZWam0HVtRZAMvvxllcnPksu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212333; c=relaxed/simple; bh=7DCToQnkzmL/pQmcK1auj+tQ8X6R7XqoG8LfbO9vWAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AgdCqeTEc0mLldU9gZGxsfDW0SfwQuzNGHbcFbXy5Li79iUyEFuE4tSn14KIVAONoIw+99R/Q5lz8LZ0CL+wiJBW0DeCWNKaYLNGr6XDyRTGolJI5ASaA7pY5kj7/xFVtEbBsvTNgsXLQ1Rrhiyhl/p7WEzWecUaNedb5g6QamQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kS+oaohW; 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="kS+oaohW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A5821F00A3E; Thu, 16 Jul 2026 14:32:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784212329; bh=9s5stWowGzWKjiHZuN7yjg4ZvWafDKCGCMqSiVLBFFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kS+oaohWwdrol0buNN3bIaZzwelMG7pRcw75uueOZWaWaj63H5GtZQxrdSo50Dxyv SmP9Sd2uWZRLI6mV1COQQjQAu7l1YHp6MfXFd22H7EDizPY8Nx9PNxlAKkQHJh+l7O WRhk23mzLIhBb+02hn8wMzvkYnrfPCQ2R5qaImHQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Xu Rao , Alan Stern Subject: [PATCH 6.12 243/349] USB: usb-storage: ene_ub6250: restore media-ready check Date: Thu, 16 Jul 2026 15:32:57 +0200 Message-ID: <20260716133038.797577403@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133033.287196923@linuxfoundation.org> References: <20260716133033.287196923@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 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xu Rao commit 5fc3f333c001f1e308bbcdeecdec0d054d24338b upstream. Commit 1892bf90677a ("USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c") converted the media status fields from bitfields to bit masks. The original ene_transport() test called ene_init() only when neither media type was ready: !(sd_ready || ms_ready) The converted test became: !sd_ready || ms_ready This is not equivalent. Restore the original semantics by testing that both ready bits are clear before calling ene_init(). Fixes: 1892bf90677a ("USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c") Cc: stable Signed-off-by: Xu Rao Reviewed-by: Alan Stern Link: https://patch.msgid.link/F42641386E32404F+20260626070607.4119527-1-raoxu@uniontech.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/ene_ub6250.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -2306,7 +2306,8 @@ static int ene_transport(struct scsi_cmn /*US_DEBUG(usb_stor_show_command(us, srb)); */ scsi_set_resid(srb, 0); - if (unlikely(!(info->SD_Status & SD_Ready) || (info->MS_Status & MS_Ready))) + if (unlikely(!(info->SD_Status & SD_Ready) && + !(info->MS_Status & MS_Ready))) result = ene_init(us); if (result == USB_STOR_XFER_GOOD) { result = USB_STOR_TRANSPORT_ERROR;