This is a note to let you know that I've just added the patch titled i2c: piix4: Enable EFCH MMIO for Family 17h+ to the 5.17-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: i2c-piix4-enable-efch-mmio-for-family-17h.patch and it can be found in the queue-5.17 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6cf72f41808ab5db1d7718b999b3ff0166e67e45 Mon Sep 17 00:00:00 2001 From: Terry Bowman <terry.bowman@xxxxxxx> Date: Wed, 9 Feb 2022 11:27:17 -0600 Subject: i2c: piix4: Enable EFCH MMIO for Family 17h+ From: Terry Bowman <terry.bowman@xxxxxxx> commit 6cf72f41808ab5db1d7718b999b3ff0166e67e45 upstream. Enable EFCH MMIO using check for SMBus PCI revision ID value 0x51 or greater. This PCI revision ID check will enable family 17h and future AMD processors with the same EFCH SMBus controller HW. Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> Reviewed-by: Jean Delvare <jdelvare@xxxxxxx> Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx> Cc: Mario Limonciello <Mario.Limonciello@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/i2c/busses/i2c-piix4.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -229,6 +229,18 @@ static void piix4_sb800_region_release(s release_region(SB800_PIIX4_SMB_IDX, SB800_PIIX4_SMB_MAP_SIZE); } +static bool piix4_sb800_use_mmio(struct pci_dev *PIIX4_dev) +{ + /* + * cd6h/cd7h port I/O accesses can be disabled on AMD processors + * w/ SMBus PCI revision ID 0x51 or greater. MMIO is supported on + * the same processors and is the recommended access method. + */ + return (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD && + PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && + PIIX4_dev->revision >= 0x51); +} + static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id) { @@ -339,7 +351,7 @@ static int piix4_setup_sb800_smba(struct u8 smba_en_hi; int retval; - mmio_cfg.use_mmio = 0; + mmio_cfg.use_mmio = piix4_sb800_use_mmio(PIIX4_dev); retval = piix4_sb800_region_request(&PIIX4_dev->dev, &mmio_cfg); if (retval) return retval; @@ -461,7 +473,7 @@ static int piix4_setup_sb800(struct pci_ piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT; } } else { - mmio_cfg.use_mmio = 0; + mmio_cfg.use_mmio = piix4_sb800_use_mmio(PIIX4_dev); retval = piix4_sb800_region_request(&PIIX4_dev->dev, &mmio_cfg); if (retval) { release_region(piix4_smba, SMBIOSIZE); @@ -944,6 +956,7 @@ static int piix4_add_adapter(struct pci_ return -ENOMEM; } + adapdata->mmio_cfg.use_mmio = piix4_sb800_use_mmio(dev); adapdata->smba = smba; adapdata->sb800_main = sb800_main; adapdata->port = port << piix4_port_shift_sb800; Patches currently in stable-queue which might be from terry.bowman@xxxxxxx are queue-5.17/watchdog-sp5100_tco-add-initialization-using-efch-mmio.patch queue-5.17/i2c-piix4-add-efch-mmio-support-to-region-request-and-release.patch queue-5.17/i2c-piix4-move-smbus-port-selection-into-function.patch queue-5.17/i2c-piix4-add-efch-mmio-support-to-smbus-base-address-detect.patch queue-5.17/i2c-piix4-move-port-i-o-region-request-release-code-into-functions.patch queue-5.17/i2c-piix4-replace-hardcoded-memory-map-size-with-a-define.patch queue-5.17/kernel-resource-introduce-request_mem_region_muxed.patch queue-5.17/i2c-piix4-enable-efch-mmio-for-family-17h.patch queue-5.17/watchdog-sp5100_tco-enable-family-17h-cpus.patch queue-5.17/watchdog-sp5100_tco-move-timer-initialization-into-function.patch queue-5.17/i2c-piix4-add-efch-mmio-support-for-smbus-port-select.patch queue-5.17/watchdog-sp5100_tco-refactor-mmio-base-address-initialization.patch queue-5.17/i2c-piix4-move-smbus-controller-base-address-detect-into-function.patch