public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Hugo <jhugo@codeaurora.org>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Timur Tabi <timur@kernel.org>, Stephen Boyd <swboyd@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v2] gpiolib: Show correct direction from the beginning
Date: Mon, 1 Oct 2018 08:27:39 -0600	[thread overview]
Message-ID: <79878ad4-1c2a-39fa-5baa-042140a6f1ad@codeaurora.org> (raw)
In-Reply-To: <CAPybu_1P-RWCP8yjQKkFYAX11KtYGhAfASY24Q_NZ19PD09gxA@mail.gmail.com>

On 10/1/2018 7:36 AM, Ricardo Ribalda Delgado wrote:
> Hi Linus
> On Mon, Oct 1, 2018 at 1:54 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>>
>> On Fri, Sep 28, 2018 at 9:30 PM Ricardo Ribalda Delgado
>> <ricardo.ribalda@gmail.com> wrote:
>>
>>> How do we proceed from here? Can you fix your driver somehow to
>>> init the valid mask before enabling the gpio?
>>
>> Just include a hunk to the qcom driver reordering this call
>> at the same time. No need to make it separate patches,
>> it need to be tested together anyways.
>>
>> I guess just switch the order of these two:
>>
>>          ret = gpiochip_add_data(&pctrl->chip, pctrl);
>>          if (ret) {
>>                  dev_err(pctrl->dev, "Failed register gpiochip\n");
>>                  return ret;
>>          }
>>
>>          ret = msm_gpio_init_valid_mask(chip, pctrl);
>>          if (ret) {
>>                  dev_err(pctrl->dev, "Failed to setup irq valid bits\n");
>>                  gpiochip_remove(&pctrl->chip);
>>                  return ret;
>>          }
>>
> 
> the problem is that valid_mask is not a long/integer, is a struct that
> needs to be malloced, and is malloc at gpiochip_add_data :(
> 
> Maybe we need a callback from the driver to init that mask just after
> the allocation?
> 
> A fast grep shows that the only driver using need_valid_mask (not for
> irq) is msm:
> 
> ricardo@neopili:~/curro/kernel-upstream$ git grep "need_valid_mask ="
> | grep -v irq
> drivers/gpio/gpiolib.c: gpiochip->need_valid_mask = true;
> drivers/pinctrl/intel/pinctrl-cherryview.c: bool need_valid_mask =
> !dmi_check_system(chv_no_valid_mask);
> drivers/pinctrl/qcom/pinctrl-msm.c: chip->need_valid_mask =
> msm_gpio_needs_valid_mask(pctrl);
> 
> so hacking something in the driver might not be a terrible idea.
> 

IMO, hack up the driver and I'll test it.  We can figure out what is 
needed to work, then determine what is the proper solution for that.

-- 
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

  reply	other threads:[~2018-10-01 14:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 10:36 [PATCH] gpiolib: Fix gpio_direction_* for single direction GPIOs Ricardo Ribalda Delgado
2018-09-21 10:36 ` [PATCH v2] gpiolib: Show correct direction from the beginning Ricardo Ribalda Delgado
2018-09-21 12:25   ` Timur Tabi
2018-09-27  6:51   ` Stephen Boyd
2018-09-27 12:19     ` Timur Tabi
2018-09-27 14:04       ` Jeffrey Hugo
2018-09-27 14:19         ` Timur Tabi
2018-09-27 14:34           ` Jeffrey Hugo
2018-09-28 19:14         ` Jeffrey Hugo
2018-09-28 19:22           ` Timur Tabi
2018-09-29  6:23             ` Ricardo Ribalda Delgado
2018-09-29 13:21               ` Timur Tabi
2018-09-29 13:25                 ` Timur Tabi
     [not found]             ` <D3E6F4C4-E1C4-4D88-B118-878576BF5281@gmail.com>
2018-10-01 11:54               ` Linus Walleij
2018-10-01 13:36                 ` Ricardo Ribalda Delgado
2018-10-01 14:27                   ` Jeffrey Hugo [this message]
2018-10-01 21:20                   ` Linus Walleij
2018-10-02  7:15                     ` Ricardo Ribalda Delgado
2018-10-02  7:38                       ` Linus Walleij
2018-10-02 12:26                         ` Timur Tabi
2018-10-02 12:51                           ` Linus Walleij
2018-09-25  7:36 ` [PATCH] gpiolib: Fix gpio_direction_* for single direction GPIOs Linus Walleij

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=79878ad4-1c2a-39fa-5baa-042140a6f1ad@codeaurora.org \
    --to=jhugo@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    --cc=swboyd@chromium.org \
    --cc=timur@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