lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170222141909.GA2449@lianli.shorne-pla.net>
Date:   Wed, 22 Feb 2017 23:19:09 +0900
From:   Stafford Horne <shorne@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     Jonas Bonn <jonas@...thpole.se>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        linux@...ck-us.net, openrisc@...ts.librecores.org,
        linux-kernel@...r.kernel.org, Sebastian Macke <sebastian@...ke.de>,
        Christian Svensson <blue@....nu>
Subject: Re: [PATCH v3 14/25] openrisc: Initial support for the idle state

On Tue, Feb 21, 2017 at 12:24:41PM -0800, Joe Perches wrote:
> On Wed, 2017-02-22 at 04:11 +0900, Stafford Horne wrote:
> > From: Sebastian Macke <sebastian@...ke.de>
> > 
> > This patch adds basic support for the idle state of the cpu.
> > The patch overrides the regular idle function, enables the interupts,
> > checks for the power management unit and enables the cpu doze mode
> > if available.
> 
> trivia:
> 
> > diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
> []
> > @@ -75,6 +75,20 @@ void machine_power_off(void)
> >  	__asm__("l.nop 1");
> >  }
> >  
> > +/*
> > + * Send the doze signal to the cpu if available.
> > + * Make sure, that all interrupts are enabled
> > + */
> > +void arch_cpu_idle(void)
> > +{
> > +	unsigned long upr;
> > +
> > +	local_irq_enable();
> > +	upr = mfspr(SPR_UPR);
> > +	if (upr & SPR_UPR_PMP)
> > +		mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME);
> > +}
> 
> Perhaps this would be easier to read without the automatic
> 
> void arch_cpu_idle(void)
> {
> 	local_irq_enable();
> 	if (mfspr(SPR_UPR) & SPR_UPR_PMP)
> 		mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME);
> }

Yeah, that looks better.  I made the change.  Will post another series. 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