* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
2023-06-30 11:11 ` [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq() Thomas Gleixner
@ 2023-07-03 9:13 ` Yangtao Li
2023-07-03 9:53 ` Uwe Kleine-König
2023-07-03 12:15 ` Yangtao Li
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Yangtao Li @ 2023-07-03 9:13 UTC (permalink / raw)
To: Thomas Gleixner, Uwe Kleine-König
Cc: miquel.raynal, rafael, daniel.lezcano, amitk, rui.zhang, mmayer,
bcm-kernel-feedback-list, florian.fainelli, shawnguo, s.hauer,
kernel, festevam, linux-imx, agross, andersson, konrad.dybcio,
thara.gopinath, heiko, mcoquelin.stm32, alexandre.torgue,
thierry.reding, jonathanh, matthias.bgg,
angelogioacchino.delregno, srinivas.pandruvada,
DLG-Adam.Ward.opensource, shangxiaojing, bchihi, wenst,
hayashi.kunihiko, niklas.soderlund+renesas, chi.minghao,
johan+linaro, jernej.skrabec, linux-pm, linux-arm-msm,
linux-kernel, linux-rockchip, linux-mediatek, linux-tegra,
linux-stm32, linux-arm-kernel
Hi,
On 2023/6/30 19:11, Thomas Gleixner wrote:
> On Tue, Jun 27 2023 at 13:00, Uwe Kleine-König wrote:
>> On Tue, Jun 27, 2023 at 06:12:01PM +0800, Yangtao Li wrote:
>>
>> While I assume changing to dev_err_probe is a result of my concern that
>> no error should be printed when rc=-EPROBEDEFER, my other concern that
>> adding an error message to a generic allocation function is a bad idea
>> still stands.
> I agree in general, but if you actually look at the call sites of
> devm_request_threaded_irq() then the vast majority of them print more or
> less lousy error messages. A quick grep/sed/awk/sort/uniq revealed
>
> 519 messages total (there are probably more)
>
> 352 unique messages
>
> 323 unique messages after lower casing
>
> Those 323 are mostly just variants of the same patterns with slight
> modifications in formatting and information provided.
>
> 186 of these messages do not deliver any useful information,
> e.g. "no irq", "
>
> The most useful one of all is: "could request wakeup irq: %d"
>
> So there is certainly an argument to be made that this particular
> function should print a well formatted and informative error message.
>
> It's not a general allocator like kmalloc(). It's specialized and in the
> vast majority of cases failing to request the interrupt causes the
> device probe to fail. So having proper and consistent information why
> the device cannot be used _is_ useful.
>
> Yangtao: The way how this is attempted is not useful at all.
>
> 1) The changelog is word salad and provides 0 rationale
>
> Also such series require a cover letter...
>
> 2) The dev_err() which is added is not informative at all and cannot
> replace actually useful error messages. It's not that hard to
> make it useful.
>
> 2) Adding the printks unconditionally first will emit two messages
> with different content.
>
> This is not how such changes are done.
>
> The proper approach is to create a wrapper function which emits
> the error message:
>
> wrapper(....., const char *info)
> {
> ret = devm_request_threaded_irq(....);
> if (ret < 0) {
> dev_err(dev, "Failed to request %sinterrupt %u %s %s: %d\n,
> thread_fn ? "threaded " : "",
> irq, devname, info ? : "", ret);
> }
> return ret;
> }
>
> Then convert the callsites over one by one with proper
> changelogs and justification.
>
> See?
Yes, thanks a lot for the suggestion, and v3 has been sent.
MBR,
Yangtao
>
> Thanks,
>
> tglx
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
2023-07-03 9:13 ` Yangtao Li
@ 2023-07-03 9:53 ` Uwe Kleine-König
2023-07-03 11:37 ` Yangtao Li
0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2023-07-03 9:53 UTC (permalink / raw)
To: Yangtao Li
Cc: Thomas Gleixner, heiko, hayashi.kunihiko, rafael, amitk,
alexandre.torgue, linux-tegra, thierry.reding, jernej.skrabec,
miquel.raynal, srinivas.pandruvada, festevam, linux-stm32, bchihi,
florian.fainelli, daniel.lezcano, chi.minghao, jonathanh,
linux-rockchip, agross, bcm-kernel-feedback-list, linux-imx,
wenst, rui.zhang, thara.gopinath, kernel, linux-pm, linux-arm-msm,
s.hauer, linux-mediatek, mmayer, matthias.bgg,
DLG-Adam.Ward.opensource, johan+linaro, angelogioacchino.delregno,
linux-arm-kernel, niklas.soderlund+renesas, andersson,
linux-kernel, shangxiaojing, konrad.dybcio, mcoquelin.stm32,
shawnguo
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]
Hello,
On Mon, Jul 03, 2023 at 05:13:29PM +0800, Yangtao Li wrote:
> [...] v3 has been sent.
Please make sure that you send a v3 patch series (at least) to the
people who gave you feedback for v2. If you skip people who had general
concerns about the whole series, this might help you in the short run
because they might miss to also criticise v3, but in the long run it
might result in a loss of trust in you.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
2023-07-03 9:53 ` Uwe Kleine-König
@ 2023-07-03 11:37 ` Yangtao Li
0 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2023-07-03 11:37 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Thomas Gleixner, heiko, hayashi.kunihiko, rafael, amitk,
alexandre.torgue, linux-tegra, thierry.reding, jernej.skrabec,
miquel.raynal, srinivas.pandruvada, festevam, linux-stm32, bchihi,
florian.fainelli, daniel.lezcano, chi.minghao, jonathanh,
linux-rockchip, agross, bcm-kernel-feedback-list, linux-imx,
wenst, rui.zhang, thara.gopinath, kernel, linux-pm, linux-arm-msm,
s.hauer, linux-mediatek, mmayer, matthias.bgg,
DLG-Adam.Ward.opensource, johan+linaro, angelogioacchino.delregno,
linux-arm-kernel, niklas.soderlund+renesas, andersson,
linux-kernel, shangxiaojing, konrad.dybcio, mcoquelin.stm32,
shawnguo
Hi Uwe,
On 2023/7/3 17:53, Uwe Kleine-König wrote:
> Hello,
>
> On Mon, Jul 03, 2023 at 05:13:29PM +0800, Yangtao Li wrote:
>> [...] v3 has been sent.
> Please make sure that you send a v3 patch series (at least) to the
> people who gave you feedback for v2. If you skip people who had general
> concerns about the whole series, this might help you in the short run
> because they might miss to also criticise v3, but in the long run it
> might result in a loss of trust in you.
Sorry, I'm a little busy. I just added you and Krzysztof Kozlowski in v3.
If others are interested in the follow-up series, please refer to the
following link:
https://lore.kernel.org/lkml/20230703090455.62101-1-frank.li@vivo.com/
Thx,
Yangtao
>
> Best regards
> Uwe
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
2023-06-30 11:11 ` [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq() Thomas Gleixner
2023-07-03 9:13 ` Yangtao Li
@ 2023-07-03 12:15 ` Yangtao Li
2023-07-03 12:19 ` Yangtao Li
[not found] ` <247a8166-f131-2d07-ec2b-479a4c19297f@vivo.com>
3 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2023-07-03 12:15 UTC (permalink / raw)
To: tglx
Cc: DLG-Adam.Ward.opensource, agross, alexandre.torgue, amitk,
andersson, angelogioacchino.delregno, bchihi,
bcm-kernel-feedback-list, chi.minghao, daniel.lezcano, festevam,
florian.fainelli, frank.li, hayashi.kunihiko, heiko,
jernej.skrabec, johan+linaro, jonathanh, kernel, konrad.dybcio,
linux-arm-kernel, linux-arm-msm, linux-imx, linux-kernel,
linux-mediatek, linux-pm, linux-rockchip, linux-stm32,
linux-tegra, matthias.bgg, mcoquelin.stm32, miquel.raynal, mmayer,
niklas.soderlund+renesas, rafael, rui.zhang, s.hauer,
shangxiaojing, shawnguo, srinivas.pandruvada, thara.gopinath,
thierry.reding, u.kleine-koenig, wenst
Hi Krzysztof,
Here. V3 was modified according to tglx's suggestion, if there is any problem, please point out.
Thx,
Yangtao
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
2023-06-30 11:11 ` [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq() Thomas Gleixner
2023-07-03 9:13 ` Yangtao Li
2023-07-03 12:15 ` Yangtao Li
@ 2023-07-03 12:19 ` Yangtao Li
[not found] ` <247a8166-f131-2d07-ec2b-479a4c19297f@vivo.com>
3 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2023-07-03 12:19 UTC (permalink / raw)
To: krzysztof.kozlowski
Cc: tglx, DLG-Adam.Ward.opensource, agross, alexandre.torgue, amitk,
andersson, angelogioacchino.delregno, bchihi,
bcm-kernel-feedback-list, chi.minghao, daniel.lezcano, festevam,
florian.fainelli, frank.li, hayashi.kunihiko, heiko,
jernej.skrabec, johan+linaro, jonathanh, kernel, konrad.dybcio,
linux-arm-kernel, linux-arm-msm, linux-imx, linux-kernel,
linux-mediatek, linux-pm, linux-rockchip, linux-stm32,
linux-tegra, matthias.bgg, mcoquelin.stm32, miquel.raynal, mmayer,
niklas.soderlund+renesas, rafael, rui.zhang, s.hauer,
shangxiaojing, shawnguo, srinivas.pandruvada, thara.gopinath,
thierry.reding, u.kleine-koenig, wenst
+cc krzysztof.kozlowski@linaro.org
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <247a8166-f131-2d07-ec2b-479a4c19297f@vivo.com>]
* Re: [PATCH v2 01/15] genirq/devres: Add error information printing for devm_request_threaded_irq()
[not found] ` <247a8166-f131-2d07-ec2b-479a4c19297f@vivo.com>
@ 2023-07-03 12:28 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-03 12:28 UTC (permalink / raw)
To: Yangtao Li, Thomas Gleixner, Uwe Kleine-König
Cc: miquel.raynal, rafael, daniel.lezcano, amitk, rui.zhang, mmayer,
bcm-kernel-feedback-list, florian.fainelli, shawnguo, s.hauer,
kernel, festevam, linux-imx, agross, andersson, konrad.dybcio,
thara.gopinath, heiko, mcoquelin.stm32, alexandre.torgue,
thierry.reding, jonathanh, matthias.bgg,
angelogioacchino.delregno, srinivas.pandruvada,
DLG-Adam.Ward.opensource, shangxiaojing, bchihi, wenst,
hayashi.kunihiko, niklas.soderlund+renesas, chi.minghao,
johan+linaro, jernej.skrabec, linux-pm, linux-arm-msm,
linux-kernel, linux-rockchip, linux-mediatek, linux-tegra,
linux-stm32, linux-arm-kernel
On 03/07/2023 13:54, Yangtao Li wrote:
> Hi Krzysztof,
>
> On 2023/6/30 19:11, Thomas Gleixner wrote:
>> On Tue, Jun 27 2023 at 13:00, Uwe Kleine-König wrote:
>>> On Tue, Jun 27, 2023 at 06:12:01PM +0800, Yangtao Li wrote:
>>>
>>> While I assume changing to dev_err_probe is a result of my concern that
>>> no error should be printed when rc=-EPROBEDEFER, my other concern that
>>> adding an error message to a generic allocation function is a bad idea
>>> still stands.
>> I agree in general, but if you actually look at the call sites of
>> devm_request_threaded_irq() then the vast majority of them print more or
>> less lousy error messages. A quick grep/sed/awk/sort/uniq revealed
>>
>> 519 messages total (there are probably more)
>>
>> 352 unique messages
>>
>> 323 unique messages after lower casing
>>
>> Those 323 are mostly just variants of the same patterns with slight
>> modifications in formatting and information provided.
>>
>> 186 of these messages do not deliver any useful information,
>> e.g. "no irq", "
>>
>> The most useful one of all is: "could request wakeup irq: %d"
>>
>> So there is certainly an argument to be made that this particular
>> function should print a well formatted and informative error message.
>>
>> It's not a general allocator like kmalloc(). It's specialized and in the
>> vast majority of cases failing to request the interrupt causes the
>> device probe to fail. So having proper and consistent information why
>> the device cannot be used _is_ useful.
>>
>> Yangtao: The way how this is attempted is not useful at all.
>>
>> 1) The changelog is word salad and provides 0 rationale
>>
>> Also such series require a cover letter...
>>
>> 2) The dev_err() which is added is not informative at all and cannot
>> replace actually useful error messages. It's not that hard to
>> make it useful.
>>
>> 2) Adding the printks unconditionally first will emit two messages
>> with different content.
>>
>> This is not how such changes are done.
>>
>> The proper approach is to create a wrapper function which emits
>> the error message:
>>
>> wrapper(....., const char *info)
>> {
>> ret = devm_request_threaded_irq(....);
>> if (ret < 0) {
>> dev_err(dev, "Failed to request %sinterrupt %u %s %s: %d\n,
>> thread_fn ? "threaded " : "",
>> irq, devname, info ? : "", ret);
>> }
>> return ret;
>> }
>
>
> Here.
>
> V3 was modified according to tglx's suggestion, if there is any problem,
> please point out.
The comment was about request_thread_irq, not about devres alloc. Don't
mix the places. Really, since when do we print any errors on ENOMEM?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread