lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1578482850.7554.18.camel@mtkswgap22>
Date:   Wed, 8 Jan 2020 19:27:30 +0800
From:   Hanks Chen <hanks.chen@...iatek.com>
To:     Linus Walleij <linus.walleij@...aro.org>
CC:     Rob Herring <robh@...nel.org>, CC Hwang <cc.hwang@...iatek.com>,
        <wsd_upstream@...iatek.com>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>, Stephen Boyd <sboyd@...nel.org>,
        Sean Wang <sean.wang@...nel.org>,
        Loda Chou <loda.chou@...iatek.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Marc Zyngier <marc.zyngier@....com>,
        "Mars Cheng" <mars.cheng@...iatek.com>,
        mtk01761 <wendell.lin@...iatek.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        linux-clk <linux-clk@...r.kernel.org>
Subject: Re: [PATCH v2 05/11] pinctrl: mediatek: avoid virtual gpio trying
 to set reg

On Tue, 2020-01-07 at 11:20 +0100, Linus Walleij wrote:
> On Mon, Dec 23, 2019 at 4:11 AM Hanks Chen <hanks.chen@...iatek.com> wrote:
> > On Fri, 2019-08-23 at 10:57 +0200, Linus Walleij wrote:
> > > On Mon, Aug 19, 2019 at 11:22 AM Mars Cheng <mars.cheng@...iatek.com> wrote:
> 
> > > This does not explain what a "virtual GPIO" is in this
> > > context, so please elaborate. What is this? Why does
> > > it exist? What is it used for?
> > >
> > > GPIO is "general purpose input/output" and it is a
> > > pretty rubbery category already as it is, so we need
> > > to define our terms pretty strictly.
> > >
> > Virtual GPIO only used inside SOC and not being exported to outside SOC
> > in MTK platform. Some modules use virtual GPIO as eint (e.g. pmic or
> > usb).
> 
> I would call that internal GPIOs, those are very real rails inside
> the chip made with polysilicone so there is nothing "virtual"
> about them. If the documentation for the chip calls them virtual
> then explain in the driver that these are SoC-internal
> lines so that everyone will get it.
> 

Got it, I will add the info into the driver in v3 

> Is the PMIC inside the SoC? I thought that was usually outside of it
> in its own chip.
> 
> But I suppose there could be some interface to it in the SoC and
> then that interface has this EINT?
> 

That's right. I use incorrect word.
e.g. pmic interface inside the SOC (PMIF), not pmic...

> > In MTK platform, external interrupt (EINT) and GPIO is 1-1 mapping and
> > we can set GPIO as eint.
> > But some modules use specific eint which doesn't have real GPIO pin.
> > So we use virtual GPIO to map it.
> 
> OK I get it I think... just put these comments into the code as well
> so we understand when reading the code what is going on.

Got it, will add the comments in v3. Thanks for reviewing.

> 
> > > > +       if (mtk_is_virt_gpio(hw, gpio))
> > > > +               return 1;
> > >
> > > Why are "virtual GPIOs" always inputs?
> >
> > We set virtual GPIO as eint.
> > It mean virtual GPIO only used inside SOC and not being exported to
> > outside SOC.
> 
> Are you saying that:
> - "Virtual" GPIOs are always and only used for interrupts
> - Since they are only used for interrupts, they are always inputs
> 
> Then write that in a comment to the above change so we know
> this context.
> 

Yes, virtual GPIOs are always and only used for interrupts in mtk
platform. I'll add the comments in v3. Thanks for reviewing

> Yours,
> Linus Walleij
> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