Linux-USB Archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict
@ 2023-08-23  8:54 Grant B Adams
  2023-08-23  8:54 ` [PATCH v2 1/2] power: supply: " Grant B Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Grant B Adams @ 2023-08-23  8:54 UTC (permalink / raw
  Cc: linux-omap, tony, Grant B Adams, Sebastian Reichel, Bin Liu,
	Greg Kroah-Hartman, linux-pm, linux-kernel, linux-usb

Both the tps65217-charger and vbus drivers are trying to allocate the same
TPS65217 device interrupt line (TPS65217 is a TI power management IC) 
which results in the following error and a probe failure:

genirq: Flags mismatch irq 148. 00002000 (vbus) vs. 00000000 
(tps65217-charger)

For the Beaglebone Black's config the tps65217-charger driver is currently
disabled and therefore no conflict. Based on comments from Robert C Nelson
this driver has been disabled for a long time and he is uncertain on the
reasons why it was disabled. With a battery connected to the BBB, I 
re-enabled the tps65217-charger driver which resulted in the 
abovementioned.

The conflict is resolved by changing both driver's threaded interrupt
request function from IRQF_ONESHOT to IRQF_SHARED.

Changes in v2:
   Initial patches where emailed individually and not threaded. V2 patches 
   sent as email thread. Feedback provided by gregkh@linuxfoundation.org

Grant B Adams (2):
  power: supply: Fix tps65217-charger vs vbus irq conflict
  usb: musb: dsps: Fix vbus vs tps65217-charger irq conflict

 drivers/power/supply/tps65217_charger.c | 2 +-
 drivers/usb/musb/musb_dsps.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.34.1


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

* [PATCH v2 1/2] power: supply: Fix tps65217-charger vs vbus irq conflict
  2023-08-23  8:54 [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict Grant B Adams
@ 2023-08-23  8:54 ` Grant B Adams
  2023-09-15 20:43   ` Sebastian Reichel
  2023-08-23  8:54 ` [PATCH v2 2/2] usb: musb: dsps: Fix vbus vs tps65217-charger " Grant B Adams
  2023-09-05  6:35 ` [PATCH v2 0/2] Fix tps65217-charger vs vbus " Tony Lindgren
  2 siblings, 1 reply; 5+ messages in thread
From: Grant B Adams @ 2023-08-23  8:54 UTC (permalink / raw
  Cc: linux-omap, tony, Grant B Adams, Sebastian Reichel, Bin Liu,
	Greg Kroah-Hartman, linux-pm, linux-kernel, linux-usb

Enabling the tps65217-charger driver/module causes an interrupt conflict
with the vbus driver resulting in a probe failure.
The conflict is resolved by changing both driver's threaded interrupt
request function from IRQF_ONESHOT to IRQF_SHARED.

Signed-off-by: Grant B Adams <nemith592@gmail.com>
---
 drivers/power/supply/tps65217_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c
index a4bc9f2a10bc..6f68becdbfd0 100644
--- a/drivers/power/supply/tps65217_charger.c
+++ b/drivers/power/supply/tps65217_charger.c
@@ -238,7 +238,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
 	for (i = 0; i < NUM_CHARGER_IRQS; i++) {
 		ret = devm_request_threaded_irq(&pdev->dev, irq[i], NULL,
 						tps65217_charger_irq,
-						IRQF_ONESHOT, "tps65217-charger",
+						IRQF_SHARED, "tps65217-charger",
 						charger);
 		if (ret) {
 			dev_err(charger->dev,
-- 
2.34.1


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

* [PATCH v2 2/2] usb: musb: dsps: Fix vbus vs tps65217-charger irq conflict
  2023-08-23  8:54 [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict Grant B Adams
  2023-08-23  8:54 ` [PATCH v2 1/2] power: supply: " Grant B Adams
@ 2023-08-23  8:54 ` Grant B Adams
  2023-09-05  6:35 ` [PATCH v2 0/2] Fix tps65217-charger vs vbus " Tony Lindgren
  2 siblings, 0 replies; 5+ messages in thread
