linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: "Luis R. Rodriguez" <mcgrof@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	David Quan <David.Quan@atheros.com>,
	"Luis R. Rodriguez" <mcgrof@bombadil.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"ath5k-devel@venema.h4ckr.net" <ath5k-devel@venema.h4ckr.net>,
	Jonathan May <Jonathan.May@atheros.com>,
	Jussi Kivilinna <jussi.kivilinna@mbnet.fi>,
	Tim Gardner <tim.gardner@canonical.com>
Subject: Re: [ath5k-devel] [PATCH v2] ath5k: disable ASPM
Date: Tue, 22 Jun 2010 12:13:25 -0700	[thread overview]
Message-ID: <20100622191325.GF12659@tux> (raw)
In-Reply-To: <20100622184426.GA24546@srcf.ucam.org>

On Tue, Jun 22, 2010 at 11:44:26AM -0700, Matthew Garrett wrote:
> On Tue, Jun 22, 2010 at 11:28:20AM -0700, Luis R. Rodriguez wrote:
> > On Tue, Jun 22, 2010 at 10:50 AM, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > > People who use "force" deserve whatever they get,
> > 
> > Heh, this whole patch and thread was started because Jussi tested
> > ath5k with  pcie_aspm=force (on a pre PCIE 1.1 device (?)) . I have
> > been trying to explain all along why this is a terrible idea to the
> > point we should probably just remove that code from the kernel. Hence
> > my side rants and explanations to justify my reasonings.
> 
> Well, there's two things here. If you use force then you might get 
> inappropriate ASPM. But if your BIOS enables ASPM on an old device, then 
> booting *without* CONFIG_PCIE_ASPM will leave it turned on, and booting 
> *with* CONFIG_PCIE_ASPM will turn it off. The Kconfig description is 
> confusing - reality is that CONFIG_PCIE_ASPM enables logic that allows 
> the kernel to modify the BIOS default, and disabling it makes the 
> assumption that your BIOS did something sensible.

Agreed, given that you also mentioned you would put it under embeeded
how about something like this:

diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index b8b494b..9c76b70 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -31,14 +31,29 @@ source "drivers/pci/pcie/aer/Kconfig"
 # PCI Express ASPM
 #
 config PCIEASPM
-	bool "PCI Express ASPM support(Experimental)"
-	depends on PCI && EXPERIMENTAL && PCIEPORTBUS
-	default n
+	bool "PCI Express ASPM sanity check support" if EMBEDDED
+	depends on PCI && PCIEPORTBUS
+	default y
 	help
-	  This enables PCI Express ASPM (Active State Power Management) and
-	  Clock Power Management. ASPM supports state L0/L0s/L1.
+	  This enables some sanity checks for PCI Express ASPM.
+	  ASPM supports the states L0/L0s/L1. The sanity checks are to
+	  disable ASPM if:
+
+	  a) the device is pre-1.1
+	  b) the firmware has the FADT flag set to tell you not to
+	  c) the firmware doesn't grant control via _OSC
+
+	  Without this option your BIOS's defaults will be respected
+	  and while although this should always be correct it typically
+	  is not. If your ASPM settings are incorrect you may experience
+	  odd hangs which are hard to debug. These sanity checks should
+	  help avoid these odd hangs by only enabling ASPM if we are
+	  sure we can enable it.
+
+	  For more information you can refer to this documentation:
+
+	  http://wireless.kernel.org/en/users/Documentation/ASPM
 
-	  When in doubt, say N.
 config PCIEASPM_DEBUG
 	bool "Debug PCI Express ASPM"
 	depends on PCIEASPM

> > Where is "powersave"?
> > 
> > I do see a "powersave" but its an ASPM policy string and it implies
> > you want to enable L1 and L0s when the device's LinkCap supports it,
> > see pcie_config_aspm_link() and its users. So in other words powersave
> > seems to imply you are using pcie_aspm=force, no?
> 
> No. pcie_aspm=force will enable ASPM even if (a) the device is pre-1.1, 
> (b) the firmware has the FADT flag set to tell you not to and (c) the 
> firmware doesn't grant control via _OSC. The powersave policy will 
> enable ASPM even if the BIOS didn't, but only if something else doesn't 
> tell us not to.

