]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rc: nuvoton: fix hang if chip is configured for alternative EFM IO address
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 7 Jul 2016 06:17:39 +0000 (03:17 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:10:52 +0000 (18:10 +0200)
commit 5cac1f67ea0363d463a58ec2d9118268fe2ba5d6 upstream.

If a system configures the Nuvoton chip to use the alternative
EFM IO address (CR_EFIR2) then after probing the primary EFM IO
address (CR_EFIR) this region is not released.

If a driver for another function of the Nuvoton Super I/O
chip uses the same probing mechanism then it will hang if
loaded after the nuvoton-cir driver.
This was reported for the nct6775 hwmon driver.

Fix this by properly releasing the region after probing CR_EFIR.
This regression was introduced with kernel 4.6 so cc it to stable.

Reported-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/rc/nuvoton-cir.c

index 99b303b702ac17af0f5f4c816d1adbe8f5adee0c..e8ceb0e2f6d799635368d53fe64b8a92147d32fb 100644 (file)
@@ -401,6 +401,7 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
        /* Check if we're wired for the alternate EFER setup */
        nvt->chip_major = nvt_cr_read(nvt, CR_CHIP_ID_HI);
        if (nvt->chip_major == 0xff) {
+               nvt_efm_disable(nvt);
                nvt->cr_efir = CR_EFIR2;
                nvt->cr_efdr = CR_EFDR2;
                nvt_efm_enable(nvt);