linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2022-10-24 14:02 Thierry Reding
@ 2022-10-26  7:06 ` Prathamesh Shete
  2022-11-08 10:34   ` Linus Walleij
  2022-11-08 13:29   ` Thierry Reding
  0 siblings, 2 replies; 11+ messages in thread
From: Prathamesh Shete @ 2022-10-26  7:06 UTC (permalink / raw)
  To: thierry.reding, linus.walleij, bgolaszewski, jonathanh,
	linux-gpio, linux-tegra, linux-kernel
  Cc: smangipudi, pshete, kyarlagadda, Manish Bhardwaj

This patch fixes the issue where even if PMC driver status is
disabled still we are trying to look up for the IRQ domain
that PMC driver would've registered if it had been enabled.

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
---
 drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index 54d9fa7da9c1..b99756037ed4 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -896,11 +896,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 
 	np = of_find_matching_node(NULL, tegra186_pmc_of_match);
 	if (np) {
-		irq->parent_domain = irq_find_host(np);
-		of_node_put(np);
-
-		if (!irq->parent_domain)
-			return -EPROBE_DEFER;
+		if (of_device_is_available(np)) {
+			irq->parent_domain = irq_find_host(np);
+			of_node_put(np);
+
+			if (!irq->parent_domain)
+				return -EPROBE_DEFER;
+		} else {
+			of_node_put(np);
+		}
 	}
 
 	irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2022-10-26  7:06 ` [PATCH v2] " Prathamesh Shete
@ 2022-11-08 10:34   ` Linus Walleij
  2022-11-08 13:29   ` Thierry Reding
  1 sibling, 0 replies; 11+ messages in thread
From: Linus Walleij @ 2022-11-08 10:34 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: thierry.reding, bgolaszewski, jonathanh, linux-gpio, linux-tegra,
	linux-kernel, smangipudi, kyarlagadda, Manish Bhardwaj

On Wed, Oct 26, 2022 at 9:06 AM Prathamesh Shete <pshete@nvidia.com> wrote:

> This patch fixes the issue where even if PMC driver status is
> disabled still we are trying to look up for the IRQ domain
> that PMC driver would've registered if it had been enabled.
>
> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2022-10-26  7:06 ` [PATCH v2] " Prathamesh Shete
  2022-11-08 10:34   ` Linus Walleij
@ 2022-11-08 13:29   ` Thierry Reding
  1 sibling, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2022-11-08 13:29 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: linus.walleij, bgolaszewski, jonathanh, linux-gpio, linux-tegra,
	linux-kernel, smangipudi, kyarlagadda, Manish Bhardwaj

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

On Wed, Oct 26, 2022 at 12:36:14PM +0530, Prathamesh Shete wrote:
> This patch fixes the issue where even if PMC driver status is
> disabled still we are trying to look up for the IRQ domain
> that PMC driver would've registered if it had been enabled.
> 
> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> ---
>  drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] gpio: tegra186: Check PMC driver status before any request
@ 2023-06-06  7:17 Prathamesh Shete
  2023-06-06  8:53 ` Jon Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Prathamesh Shete @ 2023-06-06  7:17 UTC (permalink / raw)
  To: linus.walleij, brgl, thierry.reding, jonathanh, linux-tegra,
	linux-gpio, linux-kernel
  Cc: smangipudi, pshete, Manish Bhardwaj

This patch fixes the issue where even if PMC driver status is
disabled still we are trying to look up for the IRQ domain
that PMC driver would've registered if it had been enabled.

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
---
 drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index 464b0ea3b6f1..80d08ddde40e 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 
 	np = of_find_matching_node(NULL, tegra186_pmc_of_match);
 	if (np) {
-		irq->parent_domain = irq_find_host(np);
-		of_node_put(np);
-
-		if (!irq->parent_domain)
-			return -EPROBE_DEFER;
+		if (of_device_is_available(np)) {
+			irq->parent_domain = irq_find_host(np);
+			of_node_put(np);
+
+			if (!irq->parent_domain)
+				return -EPROBE_DEFER;
+		} else {
+			of_node_put(np);
+		}
 	}
 
 	irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] gpio: tegra186: Check PMC driver status before any request
  2023-06-06  7:17 [PATCH] gpio: tegra186: Check PMC driver status before any request Prathamesh Shete
@ 2023-06-06  8:53 ` Jon Hunter
  2023-06-07 10:55   ` Jon Hunter
  2023-06-06  9:48 ` [PATCH] " andy.shevchenko
  2023-06-09  7:18 ` Linus Walleij
  2 siblings, 1 reply; 11+ messages in thread
From: Jon Hunter @ 2023-06-06  8:53 UTC (permalink / raw)
  To: Prathamesh Shete, linus.walleij, brgl, thierry.reding,
	linux-tegra, linux-gpio, linux-kernel
  Cc: smangipudi, Manish Bhardwaj


On 06/06/2023 08:17, Prathamesh Shete wrote:
> This patch fixes the issue where even if PMC driver status is
> disabled still we are trying to look up for the IRQ domain
> that PMC driver would've registered if it had been enabled.

It might be clearer to say ...

When the PMC device is disabled, probing of the Tegra186 GPIO driver 
fails because the IRQ domain that is registered by the PMC driver is not 
found. Fix this by checking to see if the PMC device is enabled before 
attempting to lookup the IRQ domain registered by the PMC.

Otherwise ...

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> ---
>   drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
> index 464b0ea3b6f1..80d08ddde40e 100644
> --- a/drivers/gpio/gpio-tegra186.c
> +++ b/drivers/gpio/gpio-tegra186.c
> @@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
>   
>   	np = of_find_matching_node(NULL, tegra186_pmc_of_match);
>   	if (np) {
> -		irq->parent_domain = irq_find_host(np);
> -		of_node_put(np);
> -
> -		if (!irq->parent_domain)
> -			return -EPROBE_DEFER;
> +		if (of_device_is_available(np)) {
> +			irq->parent_domain = irq_find_host(np);
> +			of_node_put(np);
> +
> +			if (!irq->parent_domain)
> +				return -EPROBE_DEFER;
> +		} else {
> +			of_node_put(np);
> +		}
>   	}
>   
>   	irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,

-- 
nvpublic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gpio: tegra186: Check PMC driver status before any request
  2023-06-06  7:17 [PATCH] gpio: tegra186: Check PMC driver status before any request Prathamesh Shete
  2023-06-06  8:53 ` Jon Hunter
@ 2023-06-06  9:48 ` andy.shevchenko
  2023-06-09  7:18 ` Linus Walleij
  2 siblings, 0 replies; 11+ messages in thread
From: andy.shevchenko @ 2023-06-06  9:48 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: linus.walleij, brgl, thierry.reding, jonathanh, linux-tegra,
	linux-gpio, linux-kernel, smangipudi, Manish Bhardwaj

Tue, Jun 06, 2023 at 12:47:17PM +0530, Prathamesh Shete kirjoitti:
> This patch fixes the issue where even if PMC driver status is
> disabled still we are trying to look up for the IRQ domain
> that PMC driver would've registered if it had been enabled.

-ENOPARSE.

Also mind grammar punctuation.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gpio: tegra186: Check PMC driver status before any request
  2023-06-06  8:53 ` Jon Hunter
@ 2023-06-07 10:55   ` Jon Hunter
  2023-06-07 11:31     ` [PATCH v2] " Prathamesh Shete
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Hunter @ 2023-06-07 10:55 UTC (permalink / raw)
  To: Prathamesh Shete, linus.walleij, brgl, thierry.reding,
	linux-tegra, linux-gpio, linux-kernel
  Cc: smangipudi, Manish Bhardwaj


On 06/06/2023 09:53, Jon Hunter wrote:
> 
> On 06/06/2023 08:17, Prathamesh Shete wrote:
>> This patch fixes the issue where even if PMC driver status is
>> disabled still we are trying to look up for the IRQ domain
>> that PMC driver would've registered if it had been enabled.
> 
> It might be clearer to say ...
> 
> When the PMC device is disabled, probing of the Tegra186 GPIO driver 
> fails because the IRQ domain that is registered by the PMC driver is not 
> found. Fix this by checking to see if the PMC device is enabled before 
> attempting to lookup the IRQ domain registered by the PMC.

It could also be worth noting that it is OK to skip the PMC IRQ domain 
in this case because this only impacts wake-ups and not GPIO 
functionality in general.

Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2023-06-07 10:55   ` Jon Hunter
@ 2023-06-07 11:31     ` Prathamesh Shete
  2023-06-07 11:46       ` Jon Hunter
  2023-06-08 16:02       ` Thierry Reding
  0 siblings, 2 replies; 11+ messages in thread
From: Prathamesh Shete @ 2023-06-07 11:31 UTC (permalink / raw)
  To: linus.walleij, brgl, thierry.reding, jonathanh, linux-tegra,
	linux-gpio, linux-kernel
  Cc: smangipudi, pshete, Manish Bhardwaj

When the PMC device is disabled, probing of the Tegra186 GPIO driver
fails because the IRQ domain that is registered by the PMC driver is
not found. The PMC IRQ domain is only used for wake-up and does not
impact GPIO functionality in general. Therefore, if the PMC device is
disabled, skip looking up the PMC IRQ domain to allow the GPIO driver
to be probed.

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
---
 drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index 464b0ea3b6f1..80d08ddde40e 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 
 	np = of_find_matching_node(NULL, tegra186_pmc_of_match);
 	if (np) {
-		irq->parent_domain = irq_find_host(np);
-		of_node_put(np);
-
-		if (!irq->parent_domain)
-			return -EPROBE_DEFER;
+		if (of_device_is_available(np)) {
+			irq->parent_domain = irq_find_host(np);
+			of_node_put(np);
+
+			if (!irq->parent_domain)
+				return -EPROBE_DEFER;
+		} else {
+			of_node_put(np);
+		}
 	}
 
 	irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2023-06-07 11:31     ` [PATCH v2] " Prathamesh Shete
@ 2023-06-07 11:46       ` Jon Hunter
  2023-06-08 16:02       ` Thierry Reding
  1 sibling, 0 replies; 11+ messages in thread
From: Jon Hunter @ 2023-06-07 11:46 UTC (permalink / raw)
  To: Prathamesh Shete, linus.walleij, brgl, thierry.reding,
	linux-tegra, linux-gpio, linux-kernel
  Cc: smangipudi, Manish Bhardwaj


On 07/06/2023 12:31, Prathamesh Shete wrote:
> When the PMC device is disabled, probing of the Tegra186 GPIO driver
> fails because the IRQ domain that is registered by the PMC driver is
> not found. The PMC IRQ domain is only used for wake-up and does not
> impact GPIO functionality in general. Therefore, if the PMC device is
> disabled, skip looking up the PMC IRQ domain to allow the GPIO driver
> to be probed.
> 
> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> ---
>   drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
> index 464b0ea3b6f1..80d08ddde40e 100644
> --- a/drivers/gpio/gpio-tegra186.c
> +++ b/drivers/gpio/gpio-tegra186.c
> @@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
>   
>   	np = of_find_matching_node(NULL, tegra186_pmc_of_match);
>   	if (np) {
> -		irq->parent_domain = irq_find_host(np);
> -		of_node_put(np);
> -
> -		if (!irq->parent_domain)
> -			return -EPROBE_DEFER;
> +		if (of_device_is_available(np)) {
> +			irq->parent_domain = irq_find_host(np);
> +			of_node_put(np);
> +
> +			if (!irq->parent_domain)
> +				return -EPROBE_DEFER;
> +		} else {
> +			of_node_put(np);
> +		}
>   	}
>   
>   	irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,

Thanks!

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] gpio: tegra186: Check PMC driver status before any request
  2023-06-07 11:31     ` [PATCH v2] " Prathamesh Shete
  2023-06-07 11:46       ` Jon Hunter
@ 2023-06-08 16:02       ` Thierry Reding
  1 sibling, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2023-06-08 16:02 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: linus.walleij, brgl, jonathanh, linux-tegra, linux-gpio,
	linux-kernel, smangipudi, Manish Bhardwaj

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

On Wed, Jun 07, 2023 at 05:01:04PM +0530, Prathamesh Shete wrote:
> When the PMC device is disabled, probing of the Tegra186 GPIO driver
> fails because the IRQ domain that is registered by the PMC driver is
> not found. The PMC IRQ domain is only used for wake-up and does not
> impact GPIO functionality in general. Therefore, if the PMC device is
> disabled, skip looking up the PMC IRQ domain to allow the GPIO driver
> to be probed.
> 
> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> ---
>  drivers/gpio/gpio-tegra186.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gpio: tegra186: Check PMC driver status before any request
  2023-06-06  7:17 [PATCH] gpio: tegra186: Check PMC driver status before any request Prathamesh Shete
  2023-06-06  8:53 ` Jon Hunter
  2023-06-06  9:48 ` [PATCH] " andy.shevchenko
@ 2023-06-09  7:18 ` Linus Walleij
  2 siblings, 0 replies; 11+ messages in thread
From: Linus Walleij @ 2023-06-09  7:18 UTC (permalink / raw)
  To: Prathamesh Shete
  Cc: brgl, thierry.reding, jonathanh, linux-tegra, linux-gpio,
	linux-kernel, smangipudi, Manish Bhardwaj

On Tue, Jun 6, 2023 at 9:17 AM Prathamesh Shete <pshete@nvidia.com> wrote:

> This patch fixes the issue where even if PMC driver status is
> disabled still we are trying to look up for the IRQ domain
> that PMC driver would've registered if it had been enabled.
>
> Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>

Patch applied!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-06-09  7:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06  7:17 [PATCH] gpio: tegra186: Check PMC driver status before any request Prathamesh Shete
2023-06-06  8:53 ` Jon Hunter
2023-06-07 10:55   ` Jon Hunter
2023-06-07 11:31     ` [PATCH v2] " Prathamesh Shete
2023-06-07 11:46       ` Jon Hunter
2023-06-08 16:02       ` Thierry Reding
2023-06-06  9:48 ` [PATCH] " andy.shevchenko
2023-06-09  7:18 ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 14:02 Thierry Reding
2022-10-26  7:06 ` [PATCH v2] " Prathamesh Shete
2022-11-08 10:34   ` Linus Walleij
2022-11-08 13:29   ` Thierry Reding

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).