<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/soc/fsl/qman.h, branch 0x221E-v0.0.1-v6.19</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-11-05T02:44:43Z</updated>
<entry>
<title>soc: fsl_qbman: use be16_to_cpu() in qm_sg_entry_get_off()</title>
<updated>2024-11-05T02:44:43Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2024-10-29T16:43:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a12fcef429e17cb3db47cde0692a185d3ca712a3'/>
<id>urn:sha1:a12fcef429e17cb3db47cde0692a185d3ca712a3</id>
<content type='text'>
struct qm_sg_entry :: offset is a 13-bit field, declared as __be16.

When using be32_to_cpu(), a wrong value will be calculated on little
endian systems (Arm), because type promotion from 16-bit to 32-bit,
which is done before the byte swap and always in the CPU native
endianness, changes the value of the scatter/gather list entry offset in
big-endian interpretation (adds two zero bytes in the LSB interpretation).
The result of the byte swap is ANDed with GENMASK(12, 0), so the result
is always zero, because only those bytes added by type promotion remain
after the application of the bit mask.

The impact of the bug is that scatter/gather frames with a non-zero
offset into the buffer are treated by the driver as if they had a zero
offset. This is all in theory, because in practice, qm_sg_entry_get_off()
has a single caller, where the bug is inconsequential, because at that
call site the buffer offset will always be zero, as will be explained in
the subsequent change.

Flagged by sparse:

warning: cast to restricted __be32
warning: cast from restricted __be16

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Breno Leitao &lt;leitao@debian.org&gt;
Acked-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Acked-by: Madalin Bucur &lt;madalin.bucur@oss.nxp.com&gt;
Link: https://patch.msgid.link/20241029164317.50182-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qbman: Add CGR update function</title>
<updated>2022-09-05T13:27:39Z</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@seco.com</email>
</author>
<published>2022-09-02T21:57:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=914f8b228ede709274b8c80514b352248ec9da00'/>
<id>urn:sha1:914f8b228ede709274b8c80514b352248ec9da00</id>
<content type='text'>
This adds a function to update a CGR with new parameters. qman_create_cgr
can almost be used for this (with flags=0), but it's not suitable because
it also registers the callback function. The _safe variant was modeled off
of qman_cgr_delete_safe. However, we handle multiple arguments and a return
value.

Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Acked-by: Camelia Groza &lt;camelia.groza@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>soc/fsl/qbman: Add an argument to signal if NAPI processing is required.</title>
<updated>2020-11-04T01:41:03Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2020-11-01T23:22:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f84754dbc55e3abd8241e3038b615af65c745f47'/>
<id>urn:sha1:f84754dbc55e3abd8241e3038b615af65c745f47</id>
<content type='text'>
dpaa_eth_napi_schedule() and caam_qi_napi_schedule() schedule NAPI if
invoked from:

 - Hard interrupt context
 - Any context which is not serving soft interrupts

Any context which is not serving soft interrupts includes hard interrupts
so the in_irq() check is redundant. caam_qi_napi_schedule() has a comment
about this:

        /*
         * In case of threaded ISR, for RT kernels in_irq() does not return
         * appropriate value, so use in_serving_softirq to distinguish between
         * softirq and irq contexts.
         */
         if (in_irq() || !in_serving_softirq())

This has nothing to do with RT. Even on a non RT kernel force threaded
interrupts run obviously in thread context and therefore in_irq() returns
false when invoked from the handler.

The extension of the in_irq() check with !in_serving_softirq() was there
when the drivers were added, but in the out of tree FSL BSP the original
condition was in_irq() which got extended due to failures on RT.

The usage of in_xxx() in drivers is phased out and Linus clearly requested
that code which changes behaviour depending on context should either be
separated or the context be conveyed in an argument passed by the caller,
which usually knows the context. Right he is, the above construct is
clearly showing why.

The following callchains have been analyzed to end up in
dpaa_eth_napi_schedule():

