Re: [PATCH 2/2] MIPS: Malta: support powering down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 01, 2014 at 06:28:26PM +0100, Maciej W. Rozycki wrote:
> > Returning to
> > the monitor/bootloader prompt (which may or may not be YAMON) is not
> > generally possible since the memory it was using has probably been
> > overwritten.
> 
>  It depends on whether the YAMON memory (first 1MB IIRC) is claimed by the 
> kernel or not; I don't remember offhand.  Also I don't know if YAMON 
> reinstalls its exception handlers on application return.  In principle it 
> should be doable.
> 

The memory used by YAMON is reserved throughout boot (presumably to
allow the amon interface to be used by the old CONFIG_MIPS_CMP SMP
implementation). It's freed at the end of boot though.

> > It may make sense to separate halt & power off though, with
> > halt simply executing an infinite loop as you suggest.
> 
>  Yes, that would be great if YAMON return turns out infeasible.
> 

One big issue is that the system may not even be running YAMON. U-boot
runs just fine on a Malta and executes from the end of the first 256MB
of kseg0, rather than from the start of it. It would be possible to
specify some mechanism for the bootloader to tell the kernel what memory
it uses & avoid touching it, then attempt a return if that information
is provided, but I don't really think it would be worthwhile.

> > >  Shouldn't the handle on the device and the resource be requested early 
> > > on, where mips_machine_halt (mips_machine_power_off) is installed as the 
> > > halt (power-off) handler?  Especially requesting the resource here seems 
> > > to make little sense to me -- we're about to kill the box, so why bother 
> > > verifying whether it's going to interfere with a random driver?
> > 
> > Well requesting the I/O region was more about sanity checking that it's
> > present. This could be done earlier I guess, it would just mean keeping
> > around the needed I/O & PCI bus pointers in globals and I don't see the
> > issue with just acquiring them when they're needed.
> 
>  I have two issues with that:
> 
> 1. Drivers generally claim resources at initialisation, not at the time 
>    the resources need to be used.  While the power-off driver is very 
>    simple and single-use only, I see no reason for it to be different.  
>    I find it useful to see what hardware has drivers attached in 
>    /proc/iomem or /proc/ioports too.
> 
> 2. Any resource claim error message seen at boot can prompt the system 
>    operator to take a corrective action.  When it's only issued at system 
>    shutdown, it's likely it'll be too late already.
> 
> Do you think there's anything wrong with these obervations?
> 

Nope that's fine, I'll move the request for v2 and implement the hang on
halt behaviour.

Thanks,
    Paul

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux