# Re: \[PATCH v10 1/1\] can: usb: etas\_es58X: add support for ETAS ES58X CAN USB interfaces

- From: Marc Kleine-Budde \<mkl@pengutronix.de\>
- Date: 2021-01-13 16:07:14 
- List: linux-can
- Page: https://ratatoskr.run/linux-can/2021/01/9355102
- Thread: https://ratatoskr.run/linux-can/2021/01/9355098/t.md

```text
On 1/13/21 3:35 PM, Vincent MAILHOL wrote:
>> My understanding is that having a queue size being a power of two is
>> required in order not to use spinlocks (else, modulo operations would
>> break when the index wraparound back to zero). I tried to minimize the
>> number of spinlock: only one per bulk send or bulk receive.
> 
> Or do you mean to round up the skb_echo array length to the next power
> of two in the driver despite the actual size of the device FIFO? Did
> not think about that in the past but that should work.
> 
> I am going to think a bit more of how to improve that.

For the echo_skb rounding up might work, but you should round down, so that your
can directly use the masked value.

Marc
-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-can/2021/01/9355102/attachment/0) (application/pgp-signature, 488 bytes)
