diff mbox series

[v4,2/8] usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses

Message ID 20200824110443.71860-3-sr@denx.de
State Accepted
Commit e68efa1ecf4552158451f9b097fbcc15ce927489
Delegated to: Daniel Schwierzeck
Headers show
Series mips/usb: Add Octeon xHCI USB support | expand

Commit Message

Stefan Roese Aug. 24, 2020, 11:04 a.m. UTC
Octeon uses mapped addresses for virtual and physical memory. It's not
that easy to calculate the resulting addresses here. So let's remove
this BUG_ON() completely, as it's not really helpful.

Please also note, that BUG_ON() is not recommended any more in the Linux
kernel.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>

---

Changes in v4:
- Add Reviewed-by tag from Bin

Changes in v3:
- Minor corrections to the commit text as suggested by Bin

Changes in v2:
- Completely remove BUG_ON() for this trans_event.buffer check
- Reword commit text

 drivers/usb/host/xhci-ring.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 092ed6eaf1..fd15f39906 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -726,8 +726,6 @@  int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,
 
 	BUG_ON(TRB_TO_SLOT_ID(field) != slot_id);
 	BUG_ON(TRB_TO_EP_INDEX(field) != ep_index);
-	BUG_ON(*(void **)(uintptr_t)le64_to_cpu(event->trans_event.buffer) -
-		buffer > (size_t)length);
 
 	record_transfer_result(udev, event, length);
 	xhci_acknowledge_event(ctrl);