accel/ivpu/37xx: Fix interrupt_clear_with_0 WA initialization
authorAndrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Mon, 4 Dec 2023 12:23:31 +0000 (13:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:54 +0000 (17:01 +0100)
commit83a42d791ba206978ec5381743dbcc49f3357e1d
tree7dce032d599b1f90eabb366b9b43881a7800230b
parent0afcc6291024dc8fa32b966a0da27345b82bc6cd
accel/ivpu/37xx: Fix interrupt_clear_with_0 WA initialization

[ Upstream commit 35c49cfc8b702eda7a0d3f05497b16f81b69e289 ]

Using PCI Device ID/Revision to initialize the interrupt_clear_with_0
workaround is problematic - there are many pre-production
steppings with different behavior, even with the same PCI ID/Revision

Instead of checking for PCI Device ID/Revision, check the VPU
buttress interrupt status register behavior - if this register
is not zero after writing 1s it means there register is RW
instead of RW1C and we need to enable the interrupt_clear_with_0
workaround.

Fixes: 7f34e01f77f8 ("accel/ivpu: Clear specific interrupt status bits on C0")
Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://lore.kernel.org/all/20231204122331.40560-1-jacek.lawrynowicz@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/accel/ivpu/ivpu_hw_37xx.c