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 44B3647CA62; Mon, 31 Aug 2026 13:56:02 +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=1788184564; cv=none; b=fpIEjxBsz06izvEypEdz/Zpe7jpBD4WNMhQijC6707j7O7kX7A+RPOgmOvuNMwLzzBGo9+K8x9v6LAOc6uWr7xtzBYQ1haSJj4K6oRB4Hxv88xXhj52tuXIamTRrSm/ErHw0jv64WTqiEOPStuoHdG+ukXgvNYP/YRMutnMjcKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788184564; c=relaxed/simple; bh=Tl06liVuCCLJZBpTiBsfk55bVdGhYNXw1seEdqksYiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E14tuue9PUNWriDwMzrIG7AS+jK7IMnPUDGgKxh8eFdum5ygC97q+u8Yn8uaKHvhAtbxZNPQx3ORap4dxzoabnQdPTZX60f0ww/zZUnM05o5s5D5OQ9sE8Veg7zgzhvBuJfjUfwTh03qtzYEsRn/vOWJGIekT34NJEQWQQOVSv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0SkHsvAq; 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="0SkHsvAq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE5341F000E9; Mon, 31 Aug 2026 13:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788184562; bh=j9MVQYLlQJjUdYTo1xI152LcDCTXwcOa01ih9qiQvfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=0SkHsvAq6BPJpwz1q+63t6ZHHCJ1gw6fsvkdqsazseP9LxmexeRZkXxoLy3FU0JW3 FzQ8s5l1xLVVqraSs3qaDYoZwE8nA++GgHUVAi37U775lR/UGrkfMGhFfUWvk4sy3+ Pb7P5+hFxyx4iUG/P+NKeLIITGbrcWQh3PiAPEI8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Tomasz=20Paku=C5=82a?= , Jiri Kosina , Sasha Levin Subject: [PATCH 6.6 51/91] HID: pidff: Support device error response from PID_BLOCK_LOAD Date: Mon, 31 Aug 2026 15:34:39 +0200 Message-ID: <20260831133402.390435464@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260831133359.468089036@linuxfoundation.org> References: <20260831133359.468089036@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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomasz Pakuła [ Upstream commit 9d4174dc4a234408d91fd83725e1899766cd1731 ] If an error happens on the device, the driver will no longer fall into the trap of reading this status 60 times before it decides that this reply won't change to success/memory full. Greatly reduces communication overhead during device error situation. Signed-off-by: Tomasz Pakuła Signed-off-by: Jiri Kosina Stable-dep-of: 67bb1074e3d2 ("HID: pidff: fix OOB write when hid->inputs is empty") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hid/usbhid/hid-pidff.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -131,7 +131,8 @@ static const u8 pidff_effect_types[] = { #define PID_BLOCK_LOAD_SUCCESS 0 #define PID_BLOCK_LOAD_FULL 1 -static const u8 pidff_block_load_status[] = { 0x8c, 0x8d }; +#define PID_BLOCK_LOAD_ERROR 2 +static const u8 pidff_block_load_status[] = { 0x8c, 0x8d, 0x8e}; #define PID_EFFECT_START 0 #define PID_EFFECT_STOP 1 @@ -515,6 +516,11 @@ static int pidff_request_effect_upload(s pidff->block_load[PID_RAM_POOL_AVAILABLE].value[0] : -1); return -ENOSPC; } + if (pidff->block_load_status->value[0] == + pidff->status_id[PID_BLOCK_LOAD_ERROR]) { + hid_dbg(pidff->hid, "device error during effect creation\n"); + return -EREMOTEIO; + } } hid_err(pidff->hid, "pid_block_load failed 60 times\n"); return -EIO;