* [PATCH v2] Input: xpad - Move Xbox 360 magic packet sending
@ 2023-05-02 3:12 Vicki Pfau
2023-06-03 0:35 ` Vicki Pfau
0 siblings, 1 reply; 3+ messages in thread
From: Vicki Pfau @ 2023-05-02 3:12 UTC (permalink / raw)
To: Dmitry Torokhov, Dongliang Mu, linux-input
Cc: Dan Carpenter, Vicki Pfau, syzbot+a3f758b8d8cb7e49afec
This moves the sending of the magic packet introduced in db7220c48d8d from
xpad_probe to xpad_start_input to ensure that xpad->dev->dev exists in the
event that an error occurs. This should also fix issues with suspend that may
occur with some controllers.
Fixes: db7220c48d8d ("Input: xpad - fix support for some third-party controllers")
Reported-by: syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com
Reported-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://groups.google.com/g/syzkaller-bugs/c/iMhTgpGuIbM
Signed-off-by: Vicki Pfau <vi@endrift.com>
---
drivers/input/joystick/xpad.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 50ecff681b89..40abea92c393 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1720,6 +1720,27 @@ static int xpad_start_input(struct usb_xpad *xpad)
return error;
}
}
+ if (xpad->xtype == XTYPE_XBOX360) {
+ /*
+ * Some third-party controllers Xbox 360-style controllers
+ * require this message to finish initialization.
+ */
+ u8 dummy[20];
+
+ error = usb_control_msg_recv(xpad->udev, 0,
+ /* bRequest */ 0x01,
+ /* bmRequestType */
+ USB_TYPE_VENDOR | USB_DIR_IN |
+ USB_RECIP_INTERFACE,
+ /* wValue */ 0x100,
+ /* wIndex */ 0x00,
+ dummy, sizeof(dummy),
+ 25, GFP_KERNEL);
+ if (error)
+ dev_warn(&xpad->dev->dev,
+ "unable to receive magic message: %d\n",
+ error);
+ }
return 0;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] Input: xpad - Move Xbox 360 magic packet sending
2023-05-02 3:12 [PATCH v2] Input: xpad - Move Xbox 360 magic packet sending Vicki Pfau
@ 2023-06-03 0:35 ` Vicki Pfau
2023-06-06 17:47 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Vicki Pfau @ 2023-06-03 0:35 UTC (permalink / raw)
To: Dmitry Torokhov, Dongliang Mu, linux-input
Cc: Dan Carpenter, syzbot+a3f758b8d8cb7e49afec
On 5/1/23 20:12, Vicki Pfau wrote:
> This moves the sending of the magic packet introduced in db7220c48d8d from
> xpad_probe to xpad_start_input to ensure that xpad->dev->dev exists in the
> event that an error occurs. This should also fix issues with suspend that may
> occur with some controllers.
>
> Fixes: db7220c48d8d ("Input: xpad - fix support for some third-party controllers")
> Reported-by: syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com
> Reported-by: Dongliang Mu <dzm91@hust.edu.cn>
> Link: https://groups.google.com/g/syzkaller-bugs/c/iMhTgpGuIbM
> Signed-off-by: Vicki Pfau <vi@endrift.com>
> ---
> drivers/input/joystick/xpad.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 50ecff681b89..40abea92c393 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -1720,6 +1720,27 @@ static int xpad_start_input(struct usb_xpad *xpad)
> return error;
> }
> }
> + if (xpad->xtype == XTYPE_XBOX360) {
> + /*
> + * Some third-party controllers Xbox 360-style controllers
> + * require this message to finish initialization.
> + */
> + u8 dummy[20];
> +
> + error = usb_control_msg_recv(xpad->udev, 0,
> + /* bRequest */ 0x01,
> + /* bmRequestType */
> + USB_TYPE_VENDOR | USB_DIR_IN |
> + USB_RECIP_INTERFACE,
> + /* wValue */ 0x100,
> + /* wIndex */ 0x00,
> + dummy, sizeof(dummy),
> + 25, GFP_KERNEL);
> + if (error)
> + dev_warn(&xpad->dev->dev,
> + "unable to receive magic message: %d\n",
> + error);
> + }
>
> return 0;
> }
It's been a month and this fixed version of the patch never got any replies. Did it just get overlooked? Or does the fact that the old version got reverted mean I need to change the description in some capacity?
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] Input: xpad - Move Xbox 360 magic packet sending
2023-06-03 0:35 ` Vicki Pfau
@ 2023-06-06 17:47 ` Dmitry Torokhov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2023-06-06 17:47 UTC (permalink / raw)
To: Vicki Pfau
Cc: Dongliang Mu, linux-input, Dan Carpenter,
syzbot+a3f758b8d8cb7e49afec
Hi Vicki,
On Fri, Jun 02, 2023 at 05:35:52PM -0700, Vicki Pfau wrote:
> On 5/1/23 20:12, Vicki Pfau wrote:
> > This moves the sending of the magic packet introduced in db7220c48d8d from
> > xpad_probe to xpad_start_input to ensure that xpad->dev->dev exists in the
> > event that an error occurs. This should also fix issues with suspend that may
> > occur with some controllers.
> >
> > Fixes: db7220c48d8d ("Input: xpad - fix support for some third-party controllers")
> > Reported-by: syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com
> > Reported-by: Dongliang Mu <dzm91@hust.edu.cn>
> > Link: https://groups.google.com/g/syzkaller-bugs/c/iMhTgpGuIbM
> > Signed-off-by: Vicki Pfau <vi@endrift.com>
> > ---
> > drivers/input/joystick/xpad.c | 21 +++++++++++++++++++++
> > 1 file changed, 21 insertions(+)
> >
> > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> > index 50ecff681b89..40abea92c393 100644
> > --- a/drivers/input/joystick/xpad.c
> > +++ b/drivers/input/joystick/xpad.c
> > @@ -1720,6 +1720,27 @@ static int xpad_start_input(struct usb_xpad *xpad)
> > return error;
> > }
> > }
> > + if (xpad->xtype == XTYPE_XBOX360) {
> > + /*
> > + * Some third-party controllers Xbox 360-style controllers
> > + * require this message to finish initialization.
> > + */
> > + u8 dummy[20];
> > +
> > + error = usb_control_msg_recv(xpad->udev, 0,
> > + /* bRequest */ 0x01,
> > + /* bmRequestType */
> > + USB_TYPE_VENDOR | USB_DIR_IN |
> > + USB_RECIP_INTERFACE,
> > + /* wValue */ 0x100,
> > + /* wIndex */ 0x00,
> > + dummy, sizeof(dummy),
> > + 25, GFP_KERNEL);
> > + if (error)
> > + dev_warn(&xpad->dev->dev,
> > + "unable to receive magic message: %d\n",
> > + error);
> > + }
> >
> > return 0;
> > }
>
> It's been a month and this fixed version of the patch never got any
> replies. Did it just get overlooked? Or does the fact that the old
> version got reverted mean I need to change the description in some
> capacity?
Yes, because the original patch was reverted you need to adjust the
patch/description and resubmit as a new patch.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-06 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 3:12 [PATCH v2] Input: xpad - Move Xbox 360 magic packet sending Vicki Pfau
2023-06-03 0:35 ` Vicki Pfau
2023-06-06 17:47 ` Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.