Re: legousbtower

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have tried your patch and it works fine. It seems that it recognised
the tower and also creates the path /dev/usb/legousbtower0.

[  784.308089] usb 8-2: new low-speed USB device number 4 using uhci_hcd
[  784.529202] usb 8-2: New USB device found, idVendor=0694, idProduct=0001
[  784.529205] usb 8-2: New USB device strings: Mfr=4, Product=26,
SerialNumber=0
[  784.529208] usb 8-2: Product: LEGO USB Tower
[  784.529210] usb 8-2: Manufacturer: LEGO Group
[  784.537094] legousbtower 8-2:1.0: LEGO USB Tower firmware version
is 1.0 build 134
[  784.538146] legousbtower 8-2:1.0: LEGO USB Tower #-160 now attached
to major 180 minor 0

But when I tried to access it with nqc (sudo nqc
-S/dev/usb/legousbtower0 -firmware  ./firm0332.lgo), for example, it
gives me the following error:

Could not open serial port or USB device.

with the log:

[  784.538146] legousbtower 8-2:1.0: LEGO USB Tower #-160 now attached
to major 180 minor 0
[  994.013492] usb 8-2: LEGO USB Tower reset control request failed

I'm testing with kernel last stable kernel (4.10).

Alfredo

2017-04-20 14:10 GMT+02:00 Greg KH <greg@xxxxxxxxx>:
> On Thu, Apr 20, 2017 at 01:29:16PM +0200, Alfredo Rafael Vicente Boix wrote:
>> Hello,
>>
>> Thank you for your quick answer. I just have compiled the last stable
>> kernel and I'm having the same issue. This is Lliurex (based in
>> ubuntu)
>>
>> [ 2016.280112] usb 8-2: USB disconnect, device number 2
>> [ 2017.944091] usb 8-2: new low-speed USB device number 3 using uhci_hcd
>> [ 2018.165147] usb 8-2: New USB device found, idVendor=0694, idProduct=0001
>> [ 2018.165151] usb 8-2: New USB device strings: Mfr=4, Product=26,
>> SerialNumber=0
>> [ 2018.165153] usb 8-2: Product: LEGO USB Tower
>> [ 2018.165155] usb 8-2: Manufacturer: LEGO Group
>> [ 2018.168352] legousbtower 8-2:1.0: LEGO USB Tower get version
>> control request failed
>
> Ok, that is odd.
>
>> [ 2018.168361] legousbtower: probe of 8-2:1.0 failed with error -11
>
> And -11 is also probably not the right error to return here -EAGAIN
> doesn't make sense...
>
> But, this did find at least one bug in the driver, where data was being
> sent to the device off of the stack.  Can you try the patch below to see
> if that fixes anything or not?
>
> It's not a "complete" patch, but should be good enough for testing.
>
> If that doesn't work, I don't see why asking for the firmware
> information is required, we should be able to just continue on if this
> fails.  There was some reorginization done in this area of the code a
> few versions back, but I don't see how that could affect this device
> (famous last words...)
>
> thanks,
>
> greg k-h
>
> -------------------------
>
> diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
> index 322a042d6e59..aac51caa55b2 100644
> --- a/drivers/usb/misc/legousbtower.c
> +++ b/drivers/usb/misc/legousbtower.c
> @@ -808,7 +808,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
>         struct lego_usb_tower *dev = NULL;
>         struct usb_host_interface *iface_desc;
>         struct usb_endpoint_descriptor* endpoint;
> -       struct tower_get_version_reply get_version_reply;
> +       struct tower_get_version_reply *get_version_reply;
>         int i;
>         int retval = -ENOMEM;
>         int result;
> @@ -886,6 +886,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
>         dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval;
>         dev->interrupt_out_interval = interrupt_out_interval ? interrupt_out_interval : dev->interrupt_out_endpoint->bInterval;
>
> +       get_version_reply = kmalloc(sizeof(*get_version_reply), GFP_KERNEL);
>         /* get the firmware version and log it */
>         result = usb_control_msg (udev,
>                                   usb_rcvctrlpipe(udev, 0),
> @@ -893,8 +894,8 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
>                                   USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
>                                   0,
>                                   0,
> -                                 &get_version_reply,
> -                                 sizeof(get_version_reply),
> +                                 get_version_reply,
> +                                 sizeof(*get_version_reply),
>                                   1000);
>         if (result < 0) {
>                 dev_err(idev, "LEGO USB Tower get version control request failed\n");
> @@ -902,9 +903,10 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
>                 goto error;
>         }
>         dev_info(&interface->dev, "LEGO USB Tower firmware version is %d.%d "
> -                "build %d\n", get_version_reply.major,
> -                get_version_reply.minor,
> -                le16_to_cpu(get_version_reply.build_no));
> +                "build %d\n", get_version_reply->major,
> +                get_version_reply->minor,
> +                le16_to_cpu(get_version_reply->build_no));
> +       kfree(get_version_reply);
>
>         /* we can register the device now, as it is ready */
>         usb_set_intfdata (interface, dev);
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux