From: Johan Hovold <johan@kernel.org>
To: Karoly Pados <pados@pados.hu>
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: USB: serial: cp210x: Fix GPIO in autosuspend
Date: Tue, 15 Jan 2019 10:26:07 +0100 [thread overview]
Message-ID: <20190115092607.GN3691@localhost> (raw)
On Tue, Jan 15, 2019 at 09:17:58AM +0000, Karoly Pados wrote:
> > I think it's better to add the autopm call to gpio210x_gpio_get/set
> > only. This will allow for a simpler patch, and keeps the autopm handling
> > confined to the gpio paths.
>
> I'll submit a v2.
>
> >> @@ -1383,6 +1397,7 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int
> >> value)
> >> } else {
> >> u16 wIndex = buf.state << 8 | buf.mask;
> >>
> >> + usb_autopm_get_interface(serial->interface);
> >
> > Also make sure to always check for errors from autopm_get().
>
> I checked everywhere else, the reason I didn't check here is on
> purpose based on your previous feedback. The caller function here
> doesn't have a return value, so the only way to return errors is to
> log, but in my last patch to ftdi_sio you made clear that errors from
> autopm_get shouldn't get logged. Trying to call usb_control_msg() even
> though the device could not wake does not cause issues, and the return
> value from usb_control_msg() clearly identifies the reason for failure
> (failure due to autosuspend), so error information is not lost either.
> So I thought not checking here has no real disadvantage and I still
> stay conformant to your previous guidance.
Ok, I understand your reasoning, but please do check for errors and bail
out early if autopm_get() fails. No need to log errors.
Thanks,
Johan
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Karoly Pados <pados@pados.hu>
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial: cp210x: Fix GPIO in autosuspend
Date: Tue, 15 Jan 2019 10:26:07 +0100 [thread overview]
Message-ID: <20190115092607.GN3691@localhost> (raw)
In-Reply-To: <15f71a61af66817847d4b11b9e2e60e8@pados.hu>
On Tue, Jan 15, 2019 at 09:17:58AM +0000, Karoly Pados wrote:
> > I think it's better to add the autopm call to gpio210x_gpio_get/set
> > only. This will allow for a simpler patch, and keeps the autopm handling
> > confined to the gpio paths.
>
> I'll submit a v2.
>
> >> @@ -1383,6 +1397,7 @@ static void cp210x_gpio_set(struct gpio_chip *gc, unsigned int gpio, int
> >> value)
> >> } else {
> >> u16 wIndex = buf.state << 8 | buf.mask;
> >>
> >> + usb_autopm_get_interface(serial->interface);
> >
> > Also make sure to always check for errors from autopm_get().
>
> I checked everywhere else, the reason I didn't check here is on
> purpose based on your previous feedback. The caller function here
> doesn't have a return value, so the only way to return errors is to
> log, but in my last patch to ftdi_sio you made clear that errors from
> autopm_get shouldn't get logged. Trying to call usb_control_msg() even
> though the device could not wake does not cause issues, and the return
> value from usb_control_msg() clearly identifies the reason for failure
> (failure due to autosuspend), so error information is not lost either.
> So I thought not checking here has no real disadvantage and I still
> stay conformant to your previous guidance.
Ok, I understand your reasoning, but please do check for errors and bail
out early if autopm_get() fails. No need to log errors.
Thanks,
Johan
next reply other threads:[~2019-01-15 9:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 9:26 Johan Hovold [this message]
2019-01-15 9:26 ` [PATCH] USB: serial: cp210x: Fix GPIO in autosuspend Johan Hovold
-- strict thread matches above, loose matches on Subject: below --
2019-02-07 13:57 Johan Hovold
2019-02-07 13:57 ` [PATCH] " Johan Hovold
2019-02-06 21:43 Karoly Pados
2019-02-06 21:43 ` [PATCH] " Karoly Pados
2019-02-04 16:09 Johan Hovold
2019-02-04 16:09 ` [PATCH] " Johan Hovold
2019-01-15 10:29 Johan Hovold
2019-01-15 10:29 ` [PATCH] " Johan Hovold
2019-01-15 9:17 Karoly Pados
2019-01-15 9:17 ` [PATCH] " Karoly Pados
2019-01-15 8:57 Johan Hovold
2019-01-15 8:57 ` [PATCH] " Johan Hovold
2019-01-14 19:43 Karoly Pados
2019-01-14 19:43 ` [PATCH] " Karoly Pados
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=20190115092607.GN3691@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pados@pados.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.