public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v4 2/8] usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses
Date: Mon, 24 Aug 2020 13:04:37 +0200	[thread overview]
Message-ID: <20200824110443.71860-3-sr@denx.de> (raw)
In-Reply-To: <20200824110443.71860-1-sr@denx.de>

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 --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);
-- 
2.28.0

  parent reply	other threads:[~2020-08-24 11:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 11:04 [PATCH v4 0/8] mips/usb: Add Octeon xHCI USB support Stefan Roese
2020-08-24 11:04 ` [PATCH v4 1/8] usb: xhci: xhci-dwc3.c: Use dev_remap_addr() instead of dev_get_addr() Stefan Roese
2020-08-24 11:04 ` Stefan Roese [this message]
2020-08-24 11:04 ` [PATCH v4 3/8] usb: xhci: octeon: Add DWC3 glue layer for Octeon Stefan Roese
2020-08-24 11:04 ` [PATCH v4 4/8] mips: octeon: cpu.c: Add table for selective swapping Stefan Roese
2020-08-24 11:04 ` [PATCH v4 5/8] mips: octeon: Add mangle-port.h Stefan Roese
2020-08-24 11:04 ` [PATCH v4 6/8] mips: octeon: cache.c: Flush all pending writes in flush_dcache_range() Stefan Roese
2020-08-24 11:04 ` [PATCH v4 7/8] mips: octeon: Add USB DT nodes Stefan Roese
2020-08-24 11:04 ` [PATCH v4 8/8] mips: octeon: octeon_ebb7304_defconfig: Enable USB support Stefan Roese
2020-09-19 20:03 ` [PATCH v4 0/8] mips/usb: Add Octeon xHCI " Daniel Schwierzeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200824110443.71860-3-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox