From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752239AbdBUUY7 (ORCPT ); Tue, 21 Feb 2017 15:24:59 -0500 Received: from smtprelay0190.hostedemail.com ([216.40.44.190]:56667 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751466AbdBUUYw (ORCPT ); Tue, 21 Feb 2017 15:24:52 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3874:4321:5007:7576:10004:10400:10848:11026:11232:11473:11658:11914:12043:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:14819:21080:21451:30045:30054:30083:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: deer07_635ee5a9cbf32 X-Filterd-Recvd-Size: 2084 Message-ID: <1487708681.2853.35.camel@perches.com> Subject: Re: [PATCH v3 14/25] openrisc: Initial support for the idle state From: Joe Perches To: Stafford Horne , Jonas Bonn , Stefan Kristiansson Cc: linux@roeck-us.net, openrisc@lists.librecores.org, linux-kernel@vger.kernel.org, Sebastian Macke , Christian Svensson Date: Tue, 21 Feb 2017 12:24:41 -0800 In-Reply-To: <705d104f39c66faddd1fda08fc7b04f2b2e6a840.1487702890.git.shorne@gmail.com> References: <705d104f39c66faddd1fda08fc7b04f2b2e6a840.1487702890.git.shorne@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-02-22 at 04:11 +0900, Stafford Horne wrote: > From: Sebastian Macke > > 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); } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Tue, 21 Feb 2017 12:24:41 -0800 Subject: [OpenRISC] [PATCH v3 14/25] openrisc: Initial support for the idle state In-Reply-To: <705d104f39c66faddd1fda08fc7b04f2b2e6a840.1487702890.git.shorne@gmail.com> References: <705d104f39c66faddd1fda08fc7b04f2b2e6a840.1487702890.git.shorne@gmail.com> Message-ID: <1487708681.2853.35.camel@perches.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Wed, 2017-02-22 at 04:11 +0900, Stafford Horne wrote: > From: Sebastian Macke > > 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); }