Skip to content

While converting SATA on Apalis iMX6 to use driver model I noticed it

Marcel Ziswiler u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 0 repliesNew
  2. v22 patches 0 repliesSuperseded
  3. v13 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Added Simon's reviewed-by.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dm: device: fail uclass_find_first_device() if list_emptydrivers/core/uclass.c test/dm/core.c+5 -11 reply
2/2cmd: sata: add null pointer check for devcmd/sata.c+4 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 0/2] While converting SATA on Apalis iMX6 to use driver model I noticed it

crashing in case no SATA driver is actually there:

Apalis iMX6 # sata init
data abort

pc : [<8ff78e1a>]          lr : [<8ff78e1b>]

reloc pc : [<1781be1a>] lr : [<1781be1b>]
sp : 8df53068 ip : 00000001 fp : 00000002
r10: 8df612e8 r9 : 8df5ceb0 r8 : 8ffc2b28
r7 : 8ff746ed r6 : 00000000 r5 : 68abf82a r4 : 00000000
r3 : 8ff73d39 r2 : c0000000 r1 : 00000000 r0 : 0000000c
Flags: nzcv IRQs off FIQs off Mode SVC_32

Code: 47700025 6803b570 6bdd4604 f0254805 (68abf82a)

Resetting CPU ...

resetting ...

Investigating this I identified 3 places where no proper checking is done.

This patch set adds such checks leading to a graceful error instead:

Apalis iMX6 # sata init
Cannot probe SATA device 0 (err=-19)

Changes in v3:
- Added Simon's reviewed-by.

Changes in v2:
- Update dm_test_uclass_devices_find() to test this behaviour as suggested by Simon.
- Dropped "[PATCH 2/3] dm: sata: add null pointer check for dev" as suggested by Simon.
- Added Simon's reviewed-by.

Marcel Ziswiler (2):
dm: device: fail uclass_find_first_device() if list_empty
cmd: sata: add null pointer check for dev

 cmd/sata.c            | 4 ++++
 drivers/core/uclass.c | 2 +-
 test/dm/core.c        | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1