linux/drivers/net/ipa
Alex Elder e11ec2b868 net: ipa: only reset hashed tables when supported
Last year, the code that manages GSI channel transactions switched
from using spinlock-protected linked lists to using indexes into the
ring buffer used for a channel.  Recently, Google reported seeing
transaction reference count underflows occasionally during shutdown.

Doug Anderson found a way to reproduce the issue reliably, and
bisected the issue to the commit that eliminated the linked lists
and the lock.  The root cause was ultimately determined to be
related to unused transactions being committed as part of the modem
shutdown cleanup activity.  Unused transactions are not normally
expected (except in error cases).

The modem uses some ranges of IPA-resident memory, and whenever it
shuts down we zero those ranges.  In ipa_filter_reset_table() a
transaction is allocated to zero modem filter table entries.  If
hashing is not supported, hashed table memory should not be zeroed.
But currently nothing prevents that, and the result is an unused
transaction.  Something similar occurs when we zero routing table
entries for the modem.

By preventing any attempt to clear hashed tables when hashing is not
supported, the reference count underflow is avoided in this case.

Note that there likely remains an issue with properly freeing unused
transactions (if they occur due to errors).  This patch addresses
only the underflows that Google originally reported.

Cc: <stable@vger.kernel.org> # 6.1.x
Fixes: d338ae28d8 ("net: ipa: kill all other transaction lists")
Tested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20230724224055.1688854-1-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-07-25 20:34:20 -07:00
..
data net: ipa: add IPA v5.0 configuration data 2023-03-22 22:44:00 -07:00
reg net: ipa: add IPA v5.0 GSI register definitions 2023-03-22 22:44:00 -07: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.0 GSI register definitions 2023-03-22 22:44:00 -07: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.0 configuration data 2023-03-22 22:44:00 -07: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
ipa_interrupt.h
ipa_main.c net: ipa: add IPA v5.0 configuration data 2023-03-22 22:44:00 -07:00
ipa_mem.c IOMMU Updates for Linux v6.3: 2023-02-24 13:40:13 -08:00
ipa_mem.h
ipa_modem.c
ipa_modem.h
ipa_power.c
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.0 register definitions 2023-03-22 22:44:00 -07:00
ipa_reg.h net: ipa: add IPA v5.0 register definitions 2023-03-22 22:44:00 -07: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
Kconfig
Makefile net: ipa: add IPA v5.0 configuration data 2023-03-22 22:44:00 -07:00
reg.h net: ipa: reg: include <linux/bug.h> 2023-03-16 21:33:18 -07:00