<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-op-linux/drivers/soc/fsl, branch master</title>
<subtitle>Talos™ II Linux sources for OpenPOWER</subtitle>
<id>https://git.raptorcs.com/git/talos-op-linux/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-op-linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/'/>
<updated>2020-01-08T22:02:48+00:00</updated>
<entry>
<title>soc: fsl: qe: remove set but not used variable 'mm_gc'</title>
<updated>2020-01-08T22:02:48+00:00</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2020-01-08T13:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=6e62bd36e9ad85a22d92b1adce6a0336ea549733'/>
<id>urn:sha1:6e62bd36e9ad85a22d92b1adce6a0336ea549733</id>
<content type='text'>
drivers/soc/fsl/qe/gpio.c: In function qe_pin_request:
drivers/soc/fsl/qe/gpio.c:163:26: warning: variable mm_gc set but not used [-Wunused-but-set-variable]

commit 1e714e54b5ca ("powerpc: qe_lib-gpio: use gpiochip data pointer")
left behind this unused variable.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Chen Zhou &lt;chenzhou10@huawei.com&gt;
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE</title>
<updated>2019-12-09T19:57:45+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=5a35435ef4e6e4bd2aabd6706b146b298a9cffe5'/>
<id>urn:sha1:5a35435ef4e6e4bd2aabd6706b146b298a9cffe5</id>
<content type='text'>
There are also PPC64, ARM and ARM64 based SOCs with a QUICC Engine,
and the core QE code as well as net/wan/fsl_ucc_hdlc and
tty/serial/ucc_uart has now been modified to not rely on ppcisms.

So extend the architectures that can select QUICC_ENGINE, and add the
rather modest requirements of OF &amp;&amp; HAS_IOMEM.

The core code as well as the ucc_uart driver has been tested on an
LS1021A (arm), and it has also been tested that the QE code still
works on an mpc8309 (ppc). Qiang Zhao has tested that the QE-HDLC code
that gets enabled with this works on ARM64.

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: remove unused #include of asm/irq.h from ucc.c</title>
<updated>2019-12-09T19:57:45+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=8d70df8b88a2c365a198003f2ae0df19d0825b91'/>
<id>urn:sha1:8d70df8b88a2c365a198003f2ae0df19d0825b91</id>
<content type='text'>
When allowing this driver to be built for ARM, the build fails (for
CONFIG_SMP=y) since ARM's asm/irq.h header is not self-contained:

  In file included from drivers/soc/fsl/qe/ucc.c:18:0:
&gt;&gt; arch/arm/include/asm/irq.h:34:50: error: unknown type name 'cpumask_t'
    extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,

But nothing in this file actually uses anything from asm/irq.h -
removing this #include generates identical object code, both on PPC32
and on ARM (the latter with a patch added to asm/irq.h to make the
build work in the first place).

Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c</title>
<updated>2019-12-09T19:54:37+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=c93c159aefb089e79def966b99079b585c9108e2'/>
<id>urn:sha1:c93c159aefb089e79def966b99079b585c9108e2</id>
<content type='text'>
When building this on a 64-bit platform gcc rightly warns that the
error checking is broken (-ENOMEM stored in an u32 does not compare
greater than (unsigned long)-MAX_ERRNO). Instead, change the
ucc_fast_[tr]x_virtual_fifo_base_offset members to s32 and use an
ordinary check-for-negative. Also, this avoids treating 0 as "this
cannot have been returned from qe_muram_alloc() so don't free it".

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: drop pointless check in qe_sdma_init()</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=71352b8c4016fbf24e5244877c2ebf93eb9d4c73'/>
<id>urn:sha1:71352b8c4016fbf24e5244877c2ebf93eb9d4c73</id>
<content type='text'>
The sdma member of struct qe_immap is not at offset zero, so even if
qe_immr wasn't initialized yet (i.e. NULL), &amp;qe_immr-&gt;sdma would not
be NULL.

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: drop use of IS_ERR_VALUE in qe_sdma_init()</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=4c3e565cc6237e0fc9b60e34420456a7b3fc74f6'/>
<id>urn:sha1:4c3e565cc6237e0fc9b60e34420456a7b3fc74f6</id>
<content type='text'>
Now that qe_muram_alloc() returns s32, adapt qe_sdma_init() and avoid
another few IS_ERR_VALUE() uses.

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=611780a6aa500345360bcda8a6dfdcd0666d4695'/>
<id>urn:sha1:611780a6aa500345360bcda8a6dfdcd0666d4695</id>
<content type='text'>
When trying to build this for a 64-bit platform, one gets warnings
from using IS_ERR_VALUE on something which is not sizeof(long).

Instead, change the various *_offset fields to store a signed integer,
and simply check for a negative return from qe_muram_alloc(). Since
qe_muram_free() now accepts and ignores a negative argument, we only
need to make sure these fields are initialized with -1, and we can
just unconditionally call qe_muram_free() in ucc_slow_free().

Note that the error case for us_pram_offset failed to set that field
to 0 (which, as noted earlier, is anyway a bogus sentinel value).

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error path</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=ec2058ac8f507865f7a7c353473bf0f4ebce5fc0'/>
<id>urn:sha1:ec2058ac8f507865f7a7c353473bf0f4ebce5fc0</id>
<content type='text'>
If the kmalloc() fails, we try to undo the gen_pool allocation we've
just done. Unfortunately, start has already been modified to subtract
the GENPOOL_OFFSET bias, so we're freeing something that very likely
doesn't exist in the gen_pool, meaning we hit the

 kernel BUG at lib/genalloc.c:399!
 Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
 ...
 [&lt;803fd0e8&gt;] (gen_pool_free) from [&lt;80426bc8&gt;] (cpm_muram_alloc_common+0xb0/0xc8)
 [&lt;80426bc8&gt;] (cpm_muram_alloc_common) from [&lt;80426c28&gt;] (cpm_muram_alloc+0x48/0x80)
 [&lt;80426c28&gt;] (cpm_muram_alloc) from [&lt;80428214&gt;] (ucc_slow_init+0x110/0x4f0)
 [&lt;80428214&gt;] (ucc_slow_init) from [&lt;8044a718&gt;] (qe_uart_request_port+0x3c/0x1d8)

(this was tested by just injecting a random failure by adding
"|| (get_random_int()&amp;7) == 0" to the "if (!entry)" condition).

Refactor the code so we do the kmalloc() first, meaning that's the
thing that needs undoing in case gen_pool_alloc_algo() then
fails. This allows a later cleanup to move the locking from the
callers into the _common function, keeping the kmalloc() out of the
critical region and then, hopefully (if all the muram_alloc callers
allow) change it to a GFP_KERNEL allocation.

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: drop broken lazy call of cpm_muram_init()</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=b6231ea2b3c68101da186f0d274635a620dbf7a4'/>
<id>urn:sha1:b6231ea2b3c68101da186f0d274635a620dbf7a4</id>
<content type='text'>
cpm_muram_alloc_common() tries to support a kind of lazy
initialization - if the muram_pool has not been created yet, it calls
cpm_muram_init(). Now, cpm_muram_alloc_common() is always called under

	spin_lock_irqsave(&amp;cpm_muram_lock, flags);

and cpm_muram_init() does gen_pool_create() (which implies a
GFP_KERNEL allocation) and ioremap(), not to mention the fun that
ensues from cpm_muram_init() doing

	spin_lock_init(&amp;cpm_muram_lock);

In other words, this has never worked, so nobody can have been relying
on it.

cpm_muram_init() is called from a subsys_initcall (either from
cpm_init() in arch/powerpc/sysdev/cpm_common.c or, via qe_reset(),
from qe_init() in drivers/soc/fsl/qe/qe.c).

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>soc: fsl: qe: make cpm_muram_free() ignore a negative offset</title>
<updated>2019-12-09T19:54:36+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-11-28T14:55:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-op-linux/commit/?id=900470ce39996336a1d06da2015506106bb8ba42'/>
<id>urn:sha1:900470ce39996336a1d06da2015506106bb8ba42</id>
<content type='text'>
This allows one to simplify callers since they can store a negative
value as a sentinel to indicate "this was never allocated" (or store
the -ENOMEM from an allocation failure) and then call cpm_muram_free()
unconditionally.

Reviewed-by: Timur Tabi &lt;timur@kernel.org&gt;
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Li Yang &lt;leoyang.li@nxp.com&gt;
</content>
</entry>
</feed>
