EM7455 Modem suspend issue

Hi Community,

I have recently done the integration of the EM7455 Modem with Android pie release, now everything is running smoothly, but facing issue of the USB suspend,

As Modem is connected on the USB line because of that reason device is not going in sleep, and in our design we want to put the device in sleep,

Can you please let me know what changes are required to do this at driver side?

Please help on this issue, thanks in advance,

Thanks,
Kevil

1 Like

Hi Kevil,
Please make sure that modem firmware and AndroidRIL version are latest. https://source.sierrawireless.com/devices/em-series/em7455/#sthash.cxyUUM4Q.dpbs

Android USB driver didn’t enable auto suspend (selective suspend) by default.
Modem will suspend only when Android system enter suspend state.
To enable selective suspend of modem, you can enable it through Linux sysfs.
Here is an example of sysfs when modem is connected. Exact path depends on your platform:

1-1 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1
1-1.2 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1/1-1.2
1-1.2:1.0 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1/1-1.2/1-1.2:1.0
1-1.2:1.2 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1/1-1.2/1-1.2:1.2
1-1.2:1.3 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1/1-1.2/1-1.2:1.3
1-1.2:1.8 -> …/…/…/devices/platform/soc/f72c0000.usb/usb1/1-1/1-1.2/1-1.2:1.8

console:/sys/bus/usb/devices # echo auto > 1-1.2/power/control
You can check the USB active/suspend status by monitoring /sys/bus/usb/devices/x-x/power/runtime_status

A few points to check:

  1. Modem need to enable USB remote wake up:
    at!usbremotewakeup=1
    “1” should be default setting, please refer to “Interface Specification for MDM9X30 AT Commands”
  2. Host need to enable USB remote wake up as well:
    echo enable > /sys/bus/usb/devices/1-1.2/power/wakeup
    Usually it is not enabled by default, depends on Linux kernel.

If it can help, please check on “Solution”, so that the community can find the solution easily for their issue.
Thanks,

1 Like

@jerdung

Thank you for the reply,

To enable the auto suspend functionality do i need to un-comment or add (POWER_LEVEL_AUTO) following macro from the “sierra.c” and “sierra_net.c” driver? or any other changes are required?

Thanks,
Kevil

Hi Kevin,
If you use this command, no need to update file sierra.c or sirrra_net.c

Thanks,

@jerdung

I have tried your given command and found that modem is registering and de-register continuously it self within 1 or 2 seconds as below,

#################################################################

console:/ # dmesg | grep -i “sierr”
[ 9.711239] usbcore: registered new interface driver sierra_net
[ 9.794306] usbcore: registered new interface driver sierra
[ 9.794457] usbserial: USB Serial support registered for Sierra USB modem
[ 9.794474] sierra: v.1.7.46_android_generic_2:USB Driver for Sierra Wireless USB modems
[ 17.600332] sierra 1-1.2:1.0: Sierra USB modem converter detected
[ 17.607054] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB0
[ 17.614012] sierra 1-1.2:1.2: Sierra USB modem converter detected
[ 17.651489] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB1
[ 17.664660] sierra 1-1.2:1.3: Sierra USB modem converter detected
[ 17.729711] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB2
[ 17.955031] init: Parsing file /system/etc/init/rildsierra.rc…
[ 30.054501] init: processing action (boot) from (/system/etc/init/rildsierra.rc:1)
[ 30.055781] init: Command ‘chmod 0755 /system/bin/dhcpcd’ action=boot (/system/etc/init/rildsierra.rc:9) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.056147] init: Command ‘chmod 0755 /system/bin/init.config.ip’ action=boot (/system/etc/init/rildsierra.rc:10) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.056494] init: Command ‘chmod 0755 /system/bin/init.dhcpcd’ action=boot (/system/etc/init/rildsierra.rc:11) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.106303] init: processing action (persist.sys.ril.type=QMI) from (/system/etc/init/rildsierra.rc:61)
[ 35.158141] init: processing action (persist.sys.ril.type=QMI) from (/system/etc/init/rildsierra.rc:61)
[ 49.958338] init: processing action (sys.boot_completed=1) from (/system/etc/init/rildsierra.rc:76)
[ 50.336983] init: processing action (sys.ril.modem.reset=1) from (/system/etc/init/rildsierra.rc:73)
[ 63.306518] init: Received control message ‘start’ for ‘sierra_dhcpcd’ from pid: 893 (/vendor/bin/hw/rild -l /vendor/lib64/libsierra-ril.so – -a -i wwan0)
[ 63.308241] init: starting service ‘sierra_dhcpcd’…
[ 63.781938] init: Service ‘sierra_dhcpcd’ (pid 2815) exited with status 0

#####################################################################

cd /sys/bus/usb/devices/1-1

####################################################################

find . -name control -print -exec cat {} ;

####################################################################

./1-1.1/1-1.1:1.0/ep_02/power/control
auto
./1-1.1/1-1.1:1.0/ep_81/power/control
auto
./1-1.1/1-1.1:1.0/host0/scsi_host/host0/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sda/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/power/control
on
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0/power/control
auto
./1-1.1/1-1.1:1.0/host0/target0:0:0/0:0:0:0/scsi_device/0:0:0:0/power/control
auto
./1-1.1/1-1.1:1.0/host0/power/control
auto
./1-1.1/ep_00/power/control
auto
./1-1.1/power/control
on
./1-1.2/1-1.2:1.0/ep_01/power/control
auto
./1-1.2/1-1.2:1.0/ep_81/power/control
auto
./1-1.2/1-1.2:1.0/ttyUSB0/tty/ttyUSB0/power/control
auto
./1-1.2/1-1.2:1.0/ttyUSB0/power/control
auto
./1-1.2/1-1.2:1.2/ep_02/power/control
auto
./1-1.2/1-1.2:1.2/ep_82/power/control
auto
./1-1.2/1-1.2:1.2/ep_83/power/control
auto
./1-1.2/1-1.2:1.2/ttyUSB1/tty/ttyUSB1/power/control
auto
./1-1.2/1-1.2:1.2/ttyUSB1/power/control
auto
./1-1.2/1-1.2:1.3/ep_03/power/control
auto
./1-1.2/1-1.2:1.3/ep_84/power/control
auto
./1-1.2/1-1.2:1.3/ep_85/power/control
auto
./1-1.2/1-1.2:1.3/ttyUSB2/tty/ttyUSB2/power/control
auto
./1-1.2/1-1.2:1.3/ttyUSB2/power/control
auto
./1-1.2/1-1.2:1.8/net/wwan0/power/control
auto
./1-1.2/1-1.2:1.8/ep_04/power/control
auto
./1-1.2/1-1.2:1.8/ep_86/power/control
auto
./1-1.2/1-1.2:1.8/ep_87/power/control
auto
./1-1.2/1-1.2:1.8/GobiQMI/qcqmi0/power/control
auto
./1-1.2/ep_00/power/control
auto
./1-1.2/power/control
on
./ep_00/power/control
auto
./power/control
auto
./1-1:1.0/1-1-port1/power/control
auto
./1-1:1.0/1-1-port2/power/control
auto
./1-1:1.0/1-1-port3/power/control
auto
./1-1:1.0/1-1-port4/power/control
auto
./1-1:1.0/ep_81/power/control
auto

#################################################################

echo auto > ./1-1.1/power/control
echo auto > ./1-1.2/power/control

################################################################

Modem is trying to go in suspend mode, but wake up after 1 second as shown below
Disconnected at 306 seconds and again wakeup at 308 seconds.

################################################################

dmesg | grep -i “sierr”
[ 9.711239] usbcore: registered new interface driver sierra_net
[ 9.794306] usbcore: registered new interface driver sierra
[ 9.794457] usbserial: USB Serial support registered for Sierra USB modem
[ 9.794474] sierra: v.1.7.46_android_generic_2:USB Driver for Sierra Wireless USB modems
[ 17.600332] sierra 1-1.2:1.0: Sierra USB modem converter detected
[ 17.607054] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB0
[ 17.614012] sierra 1-1.2:1.2: Sierra USB modem converter detected
[ 17.651489] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB1
[ 17.664660] sierra 1-1.2:1.3: Sierra USB modem converter detected
[ 17.729711] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB2
[ 17.955031] init: Parsing file /system/etc/init/rildsierra.rc…
[ 30.054501] init: processing action (boot) from (/system/etc/init/rildsierra.rc:1)
[ 30.055781] init: Command ‘chmod 0755 /system/bin/dhcpcd’ action=boot (/system/etc/init/rildsierra.rc:9) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.056147] init: Command ‘chmod 0755 /system/bin/init.config.ip’ action=boot (/system/etc/init/rildsierra.rc:10) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.056494] init: Command ‘chmod 0755 /system/bin/init.dhcpcd’ action=boot (/system/etc/init/rildsierra.rc:11) took 0ms and failed: fchmodat() failed: Read-only file system
[ 30.106303] init: processing action (persist.sys.ril.type=QMI) from (/system/etc/init/rildsierra.rc:61)
[ 35.158141] init: processing action (persist.sys.ril.type=QMI) from (/system/etc/init/rildsierra.rc:61)
[ 49.958338] init: processing action (sys.boot_completed=1) from (/system/etc/init/rildsierra.rc:76)
[ 50.336983] init: processing action (sys.ril.modem.reset=1) from (/system/etc/init/rildsierra.rc:73)
[ 63.306518] init: Received control message ‘start’ for ‘sierra_dhcpcd’ from pid: 893 (/vendor/bin/hw/rild -l /vendor/lib64/libsierra-ril.so – -a -i wwan0)
[ 63.308241] init: starting service ‘sierra_dhcpcd’…
[ 63.781938] init: Service ‘sierra_dhcpcd’ (pid 2815) exited with status 0
[ 306.826115] kfree at sierra_remove_sysfs_attrs
[ 306.826149] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
[ 306.828737] sierra 1-1.2:1.0: device disconnected
[ 306.838547] kfree at sierra_remove_sysfs_attrs
[ 306.838580] sierra ttyUSB1: Sierra USB modem converter now disconnected from ttyUSB1
[ 306.840314] sierra 1-1.2:1.2: device disconnected
[ 306.850230] kfree at sierra_remove_sysfs_attrs
[ 306.850265] sierra ttyUSB2: Sierra USB modem converter now disconnected from ttyUSB2
[ 306.852372] sierra 1-1.2:1.3: device disconnected
[ 308.779099] sierra 1-1.2:1.0: Sierra USB modem converter detected
[ 308.791422] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB0
[ 308.801016] sierra 1-1.2:1.2: Sierra USB modem converter detected
[ 308.808876] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB1
[ 308.819509] sierra 1-1.2:1.3: Sierra USB modem converter detected
[ 308.827939] usb 1-1.2: Sierra USB modem converter now attached to ttyUSB2

Can you please let me know what is the issue here?

And one more question what is the way to put the modem in low power mode, during sleep we also want to configure modem in LPM?

Thanks,
Kevil

Hi Kevil,
I don’t observe autosuspend issue in your log.

You can enable GobiNet debug and capture kernel log to monitor modem suspend/active state as below:
1|console:/ # echo 1 > /sys/module/GobiNet/parameters/debug

Kernel log samples:

[ 566.156416] GobiNet::GobiNetSuspend(3054) Set Power Save Mode 1
[ 566.162624] GobiNet::GobiNetSuspend(3054) device autosuspend
1|console:/ # echo 1 > /dev/ttyUSB2

[ 605.482472] GobiNet::GobiNetResume(3048)
[ 605.486778] GobiNet::GobiNetResume(3048) resuming from power mode 0x0402

[ 609.010622] GobiNet::GobiNetSuspend(3054) device autosuspend
[ 609.016673] GobiNet::GobiNetSuspend(3054) suspend event = 0x0402

Please make sure firmware or driver is the latest.

To set module LPM mode, send AT+CFUN=0 or AT+CFUN=4

Thanks,

@jerdung,

Yes, i have enabled the debug log, and getting the suspend log as well, looks like suspend issue is solved,

But i need to know few things about the “AT+CFUN=0 or AT+CFUN=4” AT command, does it really consume less power,

Because according to datasheet “!PCOFFEN” when W_DISABLE is asserted it configure the modem in low power mode or power off,

So what is the difference between “W_DISABLE” assert and “AT+CFUN=0 or AT+CFUN=4”, both are doing same work to put the modem in LPM or different?

When throw a CFUN command and tried to read it “!PCINFO”
AT(19)< State: Low Power Mode
AT(19)< LPM voters - Temp:0, Volt:0, User:1, W_DISABLE:0, IMSWITCH:0, BIOS:0, LWM2M:0, OMADM:0, FOTA:0
AT(19)< LPM persistence - None
AT(19)< OK

It shows User:1

When assert a W_DISABLE and tried to read it “!PCINFO”
AT(19)< State: Low Power Mode
AT(19)< LPM voters - Temp:0, Volt:0, User:0, W_DISABLE:1, IMSWITCH:0, BIOS:0, LWM2M:0, OMADM:0, FOTA:0
AT(19)< LPM persistence - None
AT(19)< OK

