Skip to contentSkip to conversation

x86/early-quirks: Scan all functions in early_pci_scan_bus()

PATCH RESEND In review Thorsten Blum 4 participants 10 messages Nov 6 – Nov 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 x86/early-quirks: Scan all functions in early_pci_scan_bus()

early_pci_scan_bus() stops scanning a PCI slot when check_dev_quirk() returns nonzero, which avoids probing functions 1-7 on single-function devices, but also stops scanning when a function is absent on a multifunction device.

This can skip early quirks on multifunction devices with holes in their function numbering.

On iMac13,1 and iMac13,2, the BCM4331 AirPort card is behind root port 00:1c.3, also documented by the model list in commit abb2bafd295f ("x86/quirks: Add early quirk to reset Apple AirPort card").

Public lspci output for 2012 iMacs [1][2] shows that 00:1c.0, 00:1c.2, 00:1c.3 and 00:1c.4 are present, but 00:1c.1 is missing. The old code stops at 00:1c.1 and never reaches 00:1c.3, so the AirPort reset quirk is silently skipped on these machines.

Check function 0 first, and if it indicates a multifunction device, scan functions 1-7 independently so that absent functions do not cause later ones to be skipped.

---
Changes in v2:
- Add iMac13,x background information and supporting links (Lukas)
- v1: https://lore.kernel.org/r/[email protected]/

 arch/x86/kernel/early-quirks.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
arch/x86/kernel/early-quirks.c +8 -6
index 6b6f32f40cbe..c641f38eca3a 100644
@@ -795,12 +795,14 @@ static void __init early_pci_scan_bus(int bus)
 	int slot, func;
 
 	/* Poor man's PCI discovery */
-	for (slot = 0; slot < 32; slot++)
-		for (func = 0; func < 8; func++) {
-			/* Only probe function 0 on single fn devices */
-			if (check_dev_quirk(bus, slot, func))
-				break;
-		}
+	for (slot = 0; slot < 32; slot++) {
+		/* Only multifunction devices may have functions 1-7 */
+		if (check_dev_quirk(bus, slot, 0))
+			continue;
+
+		for (func = 1; func < 8; func++)
+			check_dev_quirk(bus, slot, func);
+	}
 }
 
 void __init early_quirks(void)
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 21 lines

early_pci_scan_bus() stops scanning a PCI slot when check_dev_quirk() returns nonzero, which avoids probing functions 1-7 on single-function devices, but also stops scanning when a function is absent on a multifunction device.

This can skip early quirks on multifunction devices with holes in their function numbering.

On iMac13,1 and iMac13,2, the BCM4331 AirPort card is behind root port 00:1c.3, also documented by the model list in commit abb2bafd295f ("x86/quirks: Add early quirk to reset Apple AirPort card").

Public lspci output for 2012 iMacs [1][2] shows that 00:1c.0, 00:1c.2, 00:1c.3 and 00:1c.4 are present, but 00:1c.1 is missing. The old code stops at 00:1c.1 and never reaches 00:1c.3, so the AirPort reset quirk is silently skipped on these machines.

Check function 0 first, and if it indicates a multifunction device, scan functions 1-7 independently so that absent functions do not cause later ones to be skipped.

Quoted 9 lines

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Thorsten Blum
Quoted 30 lines · Thorsten Blum

early_pci_scan_bus() stops scanning a PCI slot when check_dev_quirk() returns nonzero, which avoids probing functions 1-7 on single-function devices, but also stops scanning when a function is absent on a multifunction device.

This can skip early quirks on multifunction devices with holes in their function numbering.

On iMac13,1 and iMac13,2, the BCM4331 AirPort card is behind root port 00:1c.3, also documented by the model list in commit abb2bafd295f ("x86/quirks: Add early quirk to reset Apple AirPort card").

Public lspci output for 2012 iMacs [1][2] shows that 00:1c.0, 00:1c.2, 00:1c.3 and 00:1c.4 are present, but 00:1c.1 is missing. The old code stops at 00:1c.1 and never reaches 00:1c.3, so the AirPort reset quirk is silently skipped on these machines.

Check function 0 first, and if it indicates a multifunction device, scan functions 1-7 independently so that absent functions do not cause later ones to be skipped.

Quoted 7 lines

---
Changes in v2:
- Add iMac13,x background information and supporting links (Lukas)
- v1: https://lore.kernel.org/r/[email protected]/

 arch/x86/kernel/early-quirks.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Applied to blum/for-7.5 for linux-next testing.

[1/1] x86/early-quirks: Scan all functions in early_pci_scan_bus()

      https://git.kernel.org/blum/c/83e3892f2aadca0123a3b7d452e3f39e74cf5126

I plan to send it to Linus during the next merge window unless there are objections or the x86/PCI maintainers would prefer to take it.

Thanks,
Thorsten

#3 lore raw
Quoted 7 lines · Thorsten Blum

Applied to blum/for-7.5 for linux-next testing.

[1/1] x86/early-quirks: Scan all functions in early_pci_scan_bus()

      https://git.kernel.org/blum/c/83e3892f2aadca0123a3b7d452e3f39e74cf5126

I plan to send it to Linus during the next merge window unless there are objections or the x86/PCI maintainers would prefer to take it.

I'm confused why you would even consider sending this to Linus. I'm sorry but I'm not familiar with your work. Is this kind of thing you normally send to Linus?

Oh, and I guess this is an objection. Please don't send this specific fix upstream.

#4 lore raw
Quoted 6 lines · Dave Hansen
Quoted 5 lines · Thorsten Blum

Applied to blum/for-7.5 for linux-next testing.

[1/1] x86/early-quirks: Scan all functions in early_pci_scan_bus()

      https://git.kernel.org/blum/c/83e3892f2aadca0123a3b7d452e3f39e74cf5126
Quoted 6 lines
Quoted 2 lines

I plan to send it to Linus during the next merge window unless there are objections or the x86/PCI maintainers would prefer to take it.

I'm confused why you would even consider sending this to Linus. I'm sorry but I'm not familiar with your work. Is this kind of thing you normally send to Linus?

The patch has been reviewed and acked for quite some time. Bjorn offered to take it via the PCI tree at the end of October, pending an ack from one of the x86 maintainers, but there hasn't been any further feedback.

I'm not keen on sending it directly to Linus, but I'd like to get it into linux-next for testing and eventually merged.

Quoted 2 lines

Oh, and I guess this is an objection. Please don't send this specific fix upstream.

Is your objection to the patch itself or to merging it via my tree?

Thanks,
Thorsten

maintainer
#5 lore raw
Quoted 3 lines · Thorsten Blum

The patch has been reviewed and acked for quite some time. Bjorn offered to take it via the PCI tree at the end of October, pending an ack from one of the x86 maintainers, but there hasn't been any further feedback.

Why, because after sifting through all that gibberish in the commit message, it is basically telling me that some mac laptops have trouble with Linux?

And because of this we need to stop the presses and take your patch immediately?

Quoted 2 lines

I'm not keen on sending it directly to Linus, but I'd like to get it into linux-next for testing and eventually merged.

So just from looking at the diff, that patch will definitely NOT go to stable but needs to stay in tip for at least a cycle so that it is tested as widely as possible.

Because if you break other systems with it, we will have to revert and fix up after you.

Quoted 4 lines
Quoted 2 lines

Oh, and I guess this is an objection. Please don't send this specific fix upstream.

Is your objection to the patch itself or to merging it via my tree?

It is also my objection to you not merging anything tip-maintained through your tree.

It looks like you fail to adhere to the process everyone has agreed upon and you're simply bypassing maintainers. No one does that and if you're planning on working with other maintainers, bypassing them is the *LAST* thing you should do. I never thought I would have to even write this on the mailing list - it should be implicit.

