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

Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL



Hello Roger,

On 01/14/2016 04:43 PM, Roger Shimizu wrote:
> On Thu, Jan 14, 2016 at 11:32 PM, Roger Shimizu <rogershimizu@gmail.com> wrote:
>> On Thu, Jan 14, 2016 at 11:08 PM, Uwe Kleine-König
>> <uwe+debian@kleine-koenig.org> wrote:
>>>>>> I need to run the following command to enable USB port on Linkstation
>>>>>> LS-WXL/WSXL (armel/kirkwood with DTS [0] ):
>>>>>>   echo 37 >/sys/class/gpio/export
>>>>>>   echo out > /sys/class/gpio/gpio37/direction
>>>>>>   echo 1 > /sys/class/gpio/gpio37/value
>>>
>>> Can you post the contents of /sys/kernel/debug/gpio when the broken
>>> kernel is running?
>>
>> Thanks for the debugging tool!
>> It seems there's clue ...
>>
>> Here's the log for working & non-working kernel:
>>
>> # uname -a
>> Linux LS-WXL 4.2.0-0.bpo.1-kirkwood #1 Debian 4.2.6-3~bpo8+2
>> (2015-12-14) armv5tel GNU/Linux
>> # mount -t debugfs none /sys/kernel/debug

For me this doesn't need to be mounted explicitly. Maybe the relevant
difference is that I'm using systemd and you don't?

>> # cat  /sys/kernel/debug/gpio
>> GPIOs 0-31, platform/f1010100.gpio, f1010100.gpio:
>>  gpio-28  (HDD0 Power          ) out hi
>>  gpio-29  (HDD1 Power          ) out hi
>>
>> GPIOs 32-49, platform/f1010140.gpio, f1010140.gpio:
>>  gpio-34  (?                   ) out hi
>>  gpio-35  (?                   ) out hi
>>  gpio-37  (?                   ) out lo
>>  gpio-38  (?                   ) out hi
>>  gpio-40  (?                   ) out hi

This is the kernel where exporting works? I don't understand that one.
Is this before or after exporting the gpio to userspace?

>> # uname -a
>> Linux LS-WXL 3.16.0-4-kirkwood #1 Debian 3.16.7-ckt7-1 (2015-03-01)
>> armv5tel GNU/Linux
>> # mount -t debugfs none /sys/kernel/debug
>> # cat  /sys/kernel/debug/gpio
>> GPIOs 0-31, platform/f1010100.gpio, f1010100.gpio:
>>  gpio-28  (HDD0 Power          ) out hi
>>  gpio-29  (HDD1 Power          ) out hi
>>
>> GPIOs 32-49, platform/f1010140.gpio, f1010140.gpio:
>>  gpio-34  (lswxl:red:hdderr0   ) out hi
>>  gpio-35  (lswxl:red:hdderr1   ) out hi
>>  gpio-37  (lswxl:red:func      ) out lo
>>  gpio-38  (lswxl:amber:info    ) out hi
>>  gpio-40  (lswxl:blue:power    ) out hi
> 
> For above gpio-XX and it's string, I know there're gpio pin definition
> errors for gpio 32-49.
> Now I understand gpio 32-49 should be defined as gpio1 XX, and XX
> should be real pinnumber - 32.
> e.g. GPIO 37 should be defined as "gpio1 5"

Yeah, when looking at the dts link you provided I wondered about the 37
in there. But not enough to mention it here.

> After I modified DTS as above new gpio[01] pinnumber, the debug info is like:
> 
> GPIOs 0-31, platform/f1010100.gpio, f1010100.gpio:
>  gpio-28  (HDD0 Power          ) out hi
>  gpio-29  (HDD1 Power          ) out hi
> 
> GPIOs 32-49, platform/f1010140.gpio, f1010140.gpio:
>  gpio-37  (USB Power           ) out hi
>  gpio-41  (Function Button     ) in  hi (act lo) - IRQ edge  (clear  )
>  gpio-42  (Power-on Switch     ) in  lo (act hi) - IRQ edge  (clear  )
>  gpio-43  (Power-auto Switch   ) in  hi (act lo) - IRQ edge  (clear  )
> 
> So gpio-37 is HIGH by default now.
> Although gpio export is still not working on previously reported
> kernel version, my problem seems get solved.

When a gpio is in use by a driver it is normal and expected that you
cannot export it to userspace. So I'm not sure what is the remaining
problem now. Also I failed to see the commit that made the difference
for you when (quickly) looking through the differences between
3.16.7-ckt4-3 and 3.16.7-ckt7-1.

Best regards
Uwe


Reply to: