linux/drivers/net/ipa
Alex Elder 50c24f0c94 net: ipa: only reset hashed tables when supported
commit e11ec2b868 upstream.

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>
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-08-11 12:08:09 +02:00
..
data net: ipa: fix v3.5.1 resource limit max values 2022-10-25 19:48:57 -07:00
reg net: ipa: fix v3.1 resource limit masks 2022-10-25 19:48:58 -07:00
gsi.c net: ipa: generic command param fix 2023-03-10 09:33:02 +01:00
gsi.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
gsi_private.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
gsi_reg.h net: ipa: generic command param fix 2023-03-10 09:33:02 +01:00
gsi_trans.c net: ipa: compute DMA pool size properly 2023-04-06 12:10:48 +02:00
gsi_trans.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_cmd.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_cmd.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_data.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_endpoint.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_endpoint.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_gsi.c net: ipa: include declarations in "ipa_gsi.c" 2020-07-07 12:43:18 -07:00
ipa_gsi.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_interrupt.c net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_interrupt.h net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_main.c net: ipa: don't configure IDLE_INDICATION on v3.1 2022-10-25 19:49:13 -07:00
ipa_mem.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_mem.h net: ipa: don't index mem data array by ID 2021-06-10 14:50:08 -07:00
ipa_modem.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_modem.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_power.c net: ipa: disable ipa interrupt during suspend 2023-02-01 08:34:22 +01:00
ipa_power.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi_msg.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_qmi_msg.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_reg.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_reg.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_resource.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_resource.h net: ipa: get rid of empty IPA functions 2021-04-09 20:57:25 -07:00
ipa_smp2p.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_smp2p.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_sysfs.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_sysfs.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_table.c net: ipa: only reset hashed tables when supported 2023-08-11 12:08:09 +02:00
ipa_table.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_uc.c net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_uc.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
ipa_version.h net: ipa: update copyrights 2022-10-03 16:49:20 -07:00
Kconfig net: ipa: add an interconnect dependency 2022-03-02 22:14:05 -08:00
Makefile net: ipa: add per-version IPA register definition files 2022-09-27 18:42:49 -07:00