Re: [PATCH 1/2] pinctrl: qcom: disable GPIO groups with no pins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux