media: atomisp: Remove non working doorbell check from punit_ddr_dvfs_enable()
authorHans de Goede <hdegoede@redhat.com>
Sun, 15 Jan 2023 14:27:39 +0000 (15:27 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Wed, 8 Feb 2023 06:59:11 +0000 (07:59 +0100)
punit_ddr_dvfs_enable() is only used on CHT devices and there dmesg
gets filled with: "DDR DVFS, door bell is not cleared within 3ms"
messages, so clearly the doorbell checking is not working.

This check was added by:
https://github.com/intel/ProductionKernelQuilts/blob/master/uefi/cht-m1stable/patches/cam-0340-atomisp-add-door-bell-for-ddr-dvfs-on-cht.patch

Which commit message says: "PUNIT interface added to check Req_ACK
of freq status". This suggests that the doorbell mechanism may only
be available with certain PUNIT fw versions and it seems that
many CHT devices do not have this fw version; that or the doorbell
mechanism is not working for other reasons.

Revert cam-0340-atomisp-add-door-bell-for-ddr-dvfs-on-cht.patch,
replacing the doorbell check with a msleep(20) this fixes dmesg
getting filled with error messages.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index e994a4a5284ecf8e7bca4046b7d413fecab08950..9eea8ffbc3d6c6f9210a6f0c569578ca3139aa24 100644 (file)
@@ -638,27 +638,16 @@ done:
 */
 static void punit_ddr_dvfs_enable(bool enable)
 {
-       int door_bell = 1 << 8;
-       int max_wait = 30;
        int reg;
 
        iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, MRFLD_ISPSSDVFS, &reg);
        if (enable) {
                reg &= ~(MRFLD_BIT0 | MRFLD_BIT1);
        } else {
-               reg |= (MRFLD_BIT1 | door_bell);
+               reg |= MRFLD_BIT1;
                reg &= ~(MRFLD_BIT0);
        }
        iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, MRFLD_ISPSSDVFS, reg);
-
-       /* Check Req_ACK to see freq status, wait until door_bell is cleared */
-       while ((reg & door_bell) && max_wait--) {
-               iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, MRFLD_ISPSSDVFS, &reg);
-               usleep_range(100, 500);
-       }
-
-       if (max_wait == -1)
-               pr_info("DDR DVFS, door bell is not cleared within 3ms\n");
 }
 
 static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable)
@@ -671,8 +660,10 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable)
        dev_dbg(isp->dev, "IUNIT power-%s.\n", enable ? "on" : "off");
 
        /* WA for P-Unit, if DVFS enabled, ISP timeout observed */
-       if (IS_CHT && enable)
+       if (IS_CHT && enable) {
                punit_ddr_dvfs_enable(false);
+               msleep(20);
+       }
 
        /*
         * FIXME:WA for ECS28A, with this sleep, CTS