All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Li <jun.li@nxp.com>
To: Fabio Estevam <festevam@gmail.com>,
	"bjorn@mork.no" <bjorn@mork.no>,
	Peter Chen <peter.chen@kernel.org>, Marek Vasut <marex@denx.de>
Cc: netdev <netdev@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>,
	Alexander Stein <alexander.stein@ew.tq-group.com>,
	Schrempf Frieder <frieder.schrempf@kontron.de>
Subject: RE: imx7: USB modem reset causes modem to not re-connect
Date: Tue, 13 Dec 2022 08:15:05 +0000	[thread overview]
Message-ID: <PA4PR04MB96407AC656705A79BF72D2E089E39@PA4PR04MB9640.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <CAOMZO5AWRDLu5t0O=AG7CxNLv20HTmMTRh=so=s7+nTH0_qYgQ@mail.gmail.com>



> -----Original Message-----
> From: Fabio Estevam <festevam@gmail.com>
> Sent: Tuesday, December 13, 2022 3:01 AM
> To: bjorn@mork.no; Peter Chen <peter.chen@kernel.org>; Marek Vasut
> <marex@denx.de>; Jun Li <jun.li@nxp.com>
> Cc: netdev <netdev@vger.kernel.org>; USB list <linux-usb@vger.kernel.org>;
> Alexander Stein <alexander.stein@ew.tq-group.com>; Schrempf Frieder
> <frieder.schrempf@kontron.de>
> Subject: Re: imx7: USB modem reset causes modem to not re-connect
> 
> On Mon, Dec 12, 2022 at 3:10 PM Fabio Estevam <festevam@gmail.com> wrote:
> >
> > Hi,
> >
> > On an imx7d-based board running kernel 5.10.158, I noticed that a
> > Quectel BG96 modem is gone after sending a reset command via AT:
> 
> Disabling runtime pm like this:
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c
> b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 9ffcecd3058c..e2a263d583f9 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -62,7 +62,6 @@ static const struct ci_hdrc_imx_platform_flag
> imx6ul_usb_data = {  };
> 
>  static const struct ci_hdrc_imx_platform_flag imx7d_usb_data = {
> -       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM,
>  };
> 
>  static const struct ci_hdrc_imx_platform_flag imx7ulp_usb_data = {
> 
> makes the USB modem to stay connected after the reset command:
> 
> # microcom /dev/ttyUSB3
> >AT+CFUN=1,1
> OK
> [   31.339416] usb 2-1: USB disconnect, device number 2

So disconnect happened.

> [   31.349480] option1 ttyUSB0: GSM modem (1-port) converter now
> disconnected from ttyUSB0
> [   31.358298] option 2-1:1.0: device disconnected
> [   31.366390] option1 ttyUSB1: GSM modem (1-port) converter now
> disconnected from ttyUSB1
> [   31.374883] option 2-1:1.1: device disconnected
> [   31.383359] option1 ttyUSB2: GSM modem (1-port) converter now
> disconnected from ttyUSB2
> [   31.391800] option 2-1:1.2: device disconnected
> [   31.404700] option1 ttyUSB3: GSM modem (1-port) converter now
> disconnected from ttyUSB3
> # [   31.413261] option 2-1:1.3: device disconnected

After a while, re-emulation happens.  

> [   36.151388] usb 2-1: new high-speed USB device number 3 using ci_hdrc
> [   36.354398] usb 2-1: New USB device found, idVendor=2c7c,
> idProduct=0296, bcdDevice= 0.00
> [   36.362768] usb 2-1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=4
> [   36.370031] usb 2-1: Product: Qualcomm CDMA Technologies MSM
> [   36.375818] usb 2-1: Manufacturer: Qualcomm, Incorporated
> [   36.381355] usb 2-1: SerialNumber: 7d1563c1
> [   36.389915] option 2-1:1.0: GSM modem (1-port) converter detected
> [   36.397679] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
> [   36.412591] option 2-1:1.1: GSM modem (1-port) converter detected
> [   36.420237] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
> [   36.434988] option 2-1:1.2: GSM modem (1-port) converter detected
> [   36.442792] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
> [   36.457745] option 2-1:1.3: GSM modem (1-port) converter detected
> [   36.465709] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3

So this disconnect and then connect is you expected behavior?

Li Jun
> 
> Does anyone have any suggestions as to what could be the problem with runtime
> pm?

  parent reply	other threads:[~2022-12-13  8:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 18:10 imx7: USB modem reset causes modem to not re-connect Fabio Estevam
2022-12-12 19:01 ` Fabio Estevam
2022-12-13  7:31   ` Alexander Stein
2022-12-13  8:15   ` Jun Li [this message]
2022-12-13  9:33     ` Fabio Estevam
2022-12-13 11:17       ` Jun Li
2022-12-16 12:00         ` Fabio Estevam
2022-12-13  8:12 ` Jun Li

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=PA4PR04MB96407AC656705A79BF72D2E089E39@PA4PR04MB9640.eurprd04.prod.outlook.com \
    --to=jun.li@nxp.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=bjorn@mork.no \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    /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.