From patchwork Mon Aug 17 09:41:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 41972 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7H9kAkW019770 for ; Mon, 17 Aug 2009 09:46:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756890AbZHQJqH (ORCPT ); Mon, 17 Aug 2009 05:46:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756895AbZHQJqH (ORCPT ); Mon, 17 Aug 2009 05:46:07 -0400 Received: from mail-px0-f196.google.com ([209.85.216.196]:43205 "EHLO mail-px0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756890AbZHQJqG (ORCPT ); Mon, 17 Aug 2009 05:46:06 -0400 Received: by pxi34 with SMTP id 34so1130593pxi.4 for ; Mon, 17 Aug 2009 02:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=/w821jH0gCj1bnzU3wfP3g/BWwVAjKije1W8UoZ+CUk=; b=Hi5Ui7+ZP5LEWeP+k9PHUSd4rbG7/6d07jzZQ9VnUFd9JGK9x9qGR5ZIvx0daapydM Kye4JxLcVl49tw5EcNF9gG+mcDHEUQcVRyGXHlts1G2qAJ1uXaZDP1wwT8VgLdTm2hoN FXxOAY/T+16GvhWpQ4GZWR/Xc9NDWsGzEiGJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=bGFjkGW2tRAoW4f6jvPV0znU+mB2n/kv2v18zeoMumLAodi5GgA+rx+FPG4x2hKFKO 3QWHD24dOAjpO283gHSlxgUZMqyI8fhfCvNSO5qpe0XcshQz+PohdTGJTCZ9cBJ13ptf gNFwLCCJZ53JEJ6l76SGiLRgsWwDTXSlvu1kQ= Received: by 10.140.128.1 with SMTP id a1mr2254666rvd.158.1250502367378; Mon, 17 Aug 2009 02:46:07 -0700 (PDT) Received: from rx1.opensource.se (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id f42sm15252274rvb.45.2009.08.17.02.46.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Aug 2009 02:46:06 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Mon, 17 Aug 2009 18:41:40 +0900 Message-Id: <20090817094140.9319.29113.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: SuperH Mobile Software Standby support for cpuidle Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds "SuperH Mobile Standby Mode [SF]" to the list of cpuidle sleep modes. If the software latency requirements from cpuidle are met together with fulfilled hardware requirements then deep sleep modes can be entered. Tested on sh7722 and sh7724 with "Sleep Mode", "Sleep Mode + SF" and "Software Standby Mode + SF" together with a multimedia work load and flood ping without packet drop. Signed-off-by: Magnus Damm --- arch/sh/kernel/cpu/shmobile/cpuidle.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0003/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ work/arch/sh/kernel/cpu/shmobile/cpuidle.c 2009-07-01 16:25:32.000000000 +0900 @@ -21,6 +21,7 @@ static unsigned long cpuidle_mode[] = { SUSP_SH_SLEEP, /* regular sleep mode */ SUSP_SH_SLEEP | SUSP_SH_SF, /* sleep mode + self refresh */ + SUSP_SH_STANDBY | SUSP_SH_SF, /* software standby mode + self refresh */ }; static int cpuidle_sleep_enter(struct cpuidle_device *dev, @@ -96,6 +97,16 @@ void sh_mobile_setup_cpuidle(void) state->flags |= CPUIDLE_FLAG_TIME_VALID; state->enter = cpuidle_sleep_enter; + state = &dev->states[i++]; + snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); + strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", CPUIDLE_DESC_LEN); + state->exit_latency = 2300; + state->target_residency = 1 * 2; + state->power_usage = 1; + state->flags = 0; + state->flags |= CPUIDLE_FLAG_TIME_VALID; + state->enter = cpuidle_sleep_enter; + dev->state_count = i; cpuidle_register_device(dev);