Re: [PATCH] gpiolib: fix allocation of mixed dynamic/static GPIOs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 27, 2023 at 8:40 AM Christophe Leroy
<christophe.leroy@xxxxxxxxxx> wrote:
>
>
>
> Le 27/04/2023 à 00:03, Andreas Kemnade a écrit :
> > [Vous ne recevez pas souvent de courriers de andreas@xxxxxxxxxxxx. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> >
> > If static allocation and dynamic allocation GPIOs are present,
> > dynamic allocation pollutes the numberspace for static allocation,
> > causing static allocation to fail.
> > Enfore dynamic allocation above GPIO_DYNAMIC_BASE.
>
> Hum ....
>
> Commit 7b61212f2a07 ("gpiolib: Get rid of ARCH_NR_GPIOS") was supposed
> to enforce dynamic allocation above GPIO_DYNAMIC_BASE already.
>
> Can you describe what is going wrong exactly with the above commit ?

Above commit only works to the first dynamic allocation, if you need
more than one with static ones present it mistakenly will give you a
base _below_ DYNAMIC_BASE.

However, this change is just PoC I proposed, the conditional and
action should be slightly different to cover a corner case, when
statically allocated chip overlaps the DYNAMIC_BASE, i.e. gdev->base <
DYNAMIC_BASE, while gdev->base + gdev->ngpio >= DYNAMIC_BASE.


-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux