Ticket #2293 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

linux/andy-tracking: gps does not always honor power_on

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

Description

Steps to reproduce:
1) echo 1 > /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/power_on
2) echo mem > /sys/power/state
3) cat /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/power_on
4) echo 1 > /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/power_on
5) cat /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0/power_on

Expected results:
3) 1 or 0, both are ok to me
5) 1

Actual results:
3) 0
5) 0

More info:
6) I can start the GPS chip if I first write 0 to power_on and then write 1 there.
7) I am using andy-tracking 9ecc089861ab238e
8) I think the bug is that neo1973_gps.power_was_on is updated only in power_gps_write() but gta01_pm_gps_suspend calls gps_pwron_set(0) directly and bypasses this.
9) My understanding:

  • cat power_on returns 0
  • since gps_pwron_get returns 0
  • since regulator_is_enabled(neo1973_gps.regulator[GTA02_GPS_REG_RF_3V]) returns 0
  • echo 1 > power_on does not enable regulator
  • since neo1973_gps.power_was_on is set
  • => power_was_on state is wrong.


Attachments

openmoko-gps-power1.patch (978 bytes) - added by lindi 10 years ago.
proposed fix (untested!)

Change History

Changed 10 years ago by lindi

proposed fix (untested!)

comment:1 Changed 10 years ago by PaulFertser

Lindi, afaict the intent of power_was_on is to keep information about power state during suspend (while GPS is actually unpowered). So power_was_on is correct here but ps_pwron_set should be able to power on the GPS regardless of its state (special care should be taken to not enable regulator twice, because regulators include reference counting). Sent to the ML is a tested patch that should solve the problem.

comment:2 Changed 10 years ago by PaulFertser

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