From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/pwrctl: reduce the amount of Kconfig noise
Date: Wed, 17 Jul 2024 14:31:57 +0200 [thread overview]
Message-ID: <CAMRc=MdcUhBe6-P0KH8KfrHfp8wqM0fCWGoUZaVZ7+FAkECtpA@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wgK=P_7LbCH9pzX4EZFYSd7HdJ8y=Fpt797F9XxT3ThUQ@mail.gmail.com>
On Tue, Jul 16, 2024 at 10:29 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Tue, 16 Jul 2024 at 13:10, Bartosz Golaszewski
> <bartosz.golaszewski@linaro.org> wrote:
> >
> > select PCI_PWRCTL_PWRSEQ if ARCH_QCOM
> >
> > in the ATH11K_PCI and ATH12K Kconfig entries? Am I getting this right?
>
> So on the whole, I'd prefer these things to be done where they are
> actually required.
>
> But I'm not actually entirely sure what the hard _requirements_ from a
> hardware - or a kernel build - standpoint actually are.
>
> If there aren't any hard requirements at all, then maybe the whole "do
> you want pweseq" should be an actual question (but limited only to
> situations where it makes sense).
>
> If the hard requirement is at the level of the driver itself, then the
> "select" should be in the driver.
>
> That doesn't seem to be the case here, since ATH11K_PCI certainly
> works without it, but if that driver requires power sequencing on
> ARCH_QCOM platforms, then maybe that is indeed the right thing.
>
> And if the hard requirement comes from some SoC setup, then optimally
> I think the "select" should be at that level, but we don't actually
> seem to have that level of questions (but maybe something in
>
> drivers/soc/qcom/Kconfig
>
> might make sense?)
>
The hard requirement really comes from the board level - not SoC. It's
the board that has the BT/WLAN module hardwired and - depending on how
the module is powered - may or may not require power sequencing. But I
don't think we have any per-board infrastructure in Kconfig.
> Anyway, this is not necessarily something where there is "one correct
> answer". This may be a somewhat gray area, and it looks like ARCH_QCOM
> is a very big "any Qualcomm SoC" thing and not very specific.
>
> So I'm not sure what the right answer is, but I *am* pretty sure of
> what the wrong answer is. And this:
>
> default m if ((ATH11K_PCI || ATH12K) && ARCH_QCOM)
>
> looks like it cannot possibly be right if ATH11K_PCI is built-in,
> since then the probing of the device will happen long before that
> PCI_PWRCTL_PWRSEQ module has been loaded.
>
> And that doesn't sound sensible to me. Does it?
>
> TL;DR: I do think that the
>
> select PCI_PWRCTL_PWRSEQ if ARCH_QCOM
>
> in the ATH11K_PCI and ATH12K Kconfig entries *may* be the right thing.
> But again, I'm not actually 100% sure of the hard requirements here.
>
> Linus
After sleeping on it I really think that it may be better to introduce
a more generic ARCH_HAVE_PCI_PWRCTL symbol so that we don't have to
update the ATH Kconfig entires for every new platform that needs it.
For want of a more fine-grained solution, we would select it from
ARCH_QCOM.
Bart
prev parent reply other threads:[~2024-07-17 12:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 15:23 [PATCH] PCI/pwrctl: reduce the amount of Kconfig noise Bartosz Golaszewski
2024-07-16 15:59 ` Manivannan Sadhasivam
2024-07-16 16:29 ` Bartosz Golaszewski
2024-07-16 16:33 ` Manivannan Sadhasivam
2024-07-16 17:38 ` Bartosz Golaszewski
2024-07-16 18:08 ` Linus Torvalds
2024-07-16 18:48 ` Bartosz Golaszewski
2024-07-16 19:02 ` Linus Torvalds
2024-07-16 20:10 ` Bartosz Golaszewski
2024-07-16 20:29 ` Linus Torvalds
2024-07-17 12:31 ` Bartosz Golaszewski [this message]
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='CAMRc=MdcUhBe6-P0KH8KfrHfp8wqM0fCWGoUZaVZ7+FAkECtpA@mail.gmail.com' \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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).