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

William Zhang william.zhang at broadcom.com
Fri Nov 13 17:13:59 PST 2026


On Fri, Nov 13, 2026 at 4:51 PM Mark Brown <broonie at kernel.org> wrote:
>
> 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.
In that case,   Mingyin, please update the patch to ensure FCW >=1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5473 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20261113/3cfb2f56/attachment.p7s>


More information about the linux-riscv mailing list