<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/ipa/ipa_cmd.c, branch v6.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-06-13T11:01:58Z</updated>
<entry>
<title>net: ipa: rename channel-&gt;tlv_count</title>
<updated>2022-06-13T11:01:58Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2022-06-10T15:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88e03057e4df72ecf1f9d8e0424e209eef82beaf'/>
<id>urn:sha1:88e03057e4df72ecf1f9d8e0424e209eef82beaf</id>
<content type='text'>
Each GSI channel has a TLV FIFO of a certain size, specified in the
configuration data for an AP channel.  That size dictates the
maximum number of TREs that are allowed in a single transaction.

The only way that value is used after initialization is as a limit
on the number of TREs in a transaction; calling it "tlv_count"
isn't helpful, and in fact gsi_channel_trans_tre_max() exists to
sort of abstract it.

Instead, rename the channel-&gt;tlv_count field trans_tre_max, and get
rid of the helper function.  Update a couple of comments as well.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: remove command info pool</title>
<updated>2022-05-22T19:46:12Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2022-05-22T00:32:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8797972afff3d462711758acec68be11172e2d01'/>
<id>urn:sha1:8797972afff3d462711758acec68be11172e2d01</id>
<content type='text'>
The ipa_cmd_info structure now contains only one field, and it's an
enumerated type whose values all fit in 8 bits.  Currently we'll
never use more than 8 TREs in a command transaction, and we can
represent that number of command opcodes in the same space as a 64
bit pointer to an ipa_cmd_info structure.

Define IPA_COMMAND_TRANS_TRE_MAX as the maximum number of TREs that
can be in a command transaction.  Replace the info pointer in a
transaction with a fixed-size array named cmd_opcode[] of that many
bytes.  Store the opcode in this array when adding a command TRE to
a transaction, as was done previously for the info array.  This
makes the ipa_cmd_info unused, so get rid of it.

When committing an immediate command transaction, use the channel's
Boolean command flag to determine whether to fill in the opcode,
which will be taken (as before) from the array in the transaction.

This makes the command info pool unnecessary, so get rid of it.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: remove command direction argument</title>
<updated>2022-05-22T19:46:12Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2022-05-22T00:32:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4de284b72e59e1006a6b6358c060265a9f1be100'/>
<id>urn:sha1:4de284b72e59e1006a6b6358c060265a9f1be100</id>
<content type='text'>
We no longer use the direction argument for gsi_trans_cmd_add(), so
get rid of it in its definition, and in its seven callers.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: kill gsi_trans_commit_wait_timeout()</title>
<updated>2022-05-22T19:46:12Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2022-05-22T00:32:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d15180b4eadbdee782d97afcbf3c56e2f246c40a'/>
<id>urn:sha1:d15180b4eadbdee782d97afcbf3c56e2f246c40a</id>
<content type='text'>
Since the beginning gsi_trans_commit_wait_timeout() has existed to
provide a way to allow waiting a limited time for a transaction
to complete.  But that function has never been used.

In fact, there is no use for this function, because a transaction
committed to hardware should *always* complete.  The only reason it
might not complete is if there were a hardware failure, or perhaps a
system configuration error.

Furthermore, if a timeout ever did occur, the IPA hardware would be
in an indeterminate state, from which there is no recovery.  It
would require some sort of complete IPA reset, and would require the
participation of the modem, and at this time there is no such
sequence defined.

So get rid of the definition of gsi_trans_commit_wait_timeout(), and
update a few comments accordingly.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: kill ipa_cmd_pipeline_clear()</title>
<updated>2021-11-23T12:26:40Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-11-23T01:16:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e4e9bfb7c93d7e78aa4ad7e1c411a8df15386062'/>
<id>urn:sha1:e4e9bfb7c93d7e78aa4ad7e1c411a8df15386062</id>
<content type='text'>
Calling ipa_cmd_pipeline_clear() after stopping the channel
underlying the AP&lt;-modem RX endpoint can lead to a deadlock.

This occurs in the -&gt;runtime_suspend device power operation for the
IPA driver.  While this callback is in progress, any other requests
for power will block until the callback returns.

Stopping the AP&lt;-modem RX channel does not prevent the modem from
sending another packet to this endpoint.  If a packet arrives for an
RX channel when the channel is stopped, an SUSPEND IPA interrupt
condition will be pending.  Handling an IPA interrupt requires
power, so ipa_isr_thread() calls pm_runtime_get_sync() first thing.

