Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1260561 > unrolled thread

[PATCH v2 0/3] Fixes for twl4030 charger

Started by"H. Nikolaus Schaller" <hns@goldelico.com>
First post2015-11-02 12:30 +0100
Last post2015-11-13 11:30 +0100
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/3] Fixes for twl4030 charger "H. Nikolaus Schaller" <hns@goldelico.com> - 2015-11-02 12:30 +0100
    [PATCH v2 2/3] drivers:power:twl4030-charger: don't return after allocating irq "H. Nikolaus Schaller" <hns@goldelico.com> - 2015-11-02 12:30 +0100
    Re: [PATCH v2 0/3] Fixes for twl4030 charger "H. Nikolaus Schaller" <hns@goldelico.com> - 2015-11-13 11:30 +0100

#1260561 — [PATCH v2 0/3] Fixes for twl4030 charger

From"H. Nikolaus Schaller" <hns@goldelico.com>
Date2015-11-02 12:30 +0100
Subject[PATCH v2 0/3] Fixes for twl4030 charger
Message-ID<qqltf-4Hq-9@gated-at.bofh.it>
Changes V2:
* worked in comments by Nishanth Menon <nm@ti.com>
* added another patch which solves a probing/boot stall problem (irq allocation vs. -EPROBE_DEFER)

V1:
4.3-rc1 introduced a new charger driver for the twl4030.

While making it operable and testing on GTA04 and OpenPandora
we have found some issues.


H. Nikolaus Schaller (3):
  drivers:power:twl4030-charger: fix problem with EPROBE_DEFER
  drivers:power:twl4030-charger: don't return after allocating irq
  drivers:power:twl4030-charger: don't check if battery is present

 drivers/power/twl4030_charger.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1260562 — [PATCH v2 2/3] drivers:power:twl4030-charger: don't return after allocating irq

From"H. Nikolaus Schaller" <hns@goldelico.com>
Date2015-11-02 12:30 +0100
Subject[PATCH v2 2/3] drivers:power:twl4030-charger: don't return after allocating irq
Message-ID<qqltf-4Hq-7@gated-at.bofh.it>
In reply to#1260561
It appears that simply returning with error status (especially
-EPROBE_DEFER) is very dangerous *after* allocating devm managed
interrupts.

See discussion of potential issues: https://lkml.org/lkml/2013/2/22/65

The result is that the boot process hangs if both, phy-twl4030-usb and this
twl4030_charger driver are compiled as modules. This has been observed
on gta04 and openpandora boards.

So we move the search and check that the twl4030-phy transceiver link is
available before we request to set up the interrupts.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/power/twl4030_charger.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index 00697e9..05d693d 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -1031,23 +1031,6 @@ static int twl4030_bci_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_request_threaded_irq(&pdev->dev, bci->irq_chg, NULL,
-			twl4030_charger_interrupt, IRQF_ONESHOT, pdev->name,
-			bci);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "could not request irq %d, status %d\n",
-			bci->irq_chg, ret);
-		return ret;
-	}
-
-	ret = devm_request_threaded_irq(&pdev->dev, bci->irq_bci, NULL,
-			twl4030_bci_interrupt, IRQF_ONESHOT, pdev->name, bci);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "could not request irq %d, status %d\n",
-			bci->irq_bci, ret);
-		return ret;
-	}
-
 	INIT_WORK(&bci->work, twl4030_bci_usb_work);
 	INIT_DELAYED_WORK(&bci->current_worker, twl4030_current_worker);
 
@@ -1066,6 +1049,23 @@ static int twl4030_bci_probe(struct platform_device *pdev)
 		}
 	}
 
+	ret = devm_request_threaded_irq(&pdev->dev, bci->irq_chg, NULL,
+			twl4030_charger_interrupt, IRQF_ONESHOT, pdev->name,
+			bci);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "could not request irq %d, status %d\n",
+			bci->irq_chg, ret);
+		return ret;
+	}
+
+	ret = devm_request_threaded_irq(&pdev->dev, bci->irq_bci, NULL,
+			twl4030_bci_interrupt, IRQF_ONESHOT, pdev->name, bci);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "could not request irq %d, status %d\n",
+			bci->irq_bci, ret);
+		return ret;
+	}
+
 	/* Enable interrupts now. */
 	reg = ~(u32)(TWL4030_ICHGLOW | TWL4030_ICHGEOC | TWL4030_TBATOR2 |
 		TWL4030_TBATOR1 | TWL4030_BATSTS);
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1268805

From"H. Nikolaus Schaller" <hns@goldelico.com>
Date2015-11-13 11:30 +0100
Message-ID<qujMf-5a8-43@gated-at.bofh.it>
In reply to#1260561
ping.

Am 02.11.2015 um 12:27 schrieb H. Nikolaus Schaller <hns@goldelico.com>:

> Changes V2:
> * worked in comments by Nishanth Menon <nm@ti.com>
> * added another patch which solves a probing/boot stall problem (irq allocation vs. -EPROBE_DEFER)
> 
> V1:
> 4.3-rc1 introduced a new charger driver for the twl4030.
> 
> While making it operable and testing on GTA04 and OpenPandora
> we have found some issues.
> 
> 
> H. Nikolaus Schaller (3):
>  drivers:power:twl4030-charger: fix problem with EPROBE_DEFER
>  drivers:power:twl4030-charger: don't return after allocating irq
>  drivers:power:twl4030-charger: don't check if battery is present
> 
> drivers/power/twl4030_charger.c | 39 ++++++++++++++++++---------------------
> 1 file changed, 18 insertions(+), 21 deletions(-)
> 
> -- 
> 2.5.1
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web