On Thu, 2010-12-02 at 23:46 +0800, Arjan van de Ven wrote:
> On 12/2/2010 1:12 AM, Hong Liu wrote:
> > +           intel_scu_ipc_simple_command(0xf1, 1);
> > +   else {
> > +           bool charger_conn = check_charger_conn();
> > +
> > +           if (charger_conn) {
> > +                   /* enter into active dead mode to do battery charging */
> > +                   intel_scu_ipc_update_register(MSIC_RTC_CONFIG2,
> > +                           MSIC_ACTIVE_DEAD, MSIC_ACTIVE_DEAD_MASK);
> > +                   intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
> > +           } else {
> > +                   intel_scu_ipc_update_register(MSIC_CHIP_CTRL,
> > +                                   MSIC_CHIP_COLD_OFF, MSIC_CHIP_COLD_OFF);
> > +           }
> > +   }
> >   }
> 
> how do you solve the race of the user plugging in a charger after this 
> check, but before the reboot/power_off is completed?
> 

I don't think I have a solution in Linux kernel for this kind of race.
User has to power up the device again to fix this...

> shouldn't this be done by firmware instead?
> 

Yes, you are right. I think we should solve this in firmware as you
suggested.

We always do a COLD_RESET into active dead mode in Linux kernel, and let
the firmware decide what to do next, either charging the battery or
doing a COLF_OFF.

Thanks,
Hong

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to