[Letux-kernel] LetuxOS: Kernel: m-stable 5.4.77 successful

Andreas Kemnade andreas at kemnade.info
Fri Nov 20 22:37:00 CET 2020


On Fri, 20 Nov 2020 22:26:16 +0100
Andreas Kemnade <andreas at kemnade.info> wrote:

> On Mon, 16 Nov 2020 15:20:24 +0100 (CET)
> hns at goldelico.com (H. Nikolaus Schaller) wrote:
> 
> > KVERSION: v5.4.77 - http://www.kernel.org
> > CONFIGS:  arch/arm/configs/letux_defconfig arch/arm/configs/letux_lpae_defconfig arch/mips/configs/letux_defconfig
> >   
> does not compile here
>   CC [M]  drivers/gpu/drm/omapdrm/omap_gem.o
> /home/andi/kernel/drivers/gpu/drm/omapdrm/omap_gem.c: In function ‘_omap_gem_unpin’:
> /home/andi/kernel/drivers/gpu/drm/omapdrm/omap_gem.c:886:28: error: passing argument 1 of ‘refcount_dec_and_test_checked’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>   if (refcount_dec_and_test(&omap_obj->dma_addr_cnt)) {
>                             ^~~~~~~~~~~~~~~~~~~~~~~
> In file included from /home/andi/kernel/include/linux/kref.h:17,
>                  from /home/andi/kernel/include/linux/kobject.h:23,
>                  from /home/andi/kernel/include/linux/device.h:16,
>                  from /home/andi/kernel/include/linux/dma-mapping.h:7,
>                  from /home/andi/kernel/drivers/gpu/drm/omapdrm/omap_gem.c:7:
> /home/andi/kernel/include/linux/refcount.h:54:68: note: expected ‘refcount_t *’ {aka ‘struct refcount_struct *’} but argument is of type ‘u32 *’ {aka ‘unsigned int *’}
>  extern __must_check bool refcount_dec_and_test_checked(refcount_t *r);
>                                                         ~~~~~~~~~~~~^
> cc1: some warnings being treated as errors
> 
> git blame:
> commit a882ed5f130ce0d467944a5d0a4d1e7259d815af
> Author: Matthijs van Duin <matthijsvanduin at gmail.com>
> Date:   Fri Jun 19 16:34:41 2020 +0100
> 
>     omapdrm: Use sg_table for dmabufs to enable width != 8192
>     
>     This fixes cases other than width=8k/stride=32k by using a proper
>     sg_table with multiple entries for dmabufs, mapping each line
>     to its correct TILER address.
>     
>     Original-by: Matthijs van Duin <matthijsvanduin at gmail.com>
>     Signed-off-by: David Shah <dave at ds0.me>
> 
> Hmm, letux-5.9 compiles, so any dangerous cherry-picking here?!
> 
the logic looks ill:
               return;
        if (omap_obj->dma_addr_cnt--)
                return;
        if (WARN_ON(!omap_obj->block))
                return;

        if (refcount_dec_and_test(&omap_obj->dma_addr_cnt)) {

That looks a bit duplicated here (besides of the type problem).
dma_addr_cnt will always be 0 if that if is reached.
And then the 0 is decremented and checked if it is zero?!


More information about the Letux-kernel mailing list