Skip to content

Conversation

@craftyguy
Copy link
Contributor

@craftyguy craftyguy commented Sep 15, 2025

Apple silicon support on Linux uses a separate platform driver called
'apple-nvme', and libnvme doesn't know about this transport. This fixes
a "No transport address for 'apple-nvme'" error when running on Apple
silicon, where libnvme was unable to enumerate nvme storage attached to
this platform.

$ nvme list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            xxxxxxxxxxxxxxxx     APPLE SSD AP2048Z                        0x1          2.00  TB /   2.00  TB      4 KiB +  0 B   532.140.
...

Signed-off-by: Clayton Craft clayton@craftyguy.net

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Sep 15, 2025
This patch was submitted upstream: linux-nvme/libnvme#1071
Without this, libnvme is unable to detect NVMe storage attached to Apple silicon.
@igaw
Copy link
Collaborator

igaw commented Sep 17, 2025

This change seems to be incomplete. There are a few more places where the transport is checked and it really looks like these places should also be covered. The documentation should also be updated accordingly.

I suppose it would be a good idea to collect the sysfs entries scripts/collect-sysfs and have a test for this transport.

@craftyguy
Copy link
Contributor Author

This change seems to be incomplete. There are a few more places where the transport is checked and it really looks like these places should also be covered. The documentation should also be updated accordingly.

I suppose it would be a good idea to collect the sysfs entries scripts/collect-sysfs and have a test for this transport.

Thanks for the info/guidance. I'm really unfamiliar with this codebase (and nvme stuff at this level), I saw an error and hacked my way through it with this patch 😅

I'll collect sysfs entries, and see if I can make sense of how to add tests + include this transport in other checks.

@igaw
Copy link
Collaborator

igaw commented Sep 18, 2025

Sure thing and don't get me wrong, this is highly appreciated. You can just dump the sysfs data dump here and I'll add a test if you can't figure it out. I am all in for getting this supported correctly.

bell-sw pushed a commit to bell-sw/alpaquita-aports that referenced this pull request Sep 18, 2025
[ commit ddc25fcdca0870ead38fcb7c640214b0dd71d24f ]

This patch was submitted upstream: linux-nvme/libnvme#1071
Without this, libnvme is unable to detect NVMe storage attached to Apple silicon.
externalmirrors-syncer bot pushed a commit to external-mirrors/pmaports that referenced this pull request Sep 23, 2025
- [ ] Fix bug with os-installer allowing users to select partitions even though we told it not to
  - https://gitlab.gnome.org/p3732/os-installer/-/issues/52

- [ ] Make the 'deploy' script more robust somehow. This could go sideways and wipe partitions on the macbook that require using DFU to restore (I did it, it works, but it's annoying and you lose data)

- [x] Add support for Apple nvme transport to libnvme, so udisks can 'see' the nvme storage
  -  linux-nvme/libnvme#1071
  - Patch submitted / merged in aports: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/90173

- [ ] The stage 2 binary distributed by the official Asahi installer has really old devicetrees that break loading the asahi GPU kernel driver on my M2 with the latest Asahi kernel.
  - This would be a nice way to resolve it, but still requires the Asahi folks to build a new UEFI-only image: AsahiLinux/u-boot#2
  - --> Waiting on: AsahiLinux/m1n1#497
@craftyguy craftyguy force-pushed the apple-nvme branch 2 times, most recently from b559599 to 9dab90f Compare October 1, 2025 21:34
@craftyguy
Copy link
Contributor Author

@igaw ok I had some time to look at this further, and tried my best to find other conditions and add a sysfs test for this transport.

There are a ton of docs/manpages in this project (which is amazing!) but I'm not sure what I need to update... Do you have any pointers? Thanks again for your help and patience :)

Apple silicon support on Linux uses a separate platform driver called
'apple-nvme', and libnvme doesn't know about this transport. This fixes
a "No transport address for 'apple-nvme'" error when running on Apple
silicon, where libnvme was unable to enumerate nvme storage attached to
this platform.

$ nvme list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            xxxxxxxxxxxxxxxx     APPLE SSD AP2048Z                        0x1          2.00  TB /   2.00  TB      4 KiB +  0 B   532.140.
...

Signed-off-by: Clayton Craft <clayton@craftyguy.net>

squash
@igaw
Copy link
Collaborator

igaw commented Oct 7, 2025

FWIW, just reformatted the if conditions. Looks great! Thanks a lot!

@igaw igaw merged commit 7f2243c into linux-nvme:master Oct 7, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants