[PATCH v2 3/5] spi: bcmbca-hsspi: fix division by zero for devices without a max speed

Mark Brown broonie at kernel.org
Fri Nov 13 16:51:06 PST 2026


On Wed, Nov 11, 2026 at 05:36:37PM +0800, shao.mingyin at zte.com.cn wrote:

> > IMHO the upper layer should fail ... rather than having the controller
> > driver to override with a risky 1Hz clock.

> Agreed; the fix belongs upstream of the driver, not in ->set_clk().
> Mark, which do you prefer: reject max_speed_hz == 0 in spi core, or
> have these two drivers clamp FCW >= 1?  I'll wait for your call and
> won't spin a v3 meanwhile.

Ideally the core should do this but that's quite hard to do due to knock
on effects of handling 0 as a default everywhere, together with having a
bunch of existing drivers that don't provide any information.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20261114/6392fb06/attachment.sig>


More information about the linux-riscv mailing list