Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39, v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29, v6.1.28, v6.1.27, v6.1.26, v6.3, v6.1.25, v6.1.24, v6.1.23, v6.1.22 |
|
#
6c75dc94 |
| 28-Mar-2023 |
Alex Elder <elder@linaro.org> |
net: ipa: compute DMA pool size properly
In gsi_trans_pool_init_dma(), the total size of a pool of memory used for DMA transactions is calculated. However the calculation is done incorrectly.
For
net: ipa: compute DMA pool size properly
In gsi_trans_pool_init_dma(), the total size of a pool of memory used for DMA transactions is calculated. However the calculation is done incorrectly.
For 4KB pages, this total size is currently always more than one page, and as a result, the calculation produces a positive (though incorrect) total size. The code still works in this case; we just end up with fewer DMA pool entries than we intended.
Bjorn Andersson tested booting a kernel with 16KB pages, and hit a null pointer derereference in sg_alloc_append_table_from_pages(), descending from gsi_trans_pool_init_dma(). The cause of this was that a 16KB total size was going to be allocated, and with 16KB pages the order of that allocation is 0. The total_size calculation yielded 0, which eventually led to the crash.
Correcting the total_size calculation fixes the problem.
Reported-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Bjorn Andersson <quic_bjorande@quicinc.com> Fixes: 9dd441e4ed57 ("soc: qcom: ipa: GSI transactions") Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20230328162751.2861791-1-elder@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15, v6.1.14, v6.1.13, v6.2, v6.1.12, v6.1.11, v6.1.10, v6.1.9, v6.1.8, v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17, v6.1.2, v6.0.16, v6.1.1, v6.0.15, v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80, v6.0.9, v5.15.79, v6.0.8, v5.15.78, v6.0.7, v5.15.77, v5.15.76, v6.0.6, v6.0.5, v5.15.75, v6.0.4, v6.0.3 |
|
#
36875a06 |
| 18-Oct-2022 |
Kees Cook <keescook@chromium.org> |
net: ipa: Proactively round up to kmalloc bucket size
Instead of discovering the kmalloc bucket size _after_ allocation, round up proactively so the allocation is explicitly made for the full size,
net: ipa: Proactively round up to kmalloc bucket size
Instead of discovering the kmalloc bucket size _after_ allocation, round up proactively so the allocation is explicitly made for the full size, allowing the compiler to correctly reason about the resulting size of the buffer through the existing __alloc_size() hint.
Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric Dumazet <edumazet@google.com> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Paolo Abeni <pabeni@redhat.com> Cc: netdev@vger.kernel.org Reviewed-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/lkml/4d75a9fd-1b94-7208-9de8-5a0102223e68@ieee.org Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20221018092724.give.735-kees@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
Revision tags: v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72, v6.0 |
|
#
a4388da5 |
| 30-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: update copyrights
Some source files state copyright dates that are earlier than the last modification of the file. Change the copyright year to 2022 in all such cases.
Signed-off-by: Ale
net: ipa: update copyrights
Some source files state copyright dates that are earlier than the last modification of the file. Change the copyright year to 2022 in all such cases.
Signed-off-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/r/20220930224549.3503434-1-elder@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
ace5dc61 |
| 30-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: update comments
This patch just updates comments throughout the IPA code.
Transaction state is now tracked using indexes into an array rather than linked lists, and a few comments refer t
net: ipa: update comments
This patch just updates comments throughout the IPA code.
Transaction state is now tracked using indexes into an array rather than linked lists, and a few comments refer to the "old way" of doing things. The description of how transactions are used was changed to refer to "operations" rather than "commands", to (hopefully) remove a possible ambiguity.
IPA register offsets and fields are now handled differently as well, and the register documentation is updated to better describe the code.
A few minor updates to comments were made (e.g., adding a missing word, fixing a typo or punctuation, etc.).
Finally, the local macro atomic_dec_not_zero() is no longer used, so it is deleted.
Signed-off-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/r/20220930224527.3503404-1-elder@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v5.15.71, v5.15.70, v5.15.69, v5.15.68, v5.15.67, v5.15.66 |
|
#
019e37ea |
| 06-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: don't have gsi_channel_update() return a value
If it finds no completed transactions, gsi_channel_trans_complete() calls gsi_channel_update() to check hardware. If new transactions have c
net: ipa: don't have gsi_channel_update() return a value
If it finds no completed transactions, gsi_channel_trans_complete() calls gsi_channel_update() to check hardware. If new transactions have completed, gsi_channel_update() records that, then calls gsi_channel_trans_complete() to return the first of those found. This recursion won't go any further, but can be avoided if we have gsi_channel_update() only be responsible for updating state after accessing hardware.
Change gsi_channel_update() so it simply checks for and handles new completions, without returning a value. If it needs to call that function, have gsi_channel_trans_complete() determine whether there are new transactions available after the update.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
e0e3406c |
| 06-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: update channel in gsi_channel_trans_complete()
Have gsi_channel_trans_complete() update the known state from hardware rather than doing so in gsi_channel_poll_one().
Signed-off-by: Alex E
net: ipa: update channel in gsi_channel_trans_complete()
Have gsi_channel_trans_complete() update the known state from hardware rather than doing so in gsi_channel_poll_one().
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
d338ae28 |
| 06-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: kill all other transaction lists
None of the transaction lists are actually needed any more, because transaction IDs (which have been shown to be equivalent) are used instead. So we can r
net: ipa: kill all other transaction lists
None of the transaction lists are actually needed any more, because transaction IDs (which have been shown to be equivalent) are used instead. So we can remove all of them, as well as the spinlock that protects updates to them.
Not requiring a lock simplifies gsi_trans_free() as well; we only need to check the reference count once to decide whether we've hit the last reference.
This makes the links field in the gsi_trans structure unused, so get rid of that as well.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
11902b41 |
| 06-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: kill the allocated transaction list
The only place the trans_info->alloc list is used is when initializing it, when adding a transaction to it when allocation finishes, and when moving a t
net: ipa: kill the allocated transaction list
The only place the trans_info->alloc list is used is when initializing it, when adding a transaction to it when allocation finishes, and when moving a transaction from that list to the committed list.
We can just skip putting a transaction on the allocated list, and add it (rather than move it) to the committed list when it is committed.
On additional caveat is that an allocated transaction that's committed without any TREs added will be immediately freed. Because we aren't adding allocated transactions to a list any more, the list links need to be initialized to ensure they're valid at the time list_del() is called for the transaction.
Then we can safely eliminate the allocated transaction list.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
0c126ec3 |
| 06-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: always use transaction IDs instead of lists
In gsi_channel_trans_complete(), use the completed and pending IDs to determine whether there are any transactions in completed state.
Similarl
net: ipa: always use transaction IDs instead of lists
In gsi_channel_trans_complete(), use the completed and pending IDs to determine whether there are any transactions in completed state.
Similarly, in gsi_channel_trans_cancel_pending(), use the pending and committed IDs to mark pending transactions cancelled. Rearrange the logic a bit there for a simpler result.
This removes the only user of list_last_entry_or_null(), so get rid of that macro.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.15.65 |
|
#
8672bab7 |
| 02-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: verify a few more IDs
The completed transaction list is used in gsi_channel_trans_complete() to return the next transaction in completed state.
Add some temporary checks to verify the tra
net: ipa: verify a few more IDs
The completed transaction list is used in gsi_channel_trans_complete() to return the next transaction in completed state.
Add some temporary checks to verify the transaction indicated by the completed ID matches the one first in this list.
Similarly, we use the pending and completed transaction lists when cancelling pending transactions in gsi_channel_trans_cancel_pending().
Add temporary checks there to verify the transactions indicated by IDs match those tracked by these lists.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
b2abe33d |
| 02-Sep-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: rework last transaction determination
When quiescing a channel, we find the "last" transaction, which is the latest one to have been allocated. (New transaction allocation will have been
net: ipa: rework last transaction determination
When quiescing a channel, we find the "last" transaction, which is the latest one to have been allocated. (New transaction allocation will have been prevented by the time this is called.)
Currently we do this by looking for the first non-empty transaction list in each state, then return the last entry from that last. Instead, determine the last entry in each list (if any) and return that entry if found.
Temporarily (locally) introduce list_last_entry_or_null() as a helper for this, mirroring list_first_entry_or_null(). This macro definition will be removed by an upcoming patch.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
fd3bd039 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: track polled transactions with an ID
Add a transaction ID to track the first element in the transaction array that has been polled. Advance the ID when we are releasing a transaction.
Te
net: ipa: track polled transactions with an ID
Add a transaction ID to track the first element in the transaction array that has been polled. Advance the ID when we are releasing a transaction.
Temporarily add warnings that verify that the first polled transaction tracked by the ID matches the first element on the polled list, both when polling and freeing.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
949cd0b5 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: track completed transactions with an ID
Add a transaction ID field to track the first element in the transaction array that has completed but has not yet been polled.
Advance the ID when
net: ipa: track completed transactions with an ID
Add a transaction ID field to track the first element in the transaction array that has completed but has not yet been polled.
Advance the ID when we are processing a transaction in the NAPI polling loop (where completed transactions become polled).
Temporarily add warnings that verify that the first completed transaction tracked by the ID matches the first element on the completed list, both when pending and completing.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
eeff7c14 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: track pending transactions with an ID
Add a transaction ID field to track the first element in the transaction array that is pending (sent to hardware) but not yet complete. Advance the I
net: ipa: track pending transactions with an ID
Add a transaction ID field to track the first element in the transaction array that is pending (sent to hardware) but not yet complete. Advance the ID when a completion event for a channel indicates that transactions have completed.
Temporarily add warnings that verify that the first pending transaction tracked by the ID matches the first element on the pending list, both when pending and completing, as well as when resetting the channel.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
fc95d958 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: track committed transactions with an ID
Add a transaction ID field to track the first element in a channel's transaction array that has been committed, but not yet passed to the hardware.
net: ipa: track committed transactions with an ID
Add a transaction ID field to track the first element in a channel's transaction array that has been committed, but not yet passed to the hardware. Advance the ID when the hardware is notified via doorbell that TREs from a transaction are ready for consumption.
Temporarily add warnings that verify that the first committed transaction tracked by the ID matches the first element on the committed list, both when committing and pending (at doorbell).
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
41e2a2c0 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: track allocated transactions with an ID
Transactions for a channel are now managed in an array, with a free transaction ID indicating which is the next one free.
Add another transaction I
net: ipa: track allocated transactions with an ID
Transactions for a channel are now managed in an array, with a free transaction ID indicating which is the next one free.
Add another transaction ID field to track the first element in the array that has been allocated. Advance it when a transaction is committed (because that is when that transaction leaves allocated state).
Temporarily add warnings that verify that the first allocated transaction tracked by the ID matches the first element on the allocated list, both when allocating and committing a transaction.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
12382d11 |
| 31-Aug-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: use an array for transactions
Transactions are always allocated one at a time. The maximum number of them we could ever need occurs if each TRE is assigned to a transaction. So a channel
net: ipa: use an array for transactions
Transactions are always allocated one at a time. The maximum number of them we could ever need occurs if each TRE is assigned to a transaction. So a channel requires no more transactions than the number of TREs in its transfer ring. That number is known to be a power-of-2 less than 65536.
The transaction pool abstraction is used for other things, but for transactions we can use a simple array of transaction structures, and use a free index to indicate which entry in the array is the next one free for allocation.
By having the number of elements in the array be a power-of-2, we can use an ever-incrementing 16-bit free index, and use it modulo the array size. Distinguish a "trans_id" (whose value can exceed the number of entries in the transaction array) from a "trans_index" (which is less than the number of entries).
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v5.15.64, v5.15.63, v5.15.62, v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56 |
|
#
616c4a83 |
| 19-Jul-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: fix an outdated comment
Since commit 8797972afff3d ("net: ipa: remove command info pool"), we don't allocate "command info" entries for command channel transactions. Fix a comment that se
net: ipa: fix an outdated comment
Since commit 8797972afff3d ("net: ipa: remove command info pool"), we don't allocate "command info" entries for command channel transactions. Fix a comment that seems to suggest we still do. (Even before that commit, the comment was out of place.)
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
4d8996cb |
| 19-Jul-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: skip some cleanup for unused transactions
In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if a transaction is unused. No used TREs means no IPA layer resources to clean u
net: ipa: skip some cleanup for unused transactions
In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if a transaction is unused. No used TREs means no IPA layer resources to clean up. So only call ipa_gsi_trans_release() if at least one TRE was used.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
49200658 |
| 19-Jul-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: rearrange transaction initialization
The transaction map is really associated with the transaction pool; move its definition earlier in the gsi_trans_info structure.
Rearrange initializat
net: ipa: rearrange transaction initialization
The transaction map is really associated with the transaction pool; move its definition earlier in the gsi_trans_info structure.
Rearrange initialization in gsi_channel_trans_init() so it sets the tre_avail value first, then initializes the transaction pool, and finally allocating the transaction map.
Update comments.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
b63f507c |
| 19-Jul-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: add a transaction committed list
We currently put a transaction on the pending list when it has been committed. But until the channel's doorbell rings, these transactions aren't actually
net: ipa: add a transaction committed list
We currently put a transaction on the pending list when it has been committed. But until the channel's doorbell rings, these transactions aren't actually "owned" by the hardware yet.
Add a new "committed" state (and list), to represent transactions that have been committed but not yet sent to hardware. Define "pending" to mean committed transactions that have been sent to hardware but have not yet completed.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v5.15.55, v5.15.54, v5.15.53, v5.15.52, v5.15.51, v5.15.50, v5.15.49 |
|
#
7c0d97e4 |
| 21-Jun-2022 |
Jiang Jian <jiangjian@cdjrlc.com> |
net: ipa: remove unexpected word "the"
there is an unexpected word "the" in the comments that need to be removed
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Reviewed-by: Alex Elder <elder@lina
net: ipa: remove unexpected word "the"
there is an unexpected word "the" in the comments that need to be removed
Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Reviewed-by: Alex Elder <elder@linaro.org> Link: https://lore.kernel.org/r/20220621085001.61320-1-jiangjian@cdjrlc.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v5.15.48 |
|
#
8eec7831 |
| 15-Jun-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: don't pass channel when mapping transaction
Change gsi_channel_trans_map() so it derives the channel used from the transaction. Pass the index of the *first* TRE used by the transaction,
net: ipa: don't pass channel when mapping transaction
Change gsi_channel_trans_map() so it derives the channel used from the transaction. Pass the index of the *first* TRE used by the transaction, and have the called function account for the fact that the last one used is what's important.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
#
dd5a046c |
| 15-Jun-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: don't assume one channel per event ring
In gsi_evt_ring_rx_update(), use gsi_event_trans() repeatedly to find the transaction associated with an event, rather than assuming consecutive eve
net: ipa: don't assume one channel per event ring
In gsi_evt_ring_rx_update(), use gsi_event_trans() repeatedly to find the transaction associated with an event, rather than assuming consecutive events are associated with the same channel. This removes the only caller of gsi_trans_pool_next(), so get rid of it.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v5.15.47 |
|
#
4e0f28e9 |
| 13-Jun-2022 |
Alex Elder <elder@linaro.org> |
net: ipa: introduce gsi_trans_tx_committed()
Create a new function that encapsulates recording information needed for TX channel statistics when a transaction is committed.
Record the accumulated l
net: ipa: introduce gsi_trans_tx_committed()
Create a new function that encapsulates recording information needed for TX channel statistics when a transaction is committed.
Record the accumulated length in the transaction before the call (for both RX and TX), so it can be used when updating TX statistics.
Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|