Re: [PATCH 1/3] arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes

2023-10-28 Thread Marcel Ziswiler
On Fri, 2023-10-27 at 16:46 +0300, Roger Quadros wrote: > From: Siddharth Vadapalli > > Update main_bcdma and main_pktdma nodes for native configuration in the > absence of DM services. > > Reported-by: Nishanth Menon > Signed-off-by: Siddharth Vadapalli > Signed-off-by: Roger Quadros > --- >

Re: [PATCH 2/3] arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet

2023-10-28 Thread Marcel Ziswiler
On Fri, 2023-10-27 at 16:46 +0300, Roger Quadros wrote: > Update main_bcdma and main_pktdma nodes for native configuration in the > absence of DM services. u-boot k3-udma driver expects these additional > register fields else probe will fail. > > Reported-by: Nishanth Menon > Signed-off-by: Roger

Re: [PATCH 0/3] arm: dts: k3-am6: Fix Ethernet/DMA

2023-10-28 Thread Marcel Ziswiler
Hi Nishanth On Fri, 2023-10-27 at 15:46 -0500, Nishanth Menon wrote: > On 16:46-20231027, Roger Quadros wrote: > > Hi, > > > > Since commit [1], Ethernet is broken on TI AM62 and AM64 platforms. > > > > The commit [1] is not the culprit. It just unearths the problem by fixing > > the error check

Re: [PATCH 1/3] kbuild: Correct missing architecture-specific hyphens

2023-10-28 Thread Masahiro Yamada
On Thu, Oct 26, 2023 at 4:27 PM Simon Glass wrote: > > These should add a hyphen to indicate that it makes a adjective. Fix > them. > > Signed-off-by: Simon Glass > --- This is trivial. Applied to linux-kbuild. Thanks. git grep -i 'arch specific' or git grep -i 'architecture specific' fin

[PATCH 1/1] doc: short overlong title underlines

2023-10-28 Thread Heinrich Schuchardt
Title underlines should match the length of the title. Unfortunately docutils only catches underlines that are too short. Add some missing empty lines after titles. Signed-off-by: Heinrich Schuchardt --- doc/arch/arm64.ffa.rst | 20 ++-- doc/board/AndesTech/ae350

Re: Pull request for tpm-next-27102023

2023-10-28 Thread Heinrich Schuchardt
On 10/28/23 02:51, Tom Rini wrote: On Fri, Oct 27, 2023 at 02:26:16PM +0300, Ilias Apalodimas wrote: Hi Tom, The following changes since commit e29b932aa07fa0226d325b35d96cd4eea0370129: Merge branch '2023-09-30-Kconfig-updates' into next (2023-10-01 11:54:31 -0400) are available in the

Re: [PATCH 1/3] arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes

2023-10-28 Thread Roger Quadros
On 28/10/2023 11:10, Marcel Ziswiler wrote: > On Fri, 2023-10-27 at 16:46 +0300, Roger Quadros wrote: >> From: Siddharth Vadapalli >> >> Update main_bcdma and main_pktdma nodes for native configuration in the >> absence of DM services. >> >> Reported-by: Nishanth Menon >> Signed-off-by: Siddha

[PATCH] hikey960: Fix 404 links

2023-10-28 Thread Dylan Corrales
The build instructions for the hikey960 had some broken links. Update the links to use new vendor URLs. Also change build instructions to reference a different file name. Signed-off-by: Dylan Corrales Cc: Manivannan Sadhasivam --- board/hisilicon/hikey960/README | 14 +++--- 1 file cha

Re: [PATCH 1/4] sunxi: DRAM: H6: add barrier after finishing DRAM setup

2023-10-28 Thread Gunjan Gupta
Tested the patch. With only dsb, it hangs within 5 reboots itself. Adding udelay(50) moved it to once in 20 times. But it still hangs. So this patch does not solve the problem Thanks & Regards Gunjan Gupta

Re: [PATCH] mpc85xx: relocate code in non-SPL build

