Re: [PATCH] usb: xhci: Replace terrible formatting with different terrible formatting

2023-11-26 Thread Hector Martin
On 2023/11/23 8:50, Marek Vasut wrote: > Replace one type of terrible code formatting with a different > type of terrible code formatting. No functional change. > > Signed-off-by: Marek Vasut > --- > Cc: Bin Meng > Cc: Hector Martin > --- > driver

Re: [PATCH 0/8] USB fixes: xHCI error handling

2023-11-20 Thread Hector Martin
On 2023/11/20 21:15, Marek Vasut wrote: > On 11/20/23 11:45, Hector Martin wrote: >> >> >> On 2023/11/20 11:09, Marek Vasut wrote: >>> On 11/20/23 00:17, Shantur Rathore wrote: >>>> On Sun, Nov 19, 2023 at 8:08 PM Marek Vasut wrote: >>

Re: [PATCH 0/8] USB fixes: xHCI error handling

2023-11-20 Thread Hector Martin
On 2023/11/20 11:09, Marek Vasut wrote: > On 11/20/23 00:17, Shantur Rathore wrote: >> On Sun, Nov 19, 2023 at 8:08 PM Marek Vasut wrote: >>> >>> On 10/27/23 01:16, Hector Martin wrote: >>>> This series is the first of a few bundles of USB fixes we ha

Re: [PATCH 4/4] usb: storage: Implement 64-bit LBA support

2023-10-29 Thread Hector Martin
On 29/10/2023 21.11, Marek Vasut wrote: > On 10/29/23 08:23, Hector Martin wrote: >> This makes things work properly on devices with >= 2 TiB >> capacity. If u-boot is built without CONFIG_SYS_64BIT_LBA, >> the capacity will be clamped at 2^32 - 1 sectors. >> &

Re: [PATCH] usb: Ignore endpoints in non-zero altsettings

2023-10-29 Thread Hector Martin
On 29/10/2023 21.04, Marek Vasut wrote: > On 10/29/23 08:24, Hector Martin wrote: >> We currently do not really handle altsettings properly, and no driver >> uses them. Ignore the respective endpoint descriptors for secondary >> altsettings, to avoid creating duplicate en

[PATCH 2/2] usb: xhci: Hook up timeouts

2023-10-29 Thread Hector Martin
Now that the USB core passes through timeout info to the host controller, actually hook it up. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 32 drivers/usb/host/xhci.c | 23 +-- include/usb/xhci.h | 14

[PATCH 1/2] usb: Pass through timeout to drivers

2023-10-29 Thread Hector Martin
this is ignored in the individual drivers. Signed-off-by: Hector Martin --- common/usb.c| 21 ++--- drivers/usb/host/ehci-hcd.c | 5 +++-- drivers/usb/host/ohci-hcd.c | 5 +++-- drivers/usb/host/r8a66597-hcd.c | 5 +++-- drivers/usb/host/usb

[PATCH 0/2] USB fixes: (Re)implement timeouts

2023-10-29 Thread Hector Martin
OHCI to someone else if anyone cares :) This series needs to be applied after [1], since the xHCI changes depend on changes made there. [1] https://lore.kernel.org/u-boot/20231029-usb-fixes-1-v2-0-623533f63...@marcan.st/ Signed-off-by: Hector Martin --- Hector Martin (2): usb: Pass thr

[PATCH] usb: Ignore endpoints in non-zero altsettings

2023-10-29 Thread Hector Martin
work properly. Signed-off-by: Hector Martin --- common/usb.c | 9 + 1 file changed, 9 insertions(+) diff --git a/common/usb.c b/common/usb.c index aad13fd9c557..90f72fda00bc 100644 --- a/common/usb.c +++ b/common/usb.c @@ -463,6 +463,15 @@ static int usb_parse_config(struct usb_device

[PATCH 4/4] usb: storage: Implement 64-bit LBA support

2023-10-29 Thread Hector Martin
This makes things work properly on devices with >= 2 TiB capacity. If u-boot is built without CONFIG_SYS_64BIT_LBA, the capacity will be clamped at 2^32 - 1 sectors. Signed-off-by: Hector Martin --- common/usb_storage.c | 132 --- 1 file chan

[PATCH 3/4] usb: storage: Use the correct CBW lengths

2023-10-29 Thread Hector Martin
USB UFI uses fixed 12-byte commands (as does RBC, which is not supported), but SCSI does not have this limitation. Use the correct command block lengths depending on the subclass. Signed-off-by: Hector Martin --- common/usb_storage.c | 22 ++ 1 file changed, 14 insertions

[PATCH 1/4] scsi: Fix a bunch of SCSI definitions.

2023-10-29 Thread Hector Martin
0x9e isn't Read Capacity, it's a service action and the read capacity command is a subcommand. READ16 is not 0x48, it's 0x88. 0x48 is SANITIZE and that sounds like we might have been destroying data instead of reading data. No bueno. Signed-off-by: Hector Martin --- drivers/

[PATCH 2/4] usb: storage: Increase read/write timeout

2023-10-29 Thread Hector Martin
Some USB devices (like hard disks) can take a long time to initially respond to read/write requests. Explicitly specify a much longer timeout than normal. Signed-off-by: Hector Martin --- common/usb_storage.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common

[PATCH 0/4] USB fixes: Mass Storage bugs & 64bit support

2023-10-29 Thread Hector Martin
s, which depends on [1] being applied first. The USBMS part is logically stand-alone and can be applied in parallel before that. [1] https://lore.kernel.org/u-boot/20231029-usb-fixes-1-v2-0-623533f63...@marcan.st/ Signed-off-by: Hector Martin --- Hector Martin (4): scsi: Fix a bunch

[PATCH 2/2] usb: hub: Add missing reset recovery delay

2023-10-29 Thread Hector Martin
Some devices like YubiKeys need more time before SET_ADDRESS. The spec says we need to wait 10ms. Signed-off-by: Hector Martin --- common/usb_hub.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/common/usb_hub.c b/common/usb_hub.c index ba11a188ca64..858ada0f73be 100644 --- a/common

[PATCH 1/2] usb: kbd: Ignore Yubikeys

2023-10-29 Thread Hector Martin
ces. This is particularly important to avoid regressing some users, since YubiKeys often *don't* work due to other bugs in the USB stack, but will start to work once they are fixed. Signed-off-by: Hector Martin --- common/usb_kbd.c | 19 +++ 1 file changed, 19 insertions(+

[PATCH 0/2] USB fixes: Add missing timeout, ignore YubiKeys

2023-10-29 Thread Hector Martin
This mini series fixes one bug, but in the process makes YubiKeys work, which then regresses people who have one *and* a USB keyboard, since we only support a single keyboard device. Therefore patch #1 makes U-Boot ignore YubiKeys, so #2 does not regress things. Signed-off-by: Hector Martin

[PATCH v2 8/8] usb: xhci: Add more debugging

2023-10-28 Thread Hector Martin
A bunch of miscellaneous debug messages to aid in working out USB issues. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c

[PATCH v2 7/8] usb: xhci: Fix DMA address calculation in queue_trb

2023-10-28 Thread Hector Martin
We need to get the DMA address before incrementing the pointer, as that might move us onto another segment. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci

[PATCH v2 6/8] usb: xhci: Do not panic on event timeouts

2023-10-28 Thread Hector Martin
Now that we always check the return value, just return NULL on timeouts. We can still log the error since this is a problem, but it's not reason to panic. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --

[PATCH v2 5/8] usb: xhci: Fail on attempt to queue TRBs to a halted endpoint

2023-10-28 Thread Hector Martin
This isn't going to work, don't pretend it will and then end up timing out. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index db

[PATCH v2 4/8] usb: xhci: Recover from halted bulk endpoints

2023-10-28 Thread Hector Martin
ff-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index e02a6e300c4f..db8b8f200250 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -671,6 +671,14 @

[PATCH v2 3/8] usb: xhci: Allow context state errors when halting an endpoint

2023-10-28 Thread Hector Martin
elsewhere but not a good reason to crash. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d21e76e0bdb6..e02a6e300c4f 100644 --- a/drivers/usb/host

[PATCH v2 2/8] usb: xhci: Better error handling in abort_td()

2023-10-28 Thread Hector Martin
ng up with unexpected event errors. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 34 ++ include/usb/xhci.h | 2 ++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-r

[PATCH v2 1/8] usb: xhci: Guard all calls to xhci_wait_for_event

2023-10-28 Thread Hector Martin
xhci_wait_for_event returns NULL on timeout, so the caller always has to check for that. This addresses immediate explosions in this part of the code when timeouts happen, but not the root cause for the timeout. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 15

[PATCH v2 0/8] USB fixes: xHCI error handling

2023-10-28 Thread Hector Martin
edhat.com/show_bug.cgi?id=2244305 Signed-off-by: Hector Martin --- Changes in v2: - Squashed in a trivial fix for patch #1 - Removed spurious blank line - Added a longer description to the cover letter - Link to v1: https://lore.kernel.org/r/20231027-usb-fixes-1-v1-0-1c879bbcd...@marcan.st --- Hec

Re: [PATCH] fixup! usb: xhci: Guard all calls to xhci_wait_for_event

2023-10-26 Thread Hector Martin
On 27/10/2023 09.36, Marek Vasut wrote: > On 10/27/23 01:26, Hector Martin wrote: >> Gah, I should've paid more attention to that rebase. Here's a dumb >> fixup for this patch. I'll squash it into a v2 if needed alongside >> any other changes, or if it looks goo

[PATCH] fixup! usb: xhci: Guard all calls to xhci_wait_for_event

2023-10-26 Thread Hector Martin
Gah, I should've paid more attention to that rebase. Here's a dumb fixup for this patch. I'll squash it into a v2 if needed alongside any other changes, or if it looks good feel free to apply/squash it in directly. --- drivers/usb/host/xhci-ring.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 8/8] usb: xhci: Add more debugging

2023-10-26 Thread Hector Martin
A bunch of miscellaneous debug messages to aid in working out USB issues. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c

[PATCH 6/8] usb: xhci: Do not panic on event timeouts

2023-10-26 Thread Hector Martin
Now that we always check the return value, just return NULL on timeouts. We can still log the error since this is a problem, but it's not reason to panic. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --

[PATCH 7/8] usb: xhci: Fix DMA address calculation in queue_trb

2023-10-26 Thread Hector Martin
We need to get the DMA address before incrementing the pointer, as that might move us onto another segment. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci

[PATCH 4/8] usb: xhci: Recover from halted non-control endpoints

2023-10-26 Thread Hector Martin
ff-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5c2d16b58589..60f2cf72dffa 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -669,6 +669,14 @

[PATCH 5/8] usb: xhci: Fail on attempt to queue TRBs to a halted endpoint

2023-10-26 Thread Hector Martin
This isn't going to work, don't pretend it will and then end up timing out. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 60

[PATCH 3/8] usb: xhci: Allow context state errors when halting an endpoint

2023-10-26 Thread Hector Martin
elsewhere but not a good reason to crash. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d08bb8e2bfba..5c2d16b58589 100644 --- a/drivers/usb/host

[PATCH 2/8] usb: xhci: Better error handling in abort_td()

2023-10-26 Thread Hector Martin
t and ending up with unexpected event errors. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 34 ++ include/usb/xhci.h | 2 ++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host

[PATCH 1/8] usb: xhci: Guard all calls to xhci_wait_for_event

2023-10-26 Thread Hector Martin
xhci_wait_for_event returns NULL on timeout, so the caller always has to check for that. This addresses the immediate explosions in this part of the code, but not the original cause. Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 15 ++- drivers/usb/host/xhci.c

[PATCH 0/8] USB fixes: xHCI error handling

2023-10-26 Thread Hector Martin
other xHCI bugs and adding better debug logs. I believe this should fix this Fedora bug too: https://bugzilla.redhat.com/show_bug.cgi?id=2244305 Signed-off-by: Hector Martin --- Hector Martin (8): usb: xhci: Guard all calls to xhci_wait_for_event usb: xhci: Better error handling in

Re: RFC: Handling of multiple EFI System Partitions

2022-12-19 Thread Hector Martin
On 19/12/2022 19.52, Ilias Apalodimas wrote: > Hi Janne, > > [...] > function that can be called from board-specific code that sets the UUID. Thoughts? Would such a feature be useful on other hardware platforms? >>> >>> efi/boot/bootaarch64.efi is only a fallback if l

Re: RFC: Handling of multiple EFI System Partitions

2022-12-19 Thread Hector Martin
On 19/12/2022 04.40, Heinrich Schuchardt wrote: > The MacBooks only have one drive. Why would you want two ESPs on one drive? The boot model of these machines is fundamentally different from EFI. There is top-level, built-in multiboot support. The boot stages are: === global === 1. iBoot1 (globa

[PATCH] nvme: Do a clean NVMe shutdown

2022-07-31 Thread Hector Martin
: Hector Martin --- drivers/nvme/nvme.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c index a305305885ec..5fd2fb9ed6a6 100644 --- a/drivers/nvme/nvme.c +++ b/drivers/nvme/nvme.c @@ -27,9 +27,8 @@ #define