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

From: Mark Brown

Date: Fri Nov 13 2026 - 19:51:16 EST


On Wed, Nov 11, 2026 at 05:36:37PM +0800, shao.mingyin@xxxxxxxxxx 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.

Attachment: signature.asc
Description: PGP signature