From patchwork Thu May 5 16:22:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Barada X-Patchwork-Id: 757632 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p45GMclC016630 for ; Thu, 5 May 2011 16:22:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755412Ab1EEQWh (ORCPT ); Thu, 5 May 2011 12:22:37 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:35563 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393Ab1EEQWh (ORCPT ); Thu, 5 May 2011 12:22:37 -0400 Received: by gyd10 with SMTP id 10so812436gyd.19 for ; Thu, 05 May 2011 09:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=8B/GRq6Af1o8CQcsI12Jj7raaG9x3tefZO3evU6hE9w=; b=c1mP0BoyCbhS2zx6DS3zfrabREYHZx8H6liwoS9IQTcGH3c6++EZNTTVRJQU1NjROw gguBRsoAcNtjzJx7HGPzncgF09iDcviEkWEINlUOG27Y+mwSJPEa5MgJ0dYq+uwEJyid mY2nOPhy6/BIv6w5WTYDwe1hfIi7w528Fiw0U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=wXfkYz4P0c/aNAaDdE4tzzFpCNvdIup23O+FFcQ8WXa9Y7x8sQAmmFuy3yrbGDMcLw UsbURANil6SxbiDNqIF9t7jB1ZhUqr5MRkOQLLbGdcYM09k1LiV1y3JmwFMJC+gbLAht FB09wUXnhnf+e9nwhy0mN9iV0eKjWYn80E+vI= Received: by 10.91.66.8 with SMTP id t8mr2446549agk.1.1304612556440; Thu, 05 May 2011 09:22:36 -0700 (PDT) Received: from [10.1.249.8] (mail.the-baradas.com [96.237.191.3]) by mx.google.com with ESMTPS id c35sm2257376anp.33.2011.05.05.09.22.35 (version=SSLv3 cipher=OTHER); Thu, 05 May 2011 09:22:35 -0700 (PDT) Message-ID: <4DC2CED3.80206@gmail.com> Date: Thu, 05 May 2011 12:22:43 -0400 From: Peter Barada User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: "linux-omap@vger.kernel.org" Subject: Module + offset calculations have to be signed in arch/arm/mach-omap2/pm-debug.c Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 05 May 2011 16:22:39 +0000 (UTC) I've been working on getting the TI OMAPPSP-03.00.01.06 kernel to properly suspend/resume on my DM37x board and all was going well until I added OTG support to the kernel and on suspend, the IVA2 and CORE pwrdms would not properly go into suspend. When comparing output from /debug/pm-debug/registers/current to the TRM, I noticed the following: MOD: CM_IVA2 (48014000) 04 => 00000017 20 => 00000001 24 => 00000001 34 => 00000001 40 => 00080a00 44 => 00000001 48 => 00000003 MOD: PRM_IVA2 (48316000) 50 => 00000007 e0 => 00ff0f05 e4 => 00000ff7 e8 => 00000ff7 f8 => 00000001 Looking at the TRM, the PRM_IVA2 registers are at 0x48306000, not 0x48316000. OMAP3430_IVA2_MOD is defined in prcm-common.h as -0x800 which means any module + reg_offset address calculation has to be signed. Once I corrected the "unsigned short offset" declaration in pm_module_def, rebuilt and tested again, IVA2/core pwrdms go into suspend correctly (and addresses look correct): Signed-off-by: Peter Barada diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 125f565..b731ef3 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -199,7 +199,7 @@ enum { struct pm_module_def { char name[8]; /* Name of the module */ short type; /* CM or PRM */ - unsigned short offset; + short offset; int low; /* First register address on this module */ int high; /* Last register address on this module */ };