So if any of the above (a) (b) or (c) are true powersave will keep
it disabled? Is pcie_aspm=forcepowersave this a new option with your
patches?

> > > Fedora's defaulted to that for a while now - we've hit
> > > issues with aacraid, but that's pretty much it in terms of cases where
> > > the heuristics don't work. Maxim's problems wouldn't be triggered
> > > because CONFIG_PCIE_ASPM disables it on pre-1.1 devices regardless of
> > > the BIOS setup.
> > 
> > I don't expect all distributions to have CONFIG_PCIE_ASPM enabled, in
> > fact I was unaware of this sanity check being included as part of
> > CONFIG_PCIE_ASPM, I recommend we consider just enabling the sanity
> > check all the time. The fact that CONFIG_PCIE_ASPM is even an option
> > seems confusing to me given that apart from this sanity check the only
> > other thing that I see useful in it is the forcing of ASPM settings
> > and as I noted I think pcie_aspm=force is pretty dangerous.
> 
> You're right, it shouldn't be an option. It's vital for making sure that 
> ASPM is disabled when it should be. I'd be happy with pcie_aspm=force 
> tainting the kernel.

:) !

> > > With the patch I've just sent, they should also all be used for Linux as
> > > well.
> > 
> > Oh nice! It'll be part of 2.6.36?
> 
> As long as Jesse picks it up.

Nice.

> > > If the same problems would appear under Windows then it's not a problem
> > > that I'm hugely concerned about as yet
> > 
> > Yes, these issues would also be part of Windows. But should also note
> > this also means for those people working on their own BIOSes it means
> > you also have to take these things into more serious consideration.
> 
> There's a standardised mechanism for BIOS authors to tell us not to 
> touch their ASPM configuration, and people that ignore that really do 
> deserve to have things break.

Oh, I was more concerned about open bios hackers. If a device requires
PCI host controller tweaks should *we* be doing those tweaks and sanity
checks oursevles upstream or should we rely on the open-bios guys to
do it accordingly in their code?

> > Me neither, ASPM should just work with default settings, which is why
> > I also do not like that the sanity check on the PCIE 1.1 spec is done
> > through CONFIG_PCIE_ASPM, it makes no sense given that ASPM *will*
> > work even if you do not have CONFIG_PCIE_ASPM but the device has
> > functional ASPM.
> 
> I agree. I'll send a patch that moves it under CONFIG_EMBEDDED and 
> defaults to on.

:D

> > I do think we should be depending on userspace to do development
> > testing and forcing ASPM on, because the only other alternative is
> > pcie_aspm=force and as noted this is just not a good idea unless you
> > *seriously* know what you are doing.
> 
> If you set the powersave policy and ASPM doesn't get enabled, then 
> that's because we've got a really strong belief that ASPM shouldn't be 
> enabled. Is your concern just that pcie_aspm=force is too easy for users 
> to get at?

Yes! I think people are starting to use it like to magically save
more power without taking into consideration the implications. This is
why I was suggesting maybe we nuke that option all together. Does it
*really* give us any benefit? The only benefit I see is if we *are*
100% sure our system should work with all our root complexes and
endpoints having ASPM enabled. That I do not see happening until
a few years from now.

