Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1466053pxk; Mon, 31 Aug 2020 22:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBCpcTZGFxBE3+9H8xI/VZEcWjfYGaqoUV+cS1RLQhQW56W1N6vjzAC+DbwcugmaSYbzMI X-Received: by 2002:aa7:c383:: with SMTP id k3mr210504edq.164.1598936630116; Mon, 31 Aug 2020 22:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598936630; cv=none; d=google.com; s=arc-20160816; b=vnmaA/Gf9hlQEI2yXnDgmoGufL6EMKBmIG0cLl6kMNwRi8046Bs1WZazbAD/NmVrZF x3foJOcLo/V+/OpYRxYFr8dKutyc3Ce2R0p8xDwMX2pYhITAMjKMCIOSHnIXiWEdyxfY pWhVaSYEb7sD8ZS0lkpW2UNyfl6we5BEX8D7mKq86erAUWmsZojkiDSMz/UtY4blvRn6 FG4vHQ0btoFTUoT3pl5/Y49evpfKz1ng/5BcTMD9wJirgw2hyupuZldd1SXKVoW2GY3D lW1MDt5kDoDa4j+z4my9AaBIAwW3WMqqotYhvOYfcDZ8OJRiLSaXSVgcBoda/6cOv0xV 46Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=oAIwXugAbA4Me6Ahbu4fQf5TE5udIcETQbBaJwhYoH4=; b=H1mCQRXQLsb0Qqg9KuVmTM6jbb/7CNCZRzt8YCDY6lFn3QEE3CjIMcYmjZWXz8vLbv WIWOr9nDkQNyxxF90W3defxu7T0LvqOFjKWpOUjFKXr6kJAmfNt5YSER8/9ev2Hd+qtT aP9AZ5EoFgQTl95Zk45BmZtlKehbtkVkG0rK6qqncfn6t78Nj+Cjtznzt9hqcfFcqLba Y7SFr496kImbMs0gd1LT7/kOJHOp8Zkr+AUG4/293sjvFq9v0XKzesjJfI2w7ZXW0P3K SLQfYPD1lK7LSHr7fzeTCzVcjTA+feLPEZ1ADsTdr+LSrdK7bpudBdUGZ8790MkG63J1 YPVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si6185903edu.604.2020.08.31.22.03.25; Mon, 31 Aug 2020 22:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726467AbgIAFA3 (ORCPT + 99 others); Tue, 1 Sep 2020 01:00:29 -0400 Received: from aclms1.advantech.com.tw ([61.58.41.199]:34011 "EHLO ACLMS1.advantech.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgIAFA2 (ORCPT ); Tue, 1 Sep 2020 01:00:28 -0400 Received: from taipei09.ADVANTECH.CORP (unverified [172.20.0.236]) by ACLMS1.advantech.com.tw (Clearswift SMTPRS 5.6.0) with ESMTP id ; Tue, 1 Sep 2020 13:00:23 +0800 Received: from localhost (172.16.12.96) by taipei09.ADVANTECH.CORP (172.20.0.236) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Sep 2020 13:00:22 +0800 From: William Sung To: Johan Hovold , Greg Kroah-Hartman , , , William Sung , Campion Kang Subject: [PATCH 1/2] usb: serial: option: Fix the lackage for Quectel EG95 LTE modem support Date: Tue, 1 Sep 2020 13:00:21 +0800 Message-ID: <20200901050022.3319-1-william.sung@advantech.com.tw> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.16.12.96] X-ClientProxiedBy: ACLDAG.ADVANTECH.CORP (172.20.2.88) To taipei09.ADVANTECH.CORP (172.20.0.236) X-StopIT: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Add reset-resume callback for resetting USB devices after MCU exits from suspend/sleep mode. * 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 --- 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; + /* Store the device flags so we can use them during attach. */ usb_set_serial_data(serial, (void *)device_flags); -- 2.17.1