2023-10-28 Thread Tom Rini
On Fri, Oct 20, 2023 at 01:06:55AM +0200, Martin Fäcknitz wrote: > When building a non-SPL image, relocation is needed. This patch restores > the old behaviour before commit b35316fb67: CONFIG_SPL_SKIP_RELOCATE was > only defined if CONFIG_SPL_BUILD was defined. > > Fixes: b35316fb67cb ("Convert

Re: [PATCH] board: siemens: iot2050: Fix M.2 detection

2023-10-28 Thread Tom Rini
On Tue, Oct 17, 2023 at 07:20:14AM +0200, Jan Kiszka wrote: > From: Jan Kiszka > > The "simpler" the logic, the higher the probability to not test and get > things wrong, again: The absence of a "-PG2" suffix is not sufficient to > derive that we are on PG1. There is also "IOT2050-ADVANCED-M2".

Re: [PATCH v3] driver: misc: k3_avs: Add support for thermal shutdown

2023-10-28 Thread Tom Rini
On Thu, Oct 19, 2023 at 12:57:53PM +0530, Udit Kumar wrote: > To avoid thermal burn out, program thermal shutdown > value in VTM (Voltage and Thermal Manager) IP. > > Part of Linux kernel driver (drivers/thermal/k3_j72xx_bandgap.c) > is ported from kernel 6.6-rc1, which sets thermal shutdown valu

Re: [PATCH v2] iot2050: Allow for more than 1 USB storage device

2023-10-28 Thread Tom Rini
On Sun, Oct 22, 2023 at 08:07:26PM +0200, Jan Kiszka wrote: > From: Jan Kiszka > > This was lost in refactoring while some users of the IOT2050 expect it > to work: Make sure that up to 3 USB storage devices are probed. > > Fixes: 53873974a4b0 ("include: armv7: Enable distroboot across all conf

Re: [PATCH v1] board: toradex: verdin-imx8mp: enable usb device and fastboot support

2023-10-28 Thread Tom Rini
On Mon, Aug 28, 2023 at 11:38:02PM +0200, Marcel Ziswiler wrote: > From: Marcel Ziswiler > > Enable USB device and fastboot support which may be used to load the > Toradex Easy Installer FIT image. > > While at it also enable USB mass storage aka UMS support. > > Note that the i.MX 8M Plus rec

Re: [PATCH 1/1] config: qemu: relax print and console buffer size

2023-10-28 Thread Tom Rini
On Mon, Oct 16, 2023 at 11:54:45PM +0200, Heinrich Schuchardt wrote: > QEMU print and console buffer sizes have been restricted on QEMU below > their default values. > > One of the side effects of the print buffer size restriction is output > truncation of the 'efidebug dh' command. > > As QEMU

Re: [PATCH 1/2] misc: vexpress_config: Use member .priv_auto to set the private data

2023-10-28 Thread Tom Rini
On Wed, Oct 18, 2023 at 02:27:44PM +0800, Qi Feng wrote: > From: Wei Chen > > In current vexpress_config_probe code, it sets the uclass private data > directly. This will cause one compilation error: > drivers/misc/vexpress_config.c:114:27: error: lvalue required as left operand > of assignment

Re: [PATCH 2/2] vexpress64: Add MMC card to the BOOT_TARGET_DEVICES of FVP

2023-10-28 Thread Tom Rini
On Wed, Oct 18, 2023 at 02:27:45PM +0800, Qi Feng wrote: > From: Wei Chen > > Add MMC disk to FVP's BOOT_TARGET_DEVICES. This allows the user to boot > from MMC devices. > > Signed-off-by: Wei Chen > Signed-off-by: Qi Feng > Reviewed-by: Linus Walleij Applied to u-boot/master, thanks! --

Re: [PATCH] board: synquacer: Update the flash image layout

2023-10-28 Thread Tom Rini
On Thu, Oct 19, 2023 at 04:54:19PM +0300, Ilias Apalodimas wrote: > The SynQuacer Developerbox, in EFI mode, supports A/B capsule > updates and single image ones. The flash layout in the latter case is > outdated, update it with the new offsets and images > > Signed-off-by: Ilias Apalodimas > Te

Re: [PATCH] mpc85xx: relocate code in non-SPL build

2023-10-28 Thread Tom Rini
On Sat, Oct 28, 2023 at 04:21:18PM +0200, Martin Fäcknitz wrote: > Works now. I used T1042D4RDB_SDCARD_defconfig. > > relocate_code in arch/powerpc/cpu/mpc85xx/start.o before patch (non-SPL > build): > > 0dc0 : > dc0: 7c 61 1b 78 mr r1,r3 > dc4: 7c 89 23 78 mr r9,r4 >

[PULL] u-boot-sh/master_tmio_fixes

2023-10-28 Thread Marek Vasut
The following changes since commit fb428b61819444b9337075f49c72f326f5d12085: Merge branch '2023-10-24-assorted-general-fixes-and-updates' (2023-10-24 19:12:21 -0400) are available in the Git repository at: https://source.denx.de/u-boot/custodians/u-boot-sh.git master_tmio_fixes for you to

Re: [PATCH 1/3] kbuild: Correct missing architecture-specific hyphens

2023-10-28 Thread Randy Dunlap
On 10/28/23 02:50, Masahiro Yamada wrote: > On Thu, Oct 26, 2023 at 4:27 PM Simon Glass wrote: >> >> These should add a hyphen to indicate that it makes a adjective. Fix >> them. >> >> Signed-off-by: Simon Glass >> --- > > > This is trivial. > Applied to linux-kbuild. Thanks. > > > git gre

Re: [PATCH 3/3] arm64: boot: Support Flat Image Tree

2023-10-28 Thread Simon Glass
Hi Masahiro, On Fri, Oct 27, 2023 at 2:25 AM Masahiro Yamada wrote: > > On Thu, Oct 26, 2023 at 4:28 PM Simon Glass wrote: > > > > Add a script which produces a Flat Image Tree (FIT), a single file > > containing the built kernel and associated devicetree files. > > Compression defaults to gzip

[PATCH] get_maintainer.pl: update from Linux kernel v6.5

2023-10-28 Thread Tom Rini
Update U-Boot's version of scripts/get_maintainer.pl to sync it up with the latest changes to the Linux kernel's version of the same script. The last sync was with Linux kernel version v5.13-rc6. The commits to the kernel's get_maintainer.pl since then (starting with the most recent) are:

Re: [PATCH] test/py: always use autostart on tpm2 selftests

2023-10-28 Thread Ilias Apalodimas
Hi Simon On Fri, Oct 27, 2023, 22:15 Simon Glass wrote: > Hi Ilias, > > On Wed, 25 Oct 2023 at 18:23, Simon Glass wrote: > > > > Hi Ilias, > > > > On Wed, 25 Oct 2023 at 07:25, Ilias Apalodimas > > wrote: > > > > > > commit 789ed2784256 ("test/py: replace 'tpm2 init, startup, selftest' > se

[PATCH v2 0/3] arm: dts: k3-am6: Fix Ethernet/DMA

2023-10-28 Thread Roger Quadros
Hi, Since commit [1], Ethernet is broken on TI AM62 and AM64 platforms. The commit [1] is not the culprit. It just unearths the problem by fixing the error check in k3-udma.c. This issue was silently being ignored earlier due to wrong error check. [NULL instead of FDT_ADDR_T_NONE]. Fix the issue

[PATCH v2 1/3] arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes

2023-10-28 Thread Roger Quadros
From: Siddharth Vadapalli Update main_bcdma and main_pktdma nodes for native configuration in the absence of DM services. Reported-by: Nishanth Menon Signed-off-by: Siddharth Vadapalli Signed-off-by: Roger Quadros Reviewed-by: Nishanth Menon --- arch/arm/dts/k3-am625-sk-u-boot.dtsi | 23 +++

[PATCH v2 2/3] arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet

2023-10-28 Thread Roger Quadros
Update main_bcdma and main_pktdma nodes for native configuration in the absence of DM services. u-boot k3-udma driver expects these additional register fields else probe will fail. Reported-by: Nishanth Menon Signed-off-by: Roger Quadros Reviewed-by: Nishanth Menon Tested-by: Marcel Ziswiler -

[PATCH v2 3/3] arm: dts: k3-am642: Update main_bcdma and main_pktdma nodes

2023-10-28 Thread Roger Quadros
From: Siddharth Vadapalli Update main_bcdma and main_pktdma nodes for native configuration in the absence of DM services. Drop duplicate main_pktdma node in k3-am642-sk-u-boot.dtsi. Reported-by: Nishanth Menon Signed-off-by: Siddharth Vadapalli Signed-off-by: Roger Quadros Reviewed-by: Nisha

Re: [SPAM] [PATCH 1/1] doc: short overlong title underlines

2023-10-28 Thread Xavier Drudis Ferran
El Sat, Oct 28, 2023 at 12:03:12PM +0200, Heinrich Schuchardt deia: > Title underlines should match the length of the title. Unfortunately > docutils only catches underlines that are too short. > > Add some missing empty lines after titles. > > Signed-off-by: Heinrich Schuchardt Reviewed-by: Xa

Re: [PATCH v2] smbios: arm64: Allow table to be written at a fixed addr

2023-10-28 Thread Simon Glass
[unfortunately I am not receiving email from the list at present] Hi Heinrich, On Wed, 25 Oct 2023 at 21:39, Heinrich Schuchardt wrote: > > On 10/25/23 04:49, Simon Glass wrote: > > Hi Heinrich, > > > > On Tue, 24 Oct 2023 at 18:22, Heinrich Schuchardt > > wrote: > >> > >> > >> > >> Am 25. Okt

Re: [PATCH 0/3] arm: dts: k3-am6: Fix Ethernet/DMA

2023-10-28 Thread Nishanth Menon
On 08:16-20231028, Marcel Ziswiler wrote: [..] > > https://lore.kernel.org/linux-arm-kernel/20230810174356.3322583-1-vigne...@ti.com/ > > > > Marcel, could the Toradex team confirm as well? > > Yes, I just successfully tested it. With what you say above I also as

Re: [PATCH] mmc: sdhci: Rework SDHCI_QUIRK_BROKEN_R1B

2023-10-28 Thread Henrik Grimler
Hi Sean, Tested on odroid-u2 (exynos4412-odroid) on top of 2024.01-rc1, still works fine, so feel free to add: Tested-by: Henrik Grimler Best regards, Henrik Grimler On Fri, Oct 27, 2023 at 04:57:03PM -0400, Sean Anderson wrote: > As noted in commit 3a6383207be ("mmc: sdhci: add the quirk for

Re: [PATCH v2] smbios: arm64: Allow table to be written at a fixed addr

2023-10-28 Thread Tom Rini
On Sun, Oct 29, 2023 at 07:41:27AM +1300, Simon Glass wrote: > [unfortunately I am not receiving email from the list at present] > > Hi Heinrich, > > On Wed, 25 Oct 2023 at 21:39, Heinrich Schuchardt wrote: > > > > On 10/25/23 04:49, Simon Glass wrote: > > > Hi Heinrich, > > > > > > On Tue, 24 O

Re: [PATCH] mpc85xx: relocate code in non-SPL build

2023-10-28 Thread Martin Fäcknitz
Works now. I used T1042D4RDB_SDCARD_defconfig. relocate_code in arch/powerpc/cpu/mpc85xx/start.o before patch (non-SPL build): 0dc0 : dc0: 7c 61 1b 78 mr r1,r3 dc4: 7c 89 23 78 mr r9,r4 dc8: 7c aa 2b 78 mr r10,r5 dcc: 48 00 00 05 bl dd0 dd0:

[PATCH] test: eth: Don't crash if env_get returns NULL

2023-10-28 Thread Sean Anderson
env_get can return NULL if it fails to find the variable. Check its result before using it. Fixes: 6d9764c2a87 ("dm: test: Add a new test case against dm eth codes for NULL pointer access") Fixes: df33fd28897 ("test: eth: Add test for ethernet addresses") Signed-off-by: Sean Anderson --- test/

[RFC 1/1] rng: Provide a RNG based on the RISC-V Zkr ISA extension

2023-10-28 Thread Heinrich Schuchardt
The Zkr ISA extension (ratified Nov 2021) introduced the seed CSR. It provides an interface to a physical entropy source. A RNG driver based on the seed CSR is provided. It depends on mseccfg.sseed being set in the SBI firmware. Signed-off-by: Heinrich Schuchardt --- drivers/rng/Kconfig

[PATCH 00/15] nand: Add sandbox tests

2023-10-28 Thread Sean Anderson
This series tests raw nand flash in sandbox and fixes various bugs discovered in the process. I've tried to do things in a contemporary manner, avoiding the (numerous) variations present on only a few boards. The test is pretty minimal. Future work could test the rest of the nand API as well as the

[PATCH 01/15] spl: nand: Fix NULL-pointer dereference

2023-10-28 Thread Sean Anderson
spl_nand_fit_read unconditionally accesses load->priv. Ensure it is set. Fixes: 00e180cc513 ("spl: nand: support loading i.MX container format file") Fixes: 4620e8aabc1 ("spl: nand: support loading legacy image with payload compressed") Signed-off-by: Sean Anderson --- common/spl/spl_nand.c |

[PATCH 04/15] nand: spl_loaders: Only read enough pages to load the image

2023-10-28 Thread Sean Anderson
All other implementations of nand_spl_load_image only read as many pages as are necessary to load the image. However, nand_spl_loaders.c loads the full block. Align it with other load functions so that it is easier to determine how large of a load buffer we need. Signed-off-by: Sean Anderson ---

[PATCH 02/15] nand: Don't dereference NULL manufacturer_desc

2023-10-28 Thread Sean Anderson
When no manufacturer is matched, manufacturer_desc is NULL. Avoid dereferencing it in that case. Fixes: 4e67c571252 ("mtd,ubi,ubifs: sync with linux v3.15") Signed-off-by: Sean Anderson --- drivers/mtd/nand/raw/nand_base.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git

[PATCH 03/15] nand: Calculate SYS_NAND_PAGE_COUNT automatically

2023-10-28 Thread Sean Anderson
Contrary to what the help message says, this is the number of pages per block. Calculate it automatically based on SYS_NAND_BLOCK_SIZE and SYS_NAND_PAGE_SIZE. Signed-off-by: Sean Anderson --- README | 9 - configs/am335x_baltos_defconfig

[PATCH 06/15] spl: nand: Set bl_len to page size

2023-10-28 Thread Sean Anderson
Since commit 34793598c83 ("mtd: nand: mxs_nand_spl: Remove the page aligned access") there are no longer any users of nand_get_mtd. However, it is still important to know what the page size is so we can allocate a large-enough buffer. If the image size is not page-aligned, we will go off the end of

[PATCH 05/15] spl: legacy: Honor bl_len when decompressing

2023-10-28 Thread Sean Anderson
When allocating a buffer to load compressed data into, we need to ensure we have enough space for over- and under-flow due to alignment. Otherwise we will clobber the malloc bookkeeping data. Calculate the correct amount of overhead and use it when determining the size. Signed-off-by: Sean Anderso

[PATCH 07/15] cmd: nand: Map memory before accessing it

2023-10-28 Thread Sean Anderson
In sandbox, all memory must be mapped before accessing it. Do so for the nand command. Signed-off-by: Sean Anderson --- cmd/nand.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/cmd/nand.c b/cmd/nand.c index 71b8f964429..fe834c4ac5c 100644 --- a

[PATCH 08/15] spl: nand: Map memory before accessing it

2023-10-28 Thread Sean Anderson
In sandbox we must map memory before accessing it. Do so for the NAND load method. Signed-off-by: Sean Anderson --- common/spl/spl_nand.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 509e6047999..ff47767fe72 10064

[PATCH 09/15] mtd: Rename SPL_MTD_SUPPORT to SPL_MTD

2023-10-28 Thread Sean Anderson
Rename SPL_MTD_SUPPORT to SPL_MTD in order to match MTD. This allows using CONFIG_IS_ENABLED to test for MTD support. Signed-off-by: Sean Anderson --- common/spl/Kconfig| 2 +- configs/am335x_baltos_defconfig | 2 +- configs/am335x_evm_defconfig |

[PATCH 10/15] mtd: Add some fallbacks for add/del_mtd_device

2023-10-28 Thread Sean Anderson
This allows using these functions without ifdefs. OneNAND depends on MTD, so this ifdef was redundant in the first place. Signed-off-by: Sean Anderson --- drivers/mtd/nand/raw/nand.c | 2 -- drivers/mtd/onenand/onenand_uboot.c | 2 -- include/linux/mtd/mtd.h | 12 +

[PATCH 11/15] nand: Add function to unregister NAND devices

2023-10-28 Thread Sean Anderson
This performs the opposite of nand_register, allowing drivers to unregister nand devices. This is probably unnecessary for most regular drivers, but we expect sandbox drivers to get repeatedly bound/unbound, so this will help avoid dangling pointers. Signed-off-by: Sean Anderson --- drivers/mtd

[PATCH 12/15] nand: Allow reinitialization

2023-10-28 Thread Sean Anderson
NAND devices are destroyed in between unit tests. Provide a function to reinitialize the subsystem at the beginning of each test. Signed-off-by: Sean Anderson --- drivers/mtd/nand/raw/nand.c | 40 ++--- include/nand.h | 1 + 2 files changed, 34 inse

[PATCH 14/15] nand: Add sandbox driver

2023-10-28 Thread Sean Anderson
Add a sandbox NAND flash driver to facilitate testing. This driver supports any number of devices, each using a single chip-select. The OOB data is stored in-band, with the separation enforced through the API. For now, create two devices to test with. The first is a very small device with basic EC

[PATCH 13/15] arch: sandbox: Add function to create temporary files

2023-10-28 Thread Sean Anderson
When working with sparse data buffers that may be larger than the address space, it is convenient to work with files instead. Add a function to create temporary files of a certain size. Signed-off-by: Sean Anderson --- arch/sandbox/cpu/os.c | 17 + include/os.h | 13 +++

[PATCH 15/15] test: spl: Add a test for NAND

2023-10-28 Thread Sean Anderson
Add a SPL test for the NAND load method. We use some different functions to do the writing from the main test since things like nand_write_skip_bad aren't available in SPL. We disable BBT scanning, since scan_bbt is only populated when not in SPL. We use nand_spl_loaders.c as it seems to be common

[PATCH 0/3] tpm: Start to tidy up TPM tests

2023-10-28 Thread Simon Glass
This series is a starting point only. It tries to provide some direction for how the TPM tests should be run on real hardware and on sandbox. For sandbox, things are relatively easy since the TPM is reset before each test. Tests should start up the TPM before doing anything. Tests can be run in pa

[PATCH 1/3] tpm: sandbox: Support self-test continue in emulator

2023-10-28 Thread Simon Glass
Add support for the self-test continue command in the TPM v1.2 emulator, to match the functionality in the TPM v2 emulator. Signed-off-by: Simon Glass --- drivers/tpm/tpm_tis_sandbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbo

[PATCH 2/3] tpm: Convert sandbox-focussed tests to C

2023-10-28 Thread Simon Glass
Some of the Python tests are a pain because they don't reset the TPM state before each test. Driver model tests do this, so convert the tests to C. This means that these tests won't run on real hardware, but we have tests which do TPM init, so there is still enough coverage. Rename and update the

[PATCH 3/3] tpm: Drop unwanted special cases for sandbox

2023-10-28 Thread Simon Glass
These don't seem to be needed. Add a few notes about what to do next. Also mention parallel tests in at the top of thefile. Signed-off-by: Simon Glass --- test/py/tests/test_tpm2.py | 44 +- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/tes

RE: [RFC 1/1] rng: Provide a RNG based on the RISC-V Zkr ISA extension

2023-10-28 Thread Chanho Park
Hi, > -Original Message- > From: U-Boot On Behalf Of Heinrich > Schuchardt > Sent: Sunday, October 29, 2023 8:26 AM > To: Rick Chen ; Leo > Cc: Sughosh Ganu ; u-boot@lists.denx.de; Heinrich > Schuchardt > Subject: [RFC 1/1] rng: Provide a RNG based on the RISC-V Zkr ISA > extension > >

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

2023-10-28 Thread Hector Martin
This series is the first of a few bundles of USB fixes we have been carrying downstream on the Asahi U-Boot branch for a few months. Patches #1-#6 fix a series of related robustness issues. Certain conditions related to endpoint stalls revealed a chain of bugs throughout the stack that caused U-Bo

[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 2/8] usb: xhci: Better error handling in abort_td()

2023-10-28 Thread Hector Martin
If the xHC has a problem with our STOP ENDPOINT command, it is likely to return a completion directly instead of first a transfer event for the in-progress transfer. Handle that more gracefully. We still BUG() on the error code, but at least we don't end up timing out on the event and ending up wi

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

2023-10-28 Thread Hector Martin
There is a race where an endpoint may halt by itself while we are trying to halt it, which results in a context state error. See xHCI 4.6.9 which mentions this case. This also avoids BUGging when we attempt to stop an endpoint which was already stopped to begin with, which is probably a bug elsewh

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

2023-10-28 Thread Hector Martin
There is currently no codepath to recover from this case. In principle we could require that the upper layer do this explicitly, but let's just do it in xHCI when the next bulk transfer is started, since that reasonably implies whatever caused the problem has been dealt with. Signed-off-by: Hector

[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 db8b8f200250..a969eafd

[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 --git a/driver

[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-r

[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 i