[Linux-stm32] [PATCH 2/2] pwm: stmpe: Don't issue error messages for problems in .apply_state()

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Jul 28 08:18:03 UTC 2023


On Fri, Jul 28, 2023 at 10:02:22AM +0200, Thierry Reding wrote:
> On Fri, Jul 14, 2023 at 11:45:19PM +0200, Uwe Kleine-König wrote:
> > pwm drivers are supposed to be silent for failures in .apply_state()
> > because a problem is likely to be persistent and so it can easily flood
> > the kernel log. So remove all error messages from .apply_state() and the
> > functions that are (only) called by that callback.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> > ---
> >  drivers/pwm/pwm-stmpe.c | 35 ++++++-----------------------------
> >  1 file changed, 6 insertions(+), 29 deletions(-)
> 
> I don't necessarily agree with that claim. Given that some of the
> implementations can be quite complex, the error messages may be useful
> to diagnose what exactly is going wrong. It's also quite rare for any
> consumers to call pwm_apply_state() in quick succession, so I don't
> think "flooding" is really a problem.
> 
> Is this an actual problem anywhere?

The real motivation for this change was to stop the driver making use of
struct pwm_chip::dev as I'm changing that one in my effort to track a
pwm_chip's lifetime using a struct device preparing character device
support for PWMs. So each usage that is gone doesn't need to be touched
later together with the pwm_chip restructurings.

While I think that the error messages are hardly useful I also never
were in a situation where they triggered, so maybe my judgement isn't
well-founded.

> On the other hand, the stmpe_reg_read() and stmpe_reg_write() produce
> error messages of their own, so the ones in this driver mainly serve as
> adding context. Perhaps rather than removing these, turning them into
> dev_dbg() would be a good compromise?

I will consider that. It would still use chip->dev, but I can cope with
that. :-)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20230728/673a762e/attachment.sig>


More information about the Linux-stm32 mailing list