Skip to contentSkip to conversation

PCI: tegra: Fix building Tegra194 PCIe driver

PATCH Superseded Jon Hunter 2 participants 4 messages May 26, 2021 – Jun 7, 2021

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH v3 1/1 PCI: tegra: Fix building Tegra194 PCIe driver

Commit 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") caused a few build regressions for the Tegra194 PCIe driver which are:

1. The Tegra194 PCIe driver can no longer be built as a module. This was caused by removing the Makefile entry to build the pcie-tegra.c based upon the CONFIG_PCIE_TEGRA194 option. Therefore, restore this so that we can build the driver as a module.
2. 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") added "#ifdef CONFIG_PCIE_TEGRA194" around the native driver. But if we set CONFIG_PCIE_TEGRA194=m to build the driver as a module, autoconf.h contains "#define CONFIG_PCIE_TEGRA194_MODULE 1" (not "#define CONFIG_PCIE_TEGRA194 1"), so the #ifdef excludes the driver. Instead, use "IS_ENABLED(CONFIG_PCIE_TEGRA194)", which checks for either CONFIG_PCIE_TEGRA194 or CONFIG_PCIE_TEGRA194_MODULE.
3. The below build warnings that are seen with particular kernel configurations. Fix these by moving these structure definitions to within the necessary guards.

drivers/pci/controller/dwc/pcie-tegra194.c:259:18: warning:
‘event_cntr_data_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:250:18: warning:
‘event_cntr_ctrl_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:243:27: warning:
‘pcie_gen_freq’ defined but not used [-Wunused-const-variable=]

Fixes 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata")

---
Changes since V2:
- Update the commit message per Bjorn's feedback
- Moved the structure definitions within the necessary guards as opposed to wrapping the existing defintions with the appropriate guards.

Changes since V1:
- Added fixes tag
- Fixed 'defined but not used' compiler warnings

 drivers/pci/controller/dwc/Makefile        |  1 +
 drivers/pci/controller/dwc/pcie-tegra194.c | 51 +++++++++++-----------
 2 files changed, 26 insertions(+), 26 deletions(-)
drivers/pci/controller/dwc/Makefile +1 -0
index eca805c1a023..f0d1e2d8c022 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o
 # depending on whether ACPI, the DT driver, or both are enabled.
 
 obj-$(CONFIG_PCIE_AL) += pcie-al.o
+obj-$(CONFIG_PCIE_TEGRA194) += pcie-tegra194.o
 obj-$(CONFIG_PCI_HISI) += pcie-hisi.o
 
 ifdef CONFIG_ACPI
drivers/pci/controller/dwc/pcie-tegra194.c +25 -26

69 lines not on this page · raw message

Signature · 1 line
2.25.1
author maintainer
#1 lore raw

Hi Bjorn, Lorenzo,

Quoted 26 lines · Jon Hunter

Commit 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") caused a few build regressions for the Tegra194 PCIe driver which are:

1. The Tegra194 PCIe driver can no longer be built as a module. This was caused by removing the Makefile entry to build the pcie-tegra.c based upon the CONFIG_PCIE_TEGRA194 option. Therefore, restore this so that we can build the driver as a module.
2. 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") added "#ifdef CONFIG_PCIE_TEGRA194" around the native driver. But if we set CONFIG_PCIE_TEGRA194=m to build the driver as a module, autoconf.h contains "#define CONFIG_PCIE_TEGRA194_MODULE 1" (not "#define CONFIG_PCIE_TEGRA194 1"), so the #ifdef excludes the driver. Instead, use "IS_ENABLED(CONFIG_PCIE_TEGRA194)", which checks for either CONFIG_PCIE_TEGRA194 or CONFIG_PCIE_TEGRA194_MODULE.
3. The below build warnings that are seen with particular kernel configurations. Fix these by moving these structure definitions to within the necessary guards.

drivers/pci/controller/dwc/pcie-tegra194.c:259:18: warning:
‘event_cntr_data_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:250:18: warning:
‘event_cntr_ctrl_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:243:27: warning:
‘pcie_gen_freq’ defined but not used [-Wunused-const-variable=]

Quoted 2 lines
Fixes 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata")

Any feedback on this? We need this for v5.13.

Thanks!
Jon

Signature · 1 line
nvpublic
#2 lore raw
Quoted 29 lines · Jon Hunter

Hi Bjorn, Lorenzo,

Quoted 26 lines · Jon Hunter

Commit 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") caused a few build regressions for the Tegra194 PCIe driver which are:

1. The Tegra194 PCIe driver can no longer be built as a module. This was caused by removing the Makefile entry to build the pcie-tegra.c based upon the CONFIG_PCIE_TEGRA194 option. Therefore, restore this so that we can build the driver as a module.
2. 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") added "#ifdef CONFIG_PCIE_TEGRA194" around the native driver. But if we set CONFIG_PCIE_TEGRA194=m to build the driver as a module, autoconf.h contains "#define CONFIG_PCIE_TEGRA194_MODULE 1" (not "#define CONFIG_PCIE_TEGRA194 1"), so the #ifdef excludes the driver. Instead, use "IS_ENABLED(CONFIG_PCIE_TEGRA194)", which checks for either CONFIG_PCIE_TEGRA194 or CONFIG_PCIE_TEGRA194_MODULE.
3. The below build warnings that are seen with particular kernel configurations. Fix these by moving these structure definitions to within the necessary guards.

drivers/pci/controller/dwc/pcie-tegra194.c:259:18: warning:
‘event_cntr_data_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:250:18: warning:
‘event_cntr_ctrl_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:243:27: warning:
‘pcie_gen_freq’ defined but not used [-Wunused-const-variable=]

Quoted 5 lines
Quoted 2 lines
Fixes 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata")

Any feedback on this? We need this for v5.13.

Thanks for the reminder, I'll take a look at this. It looks like we broke this in v5.13-rc1, so we should fix it before v5.13.

author maintainer
#3 lore raw
Quoted 30 lines · Bjorn Helgaas
Quoted 29 lines · Jon Hunter

Hi Bjorn, Lorenzo,

Quoted 26 lines · Jon Hunter

Commit 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") caused a few build regressions for the Tegra194 PCIe driver which are:

1. The Tegra194 PCIe driver can no longer be built as a module. This was caused by removing the Makefile entry to build the pcie-tegra.c based upon the CONFIG_PCIE_TEGRA194 option. Therefore, restore this so that we can build the driver as a module.
2. 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata") added "#ifdef CONFIG_PCIE_TEGRA194" around the native driver. But if we set CONFIG_PCIE_TEGRA194=m to build the driver as a module, autoconf.h contains "#define CONFIG_PCIE_TEGRA194_MODULE 1" (not "#define CONFIG_PCIE_TEGRA194 1"), so the #ifdef excludes the driver. Instead, use "IS_ENABLED(CONFIG_PCIE_TEGRA194)", which checks for either CONFIG_PCIE_TEGRA194 or CONFIG_PCIE_TEGRA194_MODULE.
3. The below build warnings that are seen with particular kernel configurations. Fix these by moving these structure definitions to within the necessary guards.

drivers/pci/controller/dwc/pcie-tegra194.c:259:18: warning:
‘event_cntr_data_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:250:18: warning:
‘event_cntr_ctrl_offset’ defined but not used [-Wunused-const-variable=]
drivers/pci/controller/dwc/pcie-tegra194.c:243:27: warning:
‘pcie_gen_freq’ defined but not used [-Wunused-const-variable=]

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Fixes 7f100744749e ("PCI: tegra: Add Tegra194 MCFG quirks for ECAM errata")

Any feedback on this? We need this for v5.13.

Thanks for the reminder, I'll take a look at this. It looks like we broke this in v5.13-rc1, so we should fix it before v5.13.

Thanks. Yes this is needed before v5.13.

Jon

Signature · 1 line
nvpublic