From: Grant B Adams @ 2023-08-23  8:54 UTC (permalink / raw
  Cc: linux-omap, tony, Grant B Adams, Sebastian Reichel, Bin Liu,
	Greg Kroah-Hartman, linux-pm, linux-kernel, linux-usb

Enabling the tps65217-charger driver/module causes an interrupt conflict
with the vbus driver resulting in a probe failure.
The conflict is resolved by changing both driver's threaded interrupt
request function from IRQF_ONESHOT to IRQF_SHARED.

Signed-off-by: Grant B Adams <nemith592@gmail.com>
---
 drivers/usb/musb/musb_dsps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 9119b1d51370..cbb45de5a76f 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -851,7 +851,7 @@ static int dsps_setup_optional_vbus_irq(struct platform_device *pdev,
 
 	error = devm_request_threaded_irq(glue->dev, glue->vbus_irq,
 					  NULL, dsps_vbus_threaded_irq,
-					  IRQF_ONESHOT,
+					  IRQF_SHARED,
 					  "vbus", glue);
 	if (error) {
 		glue->vbus_irq = 0;
-- 
2.34.1


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

* Re: [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict
  2023-08-23  8:54 [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict Grant B Adams
  2023-08-23  8:54 ` [PATCH v2 1/2] power: supply: " Grant B Adams
  2023-08-23  8:54 ` [PATCH v2 2/2] usb: musb: dsps: Fix vbus vs tps65217-charger " Grant B Adams
@ 2023-09-05  6:35 ` Tony Lindgren
  2 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2023-09-05  6:35 UTC (permalink / raw
  To: Grant B Adams
  Cc: linux-omap, Sebastian Reichel, Bin Liu, Greg Kroah-Hartman,
	linux-pm, linux-kernel, linux-usb

* Grant B Adams <nemith592@gmail.com> [230823 08:54]:
> Both the tps65217-charger and vbus drivers are trying to allocate the same
> TPS65217 device interrupt line (TPS65217 is a TI power management IC) 
> which results in the following error and a probe failure:
> 
> genirq: Flags mismatch irq 148. 00002000 (vbus) vs. 00000000 
> (tps65217-charger)
> 
> For the Beaglebone Black's config the tps65217-charger driver is currently
> disabled and therefore no conflict. Based on comments from Robert C Nelson
> this driver has been disabled for a long time and he is uncertain on the
> reasons why it was disabled. With a battery connected to the BBB, I 
> re-enabled the tps65217-charger driver which resulted in the 
> abovementioned.
> 
> The conflict is resolved by changing both driver's threaded interrupt
> request function from IRQF_ONESHOT to IRQF_SHARED.

Looks good to me:

Reviewed-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH v2 1/2] power: supply: Fix tps65217-charger vs vbus irq conflict
  2023-08-23  8:54 ` [PATCH v2 1/2] power: supply: " Grant B Adams
@ 2023-09-15 20:43   ` Sebastian Reichel
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2023-09-15 20:43 UTC (permalink / raw
  To: Grant B Adams
  Cc: linux-omap, tony, Bin Liu, Greg Kroah-Hartman, linux-pm,
	linux-kernel, linux-usb

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

Hi,

On Wed, Aug 23, 2023 at 10:54:29AM +0200, Grant B Adams wrote:
> Enabling the tps65217-charger driver/module causes an interrupt conflict
> with the vbus driver resulting in a probe failure.
> The conflict is resolved by changing both driver's threaded interrupt
> request function from IRQF_ONESHOT to IRQF_SHARED.
> 
> Signed-off-by: Grant B Adams <nemith592@gmail.com>
> ---

Your commit message does not explain why IRQF_ONESHOT is dropped;
IRQF_ONESHOT and IRQF_SHARED are not mutually exclusive.

-- Sebastian

>  drivers/power/supply/tps65217_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c
> index a4bc9f2a10bc..6f68becdbfd0 100644
> --- a/drivers/power/supply/tps65217_charger.c
> +++ b/drivers/power/supply/tps65217_charger.c
> @@ -238,7 +238,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
>  	for (i = 0; i < NUM_CHARGER_IRQS; i++) {
>  		ret = devm_request_threaded_irq(&pdev->dev, irq[i], NULL,
>  						tps65217_charger_irq,
> -						IRQF_ONESHOT, "tps65217-charger",
> +						IRQF_SHARED, "tps65217-charger",
>  						charger);
>  		if (ret) {
>  			dev_err(charger->dev,
> -- 
> 2.34.1
> 

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

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

end of thread, other threads:[~2023-09-15 20:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23  8:54 [PATCH v2 0/2] Fix tps65217-charger vs vbus irq conflict Grant B Adams
2023-08-23  8:54 ` [PATCH v2 1/2] power: supply: " Grant B Adams
2023-09-15 20:43   ` Sebastian Reichel
2023-08-23  8:54 ` [PATCH v2 2/2] usb: musb: dsps: Fix vbus vs tps65217-charger " Grant B Adams
2023-09-05  6:35 ` [PATCH v2 0/2] Fix tps65217-charger vs vbus " Tony Lindgren

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 read-only IMAP folder(s) and NNTP newsgroup(s).