Bug 105621

Summary: NVE not found on new 2015 Macbook (NOT PRO)
Product: IO/Storage Reporter: derarnold (Derarnold)
Component: Block LayerAssignee: Jens Axboe (axboe)
Status: RESOLVED WILL_FIX_LATER    
Severity: blocking CC: Derarnold, jinxinzheng, vedant
Priority: P1    
Hardware: IA-64   
OS: Linux   
Kernel Version: 4.2.0-11-generic #13-Ubuntu Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg after manually loading i2c-801
lsmod after manually loading i2c-801
lspci after manually loading i2c-801

Description derarnold 2015-10-07 13:27:08 UTC
Created attachment 189611 [details]
dmesg after manually loading i2c-801

The internal NVE is not found. Information (Thank you TJ):

I think the reason the MacBook NVMe SSD isn't being found is Apple messed up and gave it the wrong PCI Class ID:


drivers/block/nvme-core.c: "#define PCI_CLASS_STORAGE_EXPRESS       0x010802" 

Apple: "pci 0000:03:00.0: [106b:2001] type 00 class 0x018002"

PCI Class 01 == Mass Storage, 08 == Non-Volatile memory controller, 02 == NVM Express

Clarification: "messed up" == the controller device isn't really NVMe.

The iFixIt tear-down Step 14 [1] shows a custom application processor, 338S00055, in a Package-on-Package with a SK Hynix H9TKNNN4GDMRRR-NGM 4 Gb (512 MB) LPDDR2-SDRAM on top. The 338S00055 has the markings:

338S00055
NPK813.00
504600-K12
AM 1507
S1X A2

[1] https://www.ifixit.com/Teardown/Retina+Macbook+2015+Teardown/39841#s90315
Comment 1 derarnold 2015-10-07 13:27:31 UTC
Created attachment 189621 [details]
lsmod  after manually loading i2c-801
Comment 2 derarnold 2015-10-07 13:27:53 UTC
Created attachment 189631 [details]
lspci  after manually loading i2c-801
Comment 3 Jens Axboe 2015-10-07 14:40:19 UTC
This requires someone take a look at the device, figure out what it is. I know people have tried forcing the nvme driver to recognize it, but that didn't work. So for now, there's really nothing I can do about it. If it's nvme, it's not compliant. If it isn't nvme, then this requires someone write a driver for it. I'm closing the bug.
Comment 4 Vedant Lath 2015-10-31 22:57:03 UTC
The SSD works after applying the patch at [1], thanks to Stephan Günther. It's a quirk in the SSD.

It still requires manual binding because of the incorrect PCI class code:
$ sudo modprobe nvme
$ echo "106b 2001" | sudo tee /sys/bus/pci/drivers/nvme/new_id

1: http://lists.infradead.org/pipermail/linux-nvme/2015-October/002947.html
Comment 5 Zheng Jinxin 2015-11-18 07:36:34 UTC
In 4.4-rc1 the Apple NVMe controller is supported already. However there is still a serious problem regarding the combination of queue depth and FLUSH commands.
We should need a hotfix from here:
http://lists.infradead.org/pipermail/linux-nvme/2015-November/003077.html

I have been testing the patch for a couple of days. It seems to work quite well. Limiting the I/O queue depth to 2 does not hurt the disk performance too drastically for daily use, as mentioned in the link.