It shows W_DISABLE:1,

Does both doing same function to put the modem in LPM or different?

Thanks,
Kevil

@jerdung,

Just i want to give you quick update W_DISABLE assert and AT+CFUN=0 both are same,

But we are facing difficulty to put the device in sleep mode,

We need to put the modem in sleep mode and also simultaneously put the device in sleep mode,

with following sequence
1- put the modem in sleep mode with assert
– echo 0 > /sys/class/gpio/gpioxx/value
2 Now suspend the modem
– echo auto > ./1-1.1/power/control
3 - device need to go in sleep,

But we have observed that , device is not going in sleep suddenly it take around 30 to 40 seconds, it is doing some processes related to modem.

So what to do in current scenario?

Thanks,
Kevil

Hi Kevil,
Please help to check the value in /sys/bus/usb/devices/x-x/power/autosuspend_delay_ms and try to change this value.

Thanks,

@jerdung,

Thank you for sharing the information,

And i want to disable the GPS, what to do for that,

Can i achieve the low power consumption by disabling GPS?

Thanks,
Kevil

Hi Kevil,
Enabling/disabling GPS will increase/decrease power Consumption, but disabling GPS will not make module to LPM. Please refer more details on “Power” Section of this document https://source.sierrawireless.com/resources/airprime/minicard/74xx/airprime_em7455_product_technical_specification/#sthash.bz2l2NA6.dpbs
You can disable GPS with this command AT!CUSTOM=“GPSENABLE”,0
If you don’t have any confusion, Please help to check on “Solution” for original problem, so that we can close this ticket here.

Thanks,

@jerdung

Thanks for the quick support,

I am not able to run the
AT!ENTERCND=“A710”
AT!CUSTOM=“GPSENABLE”,0
AT!RESET
It showing ERR,

Modem is password protected,

What to do in this condition?

Thanks,
Kevil

Hi Kevil,
Please contact your Distributor for this case.
Page 18 this document https://source.sierrawireless.com/resources/airprime/minicard/74xx/4117727-airprime-em74xx-mc74xx-at-command-reference/#sthash.ezI4xiWp.dpbs

Thanks,

@jerdung

Thank you for the reply,

According to datasheet we can also disable the GPS by W_DISABLE, i have tried that way,

But is there any “AT” command to check GPS is successfully disabled?

Thanks,
Kevil

1 Like

@jerdung

Can you please help me on below issue,

I want to disable or want to configure the EM7455 modem in the LPM during driver suspend,

I have check the driver and found that during driver suspend mode EM7455 modem is not going in LPM,

However, I am able to assert the W_DISABLE line of the modem manually through gpio and also modem is going in LPM but after that i throw a two commands,

echo auto > ./1-1.1/power/control
echo 1 > /sys/bus/usb/devices/x-x/power/autosuspend_delay

And found that device is not going in proper sleep and it can take around 25 to 30 seconds for sleep,

And now i just throw two commands, this time W_DISABLE signal is not asserted,

echo auto > ./1-1.1/power/control
echo 1 > /sys/bus/usb/devices/x-x/power/autosuspend_delay
(EM7455 modem is not in LPM but suspended)

By just above two commands device is going in sleep suddenly.

It look like after issuing W_DISABLE assert signal if i throw auto-suspend command device is not going in sleep suddenly and doing some process,

Can you please help me on this issue i want to configure the EM4755 modem in LPM during suspend mode and also device should go in sleep mode suddenly.

Thanks,
Kevil

Hi Kevil,
In this command " echo 1 > /sys/bus/usb/devices/x-x/power/autosuspend_delay"
Please replace x-x with your device’s value, from your logs, it should be 1-1.1 or 1-1.2

Thanks,

@jerdung,

Thank you for very quick response,

x-x is just example, command is thrown on correct modem USB node.

Please help us to solve above issue.

Thanks,
Kevil

Hi,
Could help to use command AT+CFUN=0 to let module to LPM, and then send 2 commands
echo auto > ./1-1.1/power/control
echo 1 > /sys/bus/usb/devices/x-x/power/autosuspend_delay

Does this issue happen?

@jerdung,

Tried using AT command as well but still issue is same,

Please help us,

Thanks,
Kevil

Hi,
It looks like the issue from your Android. What is the firmware/version of your Android/driver/module?

Thanks,