[lkml]   [2018]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Bug introduced in the of_get_named_gpiod_flags function.

On 11.10.2018 10:27, Linus Walleij wrote:
> Hi Wojciech,
> (Thanks also Randy for forwarding this!)
> On Wed, Oct 10, 2018 at 6:32 PM wzab <> wrote:
>> The function of_get_named_gpiod_flags in older versions of the kernel
>> (up to 4.7.10 - )
>> contained an important workaround:
>> /* .of_xlate might decide to not fill in the flags, so clear it. */if (flags)
>> *flags = 0; Unfortunately, newer kernels do not contain it. Therefore if the
>> "xlat" function in the gpiochip driver does not set flags, (like e.g.
>> the Xilinx AXI GPIO driver: )
>> the random, unitialized value from the stack in of_find_gpio
>> ( )
>> is used, which results in random settings of e.g., OPEN DRAIN or OPEN SOURCE mode.
>> I have also reported the problem in the Xilinx forum:
> It seems the commit removing this is:
> commit 762c2e46c0591d207289105c8718e4adf29b2b34
> "gpio: of: remove of_gpiochip_and_xlate() and struct gg_data"
> But I honestly don't see a problem with it.
> You are referencing an out-of-tree driver. Use the in-tree gpio-xilinx.c
> that does not do any custom xlate and you will be fine.
> I looked over the driver doing custom flag translation in the kernel tree,
> and they all set flags, so this is not a problem in the upstream kernel.

There was an attempt to sync up xilinx internal gpio driver with
mainline by someone else but not sure what's the status.
If you have issue with xilinx internal patch please talk to us.
If the problem is with mainline please use this mailing list.


 \ /
  Last update: 2018-10-12 10:56    [W:0.093 / U:9.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site