public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB: output an error message when the pipe type  doesn't match the endpoint type
Date: Thu, 02 Sep 2010 18:11:22 +0100	[thread overview]
Message-ID: <4C7FDABA.7080307@simon.arlott.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1009021019090.1513-100000@iolanthe.rowland.org>

On 02/09/10 15:22, Alan Stern wrote:
> On Thu, 2 Sep 2010, Simon Arlott wrote:
> 
>> On Wed, September 1, 2010 18:49, Alan Stern wrote:
>> > On Wed, 1 Sep 2010, Simon Arlott wrote:
>> >> > This is okay with me.  If you're serious about not changing the
>> >> > behavior merely because debugging is enabled, you could move this test
>> >> > out of the debug-only region and possibly change the dev_err to
>> >> > dev_dbg.  However doing so might break some devices that are currently
>> >> > working.
> 
> Which suggests that the best approach is to print the error message 
> always, but allow the submission unless CONFIG_USB_DEBUG is set.

That could result in a lot of error messages, and it doesn't give any
information on which driver caused it, but a single WARN_ON() would
only be triggered once globally. Each USB device (or endpoint) could
have a "warned" flag.

>> Looking at usb_clear_halt(), it doesn't use the direction either... but
>> drivers can call it in both directions. Several drivers already do this.
> 
> What do you mean?  Look at the first lines of code in usb_clear_halt():
> 
> 	if (usb_pipein(pipe))
> 		endp |= USB_DIR_IN;

Sorry, I misread it as always selecting the same direction.

-- 
Simon Arlott

  reply	other threads:[~2010-09-02 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 21:50 [PATCH] USB: output an error message when the pipe type doesn't match the endpoint type Simon Arlott
2010-08-31  6:41 ` Clemens Ladisch
2010-08-31 11:31   ` Simon Arlott
2010-08-31 13:52   ` Alan Stern
2010-08-31 14:04     ` Xiaofan Chen
2010-08-31 14:16 ` Alan Stern
2010-09-01 17:05   ` Simon Arlott
2010-09-01 17:49     ` Alan Stern
2010-09-02 11:56       ` Simon Arlott
2010-09-02 14:22         ` Alan Stern
2010-09-02 17:11           ` Simon Arlott [this message]
2010-09-02 19:20             ` Alan Stern

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=4C7FDABA.7080307@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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