+++ /dev/null
-From 97bcdc57c4aa3fabf03c279a193c6cb1441b782c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 23 Aug 2023 11:56:38 -0500
-Subject: ARM: davinci: Drop unused includes
-
-From: Rob Herring <robh@kernel.org>
-
-[ Upstream commit 6e73bd23a1cdcf1416ebd57ff673b5f601963ed2 ]
-
-of_platform.h include is not needed, so drop it. It implicitly includes
-of.h (for now) which is needed.
-
-Signed-off-by: Rob Herring <robh@kernel.org>
-Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Link: https://lore.kernel.org/r/20230823165637.2466480-1-robh@kernel.org
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/mach-davinci/pdata-quirks.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c
-index b8b5f1a5e0929..b5b5c7bda61ef 100644
---- a/arch/arm/mach-davinci/pdata-quirks.c
-+++ b/arch/arm/mach-davinci/pdata-quirks.c
-@@ -5,7 +5,7 @@
- * Copyright (C) 2016 BayLibre, Inc
- */
- #include <linux/kernel.h>
--#include <linux/of_platform.h>
-+#include <linux/of.h>
-
- #include <media/i2c/tvp514x.h>
- #include <media/i2c/adv7343.h>
---
-2.43.0
-
+++ /dev/null
-From 4c675dc9a0fe1ef40114ad2449fcb1da6322d189 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 9 Nov 2022 14:42:48 -0800
-Subject: ARM: OMAP2+: pdata-quirks: stop including wl12xx.h
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit e14e4c933e0047653f835e30d7d740ebb2a530cc ]
-
-As of commit 2398c41d6432 ("omap: pdata-quirks: remove openpandora
-quirks for mmc3 and wl1251") the code no longer creates an instance of
-wl1251_platform_data, so there is no need for including this header.
-
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Acked-by: Tony Lindgren <tony@atomide.com>
-Signed-off-by: Kalle Valo <kvalo@kernel.org>
-Link: https://lore.kernel.org/r/20221109224250.2885119-1-dmitry.torokhov@gmail.com
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/arm/mach-omap2/pdata-quirks.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
-index 9deba798cc919..baba73fd6f11e 100644
---- a/arch/arm/mach-omap2/pdata-quirks.c
-+++ b/arch/arm/mach-omap2/pdata-quirks.c
-@@ -10,7 +10,6 @@
- #include <linux/init.h>
- #include <linux/kernel.h>
- #include <linux/of_platform.h>
--#include <linux/wl12xx.h>
- #include <linux/mmc/card.h>
- #include <linux/mmc/host.h>
- #include <linux/power/smartreflex.h>
---
-2.43.0
-
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- arch/arm/mach-omap2/pdata-quirks.c | 10 +++++
- sound/soc/ti/omap3pandora.c | 63 +++++++++++-------------------
+ arch/arm/mach-omap2/pdata-quirks.c | 10 +++++
+ sound/soc/ti/omap3pandora.c | 63 +++++++++++++------------------------
2 files changed, 33 insertions(+), 40 deletions(-)
-diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
-index baba73fd6f11e..3499a97714e62 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
-@@ -256,9 +256,19 @@ static struct platform_device pandora_backlight = {
+@@ -257,9 +257,19 @@ static struct platform_device pandora_ba
.id = -1,
};
}
#endif /* CONFIG_ARCH_OMAP3 */
-diff --git a/sound/soc/ti/omap3pandora.c b/sound/soc/ti/omap3pandora.c
-index a287e9747c2a1..fa92ed97dfe3b 100644
--- a/sound/soc/ti/omap3pandora.c
+++ b/sound/soc/ti/omap3pandora.c
@@ -7,7 +7,7 @@
static int omap3pandora_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
-@@ -78,9 +77,9 @@ static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
+@@ -78,9 +77,9 @@ static int omap3pandora_dac_event(struct
return ret;
}
mdelay(1);
mdelay(1);
regulator_disable(omap3pandora_dac_reg);
}
-@@ -92,9 +91,9 @@ static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
+@@ -92,9 +91,9 @@ static int omap3pandora_hp_event(struct
struct snd_kcontrol *k, int event)
{
if (SND_SOC_DAPM_EVENT_ON(event))
return 0;
}
-@@ -229,35 +228,10 @@ static int __init omap3pandora_soc_init(void)
+@@ -229,35 +228,10 @@ static int __init omap3pandora_soc_init(
pr_info("OMAP3 Pandora SoC init\n");
}
platform_set_drvdata(omap3pandora_snd_device, &snd_soc_card_omap3pandora);
-@@ -268,6 +242,20 @@ static int __init omap3pandora_soc_init(void)
+@@ -268,6 +242,20 @@ static int __init omap3pandora_soc_init(
goto fail2;
}
omap3pandora_dac_reg = regulator_get(&omap3pandora_snd_device->dev, "vcc");
if (IS_ERR(omap3pandora_dac_reg)) {
pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n",
-@@ -283,10 +271,7 @@ static int __init omap3pandora_soc_init(void)
+@@ -283,10 +271,7 @@ fail3:
platform_device_del(omap3pandora_snd_device);
fail2:
platform_device_put(omap3pandora_snd_device);
return ret;
}
module_init(omap3pandora_soc_init);
-@@ -295,8 +280,6 @@ static void __exit omap3pandora_soc_exit(void)
+@@ -295,8 +280,6 @@ static void __exit omap3pandora_soc_exit
{
regulator_put(omap3pandora_dac_reg);
platform_device_unregister(omap3pandora_snd_device);
}
module_exit(omap3pandora_soc_exit);
---
-2.43.0
-
pdev->dpc_rp_log_size);
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
-@@ -6105,7 +6105,7 @@ static void dpc_log_size(struct pci_dev
+@@ -6103,7 +6103,7 @@ static void dpc_log_size(struct pci_dev
if (!(val & PCI_EXP_DPC_CAP_RP_EXT))
return;
+++ /dev/null
-From 7bd71749739ec1f721d25b9c9ab1dfe8a9ad0f73 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 3 Jul 2023 15:52:54 +0200
-Subject: PCI: Make quirk using inw() depend on HAS_IOPORT
-
-From: Niklas Schnelle <schnelle@linux.ibm.com>
-
-[ Upstream commit f768c75d61582b011962f9dcb9ff8eafb8da0383 ]
-
-In the future inw() and friends will not be compiled on architectures
-without I/O port support.
-
-Co-developed-by: Arnd Bergmann <arnd@kernel.org>
-Link: https://lore.kernel.org/r/20230703135255.2202721-2-schnelle@linux.ibm.com
-Signed-off-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
-Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/pci/quirks.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
-index 3959ea7b106b6..5aca621dd1c22 100644
---- a/drivers/pci/quirks.c
-+++ b/drivers/pci/quirks.c
-@@ -268,6 +268,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d
- DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
- #endif
-
-+#ifdef CONFIG_HAS_IOPORT
- /*
- * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
- * for some HT machines to use C4 w/o hanging.
-@@ -287,6 +288,7 @@ static void quirk_tigerpoint_bm_sts(struct pci_dev *dev)
- }
- }
- DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);
-+#endif
-
- /* Chipsets where PCI->PCI transfers vanish or hang */
- static void quirk_nopcipci(struct pci_dev *dev)
---
-2.43.0
-
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/pci/pcie/aspm.c | 8 ++++----
- drivers/pci/quirks.c | 6 +++---
+ drivers/pci/pcie/aspm.c | 8 ++++----
+ drivers/pci/quirks.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
-diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
-index 25736d408e88e..2a3d973658dac 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
-@@ -743,10 +743,10 @@ static void pcie_config_aspm_l1ss(struct pcie_link_state *link, u32 state)
+@@ -743,10 +743,10 @@ static void pcie_config_aspm_l1ss(struct
* in pcie_config_aspm_link().
*/
if (enable_req & (ASPM_STATE_L1_1 | ASPM_STATE_L1_2)) {
}
val = 0;
-diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
-index e4951b30b923b..ba353b37ba526 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
-@@ -4478,9 +4478,9 @@ static void quirk_disable_root_port_attributes(struct pci_dev *pdev)
+@@ -4476,9 +4476,9 @@ static void quirk_disable_root_port_attr
pci_info(root_port, "Disabling No Snoop/Relaxed Ordering Attributes to avoid PCIe Completion erratum in %s\n",
dev_name(&pdev->dev));
}
/*
---
-2.43.0
-
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/pci/quirks.c | 36 ++++++++++++++++++++++++++++
- drivers/pci/switch/switchtec.c | 44 ++++++++++++++++++++++++++++++----
- include/linux/switchtec.h | 1 +
+ drivers/pci/quirks.c | 36 +++++++++++++++++++++++++++++++++
+ drivers/pci/switch/switchtec.c | 44 +++++++++++++++++++++++++++++++++++++----
+ include/linux/switchtec.h | 1
3 files changed, 77 insertions(+), 4 deletions(-)
-diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
-index 5aca621dd1c22..7e5b3186db78b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
-@@ -5820,6 +5820,42 @@ SWITCHTEC_QUIRK(0x4428); /* PSXA 28XG4 */
+@@ -5818,6 +5818,42 @@ SWITCHTEC_QUIRK(0x4428); /* PSXA 28XG4
SWITCHTEC_QUIRK(0x4552); /* PAXA 52XG4 */
SWITCHTEC_QUIRK(0x4536); /* PAXA 36XG4 */
SWITCHTEC_QUIRK(0x4528); /* PAXA 28XG4 */
/*
* The PLX NTB uses devfn proxy IDs to move TLPs between NT endpoints.
-diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
-index f0322e9dbee93..332af6938d7fd 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
-@@ -372,7 +372,7 @@ static ssize_t field ## _show(struct device *dev, \
+@@ -372,7 +372,7 @@ static ssize_t field ## _show(struct dev
if (stdev->gen == SWITCHTEC_GEN3) \
return io_string_show(buf, &si->gen3.field, \
sizeof(si->gen3.field)); \
return io_string_show(buf, &si->gen4.field, \
sizeof(si->gen4.field)); \
else \
-@@ -663,7 +663,7 @@ static int ioctl_flash_info(struct switchtec_dev *stdev,
+@@ -663,7 +663,7 @@ static int ioctl_flash_info(struct switc
if (stdev->gen == SWITCHTEC_GEN3) {
info.flash_length = ioread32(&fi->gen3.flash_length);
info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN3;
info.flash_length = ioread32(&fi->gen4.flash_length);
info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN4;
} else {
-@@ -870,7 +870,7 @@ static int ioctl_flash_part_info(struct switchtec_dev *stdev,
+@@ -870,7 +870,7 @@ static int ioctl_flash_part_info(struct
ret = flash_part_info_gen3(stdev, &info);
if (ret)
return ret;
ret = flash_part_info_gen4(stdev, &info);
if (ret)
return ret;
-@@ -1606,7 +1606,7 @@ static int switchtec_init_pci(struct switchtec_dev *stdev,
+@@ -1606,7 +1606,7 @@ static int switchtec_init_pci(struct swi
if (stdev->gen == SWITCHTEC_GEN3)
part_id = &stdev->mmio_sys_info->gen3.partition_id;
part_id = &stdev->mmio_sys_info->gen4.partition_id;
else
return -EOPNOTSUPP;
-@@ -1797,6 +1797,42 @@ static const struct pci_device_id switchtec_pci_tbl[] = {
+@@ -1797,6 +1797,42 @@ static const struct pci_device_id switch
SWITCHTEC_PCI_DEVICE(0x4552, SWITCHTEC_GEN4), /* PAXA 52XG4 */
SWITCHTEC_PCI_DEVICE(0x4536, SWITCHTEC_GEN4), /* PAXA 36XG4 */
SWITCHTEC_PCI_DEVICE(0x4528, SWITCHTEC_GEN4), /* PAXA 28XG4 */
{0}
};
MODULE_DEVICE_TABLE(pci, switchtec_pci_tbl);
-diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h
-index 48fabe36509ee..8d8fac1626bd9 100644
--- a/include/linux/switchtec.h
+++ b/include/linux/switchtec.h
@@ -41,6 +41,7 @@ enum {
};
struct mrpc_regs {
---
-2.43.0
-
drm-nv04-fix-out-of-bounds-access.patch
drm-panel-visionox-rm69299-don-t-unregister-dsi-devi.patch
arm-omap2-n8x0-stop-instantiating-codec-platform-dat.patch
-arm-omap2-pdata-quirks-stop-including-wl12xx.h.patch
pci-avoid-flr-for-solidrun-snet-dpu-rev-1.patch
hid-kye-sort-kye-devices.patch
usb-pci-quirks-reduce-the-length-of-a-spinlock-secti.patch
thunderbolt-log-function-name-of-the-called-quirk.patch
thunderbolt-add-debug-log-for-link-controller-power-.patch
pci-execute-quirk_enable_clear_retrain_link-earlier.patch
-pci-make-quirk-using-inw-depend-on-has_ioport.patch
pci-switchtec-use-normal-comment-style.patch
pci-switchtec-add-support-for-pcie-gen5-devices.patch
-arm-davinci-drop-unused-includes.patch
alsa-scarlett2-move-usb-ids-out-from-device_info-str.patch
alsa-scarlett2-add-support-for-clarett-8pre-usb.patch
asoc-ti-convert-pandora-asoc-to-gpio-descriptors.patch
-usb-pci-quirks-group-amd-specific-quirk-code-togethe.patch
alsa-scarlett2-default-mixer-driver-to-enabled.patch
alsa-scarlett2-add-correct-product-series-name-to-me.patch
alsa-scarlett2-add-focusrite-clarett-2pre-and-4pre-s.patch
+++ /dev/null
-From c147212e0bfc9e3d9cf80df7e0ee1ccff65fa00f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Sep 2023 14:56:51 +0200
-Subject: usb: pci-quirks: group AMD specific quirk code together
-
-From: Niklas Schnelle <schnelle@linux.ibm.com>
-
-[ Upstream commit 7ca9f9ba8aa7380dee5dd8346b57bbaf198b075a ]
-
-A follow on patch will introduce CONFIG_USB_PCI_AMD governing the AMD
-quirk and adding its compile time dependency on HAS_IOPORT. In order to
-minimize the number of #ifdefs in C files and make that patch easier
-to read first group the code together. This is pure code movement
-no functional change is intended.
-
-Co-developed-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
-Link: https://lore.kernel.org/r/20230911125653.1393895-2-schnelle@linux.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/usb/host/pci-quirks.c | 119 +++++++++++++++++-----------------
- drivers/usb/host/pci-quirks.h | 14 ++--
- 2 files changed, 68 insertions(+), 65 deletions(-)
-
-diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
-index 2665832f9addf..5e06fad82a228 100644
---- a/drivers/usb/host/pci-quirks.c
-+++ b/drivers/usb/host/pci-quirks.c
-@@ -60,6 +60,22 @@
- #define EHCI_USBLEGCTLSTS 4 /* legacy control/status */
- #define EHCI_USBLEGCTLSTS_SOOE (1 << 13) /* SMI on ownership change */
-
-+/* ASMEDIA quirk use */
-+#define ASMT_DATA_WRITE0_REG 0xF8
-+#define ASMT_DATA_WRITE1_REG 0xFC
-+#define ASMT_CONTROL_REG 0xE0
-+#define ASMT_CONTROL_WRITE_BIT 0x02
-+#define ASMT_WRITEREG_CMD 0x10423
-+#define ASMT_FLOWCTL_ADDR 0xFA30
-+#define ASMT_FLOWCTL_DATA 0xBA
-+#define ASMT_PSEUDO_DATA 0
-+
-+/* Intel quirk use */
-+#define USB_INTEL_XUSB2PR 0xD0
-+#define USB_INTEL_USB2PRM 0xD4
-+#define USB_INTEL_USB3_PSSEN 0xD8
-+#define USB_INTEL_USB3PRM 0xDC
-+
- /* AMD quirk use */
- #define AB_REG_BAR_LOW 0xe0
- #define AB_REG_BAR_HIGH 0xe1
-@@ -93,21 +109,6 @@
- #define NB_PIF0_PWRDOWN_0 0x01100012
- #define NB_PIF0_PWRDOWN_1 0x01100013
-
--#define USB_INTEL_XUSB2PR 0xD0
--#define USB_INTEL_USB2PRM 0xD4
--#define USB_INTEL_USB3_PSSEN 0xD8
--#define USB_INTEL_USB3PRM 0xDC
--
--/* ASMEDIA quirk use */
--#define ASMT_DATA_WRITE0_REG 0xF8
--#define ASMT_DATA_WRITE1_REG 0xFC
--#define ASMT_CONTROL_REG 0xE0
--#define ASMT_CONTROL_WRITE_BIT 0x02
--#define ASMT_WRITEREG_CMD 0x10423
--#define ASMT_FLOWCTL_ADDR 0xFA30
--#define ASMT_FLOWCTL_DATA 0xBA
--#define ASMT_PSEUDO_DATA 0
--
- /*
- * amd_chipset_gen values represent AMD different chipset generations
- */
-@@ -458,50 +459,6 @@ void usb_amd_quirk_pll_disable(void)
- }
- EXPORT_SYMBOL_GPL(usb_amd_quirk_pll_disable);
-
--static int usb_asmedia_wait_write(struct pci_dev *pdev)
--{
-- unsigned long retry_count;
-- unsigned char value;
--
-- for (retry_count = 1000; retry_count > 0; --retry_count) {
--
-- pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
--
-- if (value == 0xff) {
-- dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
-- return -EIO;
-- }
--
-- if ((value & ASMT_CONTROL_WRITE_BIT) == 0)
-- return 0;
--
-- udelay(50);
-- }
--
-- dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
-- return -ETIMEDOUT;
--}
--
--void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
--{
-- if (usb_asmedia_wait_write(pdev) != 0)
-- return;
--
-- /* send command and address to device */
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
-- pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
--
-- if (usb_asmedia_wait_write(pdev) != 0)
-- return;
--
-- /* send data to device */
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
-- pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
--}
--EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
--
- void usb_amd_quirk_pll_enable(void)
- {
- usb_amd_quirk_pll(0);
-@@ -631,6 +588,50 @@ bool usb_amd_pt_check_port(struct device *device, int port)
- }
- EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
-
-+static int usb_asmedia_wait_write(struct pci_dev *pdev)
-+{
-+ unsigned long retry_count;
-+ unsigned char value;
-+
-+ for (retry_count = 1000; retry_count > 0; --retry_count) {
-+
-+ pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
-+
-+ if (value == 0xff) {
-+ dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
-+ return -EIO;
-+ }
-+
-+ if ((value & ASMT_CONTROL_WRITE_BIT) == 0)
-+ return 0;
-+
-+ udelay(50);
-+ }
-+
-+ dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
-+ return -ETIMEDOUT;
-+}
-+
-+void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
-+{
-+ if (usb_asmedia_wait_write(pdev) != 0)
-+ return;
-+
-+ /* send command and address to device */
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
-+ pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
-+
-+ if (usb_asmedia_wait_write(pdev) != 0)
-+ return;
-+
-+ /* send data to device */
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
-+ pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
-+}
-+EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
-+
- /*
- * Make sure the controller is completely inactive, unable to
- * generate interrupts or do DMA.
-diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
-index e729de21fad7a..cde2263a9d2e4 100644
---- a/drivers/usb/host/pci-quirks.h
-+++ b/drivers/usb/host/pci-quirks.h
-@@ -3,8 +3,6 @@
- #define __LINUX_USB_PCI_QUIRKS_H
-
- #ifdef CONFIG_USB_PCI
--void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
--int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
- int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev);
- bool usb_amd_hang_symptom_quirk(void);
- bool usb_amd_prefetch_quirk(void);
-@@ -12,23 +10,27 @@ void usb_amd_dev_put(void);
- bool usb_amd_quirk_pll_check(void);
- void usb_amd_quirk_pll_disable(void);
- void usb_amd_quirk_pll_enable(void);
-+void sb800_prefetch(struct device *dev, int on);
-+bool usb_amd_pt_check_port(struct device *device, int port);
-+
-+void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
-+int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
- void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev);
- void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
- void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
--void sb800_prefetch(struct device *dev, int on);
--bool usb_amd_pt_check_port(struct device *device, int port);
- #else
- struct pci_dev;
- static inline void usb_amd_quirk_pll_disable(void) {}
- static inline void usb_amd_quirk_pll_enable(void) {}
--static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
- static inline void usb_amd_dev_put(void) {}
--static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
- static inline void sb800_prefetch(struct device *dev, int on) {}
- static inline bool usb_amd_pt_check_port(struct device *device, int port)
- {
- return false;
- }
-+
-+static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
-+static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
- #endif /* CONFIG_USB_PCI */
-
- #endif /* __LINUX_USB_PCI_QUIRKS_H */
---
-2.43.0
-
alsa-scarlett2-move-usb-ids-out-from-device_info-str.patch
alsa-scarlett2-add-support-for-clarett-8pre-usb.patch
asoc-ti-convert-pandora-asoc-to-gpio-descriptors.patch
-usb-pci-quirks-group-amd-specific-quirk-code-togethe.patch
-usb-pci-quirks-handle-has_ioport-dependency-for-amd-.patch
-usb-pci-quirks-handle-has_ioport-dependency-for-uhci.patch
thunderbolt-introduce-tb_port_reset.patch
thunderbolt-introduce-tb_path_deactivate_hop.patch
thunderbolt-make-tb_switch_reset-support-thunderbolt-2-3-and-usb4-routers.patch
+++ /dev/null
-From 952f4e84ead9ecf5b11d30bdc72d08c391ef630f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Sep 2023 14:56:51 +0200
-Subject: usb: pci-quirks: group AMD specific quirk code together
-
-From: Niklas Schnelle <schnelle@linux.ibm.com>
-
-[ Upstream commit 7ca9f9ba8aa7380dee5dd8346b57bbaf198b075a ]
-
-A follow on patch will introduce CONFIG_USB_PCI_AMD governing the AMD
-quirk and adding its compile time dependency on HAS_IOPORT. In order to
-minimize the number of #ifdefs in C files and make that patch easier
-to read first group the code together. This is pure code movement
-no functional change is intended.
-
-Co-developed-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
-Link: https://lore.kernel.org/r/20230911125653.1393895-2-schnelle@linux.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/usb/host/pci-quirks.c | 119 +++++++++++++++++-----------------
- drivers/usb/host/pci-quirks.h | 14 ++--
- 2 files changed, 68 insertions(+), 65 deletions(-)
-
-diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
-index 2665832f9addf..5e06fad82a228 100644
---- a/drivers/usb/host/pci-quirks.c
-+++ b/drivers/usb/host/pci-quirks.c
-@@ -60,6 +60,22 @@
- #define EHCI_USBLEGCTLSTS 4 /* legacy control/status */
- #define EHCI_USBLEGCTLSTS_SOOE (1 << 13) /* SMI on ownership change */
-
-+/* ASMEDIA quirk use */
-+#define ASMT_DATA_WRITE0_REG 0xF8
-+#define ASMT_DATA_WRITE1_REG 0xFC
-+#define ASMT_CONTROL_REG 0xE0
-+#define ASMT_CONTROL_WRITE_BIT 0x02
-+#define ASMT_WRITEREG_CMD 0x10423
-+#define ASMT_FLOWCTL_ADDR 0xFA30
-+#define ASMT_FLOWCTL_DATA 0xBA
-+#define ASMT_PSEUDO_DATA 0
-+
-+/* Intel quirk use */
-+#define USB_INTEL_XUSB2PR 0xD0
-+#define USB_INTEL_USB2PRM 0xD4
-+#define USB_INTEL_USB3_PSSEN 0xD8
-+#define USB_INTEL_USB3PRM 0xDC
-+
- /* AMD quirk use */
- #define AB_REG_BAR_LOW 0xe0
- #define AB_REG_BAR_HIGH 0xe1
-@@ -93,21 +109,6 @@
- #define NB_PIF0_PWRDOWN_0 0x01100012
- #define NB_PIF0_PWRDOWN_1 0x01100013
-
--#define USB_INTEL_XUSB2PR 0xD0
--#define USB_INTEL_USB2PRM 0xD4
--#define USB_INTEL_USB3_PSSEN 0xD8
--#define USB_INTEL_USB3PRM 0xDC
--
--/* ASMEDIA quirk use */
--#define ASMT_DATA_WRITE0_REG 0xF8
--#define ASMT_DATA_WRITE1_REG 0xFC
--#define ASMT_CONTROL_REG 0xE0
--#define ASMT_CONTROL_WRITE_BIT 0x02
--#define ASMT_WRITEREG_CMD 0x10423
--#define ASMT_FLOWCTL_ADDR 0xFA30
--#define ASMT_FLOWCTL_DATA 0xBA
--#define ASMT_PSEUDO_DATA 0
--
- /*
- * amd_chipset_gen values represent AMD different chipset generations
- */
-@@ -458,50 +459,6 @@ void usb_amd_quirk_pll_disable(void)
- }
- EXPORT_SYMBOL_GPL(usb_amd_quirk_pll_disable);
-
--static int usb_asmedia_wait_write(struct pci_dev *pdev)
--{
-- unsigned long retry_count;
-- unsigned char value;
--
-- for (retry_count = 1000; retry_count > 0; --retry_count) {
--
-- pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
--
-- if (value == 0xff) {
-- dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
-- return -EIO;
-- }
--
-- if ((value & ASMT_CONTROL_WRITE_BIT) == 0)
-- return 0;
--
-- udelay(50);
-- }
--
-- dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
-- return -ETIMEDOUT;
--}
--
--void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
--{
-- if (usb_asmedia_wait_write(pdev) != 0)
-- return;
--
-- /* send command and address to device */
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
-- pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
--
-- if (usb_asmedia_wait_write(pdev) != 0)
-- return;
--
-- /* send data to device */
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
-- pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
-- pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
--}
--EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
--
- void usb_amd_quirk_pll_enable(void)
- {
- usb_amd_quirk_pll(0);
-@@ -631,6 +588,50 @@ bool usb_amd_pt_check_port(struct device *device, int port)
- }
- EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
-
-+static int usb_asmedia_wait_write(struct pci_dev *pdev)
-+{
-+ unsigned long retry_count;
-+ unsigned char value;
-+
-+ for (retry_count = 1000; retry_count > 0; --retry_count) {
-+
-+ pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
-+
-+ if (value == 0xff) {
-+ dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
-+ return -EIO;
-+ }
-+
-+ if ((value & ASMT_CONTROL_WRITE_BIT) == 0)
-+ return 0;
-+
-+ udelay(50);
-+ }
-+
-+ dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
-+ return -ETIMEDOUT;
-+}
-+
-+void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
-+{
-+ if (usb_asmedia_wait_write(pdev) != 0)
-+ return;
-+
-+ /* send command and address to device */
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
-+ pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
-+
-+ if (usb_asmedia_wait_write(pdev) != 0)
-+ return;
-+
-+ /* send data to device */
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
-+ pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
-+ pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
-+}
-+EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
-+
- /*
- * Make sure the controller is completely inactive, unable to
- * generate interrupts or do DMA.
-diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
-index e729de21fad7a..cde2263a9d2e4 100644
---- a/drivers/usb/host/pci-quirks.h
-+++ b/drivers/usb/host/pci-quirks.h
-@@ -3,8 +3,6 @@
- #define __LINUX_USB_PCI_QUIRKS_H
-
- #ifdef CONFIG_USB_PCI
--void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
--int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
- int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev);
- bool usb_amd_hang_symptom_quirk(void);
- bool usb_amd_prefetch_quirk(void);
-@@ -12,23 +10,27 @@ void usb_amd_dev_put(void);
- bool usb_amd_quirk_pll_check(void);
- void usb_amd_quirk_pll_disable(void);
- void usb_amd_quirk_pll_enable(void);
-+void sb800_prefetch(struct device *dev, int on);
-+bool usb_amd_pt_check_port(struct device *device, int port);
-+
-+void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
-+int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
- void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev);
- void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
- void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
--void sb800_prefetch(struct device *dev, int on);
--bool usb_amd_pt_check_port(struct device *device, int port);
- #else
- struct pci_dev;
- static inline void usb_amd_quirk_pll_disable(void) {}
- static inline void usb_amd_quirk_pll_enable(void) {}
--static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
- static inline void usb_amd_dev_put(void) {}
--static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
- static inline void sb800_prefetch(struct device *dev, int on) {}
- static inline bool usb_amd_pt_check_port(struct device *device, int port)
- {
- return false;
- }
-+
-+static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
-+static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
- #endif /* CONFIG_USB_PCI */
-
- #endif /* __LINUX_USB_PCI_QUIRKS_H */
---
-2.43.0
-
+++ /dev/null
-From 0f70138cda5d225e8d81ea1d734d20e6b11e7478 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Sep 2023 14:56:52 +0200
-Subject: usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk
-
-From: Niklas Schnelle <schnelle@linux.ibm.com>
-
-[ Upstream commit 52e24f8c0a102ac76649c6b71224fadcc82bd5da ]
-
-In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
-not being declared. In the pci-quirks case the I/O port acceses are
-used in the quirks for several AMD south bridges, Add a config option
-for the AMD quirks to depend on HAS_IOPORT and #ifdef the quirk code.
-
-Co-developed-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
-Link: https://lore.kernel.org/r/20230911125653.1393895-3-schnelle@linux.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/usb/Kconfig | 10 ++++++++++
- drivers/usb/core/hcd-pci.c | 3 +--
- drivers/usb/host/pci-quirks.c | 2 ++
- drivers/usb/host/pci-quirks.h | 30 ++++++++++++++++++++++--------
- include/linux/usb/hcd.h | 17 +++++++++++++++++
- 5 files changed, 52 insertions(+), 10 deletions(-)
-
-diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
-index 7f33bcc315f27..abf8c6cdea9ea 100644
---- a/drivers/usb/Kconfig
-+++ b/drivers/usb/Kconfig
-@@ -91,6 +91,16 @@ config USB_PCI
- If you have such a device you may say N here and PCI related code
- will not be built in the USB driver.
-
-+config USB_PCI_AMD
-+ bool "AMD PCI USB host support"
-+ depends on USB_PCI && HAS_IOPORT
-+ default X86 || MACH_LOONGSON64 || PPC_PASEMI
-+ help
-+ Enable workarounds for USB implementation quirks in SB600/SB700/SB800
-+ and later south bridge implementations. These are common on x86 PCs
-+ with AMD CPUs but rarely used elsewhere, with the exception of a few
-+ powerpc and mips desktop machines.
-+
- if USB
-
- source "drivers/usb/core/Kconfig"
-diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
-index 990280688b254..ee3156f495338 100644
---- a/drivers/usb/core/hcd-pci.c
-+++ b/drivers/usb/core/hcd-pci.c
-@@ -206,8 +206,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct hc_driver *driver)
- goto free_irq_vectors;
- }
-
-- hcd->amd_resume_bug = (usb_hcd_amd_remote_wakeup_quirk(dev) &&
-- driver->flags & (HCD_USB11 | HCD_USB3)) ? 1 : 0;
-+ hcd->amd_resume_bug = usb_hcd_amd_resume_bug(dev, driver);
-
- if (driver->flags & HCD_MEMORY) {
- /* EHCI, OHCI */
-diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
-index 5e06fad82a228..10813096d00c6 100644
---- a/drivers/usb/host/pci-quirks.c
-+++ b/drivers/usb/host/pci-quirks.c
-@@ -76,6 +76,7 @@
- #define USB_INTEL_USB3_PSSEN 0xD8
- #define USB_INTEL_USB3PRM 0xDC
-
-+#ifdef CONFIG_USB_PCI_AMD
- /* AMD quirk use */
- #define AB_REG_BAR_LOW 0xe0
- #define AB_REG_BAR_HIGH 0xe1
-@@ -587,6 +588,7 @@ bool usb_amd_pt_check_port(struct device *device, int port)
- return !(value & BIT(port_shift));
- }
- EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
-+#endif /* CONFIG_USB_PCI_AMD */
-
- static int usb_asmedia_wait_write(struct pci_dev *pdev)
- {
-diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
-index cde2263a9d2e4..a5230b0b9e913 100644
---- a/drivers/usb/host/pci-quirks.h
-+++ b/drivers/usb/host/pci-quirks.h
-@@ -2,7 +2,7 @@
- #ifndef __LINUX_USB_PCI_QUIRKS_H
- #define __LINUX_USB_PCI_QUIRKS_H
-
--#ifdef CONFIG_USB_PCI
-+#ifdef CONFIG_USB_PCI_AMD
- int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev);
- bool usb_amd_hang_symptom_quirk(void);
- bool usb_amd_prefetch_quirk(void);
-@@ -12,23 +12,37 @@ void usb_amd_quirk_pll_disable(void);
- void usb_amd_quirk_pll_enable(void);
- void sb800_prefetch(struct device *dev, int on);
- bool usb_amd_pt_check_port(struct device *device, int port);
--
--void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
--int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
--void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev);
--void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
--void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
- #else
--struct pci_dev;
-+static inline bool usb_amd_hang_symptom_quirk(void)
-+{
-+ return false;
-+};
-+static inline bool usb_amd_prefetch_quirk(void)
-+{
-+ return false;
-+}
- static inline void usb_amd_quirk_pll_disable(void) {}
- static inline void usb_amd_quirk_pll_enable(void) {}
- static inline void usb_amd_dev_put(void) {}
-+static inline bool usb_amd_quirk_pll_check(void)
-+{
-+ return false;
-+}
- static inline void sb800_prefetch(struct device *dev, int on) {}
- static inline bool usb_amd_pt_check_port(struct device *device, int port)
- {
- return false;
- }
-+#endif /* CONFIG_USB_PCI_AMD */
-
-+#ifdef CONFIG_USB_PCI
-+void uhci_reset_hc(struct pci_dev *pdev, unsigned long base);
-+int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base);
-+void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev);
-+void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
-+void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
-+#else
-+struct pci_dev;
- static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
- static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
- #endif /* CONFIG_USB_PCI */
-diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
-index 61d4f0b793dcd..00724b4f6e122 100644
---- a/include/linux/usb/hcd.h
-+++ b/include/linux/usb/hcd.h
-@@ -484,8 +484,25 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev,
- extern void usb_hcd_pci_remove(struct pci_dev *dev);
- extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
-
-+#ifdef CONFIG_USB_PCI_AMD
- extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev);
-
-+static inline bool usb_hcd_amd_resume_bug(struct pci_dev *dev,
-+ const struct hc_driver *driver)
-+{
-+ if (!usb_hcd_amd_remote_wakeup_quirk(dev))
-+ return false;
-+ if (driver->flags & (HCD_USB11 | HCD_USB3))
-+ return true;
-+ return false;
-+}
-+#else /* CONFIG_USB_PCI_AMD */
-+static inline bool usb_hcd_amd_resume_bug(struct pci_dev *dev,
-+ const struct hc_driver *driver)
-+{
-+ return false;
-+}
-+#endif
- extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
- #endif /* CONFIG_USB_PCI */
-
---
-2.43.0
-
+++ /dev/null
-From 62308e4a79ca6840e7c164e05a067e5a9f87d504 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 11 Sep 2023 14:56:53 +0200
-Subject: usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff
-
-From: Niklas Schnelle <schnelle@linux.ibm.com>
-
-[ Upstream commit 358ad297e379ff548247e3e24c6619559942bfdd ]
-
-In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
-not being declared. With the AMD quirk handled USB PCI quirks still use
-inw() in uhci_check_and_reset_hc() and thus indirectly in
-quirk_usb_handoff_uhci(). Handle this by conditionally compiling
-uhci_check_and_reset_hc() and stubbing out quirk_usb_handoff_uhci() when
-HAS_IOPORT is not available.
-
-Co-developed-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Arnd Bergmann <arnd@kernel.org>
-Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
-Link: https://lore.kernel.org/r/20230911125653.1393895-4-schnelle@linux.ibm.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/usb/host/pci-quirks.c | 23 ++++++++++++++++-------
- 1 file changed, 16 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
-index 10813096d00c6..1f9c1b1435d86 100644
---- a/drivers/usb/host/pci-quirks.c
-+++ b/drivers/usb/host/pci-quirks.c
-@@ -634,6 +634,16 @@ void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
- }
- EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
-
-+static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
-+{
-+ u16 cmd;
-+
-+ return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask);
-+}
-+
-+#define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
-+
-+#if defined(CONFIG_HAS_IOPORT) && IS_ENABLED(CONFIG_USB_UHCI_HCD)
- /*
- * Make sure the controller is completely inactive, unable to
- * generate interrupts or do DMA.
-@@ -715,14 +725,7 @@ int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base)
- }
- EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
-
--static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
--{
-- u16 cmd;
-- return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask);
--}
--
- #define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO)
--#define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
-
- static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
- {
-@@ -742,6 +745,12 @@ static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
- uhci_check_and_reset_hc(pdev, base);
- }
-
-+#else /* defined(CONFIG_HAS_IOPORT && IS_ENABLED(CONFIG_USB_UHCI_HCD) */
-+
-+static void quirk_usb_handoff_uhci(struct pci_dev *pdev) {}
-+
-+#endif /* defined(CONFIG_HAS_IOPORT && IS_ENABLED(CONFIG_USB_UHCI_HCD) */
-+
- static int mmio_resource_enabled(struct pci_dev *pdev, int idx)
- {
- return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
---
-2.43.0
-