diff mbox

[07/15] Input: xpad: move the input device creation to a new function

Message ID 561FFC47.3060802@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Rojtberg Oct. 15, 2015, 7:19 p.m. UTC
Hey Dimitry,

I have seen you have also applied
"[PATCH 08/15] Input: xpad: query Wireless controller state at init".
However this change is unfortunately incomplete without
"[PATCH 09/15] Input: xpad: handle "present" and "gone" correctly".

As is both the presence as well as the LED packets are sent immediately 
at init
which triggers the the "URB xxxx submitted while active" Warning and causes
any initialization to fail.

Attached is a fixup against current input/ next of the chunk that is in
[PATCH 09/15], but should have been in [PATCH 08/15].
Sorry for the inconvenience.

do not call xpad_identify_controller at init: it conflicts with
the already sent presence packet and will be called by
xpad360w_process_packet as needed anyway.

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
---
  drivers/input/joystick/xpad.c | 2 --
  1 file changed, 2 deletions(-)

Comments

Dmitry Torokhov Oct. 17, 2015, 4:49 p.m. UTC | #1
Hi Pavel,

On Thu, Oct 15, 2015 at 09:19:35PM +0200, Pavel Rojtberg wrote:
> Hey Dimitry,
> 
> I have seen you have also applied
> "[PATCH 08/15] Input: xpad: query Wireless controller state at init".
> However this change is unfortunately incomplete without
> "[PATCH 09/15] Input: xpad: handle "present" and "gone" correctly".
> 
> As is both the presence as well as the LED packets are sent
> immediately at init
> which triggers the the "URB xxxx submitted while active" Warning and causes
> any initialization to fail.
> 
> Attached is a fixup against current input/ next of the chunk that is in
> [PATCH 09/15], but should have been in [PATCH 08/15].
> Sorry for the inconvenience.
> 
> do not call xpad_identify_controller at init: it conflicts with
> the already sent presence packet and will be called by
> xpad360w_process_packet as needed anyway.

I see. But I believe we should only do that for wireless controllers,
because we send the presence request only for XTYPE_XBOX360W and LEDs
are also present on non-wireless variant, right?

So I think we want:

	if (xpad->xtype == XTYPE_XBOX360) {
		/*
		 * Light up the segment corresponding to controller
		 * number on wired devices. On wireless we'll do that
		 * when they respond to "presence" packet.
		 */
		xpad_identify_controller(xpad);
	}

Thanks.
Pavel Rojtberg Oct. 17, 2015, 6:08 p.m. UTC | #2
Am 17.10.2015 um 18:49 schrieb Dmitry Torokhov:
> Hi Pavel,
>
> On Thu, Oct 15, 2015 at 09:19:35PM +0200, Pavel Rojtberg wrote:
>> Hey Dimitry,
>>
>> I have seen you have also applied
>> "[PATCH 08/15] Input: xpad: query Wireless controller state at init".
>> However this change is unfortunately incomplete without
>> "[PATCH 09/15] Input: xpad: handle "present" and "gone" correctly".
>>
>> As is both the presence as well as the LED packets are sent
>> immediately at init
>> which triggers the the "URB xxxx submitted while active" Warning and causes
>> any initialization to fail.
>>
>> Attached is a fixup against current input/ next of the chunk that is in
>> [PATCH 09/15], but should have been in [PATCH 08/15].
>> Sorry for the inconvenience.
>>
>> do not call xpad_identify_controller at init: it conflicts with
>> the already sent presence packet and will be called by
>> xpad360w_process_packet as needed anyway.
> I see. But I believe we should only do that for wireless controllers,
> because we send the presence request only for XTYPE_XBOX360W and LEDs
> are also present on non-wireless variant, right?
>
> So I think we want:
>
> 	if (xpad->xtype == XTYPE_XBOX360) {
> 		/*
> 		 * Light up the segment corresponding to controller
> 		 * number on wired devices. On wireless we'll do that
> 		 * when they respond to "presence" packet.
> 		 */
> 		xpad_identify_controller(xpad);
> 	}
>
> Thanks.
yes, you are right.

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index d382d48..acb8859 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1001,8 +1001,6 @@  static int xpad_led_probe(struct usb_xpad *xpad)
      if (error)
          goto err_free_id;

-    /* Light up the segment corresponding to controller number */
-    xpad_identify_controller(xpad);
      return 0;

  err_free_id: