lkml.org 
[lkml]   [2018]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: protected pins and debugfs
On Wed, Oct 3, 2018 at 2:38 PM Sodagudi Prasad <psodagud@codeaurora.org> wrote:

> This is regarding the protected pins configuration reading and printing
> from non-secure operating systems.

I do not think anyone with security in mind should have debugfs
enabled. But maybe that is beside the point.

> GPIO framework is checking whether pin is in use(flag FLAG_REQUESTED) or
> not in gpiolib_dbg_show().
>
> If GPIO chip drivers are overriding the dbg_show callback, drivers are
> not checking whether a pin is really in use or not to print
> configuration details.
> if (chip->dbg_show)
> chip->dbg_show(s, chip);
> else
> gpiolib_dbg_show(s, gdev);

Ah that is right. Because some drivers can inspect all pins whether they
are requested or not.

> Can we use a simple/common solution like below? It will check whether a
> pin is in use or not before printing configuration data with the help of
> gpiochip_is_requested().

In the msm case I think maybe you want to inspect the valid_mask
instead, so you display debugfs info for all pins you can inspect
in hardware but avoid the "invalid" ones which I half-guess is used
by ACPI in your case.

Yours,
Linus Walleij

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