<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/ipa/ipa_endpoint.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-02-05T11:39:54Z</updated>
<entry>
<title>net: ipa: prevent concurrent replenish</title>
<updated>2022-02-05T11:39:54Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2022-01-12T13:30:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62600b0fbc6e69adfec2fca0fb6c69d10b72204b'/>
<id>urn:sha1:62600b0fbc6e69adfec2fca0fb6c69d10b72204b</id>
<content type='text'>
commit 998c0bd2b3715244da7639cc4e6a2062cb79c3f4 upstream.

We have seen cases where an endpoint RX completion interrupt arrives
while replenishing for the endpoint is underway.  This causes another
instance of replenishing to begin as part of completing the receive
transaction.  If this occurs it can lead to transaction corruption.

Use a new flag to ensure only one replenish instance for an endpoint
executes at a time.

Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: ipa: use a bitmap for endpoint replenish_enabled</title>
<updated>2022-02-05T11:39:54Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2022-01-12T13:30:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74a0e011912021740c46771a3d8c494440d4688c'/>
<id>urn:sha1:74a0e011912021740c46771a3d8c494440d4688c</id>
<content type='text'>
commit c1aaa01dbf4cef95af3e04a5a43986c290e06ea3 upstream.

Define a new replenish_flags bitmap to contain Boolean flags
associated with an endpoint's replenishing state.  Replace the
replenish_enabled field with a flag in that bitmap.  This is to
prepare for the next patch, which adds another flag.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: ipa: fix atomic update in ipa_endpoint_replenish()</title>
<updated>2022-01-27T11:03:01Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2022-01-12T13:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6279192add94a4d01589186d5a936bdfbc7d9ee7'/>
<id>urn:sha1:6279192add94a4d01589186d5a936bdfbc7d9ee7</id>
<content type='text'>
commit 6c0e3b5ce94947b311348c367db9e11dcb2ccc93 upstream.

In ipa_endpoint_replenish(), if an error occurs when attempting to
replenish a receive buffer, we just quit and try again later.  In
that case we increment the backlog count to reflect that the attempt
was unsuccessful.  Then, if the add_one flag was true we increment
the backlog again.

This second increment is not included in the backlog local variable
though, and its value determines whether delayed work should be
scheduled.  This is a bug.

Fix this by determining whether 1 or 2 should be added to the
backlog before adding it in a atomic_add_return() call.

Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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>
</author>
<published>2021-11-23T01:16:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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: disable HOLB drop when updating timer</title>
<updated>2021-11-15T13:25:45Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-11-12T22:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=816316cacad2b5abd5b41423cf04e4845239abd4'/>
<id>urn:sha1:816316cacad2b5abd5b41423cf04e4845239abd4</id>
<content type='text'>
The head-of-line blocking timer should only be modified when
head-of-line drop is disabled.

One of the steps in recovering from a modem crash is to enable
dropping of packets with timeout of 0 (immediate).  We don't know
how the modem configured its endpoints, so before we program the
timer, we need to ensure HOL_BLOCK is disabled.

Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints")
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: HOLB register sometimes must be written twice</title>
<updated>2021-11-15T13:25:45Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-11-12T22:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e228d8cbb1cc6ba78022d406340e901e08d26e0'/>
<id>urn:sha1:6e228d8cbb1cc6ba78022d406340e901e08d26e0</id>
<content type='text'>
Starting with IPA v4.5, the HOL_BLOCK_EN register must be written
twice when enabling head-of-line blocking avoidance.

Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints")
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: rename "ipa_clock.c"</title>
<updated>2021-08-22T08:44:17Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-20T16:01:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2775cbc5afeb63f1ddd8c05df216763450772ad9'/>
<id>urn:sha1:2775cbc5afeb63f1ddd8c05df216763450772ad9</id>
<content type='text'>
Finally, rename "ipa_clock.c" to be "ipa_power.c" and "ipa_clock.h"
to be "ipa_power.h".

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: rename ipa_clock_* symbols</title>
<updated>2021-08-22T08:44:17Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-20T16:01:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7aa0e8b8bd5b252c94900b19f2af8b7ec8a4e11d'/>
<id>urn:sha1:7aa0e8b8bd5b252c94900b19f2af8b7ec8a4e11d</id>
<content type='text'>
Rename a number of functions to clarify that there is no longer a
notion of an "IPA clock," but rather that the functions are more
generally related to IPA power management.

  ipa_clock_enable() -&gt; ipa_power_enable()
  ipa_clock_disable() -&gt; ipa_power_disable()
  ipa_clock_rate() -&gt; ipa_core_clock_rate()
  ipa_clock_init() -&gt; ipa_power_init()
  ipa_clock_exit() -&gt; ipa_power_exit()

Rename the ipa_clock structure to be ipa_power.  Rename all
variables and fields using that structure type "power" rather
than "clock".

Rename the ipa_clock_data structure to be ipa_power_data, and more
broadly, just substitute "power" for "clock" in places that
previously represented things related to the "IPA clock".

Update comments throughout.

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 gsi-&gt;version for channel suspend/resume</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:00:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=decfef0fa6b21508657a6e54a01508196988bc95'/>
<id>urn:sha1:decfef0fa6b21508657a6e54a01508196988bc95</id>
<content type='text'>
The GSI layer has the IPA version now, so there's no need for
version-specific flags to be passed from IPA.  One instance of
this is in gsi_channel_suspend() and gsi_channel_resume(), which
indicate whether or not the endpoint suspend is implemented by
GSI stopping the channel.  We can make that determination based
on gsi-&gt;version, eliminating the need for a Boolean flag in those
functions.

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>
</author>
<published>2021-07-26T17:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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>
</feed>
