On 2019-04-30 09:42, Stanislaw Gruszka wrote: > If buffer size is not usb_endpoint_maxp (512 or 1024 bytes) multiple, > usb host driver has to use bounce buffer and copy data. For RX we can > avoid that since we alreay allocate q->buf_size (2kB) buffers and > mt76usb hardware will not fill more data as rx packet size is limited > by network protocol. However add error message if this assumption > somehow will be not true. > > Signed-off-by: Stanislaw Gruszka <sgruszka@xxxxxxxxxx> > --- > drivers/net/wireless/mediatek/mt76/usb.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c > index c299c6591072..025e072cff28 100644 > --- a/drivers/net/wireless/mediatek/mt76/usb.c > +++ b/drivers/net/wireless/mediatek/mt76/usb.c > @@ -447,8 +446,10 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb) > return 0; > > data_len = min_t(int, len, data_len - MT_DMA_HDR_LEN); > - if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) > + if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) { > + dev_err(dev->dev, "rx data too big %d\n", data_len); Please use WARN_ON_ONCE here, or at least dev_err_ratelimited if you think it's necessary to print data_len. - Felix