Re: [PATCH 2/2] spi: fix the divide by 0 error when calculating xfer waiting time
From: Mark Brown
Date: Thu Dec 31 2020 - 08:38:02 EST
On Thu, Dec 31, 2020 at 11:23:37AM +0800, Xu Yilun wrote:
> On Wed, Dec 30, 2020 at 01:46:44PM +0000, Mark Brown wrote:
> > > BTW, Could we keep the spi->max_speed_hz if no controller->max_speed_hz?
> > > Always clamp the spi->max_speed_hz to 0 makes no sense.
> > Right, that's the fix.
> Seems it still doesn't fix the case that neither controller nor client dev
> provides the non-zero max_speed_hz. Do you think the patch is still
> necessary?
Right, something like this would help if we genuinely have no idea. We
probably shouldn't do it at validation stage which would be the other
thing since it might cause us to realy hurt performance on systems which
happen to have a sensible default in hardware but don't specify a
maximum - we might set too low a default speed for the actual transfer.
Please fix the coding style issue I mentioned and resubmit.
Attachment:
signature.asc
Description: PGP signature