Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller
@ 2016-05-16 17:52 Carina Willbold
  2016-05-17  7:39 ` Johannes Thumshirn
  2016-05-23 11:00 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Carina Willbold @ 2016-05-16 17:52 UTC (permalink / raw)


With this patch, the flash drive of the April 2016 MacBook9,1 12"
(A1534) is properly recognized and works just fine.

Signed-off-by: Carina Willbold <nvme at elfenteich.de>

---
 drivers/nvme/host/pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 4fd733f..207c697 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1732,6 +1732,8 @@ static int nvme_pci_enable(struct nvme_dev *dev)
 	/*
 	 * Temporary fix for the Apple controller found in the MacBook8,1 and
 	 * some MacBook7,1 to avoid controller resets and data loss.
+	 * For the controller found in the MacBook9,1 (device ID 0x2003), it
+	 * seems that this workaround is not necessary.
 	 */
 	if (pdev->vendor == PCI_VENDOR_ID_APPLE && pdev->device == 0x2001) {
 		dev->q_depth = 2;
@@ -2181,6 +2183,7 @@ static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_IDENTIFY_CNS, },
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },  /* for the MacBook 9,1 */
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, nvme_id_table);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller
  2016-05-16 17:52 [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller Carina Willbold
@ 2016-05-17  7:39 ` Johannes Thumshirn
  2016-05-23 11:00 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2016-05-17  7:39 UTC (permalink / raw)


On Mon, May 16, 2016@07:52:09PM +0200, Carina Willbold wrote:
> With this patch, the flash drive of the April 2016 MacBook9,1 12"
> (A1534) is properly recognized and works just fine.
> 
> Signed-off-by: Carina Willbold <nvme at elfenteich.de>

Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller
  2016-05-16 17:52 [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller Carina Willbold
  2016-05-17  7:39 ` Johannes Thumshirn
@ 2016-05-23 11:00 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2016-05-23 11:00 UTC (permalink / raw)


>  	 * some MacBook7,1 to avoid controller resets and data loss.
> +	 * For the controller found in the MacBook9,1 (device ID 0x2003), it
> +	 * seems that this workaround is not necessary.

No need for this comment.

>  	if (pdev->vendor == PCI_VENDOR_ID_APPLE && pdev->device == 0x2001) {
>  		dev->q_depth = 2;
> @@ -2181,6 +2183,7 @@ static const struct pci_device_id nvme_id_table[] = {
>  		.driver_data = NVME_QUIRK_IDENTIFY_CNS, },
>  	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
> +	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },  /* for the MacBook 9,1 */

But it might be worth to have a comment above these two entries like

	/*
	 * Controller that don't use the NVMe class code:
         */

and skip the comment after your newly added entry.

Otherwise this looks fine:

Reviewed-by: Christoph Hellwig <hch at lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-23 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-16 17:52 [PATCH] NVMe: Recognize the MacBook9,1 NVMe controller Carina Willbold
2016-05-17  7:39 ` Johannes Thumshirn
2016-05-23 11:00 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox