From patchwork Mon Jun 9 01:46:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 894953 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 7E58312B94 for ; Mon, 9 Jun 2025 01:47:31 +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=1749433651; cv=none; b=KqNzpRGFdyR338TixzNXHtwIu6WuESBL8zy+ST4Kuemo6La/JWtBPZoh6O4VuyxyHhkHJZveSwrAYQMT1pbRbjH7P+Xlba8RzT9d64fnzsosQdiF36uJwCgUUGykS6r98fzC0pSKoaXYZI9DEKoczyoNWihQquC9qYyqy1PfyAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749433651; c=relaxed/simple; bh=wAu9Bm+Mw5O4OaXL9CM7XNDo23JDWr8bPutnxZzqeY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PPVU+T4+/0lIi1tKkcyeJqFKGc+f3/2Kd3qXYnF1aG687u8ZQtipUdFizEpYemA5OiLVZ2lZPjNf0EcrXAWjfd4p0+QoE4lPKD/sIFIHvhIerb0rv/sNhMin2hDd78saf7gP/NfcSZbi8hel4yRRbPtOR/bo7jOCOmw3hd/LBvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OptiznrD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OptiznrD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A96EC4CEF0; Mon, 9 Jun 2025 01:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749433651; bh=wAu9Bm+Mw5O4OaXL9CM7XNDo23JDWr8bPutnxZzqeY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OptiznrDEF2ZIOf4GS2QUSQ3LrHWjbeQEXB+s+yLKAYPk4/iDq1zNXAzQkxwkoW8+ r/JVV+rYdDnuBXztRIdFHX/XgAvfcrtuJccH+UJNeJwOBsT/IKhtbPp7eALQcUsxlT Ys42MCBxgRNuGBGlbbONuzOYLImduVrnZXM35x6SPTDofGnEsxNTpc1ytQjPyM7CSq b6P3ey99cVmBBr7muNpCn0L3H7d2HDnFpQrN9UVW3EjuRLTzrHL289owV2bMl6CJ3B X4X9qlF4UJjrHZVM+H1D50bBxLf+Uu95Z1nMpyUG32FvU6TA1NsPy1lbz9pNbVVSQh HMy8kvPvtYvOA== From: Mario Limonciello To: mario.limonciello@amd.com, dmitry.torokhov@gmail.com, rojtberg@gmail.com Cc: Vicki Pfau , linux-input@vger.kernel.org Subject: [PATCH 1/2] Input: xpad: Adjust error handling for disconnect Date: Sun, 8 Jun 2025 20:46:30 -0500 Message-ID: <20250609014718.236827-2-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250609014718.236827-1-superm1@kernel.org> References: <20250609014718.236827-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Mario Limonciello When a device supporting xpad is disconnected it's expected that a URB will fail to transmit. Only show an error message when the error isn't -ENODEV. Cc: Vicki Pfau Fixes: 7fc595f4c0263 ("Input: xpad - correctly handle concurrent LED and FF requests") Signed-off-by: Mario Limonciello --- drivers/input/joystick/xpad.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index c066a4da7c140..714a694fc0e5e 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1344,9 +1344,10 @@ static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad) usb_anchor_urb(xpad->irq_out, &xpad->irq_out_anchor); error = usb_submit_urb(xpad->irq_out, GFP_ATOMIC); if (error) { - dev_err(&xpad->intf->dev, - "%s - usb_submit_urb failed with result %d\n", - __func__, error); + if (error != -ENODEV) + dev_err(&xpad->intf->dev, + "%s - usb_submit_urb failed with result %d\n", + __func__, error); usb_unanchor_urb(xpad->irq_out); return -EIO; } From patchwork Mon Jun 9 01:46:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 895428 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 5947812B94 for ; Mon, 9 Jun 2025 01:47:31 +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=1749433652; cv=none; b=Z08+40AnC0C1CSzEzPPUpu+eogyc9PZ/kK7Msjgg2ZLFZ0zI+zW9s5fBbx1X1cjGpROSvbFwieTwjasyayQpGD+it3mxqsyPQOVFScOpxo/jvGPSFPftCEuE+/WpFagPbZK/hBE3WRFM+q5yG4AGP+0FDZci0koCo5bYALSUY3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749433652; c=relaxed/simple; bh=B3CWKIvI0N2BSscz1/Po4D9VzhIdcbq/q5959aWc0cU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m9ERH8yIR5GwAC5OezGdPVvuXVMoNwM11C4km0GCVcCvdcvARgkublLK6gfMS3c3fGxoUX673r0qHYyYH6poh3Nz+PMEvyHEQajcgPmzdJLll6DjDmUyDCGZn7PH9CG6pGTYTmf2aAZ6W8dN3APNFfvLhMlzsu+HU7Ru6SIB4SY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pjd9ohDe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pjd9ohDe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56DC9C4CEEE; Mon, 9 Jun 2025 01:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749433651; bh=B3CWKIvI0N2BSscz1/Po4D9VzhIdcbq/q5959aWc0cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjd9ohDe6tW6KWGOsKsnTHdT8ECIma/31gCchW6SqrwAnfoeyBa9PeJk62epFhcwI kke6NQseGL8W4MVsnQZWoJ2rMJEA8F22NfIbJnRRu1I40Czm+geuWXD62vmpv5Zng/ SL0bzrGSUCVs9/C3z+ElRGcv9hrw2DZShSS8HkDojnk2n3Qtki24bl4lrbksp1ztvx f5G80FQ2wRgpUg5dUzexkG0LGPA7NzM+kJWKAl0nsnRGu02rbpErjgb8zVSLVTnCuh 0CI9l6U0XmVLrL9dWwV5ehBQNXasLWkHjTARbkTsMfSA8ToWzGWnULgUET++akCfr6 GAsWNYbyZ8aHA== From: Mario Limonciello To: mario.limonciello@amd.com, dmitry.torokhov@gmail.com Cc: Vicki Pfau , linux-input@vger.kernel.org Subject: [PATCH 2/2] Input: xpad: Return errors from xpad_try_sending_next_out_packet() up Date: Sun, 8 Jun 2025 20:46:31 -0500 Message-ID: <20250609014718.236827-3-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250609014718.236827-1-superm1@kernel.org> References: <20250609014718.236827-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Mario Limonciello Not all errors that occur in xpad_try_sending_next_out_packet() are IO errors. Pass up the error code to the caller so that it can decide what to to. Cc: Vicki Pfau Signed-off-by: Mario Limonciello --- drivers/input/joystick/xpad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 714a694fc0e5e..e0374111d0174 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1349,7 +1349,7 @@ static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad) "%s - usb_submit_urb failed with result %d\n", __func__, error); usb_unanchor_urb(xpad->irq_out); - return -EIO; + return error; } xpad->irq_out_active = true;