[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFULd4YMAG=9D5+YhHjGz91VzKte7qWKpYdoWLEtN6d+r7XwFw@mail.gmail.com>
Date: Mon, 19 Aug 2024 10:31:01 +0200
From: Uros Bizjak <ubizjak@...il.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] clocksource/timer-of: Add missing casts to percpu address space
On Mon, Aug 19, 2024 at 10:18 AM Daniel Lezcano
<daniel.lezcano@...aro.org> wrote:
>
> On 19/08/2024 08:13, Uros Bizjak wrote:
> > Add missing casts to percpu address space to fix
> >
> > timer-of.c:29:46: warning: incorrect type in argument 2 (different address spaces)
> > timer-of.c:29:46: expected void [noderef] __percpu *
> > timer-of.c:29:46: got struct clock_event_device *clkevt
> > timer-of.c:74:51: warning: incorrect type in argument 4 (different address spaces)
> > timer-of.c:74:51: expected void [noderef] __percpu *percpu_dev_id
> > timer-of.c:74:51: got struct clock_event_device *clkevt
> >
> > sparse warnings.
> >
> > Found by GCC's named address space checks.
> >
> > There were no changes in the resulting object file.
>
> The warning may go away but the problem sparse is spotting is still there.
>
> IMO sparse is totally right and the code related to the percpu is
> broken. It seems the .percpu flag is never used in the drivers and we
> should be able to just remove the percpu related code in timer-of.c
This issue also breaks allyesconfig build on x86 when strict percpu
address space checker is enabled. However, I have little idea what the
code is doing, so I try to keep the proposed changes as non intrusive
as possible. The referred code is questionable as it tries to reuse
the clkevent pointer once as percpu pointer and once as generic
pointer, which should be avoided.
The only other issue flagged in clocksource drivers directory is
reported in [1] where generic request_irq() function apparently tries
to handle the percpu pointer.
[1] https://lore.kernel.org/lkml/20240730132015.8920-1-ubizjak@gmail.com/
Thanks,
Uros.
Powered by blists - more mailing lists