Ticket #2177 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

andy-tracking/de473ca8: unable to powerdown GPS

Reported by: lindi Owned by: openmoko-kernel
Priority: normal Milestone:
Component: kernel Version: unspecified
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible: always

Description

When I moved from stable-tracking 80f4 to andy-tracking de47 I noticed that GPS is powered on bootup and can not be powered down:

root@ginger:~# cat /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/pwron
1
root@ginger:~# echo 0 > /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/pwron
root@ginger:~# cat /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/pwron
1
root@ginger:~# uname -r
2.6.28-GTA02_lindi-andy-tracking_de473ca893c9285a-mokodev
strace gpsd -F gpsd.sock -N -n -D 1 /dev/ttySAC1

prints

open("/dev/ttySAC1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 6
...
read(6, "1,012,*4D\r\n$GPGLL,6009.78203,N,02"..., 658) = 72

so the GPS device is really powered up and operating.

Change History

comment:1 Changed 9 years ago by lindi

I can still witness this with andy-tracking_b8b36e5ec3db71d5. However, it seems that at least after a few suspend/resume cycles the GPS device is powered down.

comment:2 Changed 9 years ago by lindi

I added some printk's around the code and tried to make sense of
this. Here are my observations. Please take them with a grain of salt
since I'm not a kernel developer:

neo1973_gps.power_was_on is initially set to 0 but
pcf50633_regulator_is_enabled() seems to return 1. In this state even
repeated calls to gps_pwron_set(0) won't disable the regulator since
it thinks it has already been disabled.

Userland workaround:

if [ `cat $sys_pm_gps/pwron` = 1 ]; then
    echo 1 | sudo tee $sys_pm_gps/pwron
fi
echo 0 | sudo tee $sys_pm_gps/pwron

Kernel fix: Don't rely on power_was_on at all but just query
regulator_is_enabled() all the time? Initialize power_was_on with 1?
Something else?

comment:3 Changed 9 years ago by PaulFertser

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.