Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753340Ab3FNWSD (ORCPT ); Fri, 14 Jun 2013 18:18:03 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:65351 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537Ab3FNWSA (ORCPT ); Fri, 14 Jun 2013 18:18:00 -0400 MIME-Version: 1.0 In-Reply-To: References: <20130401235256.GA31966@google.com> <20130614141101.GA29452@google.com> Date: Fri, 14 Jun 2013 15:17:59 -0700 X-Google-Sender-Auth: qtOh7pZdAxxEUNv3dsPAwJlRL9c Message-ID: Subject: Re: [PATCH] PCI: Remove not needed check in disable aspm link From: Yinghai Lu To: Bjorn Helgaas , Roman Yepishev Cc: Matthew Garrett , Jiang Liu , "Rafael J. Wysocki" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linus Torvalds , Andrew Morton , Greg Kroah-Hartman , Maxim Levitsky , Jussi Kivilinna Content-Type: multipart/mixed; boundary=047d7bdc08c89de1dc04df249e77 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10645 Lines: 182 --047d7bdc08c89de1dc04df249e77 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jun 14, 2013 at 2:26 PM, Bjorn Helgaas wrote: > [+cc Maxim, Jussi] > > Yeah, this is a huge mess. It makes my head hurt. I don't think it's > reasonable to add more flags because that will make my head hurt even > more. > > If I understand correctly, on Roman's system (the Acer Aspire One > AOA150 netbook mentioned in > https://bugzilla.kernel.org/show_bug.cgi?id=55211): > > - The BIOS leaves ASPM enabled for the ath5k device (03:00.0) > - The BIOS does not allow the OS to manage ASPM (via _OSC) > - The ath5k device does not work correctly with ASPM enabled > - The ath5k driver calls pci_disable_link_state(), but we do not > disable ASPM because we don't have permission from the BIOS looks like Matthew Garrett path is causing problem: commit 4949be16822e92a18ea0cc1616319926628092ee Author: Matthew Garrett Date: Tue Mar 6 13:41:49 2012 -0500 PCI: ignore pre-1.1 ASPM quirking when ASPM is disabled commit c9651e70ad0aa499814817cbf3cc1d0b806ed3a1 Author: Matthew Garrett Date: Tue Mar 27 10:17:41 2012 -0400 ASPM: Fix pcie devices with non-pcie children after those two patches, it aspm_disabled is set, via _osc early, pre-1.1 devices aspm register will be touched even aspm_force is not specified. pcie_aspm_init_link_state will all the way to pcie_config_aspm_path ==> pcie_config_aspm_link in that path, aspm_disabled is not checked nowhere. BTW, when aspm is not disabled, even the link is allocated, because it is black listed, so it is never get touched. Matthew's patch is not needed in any case. I would suspect that that aspm enabling in Roman's system could set by that path instead of BIOS. Roman, can you please check two patches + linsus' tree on your system? Thanks Yinghai --047d7bdc08c89de1dc04df249e77 Content-Type: application/octet-stream; name="revert_revert_osc_change_linus.patch" Content-Disposition: attachment; filename="revert_revert_osc_change_linus.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hhxxn2hh0 U3ViamVjdDogW1BBVENIXSBBQ1BJLCBQQ0k6IFJldmVydCByZXZlcnRpbmcgb2YgIlBDSS9BQ1BJ OiBSZXF1ZXN0IF9PU0MgY29udHJvbCBiZWZvcmUgc2Nhbm5pbmcgUENJIHJvb3QgYnVzIgoKSW4K fCBjb21taXQgYjgxNzhmMTMwZTI1YzFiZGFjMWMzM2UwOTk2ZjFmZjZlMjBlYzA4ZQp8IEF1dGhv cjogQmpvcm4gSGVsZ2FhcyA8YmhlbGdhYXNAZ29vZ2xlLmNvbT4KfCBEYXRlOiAgIE1vbiBBcHIg MSAxNTo0NzozOSAyMDEzIC0wNjAwCnwKfCAgICBSZXZlcnQgIlBDSS9BQ1BJOiBSZXF1ZXN0IF9P U0MgY29udHJvbCBiZWZvcmUgc2Nhbm5pbmcgUENJIHJvb3QgYnVzIgp8CnwgICAgVGhpcyByZXZl cnRzIGNvbW1pdCA4YzMzZjUxZGY0MDZlMWExZjdmYTRlOWIyNDQ4NDViN2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IKKwkJCSJkaXNhYmxpbmcgQVNQTVxuIik7CisJCXBjaWVfbm9fYXNwbSgp OwogCX0KIAogCXBjaV9hY3BpX2FkZF9idXNfcG1fbm90aWZpZXIoZGV2aWNlLCByb290LT5idXMp Owo= --047d7bdc08c89de1dc04df249e77 Content-Type: application/octet-stream; name="revert_matthew_aspm_disabled.patch" Content-Disposition: attachment; filename="revert_matthew_aspm_disabled.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hhxxo8wx1 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvcGNpL3BjaWUvYXNwbS5jIGIvZHJpdmVycy9wY2kvcGNpZS9h c3BtLmMKaW5kZXggNDAzYTQ0My4uYjc5NWI0MyAxMDA2NDQKLS0tIGEvZHJpdmVycy9wY2kvcGNp ZS9hc3BtLmMKKysrIGIvZHJpdmVycy9wY2kvcGNpZS9hc3BtLmMKQEAgLTQ5MywxNSArNDkzLDYg QEAgc3RhdGljIGludCBwY2llX2FzcG1fc2FuaXR5X2NoZWNrKHN0cnVjdCBwY2lfZGV2ICpwZGV2 KQogCQkJcmV0dXJuIC1FSU5WQUw7CiAKIAkJLyoKLQkJICogSWYgQVNQTSBpcyBkaXNhYmxlZCB0 aGVuIHdlJ3JlIG5vdCBnb2luZyB0byBjaGFuZ2UKLQkJICogdGhlIEJJT1Mgc3RhdGUuIEl0J3Mg c2FmZSB0byBjb250aW51ZSBldmVuIGlmIGl0J3MgYQotCQkgKiBwcmUtMS4xIGRldmljZQotCQkg Ki8KLQotCQlpZiAoYXNwbV9kaXNhYmxlZCkKLQkJCWNvbnRpbnVlOwotCi0JCS8qCiAJCSAqIERp c2FibGUgQVNQTSBmb3IgcHJlLTEuMSBQQ0llIGRldmljZSwgd2UgZm9sbG93IE1TIHRvIHVzZQog CQkgKiBSQkVSIGJpdCB0byBkZXRlcm1pbmUgaWYgYSBmdW5jdGlvbiBpcyAxLjEgdmVyc2lvbiBk ZXZpY2UKIAkJICovCg== --047d7bdc08c89de1dc04df249e77-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/