linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: William Sung <william.sung@advantech.com.tw>
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Campion Kang <campion.kang@advantech.com.tw>
Subject: Re: [PATCH 1/2] usb: serial: option: Fix the lackage for Quectel EG95 LTE modem support
Date: Fri, 18 Sep 2020 09:52:00 +0200	[thread overview]
Message-ID: <20200918075200.GO24441@localhost> (raw)
In-Reply-To: <20200901050022.3319-1-william.sung@advantech.com.tw>

On Tue, Sep 01, 2020 at 01:00:21PM +0800, William Sung wrote:
> * Add reset-resume callback for resetting USB devices after MCU exits
> from suspend/sleep mode.

Please split this in it's own patch and argue for why it's needed.

> * Because Quectel EG95 uses USB interface 4 as a USB network device, so
> return from option_startup() to prevent being used as a USB serial
> device.
>
> Fixes: da6902e5b6db ("USB: serial: option: add Quectel EG95 LTE modem"
> 
> Signed-off-by: William Sung <william.sung@advantech.com.tw>
> ---
>  drivers/usb/serial/option.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
> index 89b3192af326..9de8aec47e5e 100644
> --- a/drivers/usb/serial/option.c
> +++ b/drivers/usb/serial/option.c
> @@ -2069,6 +2069,7 @@ static struct usb_serial_driver option_1port_device = {
>  #ifdef CONFIG_PM
>  	.suspend           = usb_wwan_suspend,
>  	.resume            = usb_wwan_resume,
> +	.reset_resume      = usb_wwan_resume,
>  #endif
>  };
>  
> @@ -2104,6 +2105,11 @@ static int option_probe(struct usb_serial *serial,
>  	if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)
>  		return -ENODEV;
>  
> +	/* Quectel EC25 & EC21 & EG91 & EG95 ... interface 4 can be used as USB network device */
> +	if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2c7c) &&
> +		serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
> +		return -ENODEV;

And please use the normal mechanisms for blacklisting interfaces (e.g.
the RSVD() macro).

> +
>  	/* Store the device flags so we can use them during attach. */
>  	usb_set_serial_data(serial, (void *)device_flags);

Also make sure your patches have distinct and descriptive summaries
(Subject lines).

Johan

      parent reply	other threads:[~2020-09-18  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  5:00 [PATCH 1/2] usb: serial: option: Fix the lackage for Quectel EG95 LTE modem support William Sung
2020-09-01  5:00 ` [PATCH 2/2] usb: serial: usb_wwan: Fix " William Sung
2020-09-01 14:23   ` Daniele Palmas
2020-09-18  7:52 ` Johan Hovold [this message]

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=20200918075200.GO24441@localhost \
    --to=johan@kernel.org \
    --cc=campion.kang@advantech.com.tw \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=william.sung@advantech.com.tw \
    /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).