linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: 谢泓宇 <xiehongyu1@kylinos.cn>
Cc: Hongyu Xie <xy521521@gmail.com>,
	mathias.nyman@intel.com, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, 125707942@qq.com,
	stable@vger.kernel.org
Subject: Re: [PATCH -next] xhci: fix two places when dealing with return value of function xhci_check_args
Date: Wed, 26 Jan 2022 11:50:21 +0100	[thread overview]
Message-ID: <YfEnbRW3oU0ouGqH@kroah.com> (raw)
In-Reply-To: <c7f6a8bb-76b6-cd2d-7551-b599a8276f5c@kylinos.cn>

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Wed, Jan 26, 2022 at 06:22:45PM +0800, 谢泓宇 wrote:
> 1."What problem?
> r8152_submit_rx needs to detach netdev if -ENODEV happened, but -ENODEV will
> never happen
> because xhci_urb_enqueue only returns -EINVAL if the return value of
> xhci_check_args <= 0. So
> r8152_submit_rx will will call napi_schedule to re-submit that urb, and this
> will cause infinite urb
> submission.

Odd line-wrapping...

Anyway, why is this unique to this one driver?  Why does it not show up
for any other driver?

> The whole point is, if xhci_check_args returns value A, xhci_urb_enqueque
> shouldn't return any
> other value, because that will change some driver's behavior(like r8152.c).

But you are changing how the code currently works.  Are you sure you
want to have this "succeed" if this is on a root hub?

> 2."So if 0 is returned, you will now return that here, is that ok?
> That is a change in functionality.
> But this can only ever be the case for a root hub, is that ok?"
> 
> It's the same logic, but now xhci_urb_enqueue can return -ENODEV if xHC is
> halted.
> If it happens on a root hub,  xhci_urb_enqueue won't be called.
> 
> 3."Again, this means all is good?  Why is this being called for a root hub?"
> 
> It is the same logic with the old one, but now xhci_check_streams_endpoint
> can return -ENODEV if xHC is halted.

This still feels wrong to me, but I'll let the maintainer decide, as I
don't understand why a root hub is special here.

thanks,

greg k-h

  reply	other threads:[~2022-01-26 10:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  9:41 [PATCH -next] xhci: fix two places when dealing with return value of function xhci_check_args Hongyu Xie
2022-01-26  9:49 ` Greg KH
2022-01-26 10:22   ` 谢泓宇
2022-01-26 10:50     ` Greg KH [this message]
2022-01-26 12:49       ` Hongyu Xie
2022-01-27  9:43         ` Mathias Nyman
2022-01-28  3:48           ` 谢泓宇
2022-01-28  9:48             ` Mathias Nyman
2022-02-09  2:47               ` 谢泓宇
  -- strict thread matches above, loose matches on Subject: below --
2022-01-26  8:56 Hongyu Xie

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=YfEnbRW3oU0ouGqH@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=125707942@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=xiehongyu1@kylinos.cn \
    --cc=xy521521@gmail.com \
    /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).