Maybe we should have another type of module parameter type, a
I_know_what_Im_doing_module_parameter and taint whenever any of
those are on, not just pcie_aspm=force ? :)

  Luis

  reply	other threads:[~2010-06-22 19:13 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100528100901.14580.1322.stgit@fate.lan>
     [not found] ` <20100528212523.213125g8t0an4mn4@hayate.sektori.org>
     [not found]   ` <1275078476.18152.10.camel@mj>
     [not found]     ` <201005311006.15282.br1@einfach.org>
2010-06-01 20:43       ` [ath5k-devel] [PATCH] ath5k: disable ASPM Luis R. Rodriguez
     [not found] ` <1276806785.20754.8.camel@maxim-laptop>
     [not found]   ` <20100618112026.17623g6uhdjk8hts@naisho.dyndns.info>
     [not found]     ` <1276856142.9114.1.camel@maxim-laptop>
     [not found]       ` <20100618134930.124225d4fsi8w1fk@naisho.dyndns.info>
2010-06-18 11:05         ` Maxim Levitsky
2010-06-18 13:59           ` Bob Copeland
2010-06-18 14:11             ` Maxim Levitsky
2010-06-19  7:49               ` [PATCH v2] " Maxim Levitsky
2010-06-19 12:38                 ` Bob Copeland
2010-06-19 13:02                   ` Maxim Levitsky
2010-06-19 15:32                     ` [PATCH v3] " Maxim Levitsky
2010-07-26 20:13                       ` [ath5k-devel] " Luis R. Rodriguez
2010-07-26 20:49                         ` Maxim Levitsky
2010-07-26 21:06                           ` Luis R. Rodriguez
2010-07-26 21:14                             ` Matthew Garrett
2010-07-26 22:20                               ` Luis R. Rodriguez
2010-07-26 22:24                                 ` Matthew Garrett
2010-07-26 22:29                                   ` Luis R. Rodriguez
2010-07-26 21:17                             ` Maxim Levitsky
2010-07-26 21:25                               ` Matthew Garrett
2010-07-26 22:15                                 ` Luis R. Rodriguez
2010-07-26 22:21                                   ` Matthew Garrett
2010-07-26 22:26                                     ` Luis R. Rodriguez
2010-07-26 22:29                                       ` Matthew Garrett
2010-07-26 22:31                                         ` Luis R. Rodriguez
2010-07-26 22:33                                           ` Matthew Garrett
2010-07-26 22:43                                             ` Luis R. Rodriguez
2010-07-26 22:50                                               ` Matthew Garrett
2010-07-27  9:35                                                 ` Maxim Levitsky
2010-07-27 15:57                                                   ` Luis R. Rodriguez
2010-07-28 23:48                                                     ` Maxim Levitsky
2010-07-29  0:06                                                       ` Luis R. Rodriguez
2010-07-26 22:13                               ` Luis R. Rodriguez
2010-07-26 22:56                         ` Luis R. Rodriguez
2010-06-20  8:13                 ` [ath5k-devel] [PATCH v2] " Luis R. Rodriguez
2010-06-20 11:18                   ` Maxim Levitsky
2010-06-20 18:04                     ` Maxim Levitsky
2010-06-21  5:53                     ` Luis R. Rodriguez
2010-06-21 20:01                       ` Jussi Kivilinna
2010-06-21 20:16                       ` Maxim Levitsky
2010-06-21 20:33                         ` Jussi Kivilinna
2010-06-21 20:39                           ` Luis R. Rodriguez
2010-06-22 16:31                             ` Matthew Garrett
2010-06-22 16:48                               ` Luis R. Rodriguez
2010-06-22 16:52                                 ` Matthew Garrett
2010-06-22 17:17                                   ` Luis R. Rodriguez
2010-06-22 17:25                                     ` Matthew Garrett
2010-06-22 17:40                                       ` Luis R. Rodriguez
2010-06-22 17:50                                         ` Matthew Garrett
2010-06-22 18:28                                           ` Luis R. Rodriguez
2010-06-22 18:44                                             ` Matthew Garrett
2010-06-22 19:13                                               ` Luis R. Rodriguez [this message]
2010-06-22 19:31                                               ` Johannes Stezenbach
2010-06-22 19:37                                                 ` Luis R. Rodriguez
2010-06-22 19:38                                                   ` Luis R. Rodriguez
2010-06-23 14:39                                                     ` Johannes Stezenbach
2010-06-23 16:28                                                       ` Luis R. Rodriguez
2010-06-23 19:07                                                         ` Johannes Stezenbach
2010-06-23 19:23                                                   ` Johannes Stezenbach
2010-06-21 20:37                         ` Luis R. Rodriguez
2010-06-21 23:55                           ` Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100622191325.GF12659@tux \
    --to=lrodriguez@atheros.com \
    --cc=David.Quan@atheros.com \
    --cc=Jonathan.May@atheros.com \
    --cc=ath5k-devel@venema.h4ckr.net \
    --cc=jussi.kivilinna@mbnet.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@bombadil.infradead.org \
    --cc=mcgrof@gmail.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=tim.gardner@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).