The problem occurs because a "pipeline clear" command will not
complete while such a SUSPEND interrupt condition exists.  So the
SUSPEND IPA interrupt handler won't proceed until it gets power;
that won't happen until the -&gt;runtime_suspend callback (and its
"pipeline clear" command) completes; and that can't happen while
the SUSPEND interrupt condition exists.

It turns out that in this case there is no need to use the "pipeline
clear" command.  There are scenarios in which clearing the pipeline
is required while suspending, but those are not (yet) supported
upstream.  So a simple fix, avoiding the potential deadlock, is to
stop calling ipa_cmd_pipeline_clear() in ipa_endpoint_suspend().
This removes the only user of ipa_cmd_pipeline_clear(), so get rid
of that function.  It can be restored again whenever it's needed.

This is basically a manual revert along with an explanation for
commit 6cb63ea6a39ea ("net: ipa: introduce ipa_cmd_tag_process()").

Fixes: 6cb63ea6a39ea ("net: ipa: introduce ipa_cmd_tag_process()")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: use WARN_ON() rather than assertions</title>
<updated>2021-07-26T21:38:11Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-07-26T17:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5bc5588466a1f8b48fb04f56c46474a30508a3d6'/>
<id>urn:sha1:5bc5588466a1f8b48fb04f56c46474a30508a3d6</id>
<content type='text'>
I've added commented assertions to record certain properties that
can be assumed to hold in certain places in the IPA code.  Convert
these into real WARN_ON() calls so the assertions are actually
checked, using the standard WARN_ON() mechanism.

Where errors can be returned, return an error if a warning is
triggered.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: kill the remaining conditional validation code</title>
<updated>2021-07-26T21:38:11Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-07-26T17:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=442d68ebf0927681e9405c3db8e9fafb754cb458'/>
<id>urn:sha1:442d68ebf0927681e9405c3db8e9fafb754cb458</id>
<content type='text'>
There are only a few remaining spots that validate IPA code
conditional on whether a symbol is defined at compile time.
The checks are not expensive, so just build them always.

This completes the removal of all CONFIG_VALIDATE/CONFIG_VALIDATION
IPA code.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: fix ipa_cmd_table_valid()</title>
<updated>2021-07-26T21:38:11Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-07-26T17:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa'/>
<id>urn:sha1:f2c1dac0abcfa93e8b20065b8d6b4b2b6f9990aa</id>
<content type='text'>
Stop supporting different sizes for hashed and non-hashed filter or
route tables.  Add BUILD_BUG_ON() calls to verify the sizes of the
fields in the filter/route table initialization immediate command
are the same.

Add a check to ipa_cmd_table_valid() to ensure the size of the
memory region being checked fits within the immediate command field
that must hold it.

Remove two Boolean parameters used only for error reporting.  This
actually fixes a bug that would only show up if IPA_VALIDATE were
defined.  Define ipa_cmd_table_valid() unconditionally (no longer
dependent on IPA_VALIDATE).

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: introduce ipa_mem_find()</title>
<updated>2021-06-10T21:50:08Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-06-10T19:23:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf'/>
<id>urn:sha1:5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf</id>
<content type='text'>
Introduce a new function that abstracts finding information about a
region in IPA-local memory, given its memory region ID.  For now it
simply uses the region ID as an index into the IPA memory array.
If the region is not defined, ipa_mem_find() returns a null pointer.

Update all code that accesses the ipa-&gt;mem[] array directly to use
ipa_mem_find() instead.  The return value must be checked for null
when optional memory regions are sought.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: clean up header memory validation</title>
<updated>2021-06-10T21:50:08Z</updated>
<author>
<name>Alex Elder</name>
<email>elder@linaro.org</email>
</author>
<published>2021-06-10T19:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce05a9f39607623362aea9147c3dfab7a9f94ccb'/>
<id>urn:sha1:ce05a9f39607623362aea9147c3dfab7a9f94ccb</id>
<content type='text'>
Do some general cleanup in ipa_cmd_header_valid():
  - Delay assigning the mem variable until just before it's used.
  - Assign the maximum offset and size values together.
  - Improve comments explaining the single range of memory being
    made up of a modem portion and an AP portion.
  - Record the offset of the combined range in a local variable.
  - Do the initial size assignment right after assigning the offset.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
