<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/ipa/gsi.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>2021-08-04T09:12:05Z</updated>
<entry>
<title>net: ipa: disable GSI interrupts while suspended</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:01:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45a42a3c50b583e78d96038e834909de627f87f1'/>
<id>urn:sha1:45a42a3c50b583e78d96038e834909de627f87f1</id>
<content type='text'>
Introduce new functions gsi_suspend() and gsi_resume(), which will
disable the GSI interrupt handler after all endpoints are suspended
and re-enable it before endpoints are resumed.  This will ensure no
GSI interrupt handler will fire when the hardware is suspended.

Here's a little further explanation.  There are seven GSI interrupt
types, and most are disabled except when needed.
  - These two are not used (never enabled):
      GSI_INTER_EE_CH_CTRL
      GSI_INTER_EE_EV_CTRL
  - These two are only used to implement channel and event ring
    commands, and are only enabled while a command is underway:
      GSI_CH_CTRL
      GSI_EV_CTRL
  - The IEOB interrupt signals I/O completion.  It will not fire
    when a channel is stopped (or "suspended").
      GSI_IEOB
  - This interrupt is used to allocate or halt modem channels,
    and is only enabled while such a command is underway.
      GSI_GLOB_EE
    However it also is used to signal certain errors, and this could
    occur at any time.
  - The general interrupt signals general errors, and could occur at
    any time.
      GSI_GENERAL

The purpose for this change is to ensure no global or general
interrupts fire due to errors while the hardware is suspended.
We enable the clock on resume, and at that time we can "handle"
(at least report) these error conditions.

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: move gsi_irq_init() code into setup</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:01:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b176f95b5728e355ea6b61725cf240a575621e51'/>
<id>urn:sha1:b176f95b5728e355ea6b61725cf240a575621e51</id>
<content type='text'>
The GSI IRQ handler could be triggered as soon as it is registered
with request_irq().  The handler function, gsi_isr(), touches
hardware, meaning the IPA clock must be operational.  The IPA clock
is not operating when the handler is registered (in gsi_irq_init()),
so this is a problem.

Move the call to request_irq() for the GSI interrupt handler into
gsi_irq_setup(), which is called when the IPA clock is known to be
operational (and furthermore, the GSI firmware will have been
loaded).  Request the IRQ at the end of that function, after all
interrupt types have been disabled and masked.

Move the matching free_irq() call into gsi_irq_teardown(), and get
rid of the now empty gsi_irq_exit(),

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: have gsi_irq_setup() return an error code</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:01:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1657d8a45823429aabee0a3282b2d249abbd3831'/>
<id>urn:sha1:1657d8a45823429aabee0a3282b2d249abbd3831</id>
<content type='text'>
Change gsi_irq_setup() so it returns an error value, and introduce
gsi_irq_teardown() as its inverse.  Set the interrupt type (IRQ
rather than MSI) in gsi_irq_setup().

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: move some GSI setup functions</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7860a5f898c9f5850ff9d72e6ee473791e5a6cf'/>
<id>urn:sha1:a7860a5f898c9f5850ff9d72e6ee473791e5a6cf</id>
<content type='text'>
Move gsi_irq_setup() and gsi_ring_setup() so they're defined right
above gsi_setup() where they're called.  This is a trivial movement
of code to prepare for upcoming patches.

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: move version check for channel suspend/resume</title>
<updated>2021-08-04T09:12:05Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-08-03T14:00:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a4ba483e4a56cb469f067493265f0173e06d060'/>
<id>urn:sha1:4a4ba483e4a56cb469f067493265f0173e06d060</id>
<content type='text'>
Change the Boolean flags passed to __gsi_channel_start() and
__gsi_channel_stop() so they represent whether the request is being
made to implement suspend (versus stop) or resume (versus start).

Then stop or start the channel for suspend/resume requests only if
the hardware version indicates it should be done.

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: kill the remaining conditional validation code</title>
<updated>2021-07-26T21:38:11Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-07-26T17:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/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: introduce gsi_ring_setup()</title>
<updated>2021-06-21T19:30:59Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-06-21T17:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bae70a803a771d0f1e55cfe1db195d8af2765dd8'/>
<id>urn:sha1:bae70a803a771d0f1e55cfe1db195d8af2765dd8</id>
<content type='text'>
Prior to IPA v3.5.1, there is no HW_PARAM_2 GSI register, which we
use to determine the number of channels and endpoints per execution
environment.  In that case, we will just assume the number supported
is the maximum supported by the driver.

Introduce gsi_ring_setup() to encapsulate the code that determines
the number of channels and endpoints.

Update GSI_EVT_RING_COUNT_MAX so it is big enough to handle any
available channel for all supported hardware (IPA v4.9 can have 23
channels and 24 event rings).

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: AngeloGioacchino Del Regno
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: inter-EE interrupts aren't always available</title>
<updated>2021-06-21T19:30:59Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-06-21T17:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c31d73494fa5016596f0b36aeb3e388160c9c473'/>
<id>urn:sha1:c31d73494fa5016596f0b36aeb3e388160c9c473</id>
<content type='text'>
The GSI inter-EE interrupts are not supported prior to IPA v3.5.
Don't attempt to initialize them in gsi_irq_setup() for hardware
that does not support them.

Originally proposed by AngeloGioacchino Del Regno.

Link: https://lore.kernel.org/netdev/20210211175015.200772-4-angelogioacchino.delregno@somainline.org
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: AngeloGioacchino Del Regno
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: ipa: fix inter-EE IRQ register definitions</title>
<updated>2021-05-06T23:32:10Z</updated>
<author>
<name>Alex Elder</name>
</author>
<published>2021-05-05T22:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a780f51f87b430cc69ebf4e859e7e9be720b283'/>
<id>urn:sha1:6a780f51f87b430cc69ebf4e859e7e9be720b283</id>
<content type='text'>
In gsi_irq_setup(), two registers are written with the intention of
disabling inter-EE channel and event IRQs.

But the wrong registers are used (and defined); the ones used are
read-only registers that indicate whether the interrupt condition is
present.

Define the mask registers instead of the status registers, and use
them to disable the inter-EE interrupt types.

Fixes: 46f748ccaf01 ("net: ipa: explicitly disallow inter-EE interrupts")
Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Link: https://lore.kernel.org/r/20210505223636.232527-1-elder@linaro.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
