extcon: maxim: Fix missing IRQF_ONESHOT as only threaded handler
Subsystems (2)
PATCH 1/1 extcon: maxim: Fix missing IRQF_ONESHOT as only threaded handler
From: Guangqing Zhu <[email protected]>
Coccinelle noticed:
1. drivers/extcon/extcon-max14577.c:699:8-33: ERROR: Threaded IRQ with
no primary handler requested without IRQF_ONESHOT
2. drivers/extcon/extcon-max77693.c:1143:8-33: ERROR: Threaded IRQ with
no primary handler requested without IRQF_ONESHOT
3. drivers/extcon/extcon-max77843.c:907:8-33: ERROR: Threaded IRQ with
no primary handler requested without IRQF_ONESHOT
4. drivers/extcon/extcon-max8997.c:665:8-28: ERROR: Threaded IRQ with
no primary handler requested without IRQF_ONESHOT
--- drivers/extcon/extcon-max14577.c | 2 +- drivers/extcon/extcon-max77693.c | 2 +- drivers/extcon/extcon-max77843.c | 3 ++- drivers/extcon/extcon-max8997.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
drivers/extcon/extcon-max14577.c +1 -1
@@ -698,7 +698,7 @@ static int max14577_muic_probe(struct platform_device *pdev) ret =devm_request_threaded_irq (&pdev->dev, virq,NULL , max14577_muic_irq_handler, -IRQF_NO_SUSPEND , +IRQF_NO_SUSPEND |IRQF_ONESHOT , muic_irq->name, info);if (ret) { dev_err(&pdev->dev,
drivers/extcon/extcon-max77693.c +1 -1
@@ -1142,7 +1142,7 @@ static int max77693_muic_probe(struct platform_device *pdev) ret =devm_request_threaded_irq (&pdev->dev, virq,NULL , max77693_muic_irq_handler, -IRQF_NO_SUSPEND , +IRQF_NO_SUSPEND |IRQF_ONESHOT , muic_irq->name, info);if (ret) { dev_err(&pdev->dev,
drivers/extcon/extcon-max77843.c +2 -1
@@ -905,7 +905,8 @@ static int max77843_muic_probe(struct platform_device *pdev) muic_irq->virq = virq; ret =devm_request_threaded_irq (&pdev->dev, virq,NULL , - max77843_muic_irq_handler,IRQF_NO_SUSPEND , + max77843_muic_irq_handler, +IRQF_NO_SUSPEND |IRQF_ONESHOT , muic_irq->name, info);if (ret) { dev_err(&pdev->dev,
drivers/extcon/extcon-max8997.c +1 -1
@@ -664,7 +664,7 @@ static int max8997_muic_probe(struct platform_device *pdev) ret =request_threaded_irq (virq,NULL , max8997_muic_irq_handler, -IRQF_NO_SUSPEND , +IRQF_NO_SUSPEND |IRQF_ONESHOT , muic_irq->name, info);if (ret) { dev_err(&pdev->dev,
Signature · 1 line
2.17.1
Quoted 25 lines · On 15/04/2021 13:36, [email protected] wrote:
From: Guangqing Zhu <[email protected]>
Coccinelle noticed:
1. drivers/extcon/extcon-max14577.c:699:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
2. drivers/extcon/extcon-max77693.c:1143:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
3. drivers/extcon/extcon-max77843.c:907:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
4. drivers/extcon/extcon-max8997.c:665:8-28: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOTSigned-off-by Guangqing Zhu <[email protected]>--- drivers/extcon/extcon-max14577.c | 2 +- drivers/extcon/extcon-max77693.c | 2 +- drivers/extcon/extcon-max77843.c | 3 ++- drivers/extcon/extcon-max8997.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)drivers/extcon/extcon-max14577.c +0
-0
drivers/extcon/extcon-max14577.c static int max14577_muic_probe(struct platform_device *pdev) · line 701
Quoted 5 lines
drivers/extcon/extcon-max14577.c +1
-1@@ -698,7 +698,7 @@ static int max14577_muic_probe(struct platform_device *pdev) ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, max14577_muic_irq_handler, - IRQF_NO_SUSPEND, + IRQF_NO_SUSPEND | IRQF_ONESHOT,
The same with all other patches for IRQF_ONESHOT which are send recently:
1. On what board did you test it?
2. Is this just blind patch from Coccinelle without investigation whether it is needed (hint: it's not needed here, it does not use default primary handler).
3. If you think otherwise, please explain.
Best regards,
Krzysztof
Quoted 27 lines · Krzysztof Kozlowski
Quoted 26 lines · On 15/04/2021 13:36, [email protected] wrote:
From: Guangqing Zhu <[email protected]>
Coccinelle noticed:
1. drivers/extcon/extcon-max14577.c:699:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
2. drivers/extcon/extcon-max77693.c:1143:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
3. drivers/extcon/extcon-max77843.c:907:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
4. drivers/extcon/extcon-max8997.c:665:8-28: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOTSigned-off-by Guangqing Zhu <[email protected]>--- drivers/extcon/extcon-max14577.c | 2 +- drivers/extcon/extcon-max77693.c | 2 +- drivers/extcon/extcon-max77843.c | 3 ++- drivers/extcon/extcon-max8997.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)drivers/extcon/extcon-max14577.c +0
-0@@ -698,7 +698,7 @@ static int max14577_muic_probe(struct platform_device *pdev)
Quoted 7 lines
drivers/extcon/extcon-max14577.c static int max14577_muic_probe(struct platform_device *pdev) · line 701
Quoted 4 lines
drivers/extcon/extcon-max14577.c +1
-1ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, max14577_muic_irq_handler, - IRQF_NO_SUSPEND, + IRQF_NO_SUSPEND | IRQF_ONESHOT,The same with all other patches for
IRQF_ONESHOTwhich are send recently:
1. On what board did you test it?
I didn't test it.
Quoted 3 lines
2. Is this just blind patch from Coccinelle without investigation whether it is needed (hint: it's not needed here, it does not use default primary handler).
I found the error notice from Coccinelle and I saw the code. Maybe I'm mistaken, I think it's needed here. Because handler == NULL and thread_fn != NULL, it use irq_default_primary_handler() in request_threaded_irq().
Quoted 5 lines
3. If you think otherwise, please explain.
Best regards,
Krzysztof
Thanks for your review.
Best regards,
Guangqing Zhu
Quoted 40 lines · Guangqing Zhu
Quoted 27 lines · Krzysztof Kozlowski
Quoted 26 lines · On 15/04/2021 13:36, [email protected] wrote:
From: Guangqing Zhu <[email protected]>
Coccinelle noticed:
1. drivers/extcon/extcon-max14577.c:699:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
2. drivers/extcon/extcon-max77693.c:1143:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
3. drivers/extcon/extcon-max77843.c:907:8-33: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOT
4. drivers/extcon/extcon-max8997.c:665:8-28: ERROR: Threaded IRQ with
no primary handler requested withoutIRQF_ONESHOTSigned-off-by Guangqing Zhu <[email protected]>--- drivers/extcon/extcon-max14577.c | 2 +- drivers/extcon/extcon-max77693.c | 2 +- drivers/extcon/extcon-max77843.c | 3 ++- drivers/extcon/extcon-max8997.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)drivers/extcon/extcon-max14577.c +0
-0@@ -698,7 +698,7 @@ static int max14577_muic_probe(struct platform_device *pdev)Quoted 7 lines
drivers/extcon/extcon-max14577.c static int max14577_muic_probe(struct platform_device *pdev) · line 701
Quoted 4 lines
drivers/extcon/extcon-max14577.c +1
-1ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, max14577_muic_irq_handler, - IRQF_NO_SUSPEND, + IRQF_NO_SUSPEND | IRQF_ONESHOT,The same with all other patches for
IRQF_ONESHOTwhich are send recently:
1. On what board did you test it?I didn't test it.
Quoted 8 lines
Quoted 3 lines
2. Is this just blind patch from Coccinelle without investigation whether it is needed (hint: it's not needed here, it does not use default primary handler).
I found the error notice from Coccinelle and I saw the code. Maybe I'm mistaken, I think it's needed here. Because handler == NULL and
thread_fn!= NULL, it useirq_default_primary_handler()inrequest_threaded_irq().
No, the primary handler is nested, not default one. Otherwise it would have absolutely never worked. Therefore you are not fixing anything, except Coccinelle report.
Best regards,
Krzysztof