I don't know whether you know that, maybe you should refresh on the development process if you haven't done so:

https://docs.kernel.org/process/development-process.html

As to being familiar with your work which dhansen mentioned, I can give my experience:

You are flooding us with what are mostly cleanup patches which are so-so and not really urgent. Not really. Sure, perhaps some of them are nice to have but meh, not important. Each time I have to ask, why do I need this patch?

However, your frequency of sending more and more of them is as if your patches are the most important thing since sliced bread.

And because we cannot reply to them immediately, you resend and ping and resend again. Instead of being patient. See, we're swamped with shit that is orders of magnitude more important than your cleanups.

And I told you back then, if you really wanna help, you should REALLY HELP and review some patches from other submitters, for a change. But you completely ignored my hint - rather, you continued to shoot out your patches.

Sorry, buddy, but this is not how this works. We are not here to review only your cleanups and deal only with your output when you're not reciprocating in the least.

So what I would do if I were you, is to slow down, try to help out and be patient. Think whether your fixlet or cleanup really needs to be resent multiple times in the face of much more complex and important work we all have.

And maybe, just maybe, you could perhaps start helping out with review. The thing that we all sorely need and no one really wants to do.

Because it is only five of us against a gazillion of submitters who are even faster with AI now and we have to go sift through all that flood, and make sense of each pile.

So we're down there, neck deep in shit and all you're trying is to bypass us
- who cares what the maintainers think.

All this is telling me is that you basically have no clue how the process works. And it makes me trust you even less than before. And this project works on trust. So maybe you should step back and think twice: do you really want to work in this community and have people trust you and you trust them or do you wanna do your own shit?

Answering that would be very hepful for me to know what to do with your submissions in the future.

Thx, but not really...

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#6 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 3 lines · Thorsten Blum

The patch has been reviewed and acked for quite some time. Bjorn offered to take it via the PCI tree at the end of October, pending an ack from one of the x86 maintainers, but there hasn't been any further feedback.

[...]

It is also my objection to you not merging anything tip-maintained through your tree.

OK, I won't.

Quoted 2 lines

It looks like you fail to adhere to the process everyone has agreed upon and you're simply bypassing maintainers.

My intention was to get this patch into linux-next for broader testing, not to bypass the maintainers. Apologies if it came across that way.

maintainer
#7 lore raw
Quoted 2 lines · Thorsten Blum

My intention was to get this patch into linux-next for broader testing, not to bypass the maintainers. Apologies if it came across that way.

How about all those other things I asked? Any thoughts on them or does everything remain business-as-usual - you keep hammering us with patches and nothing really changes?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#8 lore raw
In reply to Borislav Petkov
Quoted 7 lines · Borislav Petkov
Quoted 3 lines · Thorsten Blum

The patch has been reviewed and acked for quite some time. Bjorn offered to take it via the PCI tree at the end of October, pending an ack from one of the x86 maintainers, but there hasn't been any further feedback.

Why, because after sifting through all that gibberish in the commit message, it is basically telling me that some mac laptops have trouble with Linux?

v1 (submitted on August 7) didn't mention the iMacs as examples because this bug may also affect other early quirks.

Lukas then asked for an example, which is why I added both iMacs to the commit message in v2 (submitted on August 16, with no code changes).

Quoted 2 lines

And because of this we need to stop the presses and take your patch immediately?

I never suggested the patch had to be taken immediately. And 3+ months doesn't seem particularly immediate to me for a bug either.

I resent the patch twice (September 16 and November 6) and pinged once (October 3), which should be well within the community guidelines:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

maintainer
#9 lore raw
Quoted 2 lines · Thorsten Blum

I never suggested the patch had to be taken immediately. And 3+ months doesn't seem particularly immediate to me for a bug either.

Did you not read my mail?

"So just from looking at the diff, that patch will definitely NOT go to stable but needs to stay in tip for at least a cycle so that it is tested as widely as possible.

Because if you break other systems with it, we will have to revert and fix up after you."

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette