From patchwork Fri Feb 24 17:16:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 9590831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B2DD60578 for ; Fri, 24 Feb 2017 17:17:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 926FF2871B for ; Fri, 24 Feb 2017 17:17:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86F4228727; Fri, 24 Feb 2017 17:17:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31B692871E for ; Fri, 24 Feb 2017 17:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750995AbdBXRRf (ORCPT ); Fri, 24 Feb 2017 12:17:35 -0500 Received: from mail-by2nam03on0073.outbound.protection.outlook.com ([104.47.42.73]:11538 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751380AbdBXRRa (ORCPT ); Fri, 24 Feb 2017 12:17:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnexlabs.onmicrosoft.com; s=selector1-cnexlabs-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7OcFsFbtk4/JVbbksAiQBmunUyt5efeG0/GBcGPn0Vs=; b=rkCZSHuvJXmWgIxZ0OfLVlGJJ6l0YuyQq+epmv3EJ7GVjn0dVwKqOtmwGA+xLB5gAgVmd9V1MI7Rks9T+J4KQ4S69j1BPR97apE5tpLyL1iD5CCxavsYSXvwqqSgXvaEC5QuZK58JyEVFc97DTEV9jgWXi6jzK7azJIFtzrVcIs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matias@cnexlabs.com; Received: from skyninja.cnexlabs.com (193.106.164.211) by MWHPR06MB2784.namprd06.prod.outlook.com (10.175.137.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Fri, 24 Feb 2017 17:17:20 +0000 From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: , CC: =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 1/2] lightnvm: add generic ocssd detection Date: Fri, 24 Feb 2017 18:16:48 +0100 Message-ID: <20170224171649.27409-1-matias@cnexlabs.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [193.106.164.211] X-ClientProxiedBy: AM5PR0602CA0008.eurprd06.prod.outlook.com (10.175.46.146) To MWHPR06MB2784.namprd06.prod.outlook.com (10.175.137.141) X-MS-Office365-Filtering-Correlation-Id: d577facf-483d-4de6-7250-08d45cd8fe0d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR06MB2784; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2784; 3:YWuqFbaUYwcFjvabqDsUtRAiFIIDUlH6C7f+r/a7VAJIptlp/Gss7RKrSKNkz5jPr6I9UStaK/XU0j64jVbqHElOZbKtSC90XwhDExvOwOYSmhrLwaFdh+KYyAu4Nk5j+FOJ3WgTNSyQzDOJ+MPGvTI19SPLQ+/DAXTtWi6bMQq3vgW0xRTqd6ZYDqvEpvFsalKztXvH1CqGyQBycY49NYCRyyDMoNPmp2X6312mzC09Cao3xP2xdPRaa7bYg7zyF9R2FhRzwFnQbvVFUpijdQ==; 25:5KL6UA9Pw1DfsyyJIsJ4H7cabEwBGLarsCpra5Vc/pP+gFgU4K4XuFGkk3yvwYBOpBjkaxPMnpNvBCIX/aZRMOuwdULzA8E0r/wDloa1pnTeN8Mlz+qQMtJYMYnJtNx1iJu8hePtY2JouJKxWgI3LxEmO2tl8Ss3Io5xV73lbHV1hkGVc6Dnpt5eY4mBQhcNAguxVzOTIWuQ5w9S9vZrZW+sYjEC3ATM7SeIr5Ih8yTVPLollbNGdhpPaIcHwV4x6VMTSTx9m891W9BunHSuMrBpfgJbYBrr46c6FBuEeh6jWV5YCEbr8kP5ucZb8iQKP5x7b0L0JHdFWHiSniiZxagv6ocW33H/vSoDix8UfhCwRfFTXrunpZtAeGdgiYA4r1mwA1vPB9DbkIJZOKqbyuW+vLWZY6mx3Op3NllJ2RzN8I7mtKZRuns0a03SIivRrEhaBouFCIgIfjZskb4BJg== X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2784; 31:rWi0JpDW8+ryby55RMvvwmsCt0iw6+QwoNpu4Y2ZnpFHFNAPh4Ju5c0GEq3z3ZU6jqradDpzXjPvNELgvfpQsyoovjwy3GssKgVmNmZBFcBfLXieqThIB4iKG9EBDa9+5a+PpGMK9CKpuy7p/twN36M5jGMYNE7MB9b7zodJGcLGIU35HQrgb0HBa79r0NFjJyFGe54HPZZriXQMVQCxaCfnsqEZqO8IVRS6NsLIG0E=; 20:FpnSOOvn3yVB6csKq2FSsE/XFaYTedaaA8D+whKfmC4IPXR73buCEAC/J54zajHxNR7OQ1LkWzNWTck2cdVJaPCD5SZkILAnuqIm8+8m7SOJB0A1suI61cL6N1nvCtcSIdQvFEdDYggdBRXy1O/RAIdVKBML+Y2v2JRPwUy6I78= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123562025)(20161123558025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:MWHPR06MB2784; BCL:0; PCL:0; RULEID:; SRVR:MWHPR06MB2784; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2784; 4:LJKcy8AWVF+v8GAx9369nctuGxdUmQ8HUPdQ1W0pKP2KPtOmlTlup+WiPZhmmn7285PN3UP5lNQXGcvWw21b9xvko8lrdv8X5AIya0n5NvsTCh1P0XK6Pbvc0nvJ+OQX7rtsY1ng+0Y59BpuwfAfWu29Wl5o33Iol2bXeGlfTfKvhxT+ccpoFtvp6PytKWGES58usRGtAqJsD+g+AJTMIiRypzndgnjMarIpDUZGX6gLcI3+IEn1DcxFJ2ji7rD8phRGh5hFEWwjgvz995ZtznbvjCrKGeRm2F7x7Ec45gjGiIubskTBqOP+beT9d4N+5OENQMh+/ukNLUen2bQOcnP+l7vNaB8/0dd3P8BWj5voGCjNQIbt4AZUx3FzYGsvVFzb2cQjZwuFJb7rF/i3GJ7nhVmLrdJOX9/AT/i5JUwWv7YaYK9X64WMkYQ+es+dL1+6a5tLVFfz2id5aIAFkgczouH7ACayFovHDDPD7RyeR0D31gEv5Uq8vsL2V2nNTAbcfQnN2FvXar3wzUjRX+abaR+aYmzlCQbd0l7tiqJ2+m9sb8y6+Jn0ugd/4/GvtI2fvFZF4OzVs/sp6MxRxMvnzDz1lOchqDlHQ08dlmk= X-Forefront-PRVS: 0228DDDDD7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(97736004)(105586002)(92566002)(25786008)(86362001)(36756003)(189998001)(106356001)(50466002)(38730400002)(107886003)(450100001)(66066001)(2870700001)(47776003)(7736002)(305945005)(42186005)(53936002)(5820100001)(53416004)(50986999)(6666003)(81166006)(1076002)(81156014)(23676002)(8676002)(6116002)(3846002)(50226002)(5660300001)(68736007)(2906002)(101416001)(4326007)(33646002)(6486002)(69596002)(41533002)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR06MB2784; H:skyninja.cnexlabs.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cnexlabs.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjA2TUIyNzg0OzIzOmVxSlZpMHozR0llVGMvd21kNU8xTkZvaEIz?= =?utf-8?B?UGkrSS9nV3ZLZW9iOHBlSnRhMzlvRUJjelBBa0VhcE40WElPRGZhMENhTzIz?= =?utf-8?B?bFJGeWYyc25CYU5qcFVablBYdnhLMUxoRG5CQkZBck9GZjZBTjhRMm1tSzRB?= =?utf-8?B?T2RSeTlrbDNLampYK2Y2bmpnTG0xSS82UitReUYzRzdYTjJod3M0cURwSmlI?= =?utf-8?B?dldXcUVLM0l2U1k2WEhlKzdtNmkrQi9GY0VwNmRTWWVNTU5MeTdZck9OT3R3?= =?utf-8?B?eldqdXZSYitreENKb2JBR2l4U2Z2MS9TQUZnV3JCYld6V0xGR25kV2pPODZC?= =?utf-8?B?c0dmR2pjRjl4ZVgxYVR5akVPYStpd2FTOWpSa3Z4SW1kUjduNnJDamRyd3lr?= =?utf-8?B?U0JDbGFPN04vNU5RTFU3Qm52WXNQek5hTGlIRTNJZ3pJbHpYM0FpNjJ4OG9q?= =?utf-8?B?M2xwTWh6MkF4RzZkVFlaS2t5WWFNMTF3d2F0emd6Q1FCWWJBLzY5V1QrdGdZ?= =?utf-8?B?SzI3TGVnMWFtd1hhTERwejNqQ21nOWk1M012Y1lvUFFCUng0Y0dMbWowNHhJ?= =?utf-8?B?WVRTcFBUOUhGeXlYN2x5YWdPY21tQlpSOGdsU3dBeHVSZy8yT0hhVjMyQ2gx?= =?utf-8?B?QURWTjByYVJjc3FGWjhydm83QU43eGlKdGNVN3hPeHkyRmoyZ0xRWlZ0ckNK?= =?utf-8?B?YzdJcnRiRkhhVlFZ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-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2017 17:17:20.2650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2784 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP More implementations of OCSSDs are becoming available. Adding each using pci ids are becoming a hassle. Instead, use a 16 byte string in the vendor-specific area of the identification command to identify an Open-Channel SSD. The large string should make the collision probability with other vendor-specific strings to be near nil. Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 4ea9c93..e37b432 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -986,6 +986,9 @@ int nvme_nvm_ns_supported(struct nvme_ns *ns, struct nvme_id_ns *id) /* XXX: this is poking into PCI structures from generic code! */ struct pci_dev *pdev = to_pci_dev(ctrl->dev); + if (!strncmp((char *)id->vs, "open-channel ssd", 16)) + return 1; + /* QEMU NVMe simulator - PCI ID + Vendor specific bit */ if (pdev->vendor == PCI_VENDOR_ID_CNEX && pdev->device == PCI_DEVICE_ID_CNEX_QEMU &&