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 CB50B51615E; Wed, 30 Sep 2026 16:19:01 +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=1790785148; cv=none; b=SIbGhinzsp63wO9CXot/bOa3kWybObPkRwF5oeqgVBnYkTwpNmhMchP46rK9/ywWcEu3gNjA7GUvtvCgSrWWgedEL3vh01q3wK8iFqaapEh/pjyJaAKGDzp8qopOH6BGSiEBNbL1W8iWuFqyDpz6vojJNC6u3A5gpgi4aB1wK6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790785148; c=relaxed/simple; bh=C46FTdnpaIpX/wtjm8BVYs1cdUD1AIMARFOZuK3PRHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f+RIngfrTleW3zuPc5kNood4Q/qm9aZbMzuJL4zs+f6kzzRPVaaEd+gb9lhiVQSJboWLh/M4KvVyFqpk/WCldzGht5ZKResk0sCP/kdumEnpyyFbXukdE8iaBr2emXtktfQ0jw9NexrjpUt5ckShegMHsue89c92ngUGKpALlqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1jYwXmyp; 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="1jYwXmyp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED3501F00893; Wed, 30 Sep 2026 16:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790785138; bh=R/kGoqc2aKgKZz7avBqmAyQjaO8WuCylaHSRm0PuJnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1jYwXmypnGwlohdMwJbwk64dnMg6taZ7P9asnwvTV9Dz2A7Y/oIE6/t2+khtu2eGS Llv1E9zdywe7BBj8YRAK+PR0x/eXYkGqEiEbTkaGvA2qpBw7Tt+IEq9xEzH8zfwaZv xjZ9fg7XhoIz5+WOF9dK5h+Ee8Xo0Z5xvzJsuyoc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gongwei Li , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 348/982] Bluetooth: hci_mrvl: Fix wrong return value check of wait_on_bit_timeout() Date: Wed, 30 Sep 2026 17:18:04 +0200 Message-ID: <20260930152424.290216953@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152416.775402466@linuxfoundation.org> References: <20260930152416.775402466@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gongwei Li [ Upstream commit 2deb76c21b81e42b3282224f7dd2046fe73fd1e0 ] wait_on_bit_timeout() returns 0 if the bit was cleared, -EINTR if the process received a signal and the mode permitted wake up on that signal, or -EAGAIN if the timeout elapsed. It never returns 1. Hence the check "err == 1" in mrvl_load_firmware() is dead code: when the waiting task is interrupted by a signal (-EINTR), the code falls into the "else if (err)" branch and misreports it as "Firmware request timeout" with -ETIMEDOUT instead of propagating -EINTR. Fix this by testing for -EINTR so that an interrupted firmware load is properly detected and reported. Fixes: 162f812f23ba ("Bluetooth: hci_uart: Add Marvell support") Signed-off-by: Gongwei Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_mrvl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c index fbc3f7c3a5c71..b986bdbe09b56 100644 --- a/drivers/bluetooth/hci_mrvl.c +++ b/drivers/bluetooth/hci_mrvl.c @@ -297,9 +297,8 @@ static int mrvl_load_firmware(struct hci_dev *hdev, const char *name) err = wait_on_bit_timeout(&mrvl->flags, STATE_FW_REQ_PENDING, TASK_INTERRUPTIBLE, msecs_to_jiffies(2000)); - if (err == 1) { + if (err == -EINTR) { bt_dev_err(hdev, "Firmware load interrupted"); - err = -EINTR; break; } else if (err) { bt_dev_err(hdev, "Firmware request timeout"); -- 2.53.0