Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #52203

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

From Roger Shimizu <rogershimizu@gmail.com>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL
Date 2016-01-15 15:40 +0100
Message-ID <qRdHH-7q5-9@gated-at.bofh.it> (permalink)
References (2 earlier) <qQD1w-6Mu-11@gated-at.bofh.it> <qQQUO-8fS-7@gated-at.bofh.it> <qQRe9-8oq-1@gated-at.bofh.it> <qQSjU-Dz-7@gated-at.bofh.it> <qR7LY-3lR-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


Dear Uwe,

On Fri, Jan 15, 2016 at 5:12 PM, Uwe Kleine-König
<uwe+debian@kleine-koenig.org> wrote:
> On 01/14/2016 04:43 PM, Roger Shimizu wrote:
>>> # 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?

It's an armel box with only 128M memory.
I prefer sysvinit because I use less memory.

>>> # 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?

After I fixed GPIO pin in updated DT, the USB port is enabled by default.

# uname -a
Linux LS-WXL 3.16.0-4-kirkwood #1 Debian 3.16.7-ckt20-1+deb8u2
(2016-01-02) armv5tel GNU/Linux
# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/f1010100.gpio, f1010100.gpio:
 gpio-8   (lswxl:red:hdderr0   ) out hi
 gpio-28  (HDD0 Power          ) out hi
 gpio-29  (HDD1 Power          ) out hi

GPIOs 32-49, platform/f1010140.gpio, f1010140.gpio:
 gpio-34  (lswxl:red:func      ) out lo
 gpio-36  (lswxl:blue:func     ) out hi
 gpio-37  (USB Power           ) out hi
 gpio-38  (lswxl:amber:info    ) out hi
 gpio-39  (lswxl:blue: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  )
 gpio-46  (lswxl:red:hdderr1   ) out hi
 gpio-49  (lswxl:red:alarm     ) out hi

But result of kernel 4.x is bit differrent:

# 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
# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/f1010100.gpio, f1010100.gpio:
 gpio-8   (?                   ) out hi
 gpio-28  (HDD0 Power          ) out hi
 gpio-29  (HDD1 Power          ) out hi

GPIOs 32-49, platform/f1010140.gpio, f1010140.gpio:
 gpio-34  (?                   ) out lo
 gpio-36  (?                   ) out hi
 gpio-37  (USB Power           ) out hi
 gpio-38  (?                   ) out hi
 gpio-39  (?                   ) 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  )
 gpio-46  (?                   ) out hi
 gpio-49  (?                   ) out hi

>> 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.

Yes, now I know it's used by other drivers such as gpio-leds driver,
which is working well.
For the changes in 3.16.7-ckt7-1, I guess it's related to error
handling of gpio's pin.
It become more strict on gpio pin error.

So far, all my problems has been solved, so I'm going to close this bug report.
I'll do more test on my updated DTS, and submit to upstream when I
feel it's ready.

Thanks for helping!

Cheers,
Roger

Back to linux.debian.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-13 14:20 +0100
  Processed: Re: Bug#810894: src:linux: GPIO probe failure on  Linkstation LS-WXL/WSXL owner@bugs.debian.org (Debian Bug Tracking System) - 2016-01-13 14:30 +0100
  Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Uwe Kleine-König <uwe+debian@kleine-koenig.org> - 2016-01-13 20:30 +0100
    Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-14 00:30 +0100
      Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Ben Hutchings <ben@decadent.org.uk> - 2016-01-14 01:00 +0100
        Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-14 14:50 +0100
      Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Uwe Kleine-König <uwe+debian@kleine-koenig.org> - 2016-01-14 15:20 +0100
        Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-14 15:40 +0100
          Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> - 2016-01-14 16:40 +0100
            Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-14 17:00 +0100
              Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-15 01:10 +0100
          Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-14 16:50 +0100
            Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Uwe Kleine-König <uwe+debian@kleine-koenig.org> - 2016-01-15 09:20 +0100
              Bug#810894: src:linux: GPIO probe failure on Linkstation LS-WXL/WSXL Roger Shimizu <rogershimizu@gmail.com> - 2016-01-15 15:40 +0100

csiph-web