linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: A Sun <as1033x@comcast.net>
To: Sean Young <sean@mess.org>
Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH v1 3/3] [media] mceusb: Show USB halt/stall error recovery
Date: Sat, 8 Jun 2019 20:56:57 -0400	[thread overview]
Message-ID: <cf733b41-2f3c-267e-0fcf-5e9aed3f3f92@comcast.net> (raw)
In-Reply-To: <20190608083729.bw47vkplpf3r4e4b@gofer.mess.org>

On 6/8/2019 4:37 AM, Sean Young wrote:
> Hi,
> 

>>> I think you can call usb_lock_device_for_reset() to prevent that problem.
>>
>> Deadlock still occurs in test:
>> mceusb_deferred_kevent()
>>     ->usb_reset_device()
>>         ->mceusb_dev_disconnect()
>>             ->cancel_work_sync()
>> where cancel_work_sync() blocks because mceusb_deferred_kevent() is active.
> 
> I understand. The usb_reset_device() does not need to happen synchronously
> in mceusb_deferred_kevent(). Possibly another delayed workqueue.
> 
> Actually there is also a function usb_queue_reset_device() which might do
> what you want here.
> 

Thanks! Usb_queue_reset_device() appears to be exactly what I'm looking for.

With the help of your tip, I found Alan Stern ran into a virtually identical problem
(clear halt error and reset deadlock) with drivers/hid/usbhid/hid-core.c
https://linux-usb.vger.kernel.narkive.com/fc7Lng6q/patch-usbhid-improve-handling-of-clear-halt-and-reset
So patch for mceusb may be able to use the same techniques.

>>
>>> It would be nice to see this implemented too.
>>>
>>
>> Any additional tips to implement would help!
>> How to validate and test a rare condition with a larger audience?
> 
> This is hard. Do you know the model of the mceusb and host hardware?
> 

Host is Raspberry Pi 3B+ raspbian 4.14.xx version of mid year 2018.
mceusb Pinnacle Systems PCTV Remote USB with mce emulator interface version 1
device 2304:0225 produced the sequence:
        [59388.696941] mceusb 1-1.1.2:1.0: Error: urb status = -32 (RX HALT)
        [59388.698838] mceusb 1-1.1.2:1.0: rx clear halt error -32
RX permanently stops after the error.

All the work I'm doing for mceusb is with the above.


The other case (https://ubuntuforums.org/showthread.php?t=2406882) I heard about is:
Host ubuntu,
mceusb unknown, possibly
SMK eHome Infrared Transceiver with mce emulator interface version 1
Flooding of:
	mceusb 2-1.4:1.0: Error: urb status = -32 (RX HALT)

>> Hence, the moved line.
> 
> That's in a future patch. Please only change error strings in this patch.
> 

ok, I'll post a v2 version of this patch with only the error strings changes.

The instructions the error strings say (USB reset device manually) will be my patch
resolution for the mceusb stuck halt bug for some time.

In the meantime, I'll try and test (harder part) use of usb_queue_reset_device
for a future patch to automate the USB reset procedure.

Thanks again, ..A Sun

  reply	other threads:[~2019-06-09  0:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <999ae5cd-d72b-983f-2f96-5aaca72e8214@comcast.net>
2019-06-01 23:34 ` [PATCH v1 1/3] [media] mceusb: Disable "nonsensical irdata" messages A Sun
2019-06-01 23:34 ` [PATCH v1 2/3] [media] mceusb: Reword messages referring to "urb" A Sun
2019-06-01 23:35 ` [PATCH v1 3/3] [media] mceusb: Show USB halt/stall error recovery A Sun
2019-06-06  9:53   ` Sean Young
2019-06-06 21:11     ` A Sun
2019-06-08  8:37       ` Sean Young
2019-06-09  0:56         ` A Sun [this message]
2019-06-19  7:53         ` [PATCH v2 0/3] [media] mceusb: Error message text revisions A Sun
2019-06-19  7:53         ` [PATCH v2 1/3] [media] mceusb: Disable "nonsensical irdata" messages A Sun
2019-06-19  7:54         ` [PATCH v2 2/3] [media] mceusb: Reword messages referring to "urb" A Sun
2019-06-25 10:51           ` Sean Young
2019-06-25 15:01             ` A Sun
2019-06-25 16:12               ` Sean Young
2019-06-25 21:29                 ` A Sun
2019-07-15 12:28                   ` Sean Young
2019-07-21 21:31                     ` A Sun
2019-08-10 12:17                       ` Sean Young
2019-06-19  7:54         ` [PATCH v2 3/3] [media] mceusb: Show USB halt/stall error recovery A Sun
2019-07-15  2:54           ` A Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf733b41-2f3c-267e-0fcf-5e9aed3f3f92@comcast.net \
    --to=as1033x@comcast.net \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sean@mess.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).