Skip to contentSkip to conversation

PCI: build Broadcom PAXC quirks unconditionally

PATCH In review Wei Liu 3 participants 13 messages Nov 15, 2019 – Dec 11, 2019 PCI

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 PCI: build Broadcom PAXC quirks unconditionally

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

#ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE
.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
 drivers/pci/quirks.c | 2 --
 1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -2
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
 			 PCI_DEVICE_ID_TIGON3_5719,
 			 quirk_brcm_5719_limit_mrrs);
 
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
 static void quirk_paxc_bridge(struct pci_dev *pdev)
 {
 	/*
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif
 
 /*
  * Originally in EDAC sources for i82875P: Intel tells BIOS developers to
Signature · 1 line
2.24.0
author
#1 lore raw
Quoted 5 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Quoted 8 lines

---
Alternatively, we can change the condition to:

#ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE
.

I chose to remove the ifdef because that's what other quirks looked like in this file.

Bjorn and Ray, any comment on this trivial patch?

Wei.

#2 lore raw
Quoted 12 lines · Wei Liu
Quoted 11 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

   #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

.

Quoted 7 lines
Quoted 2 lines

I chose to remove the ifdef because that's what other quirks looked like in this file.

Bjorn and Ray, any comment on this trivial patch?

Wei.

I just reviewed it and it looks good to me. Thanks!

Ray

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wei Liu

Hi Wei,

Quoted 30 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

   #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
  drivers/pci/quirks.c | 2 --
  1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -1
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
  			 PCI_DEVICE_ID_TIGON3_5719,
  			 quirk_brcm_5719_limit_mrrs);
 
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
  static void quirk_paxc_bridge(struct pci_dev *pdev)
  {
  	/*

drivers/pci/quirks.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); · line 2409

Quoted 7 lines
drivers/pci/quirks.c +0 -1
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif
 
  /*
   * Originally in EDAC sources for i82875P: Intel tells BIOS developers to

The change looks good to me. Thanks!

#4 lore raw
In reply to Wei Liu
Quoted 4 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Sorry, I missed this thinking it would be under drivers/pci/controller and hence handled by Lorenzo.

So I guess this doesn't fix a build problem, but without this patch, we just don't run the quirk if the driver is a module, right?

Quoted 34 lines

---
Alternatively, we can change the condition to:

  #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
 drivers/pci/quirks.c | 2 --
 1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -2
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
 			 PCI_DEVICE_ID_TIGON3_5719,
 			 quirk_brcm_5719_limit_mrrs);
 
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
 static void quirk_paxc_bridge(struct pci_dev *pdev)
 {
 	/*
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif
 
 /*
  * Originally in EDAC sources for i82875P: Intel tells BIOS developers to
Signature · 1 line
2.24.0
author
#5 lore raw
Quoted 5 lines · Bjorn Helgaas
Quoted 3 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Quoted 8 lines
Quoted 1 line

Sorry, I missed this thinking it would be under drivers/pci/controller and hence handled by Lorenzo.

So I guess this doesn't fix a build problem, but without this patch, we just don't run the quirk if the driver is a module, right?

Yes, this is correct.

Without this patch, the quirk doesn't get to run if the driver is a module.

Wei.

author
#6 lore raw
Quoted 12 lines · Wei Liu
Quoted 10 lines · Bjorn Helgaas
Quoted 4 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Sorry, I missed this thinking it would be under drivers/pci/controller and hence handled by Lorenzo.

Quoted 8 lines
Quoted 3 lines

So I guess this doesn't fix a build problem, but without this patch, we just don't run the quirk if the driver is a module, right?

Yes, this is correct.

Without this patch, the quirk doesn't get to run if the driver is a module.

Hi Bjorn

Are you satisfied with the patch? What do I need to do to get it merged?

Thanks,
Wei.

#7 lore raw
Quoted 13 lines · Wei Liu
Quoted 12 lines · Wei Liu
Quoted 10 lines · Bjorn Helgaas
Quoted 4 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Sorry, I missed this thinking it would be under drivers/pci/controller and hence handled by Lorenzo.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

So I guess this doesn't fix a build problem, but without this patch, we just don't run the quirk if the driver is a module, right?

Yes, this is correct.

Without this patch, the quirk doesn't get to run if the driver is a module.

Are you satisfied with the patch? What do I need to do to get it merged?

You needn't do anything. I'll clarify the changelog (the patch doesn't actually *enable* building the driver as a module; it merely ensures that we include the quirk in that case).

This is too late for v5.5, so it will get merged for v5.6 unless the modular driver itself was enabled for v5.5.

Bjorn

author
#8 lore raw
Quoted 22 lines · Bjorn Helgaas
Quoted 20 lines · Wei Liu
Quoted 18 lines · Wei Liu
Quoted 5 lines · Bjorn Helgaas
Quoted 3 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

Quoted 7 lines
Quoted 1 line

Sorry, I missed this thinking it would be under drivers/pci/controller and hence handled by Lorenzo.

So I guess this doesn't fix a build problem, but without this patch, we just don't run the quirk if the driver is a module, right?

Yes, this is correct.

Without this patch, the quirk doesn't get to run if the driver is a module.

Quoted 9 lines
Quoted 1 line

Are you satisfied with the patch? What do I need to do to get it merged?

You needn't do anything. I'll clarify the changelog (the patch doesn't actually *enable* building the driver as a module; it merely ensures that we include the quirk in that case).

This is too late for v5.5, so it will get merged for v5.6 unless the modular driver itself was enabled for v5.5.

OK. Thanks for the clarification.

Wei.

Quoted 1 line

Bjorn

#9 lore raw
In reply to Wei Liu
Quoted 29 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

#ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE
.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
 drivers/pci/quirks.c | 2 --
 1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -1
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
 			 PCI_DEVICE_ID_TIGON3_5719,
 			 quirk_brcm_5719_limit_mrrs);
 
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
 static void quirk_paxc_bridge(struct pci_dev *pdev)
 {
 	/*

drivers/pci/quirks.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); · line 2408

Quoted 4 lines
drivers/pci/quirks.c +0 -1
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif

Is there a reason this quirk can't be moved to drivers/pci/controller/pcie-iproc-platform.c? That would make it much less subtle because it would be compiled if and only if the driver itself is compiled.

If it needs to be here in quirks.c, please include a note about the reason.

Quoted 5 lines
drivers/pci/quirks.c +0 -0
 /*
  * Originally in EDAC sources for i82875P: Intel tells BIOS developers to
Signature · 1 line
2.24.0
#10 lore raw
Quoted 40 lines · Bjorn Helgaas
Quoted 29 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

   #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
  drivers/pci/quirks.c | 2 --
  1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -1
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
  			 PCI_DEVICE_ID_TIGON3_5719,
  			 quirk_brcm_5719_limit_mrrs);
 
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
  static void quirk_paxc_bridge(struct pci_dev *pdev)
  {
  	/*

drivers/pci/quirks.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); · line 2408

Quoted 4 lines
drivers/pci/quirks.c +0 -1
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif

Is there a reason this quirk can't be moved to drivers/pci/controller/pcie-iproc-platform.c? That would make it much less subtle because it would be compiled if and only if the driver itself is compiled.

Quoted 3 lines

If it needs to be here in quirks.c, please include a note about the reason.

There's no particular reason and yes it could be moved to pcie-iproc.c.

If that's preferred (and it sounds like it is) then we can do that.

Thanks,

Ray

Quoted 5 lines
Quoted 5 lines
drivers/pci/quirks.c +0 -0
  /*
   * Originally in EDAC sources for i82875P: Intel tells BIOS developers to
Signature · 1 line
2.24.0
#11 lore raw
Quoted 42 lines · Ray Jui
Quoted 39 lines · Bjorn Helgaas
Quoted 28 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

   #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
  drivers/pci/quirks.c | 2 --
  1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -1
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
  			 PCI_DEVICE_ID_TIGON3_5719,
  			 quirk_brcm_5719_limit_mrrs);
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
  static void quirk_paxc_bridge(struct pci_dev *pdev)
  {
  	/*

drivers/pci/quirks.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); · line 2408

Quoted 4 lines
drivers/pci/quirks.c +0 -1
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif

Is there a reason this quirk can't be moved to drivers/pci/controller/pcie-iproc-platform.c? That would make it much less subtle because it would be compiled if and only if the driver itself is compiled.

Quoted 6 lines
Quoted 2 lines

If it needs to be here in quirks.c, please include a note about the reason.

There's no particular reason and yes it could be moved to pcie-iproc.c.

If that's preferred (and it sounds like it is) then we can do that.

Yes, please, that would be great! No #ifdefs, plus the code won't be compiled into x86 and other arches that never use that driver.

Bjorn

#12 lore raw
Quoted 46 lines · Bjorn Helgaas
Quoted 45 lines · Ray Jui
Quoted 41 lines · Bjorn Helgaas
Quoted 28 lines · Wei Liu

CONFIG_PCIE_IPROC_PLATFORM only gets defined when the driver is built in. Removing the ifdef will allow us to build the driver as a module.

---
Alternatively, we can change the condition to:

    #ifdef CONFIG_PCIE_IPROC_PLATFORM || CONFIG_PCIE_IPROC_PLATFORM_MODULE

.

I chose to remove the ifdef because that's what other quirks looked like in this file.

---
   drivers/pci/quirks.c | 2 --
   1 file changed, 2 deletions(-)
drivers/pci/quirks.c +0 -1
index 320255e5e8f8..cd0e7c18e717 100644
@@ -2381,7 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,
   			 PCI_DEVICE_ID_TIGON3_5719,
   			 quirk_brcm_5719_limit_mrrs);
-#ifdef CONFIG_PCIE_IPROC_PLATFORM
   static void quirk_paxc_bridge(struct pci_dev *pdev)
   {
   	/*

drivers/pci/quirks.c DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); · line 2408

Quoted 4 lines
drivers/pci/quirks.c +0 -1
@@ -2405,7 +2404,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
   DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd750, quirk_paxc_bridge);
   DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, quirk_paxc_bridge);
   DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, quirk_paxc_bridge);
-#endif

Is there a reason this quirk can't be moved to drivers/pci/controller/pcie-iproc-platform.c? That would make it much less subtle because it would be compiled if and only if the driver itself is compiled.

If it needs to be here in quirks.c, please include a note about the reason.

Quoted 9 lines
Quoted 3 lines

There's no particular reason and yes it could be moved to pcie-iproc.c.

If that's preferred (and it sounds like it is) then we can do that.

Yes, please, that would be great! No #ifdefs, plus the code won't be compiled into x86 and other arches that never use that driver.

Bjorn

Okay, Wei, let me know if you'd like to help with that? If not, I can make the change.

Thanks,

Ray