|
Takashi Iwai |
b1654e |
From 16f7ae5906dfbeff54f74ec75d0563bb3a87ab0b Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
b1654e |
From: Arnd Bergmann <arnd@arndb.de>
|
|
Takashi Iwai |
b1654e |
Date: Mon, 8 Mar 2021 16:24:47 +0100
|
|
Takashi Iwai |
b1654e |
Subject: [PATCH] PCI: thunder: Fix compile testing
|
|
Takashi Iwai |
b1654e |
Git-commit: 16f7ae5906dfbeff54f74ec75d0563bb3a87ab0b
|
|
Takashi Iwai |
b1654e |
Patch-mainline: v5.13-rc1
|
|
Takashi Iwai |
b1654e |
References: git-fixes
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
Compile-testing these drivers is currently broken. Enabling it causes a
|
|
Takashi Iwai |
b1654e |
couple of build failures though:
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
drivers/pci/controller/pci-thunder-ecam.c:119:30: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
|
|
Takashi Iwai |
b1654e |
drivers/pci/controller/pci-thunder-pem.c:54:2: error: implicit declaration of function 'writeq' [-Werror,-Wimplicit-function-declaration]
|
|
Takashi Iwai |
b1654e |
drivers/pci/controller/pci-thunder-pem.c:392:8: error: implicit declaration of function 'acpi_get_rc_resources' [-Werror,-Wimplicit-function-declaration]
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
Fix them with the obvious one-line changes.
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
Link: https://lore.kernel.org/r/20210308152501.2135937-2-arnd@kernel.org
|
|
Takashi Iwai |
b1654e |
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
|
Takashi Iwai |
b1654e |
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
|
Takashi Iwai |
b1654e |
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
|
|
Takashi Iwai |
b1654e |
Reviewed-by: Robert Richter <rric@kernel.org>
|
|
Takashi Iwai |
b1654e |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
---
|
|
Takashi Iwai |
b1654e |
drivers/pci/controller/pci-thunder-ecam.c | 2 +-
|
|
Takashi Iwai |
b1654e |
drivers/pci/controller/pci-thunder-pem.c | 13 +++++++------
|
|
Takashi Iwai |
b1654e |
drivers/pci/pci.h | 6 ++++++
|
|
Takashi Iwai |
b1654e |
3 files changed, 14 insertions(+), 7 deletions(-)
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
--- a/drivers/pci/controller/pci-thunder-ecam.c
|
|
Takashi Iwai |
b1654e |
+++ b/drivers/pci/controller/pci-thunder-ecam.c
|
|
Takashi Iwai |
b1654e |
@@ -116,7 +116,7 @@ static int thunder_ecam_p2_config_read(s
|
|
Takashi Iwai |
b1654e |
* the config space access window. Since we are working with
|
|
Takashi Iwai |
b1654e |
* the high-order 32 bits, shift everything down by 32 bits.
|
|
Takashi Iwai |
b1654e |
*/
|
|
Takashi Iwai |
b1654e |
- node_bits = (cfg->res.start >> 32) & (1 << 12);
|
|
Takashi Iwai |
b1654e |
+ node_bits = upper_32_bits(cfg->res.start) & (1 << 12);
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
v |= node_bits;
|
|
Takashi Iwai |
b1654e |
set_val(v, where, size, val);
|
|
Takashi Iwai |
b1654e |
--- a/drivers/pci/controller/pci-thunder-pem.c
|
|
Takashi Iwai |
b1654e |
+++ b/drivers/pci/controller/pci-thunder-pem.c
|
|
Takashi Iwai |
b1654e |
@@ -11,6 +11,7 @@
|
|
Takashi Iwai |
b1654e |
#include <linux/pci-acpi.h>
|
|
Takashi Iwai |
b1654e |
#include <linux/pci-ecam.h>
|
|
Takashi Iwai |
b1654e |
#include <linux/platform_device.h>
|
|
Takashi Iwai |
b1654e |
+#include <linux/io-64-nonatomic-lo-hi.h>
|
|
Takashi Iwai |
b1654e |
#include "../pci.h"
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
#if defined(CONFIG_PCI_HOST_THUNDER_PEM) || (defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS))
|
|
Takashi Iwai |
b1654e |
@@ -314,9 +315,9 @@ static int thunder_pem_init(struct devic
|
|
Takashi Iwai |
b1654e |
* structure here for the BAR.
|
|
Takashi Iwai |
b1654e |
*/
|
|
Takashi Iwai |
b1654e |
bar4_start = res_pem->start + 0xf00000;
|
|
Takashi Iwai |
b1654e |
- pem_pci->ea_entry[0] = (u32)bar4_start | 2;
|
|
Takashi Iwai |
b1654e |
- pem_pci->ea_entry[1] = (u32)(res_pem->end - bar4_start) & ~3u;
|
|
Takashi Iwai |
b1654e |
- pem_pci->ea_entry[2] = (u32)(bar4_start >> 32);
|
|
Takashi Iwai |
b1654e |
+ pem_pci->ea_entry[0] = lower_32_bits(bar4_start) | 2;
|
|
Takashi Iwai |
b1654e |
+ pem_pci->ea_entry[1] = lower_32_bits(res_pem->end - bar4_start) & ~3u;
|
|
Takashi Iwai |
b1654e |
+ pem_pci->ea_entry[2] = upper_32_bits(bar4_start);
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
cfg->priv = pem_pci;
|
|
Takashi Iwai |
b1654e |
return 0;
|
|
Takashi Iwai |
b1654e |
@@ -324,9 +325,9 @@ static int thunder_pem_init(struct devic
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
#if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
-#define PEM_RES_BASE 0x87e0c0000000UL
|
|
Takashi Iwai |
b1654e |
-#define PEM_NODE_MASK GENMASK(45, 44)
|
|
Takashi Iwai |
b1654e |
-#define PEM_INDX_MASK GENMASK(26, 24)
|
|
Takashi Iwai |
b1654e |
+#define PEM_RES_BASE 0x87e0c0000000ULL
|
|
Takashi Iwai |
b1654e |
+#define PEM_NODE_MASK GENMASK_ULL(45, 44)
|
|
Takashi Iwai |
b1654e |
+#define PEM_INDX_MASK GENMASK_ULL(26, 24)
|
|
Takashi Iwai |
b1654e |
#define PEM_MIN_DOM_IN_NODE 4
|
|
Takashi Iwai |
b1654e |
#define PEM_MAX_DOM_IN_NODE 10
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
--- a/drivers/pci/pci.h
|
|
Takashi Iwai |
b1654e |
+++ b/drivers/pci/pci.h
|
|
Takashi Iwai |
b1654e |
@@ -575,6 +575,12 @@ static inline int pci_dev_specific_reset
|
|
Takashi Iwai |
b1654e |
#if defined(CONFIG_PCI_QUIRKS) && defined(CONFIG_ARM64)
|
|
Takashi Iwai |
b1654e |
int acpi_get_rc_resources(struct device *dev, const char *hid, u16 segment,
|
|
Takashi Iwai |
b1654e |
struct resource *res);
|
|
Takashi Iwai |
b1654e |
+#else
|
|
Takashi Iwai |
b1654e |
+static inline int acpi_get_rc_resources(struct device *dev, const char *hid,
|
|
Takashi Iwai |
b1654e |
+ u16 segment, struct resource *res)
|
|
Takashi Iwai |
b1654e |
+{
|
|
Takashi Iwai |
b1654e |
+ return -ENODEV;
|
|
Takashi Iwai |
b1654e |
+}
|
|
Takashi Iwai |
b1654e |
#endif
|
|
Takashi Iwai |
b1654e |
|
|
Takashi Iwai |
b1654e |
u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar);
|