On Wed, Apr 21, 2021 at 11:26:08AM +0200, Uwe Kleine-König wrote: > With these three patches PWM_DEBUG is now happy. (At least I couldn't > trigger a warning any more. I think there are still a few problems with > integer overflows.) BTW, setting the period to 138350580899 (with a clock rate of 133333333 Hz) results in setting period=0 because state->period * clkrate = 138350580899 * 133333333 = 40254751 (discarded from 18446744073749806367). Another problem I just noticed is: The driver configures a period of 4s just fine (i.e. without an overflow). But waiting for a new period to start (e.g. in atmel_pwm_disable()) aborts after 2s. So in the area of big period states there are still a few things to improve. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |