From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org,
kernel@pengutronix.de
Subject: Re: [PATCH v2] usb: mtu3: Convert to platform remove callback returning void
Date: Mon, 2 Oct 2023 16:53:05 +0200 [thread overview]
Message-ID: <2023100253-amino-pencil-9a96@gregkh> (raw)
In-Reply-To: <20231002144959.jc6wwfrvwd4cyu2l@pengutronix.de>
On Mon, Oct 02, 2023 at 04:49:59PM +0200, Uwe Kleine-König wrote:
> Hello Greg,
>
> On Mon, Oct 02, 2023 at 04:39:47PM +0200, Greg Kroah-Hartman wrote:
> > On Thu, Sep 14, 2023 at 10:02:51PM +0200, Uwe Kleine-König wrote:
> > > @@ -469,8 +469,17 @@ static int mtu3_remove(struct platform_device *pdev)
> > > ssusb_gadget_exit(ssusb);
> > > ssusb_host_exit(ssusb);
> > > break;
> > > - default:
> > > - return -EINVAL;
> > > + case USB_DR_MODE_UNKNOWN:
> > > + /*
> > > + * This cannot happen because with dr_mode ==
> > > + * USB_DR_MODE_UNKNOWN, .probe() doesn't succeed and so
> > > + * .remove() wouldn't be called at all. However (little
> > > + * surprising) the compiler isn't smart enough to see that, so
> > > + * we explicitly have this case item to not make the compiler
> > > + * wail about an unhandled enumeration value.
> > > + */
> > > + WARN_ON(1);
> >
> > Please don't add new WARN_ON() calls to the kernel, print out a big
> > error message and return, don't reboot the machine.
>
> Huh, printing out an loud error message was my intention. It's news to
> me that WARN_ON() reboots the machine?! I thought BUG_ON() was the one
> with the effects you describe that I shouldn't use.
panic-on-warn is set for zillions[1] of Linux systems out there, so systems
will reboot.
thanks,
greg k-h
[1] Unofficial number, I know the "cloud" systems set this, as well as
all of Samsung's phone kernels, a non-trivial amount of Linux
instances in the wild.
next prev parent reply other threads:[~2023-10-02 14:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 20:02 [PATCH v2] usb: mtu3: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 7:52 ` Chunfeng Yun (云春峰)
2023-09-19 8:23 ` Uwe Kleine-König
2023-10-02 14:39 ` Greg Kroah-Hartman
2023-10-02 14:49 ` Uwe Kleine-König
2023-10-02 14:53 ` Greg Kroah-Hartman [this message]
2023-10-02 21:41 ` Uwe Kleine-König
2023-10-05 7:13 ` Greg Kroah-Hartman
2023-10-20 9:53 ` Uwe Kleine-König
2023-10-20 14:33 ` Greg Kroah-Hartman
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=2023100253-amino-pencil-9a96@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=chunfeng.yun@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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