linux-stable/drivers/net/ipa
Alex Elder d80f8e96d4 net: ipa: don't overrun IPA suspend interrupt registers
In newer hardware, IPA supports more than 32 endpoints.  Some
registers--such as IPA interrupt registers--represent endpoints
as bits in a 4-byte register, and such registers are repeated as
needed to represent endpoints beyond the first 32.

In ipa_interrupt_suspend_clear_all(), we clear all pending IPA
suspend interrupts by reading all status register(s) and writing
corresponding registers to clear interrupt conditions.

Unfortunately the number of registers to read/write is calculated
incorrectly, and as a result we access *many* more registers than
intended.  This bug occurs only when the IPA hardware signals a
SUSPEND interrupt, which happens when a packet is received for an
endpoint (or its underlying GSI channel) that is suspended.  This
situation is difficult to reproduce, but possible.

Fix this by correctly computing the number of interrupt registers to
read and write.  This is the only place in the code where registers
that map endpoints or channels this way perform this calculation.

Fixes: f298ba785e ("net: ipa: add a parameter to suspend registers")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-02-21 11:25:17 +00:00
..
data net: ipa: add IPA v5.5 configuration data 2023-11-24 12:18:55 +00:00
reg net: ipa: add IPA v5.5 register definitions 2023-11-24 12:18:55 +00:00
Kconfig
Makefile net: ipa: add IPA v5.5 configuration data 2023-11-24 12:18:55 +00:00
gsi.c net: ipa: add HW_PARAM_4 GSI register 2023-02-20 08:14:20 +01:00
gsi.h net: ipa: add IPA v5.0 GSI register definitions 2023-03-22 22:44:00 -07:00
gsi_private.h
gsi_reg.c net: ipa: add IPA v5.5 register definitions 2023-11-24 12:18:55 +00:00
gsi_reg.h net: ipa: add IPA v5.0 GSI register definitions 2023-03-22 22:44:00 -07:00
gsi_trans.c net: ipa: compute DMA pool size properly 2023-03-29 21:27:40 -07:00
gsi_trans.h
ipa.h
ipa_cmd.c
ipa_cmd.h
ipa_data.h net: ipa: add IPA v5.5 configuration data 2023-11-24 12:18:55 +00:00
ipa_endpoint.c net: ipa: Use correct value for IPA_STATUS_SIZE 2023-06-01 13:29:18 +02:00
ipa_endpoint.h
ipa_gsi.c
ipa_gsi.h
ipa_interrupt.c net: ipa: don't overrun IPA suspend interrupt registers 2024-02-21 11:25:17 +00:00
ipa_interrupt.h
ipa_main.c net: ipa: Convert to platform remove callback returning void 2023-12-05 19:51:09 -08:00
ipa_mem.c net: ipa: prepare for IPA v5.5 2023-11-24 12:18:55 +00:00
ipa_mem.h
ipa_modem.c
ipa_modem.h
ipa_power.c net: ipa: Annotate struct ipa_power with __counted_by 2023-10-02 11:24:54 -07:00
ipa_power.h
ipa_qmi.c
ipa_qmi.h
ipa_qmi_msg.c
ipa_qmi_msg.h
ipa_reg.c net: ipa: add IPA v5.5 register definitions 2023-11-24 12:18:55 +00:00
ipa_reg.h net: ipa: add IPA v5.5 register definitions 2023-11-24 12:18:55 +00:00
ipa_resource.c
ipa_resource.h
ipa_smp2p.c
ipa_smp2p.h
ipa_sysfs.c net: ipa: add IPA v5.0 to ipa_version_string() 2023-03-23 21:48:32 -07:00
ipa_sysfs.h
ipa_table.c net: ipa: only reset hashed tables when supported 2023-07-25 20:34:20 -07:00
ipa_table.h
ipa_uc.c
ipa_uc.h
ipa_version.h net: ipa: add IPA v5.5 configuration data 2023-11-24 12:18:55 +00:00
reg.h net: ipa: reg: include <linux/bug.h> 2023-03-16 21:33:18 -07:00