qman_p_poll_dqrr()
  __poll_portal_fast()
    fq-&gt;cb.dqrr()
       dpaa_eth_napi_schedule()

portal_isr()
  __poll_portal_fast()
    fq-&gt;cb.dqrr()
       dpaa_eth_napi_schedule()

Both need to schedule NAPI.
The crypto part has another code path leading up to this:
  kill_fq()
     empty_retired_fq()
       qman_p_poll_dqrr()
         __poll_portal_fast()
            fq-&gt;cb.dqrr()
               dpaa_eth_napi_schedule()

kill_fq() is called from task context and ends up scheduling NAPI, but
that's pointless and an unintended side effect of the !in_serving_softirq()
check.

The code path:
  caam_qi_poll() -&gt; qman_p_poll_dqrr()

is invoked from NAPI and I *assume* from crypto's NAPI device and not
from qbman's NAPI device. I *guess* it is okay to skip scheduling NAPI
(because this is what happens now) but could be changed if it is wrong
due to `budget' handling.

Add an argument to __poll_portal_fast() which is true if NAPI needs to be
scheduled. This requires propagating the value to the caller including
`qman_cb_dqrr' typedef which is used by the dpaa and the crypto driver.

Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Cc: Aymen Sghaier &lt;aymen.sghaier@nxp.com&gt;
Cc: Herbert XS &lt;herbert@gondor.apana.org.au&gt;
Cc: Li Yang &lt;leoyang.li@nxp.com&gt;
Reviewed-by: Horia Geantă &lt;horia.geanta@nxp.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Reviewed-by: Madalin Bucur &lt;madalin.bucur@oss.nxp.com&gt;
Tested-by: Camelia Groza &lt;camelia.groza@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qman: fix -Wpacked-not-aligned warnings</title>
<updated>2020-09-22T22:38:21Z</updated>
<author>
<name>Li Yang</name>
<email>leoyang.li@nxp.com</email>
</author>
<published>2020-09-22T22:38:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1fe44191f361a88b0f9600a5bbc8ebf7ede642ce'/>
<id>urn:sha1:1fe44191f361a88b0f9600a5bbc8ebf7ede642ce</id>
<content type='text'>
This fixes compile warnings from the -Wpacked-not-aligned option.

In file included from ../drivers/crypto/caam/qi.c:12:
../include/soc/fsl/qman.h:259:1: warning: alignment 1 of ‘struct qm_dqrr_entry’ is less than 8 [-Wpacked-not-aligned]
 } __packed;
 ^
../include/soc/fsl/qman.h:292:2: warning: alignment 1 of ‘struct &lt;anonymous&gt;’ is less than 8 [-Wpacked-not-aligned]
  } __packed ern;
  ^

Reported-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>dpaa_eth: register a device link for the qman portal used</title>
<updated>2019-10-31T19:13:34Z</updated>
<author>
<name>Madalin Bucur</name>
<email>madalin.bucur@nxp.com</email>
</author>
<published>2019-10-31T14:37:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e06eea555b878f2c95b498aa1c485250ad30c960'/>
<id>urn:sha1:e06eea555b878f2c95b498aa1c485250ad30c960</id>
<content type='text'>
Before this change, unbinding the QMan portals did not trigger a
corresponding unbinding of the dpaa_eth making use of it; the first
QMan portal related operation issued afterwards crashed the kernel.
The device link ensures the dpaa_eth dependency upon the qman portal
used is honoured at the QMan portal removal.

Signed-off-by: Madalin Bucur &lt;madalin.bucur@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qbman: allow registering a device link for the portal user</title>
<updated>2019-10-31T19:13:34Z</updated>
<author>
<name>Madalin Bucur</name>
<email>madalin.bucur@nxp.com</email>
</author>
<published>2019-10-31T14:37:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a2d00f3db73dc4f6f6afcc95c1db809ea9019306'/>
<id>urn:sha1:a2d00f3db73dc4f6f6afcc95c1db809ea9019306</id>
<content type='text'>
Introduce the API required to make sure that the devices that use
the QMan portal are unbound when the portal is unbound.

Signed-off-by: Madalin Bucur &lt;madalin.bucur@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qbman_portals: add APIs to retrieve the probing status</title>
<updated>2019-05-20T19:28:16Z</updated>
<author>
<name>Laurentiu Tudor</name>
<email>laurentiu.tudor@nxp.com</email>
</author>
<published>2019-04-27T07:10:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5d1d046e2868fc876a69231eb2f24f000b521f1c'/>
<id>urn:sha1:5d1d046e2868fc876a69231eb2f24f000b521f1c</id>
<content type='text'>
Add a couple of new APIs to check the probing status of the required
cpu bound qman and bman portals:
 'int bman_portals_probed()' and 'int qman_portals_probed()'.
They return the following values.
 *  1 if qman/bman portals were all probed correctly
 *  0 if qman/bman portals were not yet probed
 * -1 if probing of qman/bman portals failed
Portals are considered successful probed if no error occurred during
the probing of any of the portals and if enough portals were probed
to have one available for each cpu.
The error handling paths were slightly rearranged in order to fit this
new functionality without being too intrusive.
Drivers that use qman/bman portal driver services are required to use
these APIs before calling any functions exported by these drivers or
otherwise they will crash the kernel.
First user will be the dpaa1 ethernet driver, coming in a subsequent
patch.

Signed-off-by: Laurentiu Tudor &lt;laurentiu.tudor@nxp.com&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc/qman: add return value to interrupt coalesce changing APIs</title>
<updated>2018-11-23T19:17:06Z</updated>
<author>
<name>Madalin Bucur</name>
<email>madalin.bucur@nxp.com</email>
</author>
<published>2018-11-21T11:41:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5c664ace8cdfd947d293b97871a4f1e4bedca5b9'/>
<id>urn:sha1:5c664ace8cdfd947d293b97871a4f1e4bedca5b9</id>
<content type='text'>
Check that the values received by the portal interrupt coalesce
change APIs are in range.

Signed-off-by: Madalin Bucur &lt;madalin.bucur@nxp.com&gt;
Signed-off-by: Roy Pledge &lt;roy.pledge@nxp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qbman: add interrupt coalesce changing APIs</title>
<updated>2018-10-05T19:06:56Z</updated>
<author>
<name>Madalin Bucur</name>
<email>madalin.bucur@nxp.com</email>
</author>
<published>2018-09-28T08:43:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6d06009cb216d071e955b3814086595851627910'/>
<id>urn:sha1:6d06009cb216d071e955b3814086595851627910</id>
<content type='text'>
Add the APIs required to control the QMan portal interrupt coalescing
settings.

Signed-off-by: Madalin Bucur &lt;madalin.bucur@nxp.com&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qbman: add APIs to retrieve the probing status</title>
<updated>2018-09-27T20:43:35Z</updated>
<author>
<name>Laurentiu Tudor</name>
<email>laurentiu.tudor@nxp.com</email>
</author>
<published>2018-09-26T13:22:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=853dc104e6a43cba9a7a87542bc6d8e3b74f0bc9'/>
<id>urn:sha1:853dc104e6a43cba9a7a87542bc6d8e3b74f0bc9</id>
<content type='text'>
Add a couple of new APIs to check the probing status of qman and bman:
 'int bman_is_probed()' and 'int qman_is_probed()'.
They return the following values.
 *  1 if qman/bman were probed correctly
 *  0 if qman/bman were not yet probed
 * -1 if probing of qman/bman failed
Drivers that use qman/bman driver services are required to use these
APIs before calling any functions exported by qman or bman drivers
or otherwise they will crash the kernel.
The APIs will be used in the following couple of qbman portal patches
and later in the series in the dpaa1 ethernet driver.

Signed-off-by: Laurentiu Tudor &lt;laurentiu.tudor@nxp.com&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
</feed>
