<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/crypto/allwinner/sun8i-ce, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-06-13T09:47:38Z</updated>
<entry>
<title>crypto: update some Arm documentation references</title>
<updated>2023-06-13T09:47:38Z</updated>
<author>
<name>Jonathan Corbet</name>
</author>
<published>2023-05-03T22:54:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39db3f15194954568b626bfb8cf50910ad811bdc'/>
<id>urn:sha1:39db3f15194954568b626bfb8cf50910ad811bdc</id>
<content type='text'>
The Arm documentation has moved to Documentation/arch/arm; update a
set of references under crypto/allwinner to match.

Cc: Corentin Labbe &lt;clabbe.montjoie@gmail.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Cc: Samuel Holland &lt;samuel@sholland.org&gt;
Acked-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - Add TRNG clock to the D1 variant</title>
<updated>2023-01-13T08:39:04Z</updated>
<author>
<name>Samuel Holland</name>
</author>
<published>2022-12-31T22:01:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f81c1d4a6d3f6b9f31cb8feec13a4357b68a95d6'/>
<id>urn:sha1:f81c1d4a6d3f6b9f31cb8feec13a4357b68a95d6</id>
<content type='text'>
At least the D1 variant requires a separate clock for the TRNG.
Without this clock enabled, reading from /dev/hwrng reports:

   sun8i-ce 3040000.crypto: DMA timeout for TRNG (tm=96) on flow 3

Experimentation shows that the necessary clock is the SoC's internal
RC oscillator. This makes sense, as noise from the oscillator can be
used as a source of entropy.

Signed-off-by: Samuel Holland &lt;samuel@sholland.org&gt;
Reviewed-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Acked-by: Corentin Labbe &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>hwrng: core - treat default_quality as a maximum and default to 1024</title>
<updated>2022-11-18T08:59:34Z</updated>
<author>
<name>Jason A. Donenfeld</name>
</author>
<published>2022-11-07T12:24:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16bdbae394280f1d97933d919023eccbf0b564bd'/>
<id>urn:sha1:16bdbae394280f1d97933d919023eccbf0b564bd</id>
<content type='text'>
Most hw_random devices return entropy which is assumed to be of full
quality, but driver authors don't bother setting the quality knob. Some
hw_random devices return less than full quality entropy, and then driver
authors set the quality knob. Therefore, the entropy crediting should be
opt-out rather than opt-in per-driver, to reflect the actual reality on
the ground.

For example, the two Raspberry Pi RNG drivers produce full entropy
randomness, and both EDK2 and U-Boot's drivers for these treat them as
such. The result is that EFI then uses these numbers and passes the to
Linux, and Linux credits them as boot, thereby initializing the RNG.
Yet, in Linux, the quality knob was never set to anything, and so on the
chance that Linux is booted without EFI, nothing is ever credited.
That's annoying.

The same pattern appears to repeat itself throughout various drivers. In
fact, very very few drivers have bothered setting quality=1024.

Looking at the git history of existing drivers and corresponding mailing
list discussion, this conclusion tracks. There's been a decent amount of
discussion about drivers that set quality &lt; 1024 -- somebody read and
interepreted a datasheet, or made some back of the envelope calculation
somehow. But there's been very little, if any, discussion about most
drivers where the quality is just set to 1024 or unset (or set to 1000
when the authors misunderstood the API and assumed it was base-10 rather
than base-2); in both cases the intent was fairly clear of, "this is a
hardware random device; it's fine."

So let's invert this logic. A hw_random struct's quality knob now
controls the maximum quality a driver can produce, or 0 to specify 1024.
Then, the module-wide switch called "default_quality" is changed to
represent the maximum quality of any driver. By default it's 1024, and
the quality of any particular driver is then given by:

    min(default_quality, rng-&gt;quality ?: 1024);

This way, the user can still turn this off for weird reasons (and we can
replace whatever driver-specific disabling hacks existed in the past),
yet we get proper crediting for relevant RNGs.

