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: <07601454-6cdb-5eff-3d4e-6169aa649e10@ti.com>
Date:   Fri, 13 Jan 2017 09:24:42 +0530
From:   Keerthy <j-keerthy@...com>
To:     Linus Walleij <linus.walleij@...aro.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        Alexandre Courbot <gnurou@...il.com>,
        Tero Kristo <t-kristo@...com>
Subject: Re: [PATCH 2/2] gpio: davinci: Remove gpio2regs function to
 accommodate multi instances



On Wednesday 11 January 2017 09:23 PM, Linus Walleij wrote:
> On Wed, Jan 11, 2017 at 1:40 PM, Keerthy <j-keerthy@...com> wrote:
>> On Wednesday 11 January 2017 04:34 PM, Linus Walleij wrote:
>>> On Wed, Jan 4, 2017 at 9:26 AM, Keerthy <j-keerthy@...com> wrote:
>>>
>>>> gpio2regs is written making an assumption that driver supports only
>>>> one instance of gpio controller. Removing this and adding a generic
>>>> array so as to support multiple instances of gpio controllers.
>>>>
>>>> Signed-off-by: Keerthy <j-keerthy@...com>
>>>
>>>
>>>> -               regs = gpio2regs(base);
>>>> +               regs = gpio_base + offset_array[i];
>>>
>>>
>>> I understand this.
>>>
>>>> -       struct davinci_gpio_regs __iomem *g = gpio2regs(hw);
>>>> +       struct davinci_gpio_controller *chips =
>>>> +                               (struct davinci_gpio_controller
>>>> *)d->host_data;
>>>> +       struct davinci_gpio_regs __iomem *g = chips[hw / 32].regs;
>>>
>>>
>>> And this, if each instans has 32 GPIOs.
>>>
>>>> -               g = gpio2regs(0);
>>>> +               g = chips[0].regs;
>>>
>>>
>>> Also makes sense.
>>>
>>>> -               g = gpio2regs(gpio);
>>>> +               g = chips[bank / 2].regs;
>>>
>>>
>>> But what is this? I don't understand that /2 at all. Please insert a
>>> comment explaining it so I can figure it out. Are there two banks
>>> per instance?
>>
>>
>> Yes! There are register sets for 32 GPIOs. 2 banks of 16 GPIOs are covered
>> by each set of registers hence /2. Shall i add a comment and send this patch
>> alone separately?
>
> Yeah.
>
> I am currently confused by several patch sets for davinci in my inbox,
> can you rebase on my devel branch when I push it and resend
> *all* you have cooking for DaVinci?

I am assuming that Patch 1 from this is applied. I will club this one 
along with my latest series and send a new v2 series so that all are in 
one place.

Thanks,
Keerthy
>
> Yours,
> Linus Walleij
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