Re: [PATCH] spi: spi-mtk-nor: fix timeout calculation overflow

2020-09-22 Thread Chuanhong Guo
On Tue, Sep 22, 2020 at 7:43 PM Chuanhong Guo wrote: > > CLK_TO_US macro is used to calculate potential transfer time for various > timeout handling. However it overflows on transfer bigger than 512 bytes > because it first did (len * 8 * 100). > This controller typically operates at 45MHz. Th

[PATCH] spi: spi-mtk-nor: fix timeout calculation overflow

2020-09-22 Thread Chuanhong Guo
CLK_TO_US macro is used to calculate potential transfer time for various timeout handling. However it overflows on transfer bigger than 512 bytes because it first did (len * 8 * 100). This controller typically operates at 45MHz. This patch did 2 things: 1. calculate clock / 100 first 2. add