linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linux GPIO <linux-gpio@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 2/5] gpiolib: Initialize the hardware with a callback
Date: Thu, 10 Oct 2019 09:41:34 +0200	[thread overview]
Message-ID: <088f0d5a-1d1c-1868-038b-db01a509d106@redhat.com> (raw)
In-Reply-To: <20191010072622.GM32742@smile.fi.intel.com>

Hi,

On 10-10-2019 09:26, Andy Shevchenko wrote:
> On Thu, Oct 10, 2019 at 10:23:04AM +0300, Andy Shevchenko wrote:
>> On Wed, Oct 09, 2019 at 09:44:31PM +0200, Hans de Goede wrote:
>>> On 09-10-2019 18:50, Andy Shevchenko wrote:
>>>> After changing the drivers to use GPIO core to add an IRQ chip
>>>> it appears that some of them requires a hardware initialization
>>>> before adding the IRQ chip.
>>>>
>>>> Add an optional callback ->init_hw() to allow that drivers
>>>> to initialize hardware if needed.
>>>>
>>>> This change is a part of the fix NULL pointer dereference
>>>> brought to the several drivers recently.
>>>>
>>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>>
>>> Hmm, IIRC Linus Walleij already added a callback for initializing the
>>> mask before the irchip gets initialized which is basically intended for
>>> what you want this callback for I think ?
>>
>> This is not about the mask, it's about hardware to be prepared before enabling.
>> Also init_valid_mask() will allocate memory which won't be needed.
> 
> If you think this is not a proper approach, we have to revert all three patches
> now (*) and think about better solution.

If this is not about the valid-mask then this approach is probably fine,
sorry for the confusion. Lets wait and see what Linus Walleij has to say.

Regards,

Hans


  reply	other threads:[~2019-10-10  7:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 16:50 [GIT PULL] intel-gpio for 5.4-2 Andy Shevchenko
2019-10-09 16:50 ` [PATCH 1/5] gpio: merrifield: Restore use of irq_base Andy Shevchenko
2019-10-11 16:21   ` Ferry Toth
2019-10-09 16:50 ` [PATCH 2/5] gpiolib: Initialize the hardware with a callback Andy Shevchenko
2019-10-09 19:44   ` Hans de Goede
2019-10-10  7:23     ` Andy Shevchenko
2019-10-10  7:26       ` Andy Shevchenko
2019-10-10  7:41         ` Hans de Goede [this message]
2019-10-10 23:18   ` Linus Walleij
2019-10-09 16:50 ` [PATCH 3/5] gpio: intel-mid: Move hardware initialization to callback Andy Shevchenko
2019-10-09 16:50 ` [PATCH 4/5] gpio: lynxpoint: " Andy Shevchenko
2019-10-09 16:50 ` [PATCH 5/5] gpio: merrifield: " Andy Shevchenko
2019-10-11 16:23   ` Ferry Toth
2019-10-10 23:22 ` [GIT PULL] intel-gpio for 5.4-2 Linus Walleij
2019-10-11  8:35   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=088f0d5a-1d1c-1868-038b-db01a509d106@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).