All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Timur Tabi <timur@codeaurora.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins
Date: Fri, 14 Jul 2017 15:04:22 -0700	[thread overview]
Message-ID: <20170714220422.GM22780@codeaurora.org> (raw)
In-Reply-To: <e8720afb-fbf9-2330-d4f6-89acb6e839cc@codeaurora.org>

On 07/14, Timur Tabi wrote:
> On 07/14/2017 04:46 PM, Stephen Boyd wrote:
> >Right, the gpiolib core would need to be updated to request the
> >gpio in gpiochip_add_data() around the loop where it goes and
> >configures things. And it could ignore ones that it can't request
> >there.
> 
> __gpiod_request already calls chip->request(), so this would need to
> be a temporary request.  It seems a bit hackish, but I'll try it.

Yeah, request, configure, free, in a loop. Unless someone is
aware why we don't do that here.

> 
> BTW, I noticed that __gpiod_free() does this:
> 
> 	if (chip->free) {
> 		spin_unlock_irqrestore(&gpio_lock, flags);
> --->		might_sleep_if(chip->can_sleep);
> 		chip->free(chip, gpio_chip_hwgpio(desc));
> 		spin_lock_irqsave(&gpio_lock, flags);
> 
> 
> Should __gpiod_request() also call might_sleep_if()?
> 
> 	if (chip->request) {
> 		/* chip->request may sleep */
> 		spin_unlock_irqrestore(&gpio_lock, flags);
> ---> missing call to might_sleep_if() here?
> 		status = chip->request(chip, gpio_chip_hwgpio(desc));
> 		spin_lock_irqsave(&gpio_lock, flags);
> 

Probably. Except we would have caught it earlier when it was
requested?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins
Date: Fri, 14 Jul 2017 15:04:22 -0700	[thread overview]
Message-ID: <20170714220422.GM22780@codeaurora.org> (raw)
In-Reply-To: <e8720afb-fbf9-2330-d4f6-89acb6e839cc@codeaurora.org>

On 07/14, Timur Tabi wrote:
> On 07/14/2017 04:46 PM, Stephen Boyd wrote:
> >Right, the gpiolib core would need to be updated to request the
> >gpio in gpiochip_add_data() around the loop where it goes and
> >configures things. And it could ignore ones that it can't request
> >there.
> 
> __gpiod_request already calls chip->request(), so this would need to
> be a temporary request.  It seems a bit hackish, but I'll try it.

Yeah, request, configure, free, in a loop. Unless someone is
aware why we don't do that here.

> 
> BTW, I noticed that __gpiod_free() does this:
> 
> 	if (chip->free) {
> 		spin_unlock_irqrestore(&gpio_lock, flags);
> --->		might_sleep_if(chip->can_sleep);
> 		chip->free(chip, gpio_chip_hwgpio(desc));
> 		spin_lock_irqsave(&gpio_lock, flags);
> 
> 
> Should __gpiod_request() also call might_sleep_if()?
> 
> 	if (chip->request) {
> 		/* chip->request may sleep */
> 		spin_unlock_irqrestore(&gpio_lock, flags);
> ---> missing call to might_sleep_if() here?
> 		status = chip->request(chip, gpio_chip_hwgpio(desc));
> 		spin_lock_irqsave(&gpio_lock, flags);
> 

Probably. Except we would have caught it earlier when it was
requested?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-07-14 22:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 21:52 [PATCH 0/2] pinctrl: qcom: add support for sparse GPIOs Timur Tabi
2017-07-13 21:52 ` Timur Tabi
2017-07-13 21:52 ` [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins Timur Tabi
2017-07-13 21:52   ` Timur Tabi
2017-07-14 16:44   ` Bjorn Andersson
2017-07-14 16:44     ` Bjorn Andersson
2017-07-14 17:01     ` Timur Tabi
2017-07-14 17:01       ` Timur Tabi
2017-07-14 17:35       ` Bjorn Andersson
2017-07-14 17:35         ` Bjorn Andersson
2017-07-14 17:11   ` Stephen Boyd
2017-07-14 17:11     ` Stephen Boyd
2017-07-14 17:17     ` Timur Tabi
2017-07-14 17:17       ` Timur Tabi
2017-07-14 17:23       ` Bjorn Andersson
2017-07-14 17:23         ` Bjorn Andersson
2017-07-14 21:43     ` Timur Tabi
2017-07-14 21:43       ` Timur Tabi
2017-07-14 21:46       ` Stephen Boyd
2017-07-14 21:46         ` Stephen Boyd
2017-07-14 22:01         ` Timur Tabi
2017-07-14 22:01           ` Timur Tabi
2017-07-14 22:04           ` Stephen Boyd [this message]
2017-07-14 22:04             ` Stephen Boyd
2017-07-13 21:52 ` [PATCH 2/2] pinctrl: qcom: qdf2xxx: add support for new ACPI HID QCOM8002 Timur Tabi
2017-07-13 21:52   ` Timur Tabi
2017-07-14 17:21   ` Bjorn Andersson
2017-07-14 17:21     ` Bjorn Andersson
2017-07-14 18:30     ` Timur Tabi
2017-07-14 18:30       ` Timur Tabi
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30  0:42 [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins Timur Tabi
2017-06-30  0:42 ` Timur Tabi

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=20170714220422.GM22780@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=timur@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.