linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Rob Herring" <robh@kernel.org>,
	linux-pci@vger.kernel.org, "Jianmin Lv" <lvjianmin@loongson.cn>,
	"Xuefeng Li" <lixuefeng@loongson.cn>,
	"Huacai Chen" <chenhuacai@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH Resend] PCI: Limit islolated function probing on bus 0 for LoongArch
Date: Tue, 14 Oct 2025 16:10:11 -0500	[thread overview]
Message-ID: <20251014211011.GA907236@bhelgaas> (raw)
In-Reply-To: <20251014074100.2149737-1-chenhuacai@loongson.cn>

On Tue, Oct 14, 2025 at 03:41:00PM +0800, Huacai Chen wrote:
> We found some discrete AMD graphics devices hide funtion 0 and the whole
> is not supposed to be probed.
> 
> Since our original purpose is to allow integrated devices (on bus 0) to
> be probed without function 0, we can limit the islolated function probing
> only on bus 0.

s/islolated/isolated/ (multiple)
s/funtion/function/

I suppose this fixes some problem where:

  - An AMD GPU is on some bus other than 00
  - The GPU has no function 0
  - Without function 0, we normally don't probe other functions
  - a02fd05661d7 means we *do* probe other functions on LoongArch
  - Therefore we find some non-0 function we're not supposed to find

If that's the case, what bad thing happens?  Is there some dmesg hint
we can include in the commit log?

I suppose this means such devices are potentially broken for s390 and
jailhouse as well?

> Cc: stable@vger.kernel.org
> Fixes: a02fd05661d73a8 ("PCI: Extend isolated function probing to LoongArch")

a02fd05661d7 (12-char SHA1 is conventional)

> -static inline bool hypervisor_isolated_pci_functions(void)
> +static inline bool hypervisor_isolated_pci_functions(int bus)
>  {
>  	if (IS_ENABLED(CONFIG_S390))
>  		return true;
>  
> -	if (IS_ENABLED(CONFIG_LOONGARCH))
> -		return true;
> +	if (IS_ENABLED(CONFIG_LOONGARCH)) {
> +		if (bus == 0)

I don't really like this embedded assumption that the root bus is bus
00.  That's not necessarily the case; we have many host bridges that
lead to a bus other than 00.

> +			return true;
> +	}
>  
>  	return jailhouse_paravirt();
>  }
> -- 
> 2.47.3
> 

      reply	other threads:[~2025-10-14 21:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  7:41 [PATCH Resend] PCI: Limit islolated function probing on bus 0 for LoongArch Huacai Chen
2025-10-14 21:10 ` Bjorn Helgaas [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=20251014211011.GA907236@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lvjianmin@loongson.cn \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.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).