* [PATCH] usbnet: silence an unnecessary warning
@ 2018-01-11 15:01 Oliver Neukum
2018-01-11 15:23 ` Bjørn Mork
2018-01-15 18:55 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Oliver Neukum @ 2018-01-11 15:01 UTC (permalink / raw)
To: davem, netdev; +Cc: Oliver Neukum
That a kevent could not be scheduled is not an error.
Such handlers must be able to deal with multiple events anyway.
As the successful scheduling of a work is a debug event, make
the failure debug priority, too.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: Cristian Caravena <caravena@gmail.com>
---
drivers/net/usb/usbnet.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index d56fe32bf48d..1e0bbe23f95c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -458,8 +458,7 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
{
set_bit (work, &dev->flags);
if (!schedule_work (&dev->kevent)) {
- if (net_ratelimit())
- netdev_err(dev->net, "kevent %d may have been dropped\n", work);
+ netdev_dbg(dev->net, "kevent %d may have been dropped\n", work);
} else {
netdev_dbg(dev->net, "kevent %d scheduled\n", work);
}
--
2.13.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usbnet: silence an unnecessary warning
2018-01-11 15:01 [PATCH] usbnet: silence an unnecessary warning Oliver Neukum
@ 2018-01-11 15:23 ` Bjørn Mork
2018-01-11 17:09 ` Oliver Neukum
2018-01-15 18:55 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Bjørn Mork @ 2018-01-11 15:23 UTC (permalink / raw)
To: Oliver Neukum; +Cc: davem, netdev
Oliver Neukum <oneukum@suse.com> writes:
> That a kevent could not be scheduled is not an error.
> Such handlers must be able to deal with multiple events anyway.
> As the successful scheduling of a work is a debug event, make
> the failure debug priority, too.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: Cristian Caravena <caravena@gmail.com>
> ---
> drivers/net/usb/usbnet.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index d56fe32bf48d..1e0bbe23f95c 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -458,8 +458,7 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
> {
> set_bit (work, &dev->flags);
> if (!schedule_work (&dev->kevent)) {
> - if (net_ratelimit())
> - netdev_err(dev->net, "kevent %d may have been dropped\n", work);
> + netdev_dbg(dev->net, "kevent %d may have been dropped\n", work);
> } else {
> netdev_dbg(dev->net, "kevent %d scheduled\n", work);
> }
Great! But why do you drop the ratelimit? This can be very noisy when
it hits. I'd like to keep it ratelimited.
But if you do decide to drop the limit, then you'll have to clean up the
braces...
Bjørn
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usbnet: silence an unnecessary warning
2018-01-11 15:23 ` Bjørn Mork
@ 2018-01-11 17:09 ` Oliver Neukum
0 siblings, 0 replies; 4+ messages in thread
From: Oliver Neukum @ 2018-01-11 17:09 UTC (permalink / raw)
To: Bjørn Mork; +Cc: davem, netdev
Am Donnerstag, den 11.01.2018, 16:23 +0100 schrieb Bjørn Mork :
> Oliver Neukum <oneukum@suse.com> writes:
>
> >
> > That a kevent could not be scheduled is not an error.
> > Such handlers must be able to deal with multiple events anyway.
> > As the successful scheduling of a work is a debug event, make
> > the failure debug priority, too.
> >
> > Signed-off-by: Oliver Neukum <oneukum@suse.com>
> > Reported-by: Cristian Caravena <caravena@gmail.com>
> > ---
> > drivers/net/usb/usbnet.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> > index d56fe32bf48d..1e0bbe23f95c 100644
> > --- a/drivers/net/usb/usbnet.c
> > +++ b/drivers/net/usb/usbnet.c
> > @@ -458,8 +458,7 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
> > {
> > set_bit (work, &dev->flags);
> > if (!schedule_work (&dev->kevent)) {
> > - if (net_ratelimit())
> > - netdev_err(dev->net, "kevent %d may have been dropped\n", work);
> > + netdev_dbg(dev->net, "kevent %d may have been dropped\n", work);
> > } else {
> > netdev_dbg(dev->net, "kevent %d scheduled\n", work);
> > }
>
> Great! But why do you drop the ratelimit? This can be very noisy when
> it hits. I'd like to keep it ratelimited.
Because this is now a debug output and if you need to debug you may need
to verify whether your kevent will be handled. So not getting either of the
messages would indicate a bug. Thus limiting the rate would defeat the purpose.
Regards
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usbnet: silence an unnecessary warning
2018-01-11 15:01 [PATCH] usbnet: silence an unnecessary warning Oliver Neukum
2018-01-11 15:23 ` Bjørn Mork
@ 2018-01-15 18:55 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-15 18:55 UTC (permalink / raw)
To: oneukum; +Cc: netdev
From: Oliver Neukum <oneukum@suse.com>
Date: Thu, 11 Jan 2018 16:01:49 +0100
> That a kevent could not be scheduled is not an error.
> Such handlers must be able to deal with multiple events anyway.
> As the successful scheduling of a work is a debug event, make
> the failure debug priority, too.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: Cristian Caravena <caravena@gmail.com>
> ---
> drivers/net/usb/usbnet.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index d56fe32bf48d..1e0bbe23f95c 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -458,8 +458,7 @@ void usbnet_defer_kevent (struct usbnet *dev, int work)
> {
> set_bit (work, &dev->flags);
> if (!schedule_work (&dev->kevent)) {
> - if (net_ratelimit())
> - netdev_err(dev->net, "kevent %d may have been dropped\n", work);
> + netdev_dbg(dev->net, "kevent %d may have been dropped\n", work);
> } else {
> netdev_dbg(dev->net, "kevent %d scheduled\n", work);
> }
As Bjørn stated, you have to clean up the braces since both arms of the
conditional are now a single line and therefore should not get curly
braces.
Thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-15 18:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-11 15:01 [PATCH] usbnet: silence an unnecessary warning Oliver Neukum
2018-01-11 15:23 ` Bjørn Mork
2018-01-11 17:09 ` Oliver Neukum
2018-01-15 18:55 ` David Miller
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).