From patchwork Wed Aug 19 01:57:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 42475 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 n7J1uolH022565 for ; Wed, 19 Aug 2009 01:57:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751231AbZHSB5o (ORCPT ); Tue, 18 Aug 2009 21:57:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751272AbZHSB5o (ORCPT ); Tue, 18 Aug 2009 21:57:44 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:57170 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbZHSB5n (ORCPT ); Tue, 18 Aug 2009 21:57:43 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n7J1vh3P012984 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 19 Aug 2009 10:57:44 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 6EBC845DE5D for ; Wed, 19 Aug 2009 10:57:43 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 4637345DE4F for ; Wed, 19 Aug 2009 10:57:43 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 236941DB8046 for ; Wed, 19 Aug 2009 10:57:43 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id C11FA1DB8040 for ; Wed, 19 Aug 2009 10:57:42 +0900 (JST) Received: from m108.css.fujitsu.com (m108 [127.0.0.1]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id 78050428061; Wed, 19 Aug 2009 10:57:42 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id F2152428060; Wed, 19 Aug 2009 10:57:41 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Wed, 19 Aug 2009 10:57:35 +0900 (JST) Message-ID: <4A8B5C0B.5000500@jp.fujitsu.com> Date: Wed, 19 Aug 2009 10:57:31 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: jbarnes@virtuousgeek.org, shaohua.li@intel.com, linux-pci@vger.kernel.org Subject: [PATCH 1/7] PCI ASPM: do not clear enabled field by support field References: <4A8B5BC8.1070907@jp.fujitsu.com> In-Reply-To: <4A8B5BC8.1070907@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org We must not clear bits in 'aspm_enabled' using 'aspm_support', or 'aspm_enabled' and 'aspm_default' might be different from the actual state. In addtion, 'aspm_default' should be intialized even if 'aspm_support' is 0. Signed-off-by: Kenji Kaneshige --- drivers/pci/pcie/aspm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: 20090818/drivers/pci/pcie/aspm.c =================================================================== --- 20090818.orig/drivers/pci/pcie/aspm.c +++ 20090818/drivers/pci/pcie/aspm.c @@ -346,12 +346,12 @@ static void pcie_aspm_cap_init(struct pc link->latency.l0s = max_t(u32, link->latency.l0s, l0s); link->latency.l1 = max_t(u32, link->latency.l1, l1); + /* Save default state */ + link->aspm_default = link->aspm_enabled; + if (!link->aspm_support) return; - link->aspm_enabled &= link->aspm_support; - link->aspm_default = link->aspm_enabled; - /* ENDPOINT states*/ list_for_each_entry(child, &linkbus->devices, bus_list) { int pos;