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


Groups > linux.kernel > #1642256 > unrolled thread

[PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's

Started byRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
First post2017-05-16 09:00 +0200
Last post2017-05-21 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> - 2017-05-16 09:00 +0200
    Re: [PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary  isr handler's Jonathan Cameron <jic23@kernel.org> - 2017-05-21 14:10 +0200

#1642256 — [PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's

FromRaveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Date2017-05-16 09:00 +0200
Subject[PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's
Message-ID<tHECB-2bV-5@gated-at.bofh.it>
The third argument of devm_request_threaded_irq() is the primary
handler. It is called in hardirq context and checks whether the
interrupt is relevant to the device. If the primary handler returns
IRQ_WAKE_THREAD, the secondary handler (a.k.a. handler thread) is
scheduled to run in process context.

bcm_iproc_adc.c uses the secondary handler as the primary one
and the other way around. So this patch fixes the same, along with
re-naming the secondary handler and primary handler names properly.

Tested on the BCM9583XX iProc SoC based boards.

Fixes: 4324c97ecedc ("iio: Add driver for Broadcom iproc-static-adc")
Reported-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Cc: stable@vger.kernel.org
---

Changes in v2:
 - Added Cc tag in the Signed-off area to send the patch to stable kernel
 - Fixes tag corrected with proper formatting

 drivers/iio/adc/bcm_iproc_adc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
index 21d38c8..7f4f9c4 100644
--- a/drivers/iio/adc/bcm_iproc_adc.c
+++ b/drivers/iio/adc/bcm_iproc_adc.c
@@ -143,7 +143,7 @@ static void iproc_adc_reg_dump(struct iio_dev *indio_dev)
 	iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA);
 }
 
-static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
+static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
 {
 	u32 channel_intr_status;
 	u32 intr_status;
@@ -167,7 +167,7 @@ static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
 	return IRQ_NONE;
 }
 
-static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
+static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
 {
 	irqreturn_t retval = IRQ_NONE;
 	struct iproc_adc_priv *adc_priv;
@@ -181,7 +181,7 @@ static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
 	adc_priv = iio_priv(indio_dev);
 
 	regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status);
-	dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_thread(),INTRPT_STS:%x\n",
+	dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_handler(),INTRPT_STS:%x\n",
 			intr_status);
 
 	intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR;
@@ -566,8 +566,8 @@ static int iproc_adc_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno,
-				iproc_adc_interrupt_thread,
 				iproc_adc_interrupt_handler,
+				iproc_adc_interrupt_thread,
 				IRQF_SHARED, "iproc-adc", indio_dev);
 	if (ret) {
 		dev_err(&pdev->dev, "request_irq error %d\n", ret);
-- 
1.9.1

[toc] | [next] | [standalone]


#1646333 — Re: [PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's

FromJonathan Cameron <jic23@kernel.org>
Date2017-05-21 14:10 +0200
SubjectRe: [PATCH v2] iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's
Message-ID<tJxQm-7Cj-5@gated-at.bofh.it>
In reply to#1642256
On 16/05/17 07:52, Raveendra Padasalagi wrote:
> The third argument of devm_request_threaded_irq() is the primary
> handler. It is called in hardirq context and checks whether the
> interrupt is relevant to the device. If the primary handler returns
> IRQ_WAKE_THREAD, the secondary handler (a.k.a. handler thread) is
> scheduled to run in process context.
> 
> bcm_iproc_adc.c uses the secondary handler as the primary one
> and the other way around. So this patch fixes the same, along with
> re-naming the secondary handler and primary handler names properly.
> 
> Tested on the BCM9583XX iProc SoC based boards.
> 
> Fixes: 4324c97ecedc ("iio: Add driver for Broadcom iproc-static-adc")
> Reported-by: Pavel Roskin <plroskin@gmail.com>
> Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
> Cc: stable@vger.kernel.org
Applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan
> ---
> 
> Changes in v2:
>   - Added Cc tag in the Signed-off area to send the patch to stable kernel
>   - Fixes tag corrected with proper formatting
> 
>   drivers/iio/adc/bcm_iproc_adc.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
> index 21d38c8..7f4f9c4 100644
> --- a/drivers/iio/adc/bcm_iproc_adc.c
> +++ b/drivers/iio/adc/bcm_iproc_adc.c
> @@ -143,7 +143,7 @@ static void iproc_adc_reg_dump(struct iio_dev *indio_dev)
>   	iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA);
>   }
>   
> -static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
> +static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
>   {
>   	u32 channel_intr_status;
>   	u32 intr_status;
> @@ -167,7 +167,7 @@ static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
>   	return IRQ_NONE;
>   }
>   
> -static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
> +static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
>   {
>   	irqreturn_t retval = IRQ_NONE;
>   	struct iproc_adc_priv *adc_priv;
> @@ -181,7 +181,7 @@ static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
>   	adc_priv = iio_priv(indio_dev);
>   
>   	regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status);
> -	dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_thread(),INTRPT_STS:%x\n",
> +	dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_handler(),INTRPT_STS:%x\n",
>   			intr_status);
>   
>   	intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR;
> @@ -566,8 +566,8 @@ static int iproc_adc_probe(struct platform_device *pdev)
>   	}
>   
>   	ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno,
> -				iproc_adc_interrupt_thread,
>   				iproc_adc_interrupt_handler,
> +				iproc_adc_interrupt_thread,
>   				IRQF_SHARED, "iproc-adc", indio_dev);
>   	if (ret) {
>   		dev_err(&pdev->dev, "request_irq error %d\n", ret);
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web