Cc: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Cc: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>Revert "crypto: allwinner - Fix dma_map_sg error check"</title>
<updated>2022-09-02T10:19:27Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2022-09-02T10:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ad548ebb85cc416587ba68c0e530a2f00b2273a'/>
<id>urn:sha1:2ad548ebb85cc416587ba68c0e530a2f00b2273a</id>
<content type='text'>
This reverts commit 2b02187bdb0bb75000850bd0309e70eb8664159e.

The original code was correct and arguably more robust than the
patched version.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: allwinner - Fix dma_map_sg error check</title>
<updated>2022-08-26T10:50:40Z</updated>
<author>
<name>Jack Wang</name>
</author>
<published>2022-08-19T06:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b02187bdb0bb75000850bd0309e70eb8664159e'/>
<id>urn:sha1:2b02187bdb0bb75000850bd0309e70eb8664159e</id>
<content type='text'>
dma_map_sg return 0 on error.

Cc: Corentin Labbe &lt;clabbe.montjoie@gmail.com&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Chen-Yu Tsai &lt;wens@csie.org&gt;
Cc: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Cc: Samuel Holland &lt;samuel@sholland.org&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Minghao Chi &lt;chi.minghao@zte.com.cn&gt;
Cc: Peng Wu &lt;wupeng58@huawei.com&gt;
Cc: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Cc: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-sunxi@lists.linux.dev
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Jack Wang &lt;jinpu.wang@ionos.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - using the pm_runtime_resume_and_get to simplify the code</title>
<updated>2022-08-19T10:39:36Z</updated>
<author>
<name>ye xingchen</name>
</author>
<published>2022-08-02T07:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7433d2fda2f0d1fcbfc72d3b36f908ad94aebf6d'/>
<id>urn:sha1:7433d2fda2f0d1fcbfc72d3b36f908ad94aebf6d</id>
<content type='text'>
Using pm_runtime_resume_and_get() to instade of  pm_runtime_get_sync
and pm_runtime_put_noidle.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: ye xingchen &lt;ye.xingchen@zte.com.cn&gt;
Acked-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - do not fallback if cryptlen is less than sg length</title>
<updated>2022-05-13T09:24:48Z</updated>
<author>
<name>Corentin Labbe</name>
</author>
<published>2022-05-02T20:19:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42a01af3f13f09656af1f97d58e98415242eef45'/>
<id>urn:sha1:42a01af3f13f09656af1f97d58e98415242eef45</id>
<content type='text'>
The sg length could be more than remaining data on it.
So check the length requirement against the minimum between those two
values.

Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - rework debugging</title>
<updated>2022-05-13T09:24:48Z</updated>
<author>
<name>Corentin Labbe</name>
</author>
<published>2022-05-02T20:19:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aff388f7874653aea0b8087cfedec52336d2066a'/>
<id>urn:sha1:aff388f7874653aea0b8087cfedec52336d2066a</id>
<content type='text'>
The "Fallback for xxx" message is annoying, remove it and store the
information in the debugfs.
Let's add more precise fallback stats and display it better.

Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - use sg_nents_for_len</title>
<updated>2022-05-13T09:24:20Z</updated>
<author>
<name>Corentin Labbe</name>
</author>
<published>2022-05-02T20:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b8309faf0ca17c819d3c9a1a262467f9dc3bd58'/>
<id>urn:sha1:6b8309faf0ca17c819d3c9a1a262467f9dc3bd58</id>
<content type='text'>
When testing with some large SG list, the sun8i-ce drivers always
fallback even if it can handle it.
So use sg_nents_for_len() which permits to see less SGs than needed.

Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: sun8i-ce - Add function for handling hash padding</title>
<updated>2022-05-13T09:24:20Z</updated>
<author>
<name>Corentin Labbe</name>
</author>
<published>2022-05-02T20:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a1714ad1a33f7dcdebabd67cbe7af423ddefe2b'/>
<id>urn:sha1:8a1714ad1a33f7dcdebabd67cbe7af423ddefe2b</id>
<content type='text'>
Move all padding work to a dedicated function.

Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
