From patchwork Tue Mar 7 00:25:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linda Knippers X-Patchwork-Id: 9607891 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 BC9DF60414 for ; Tue, 7 Mar 2017 00:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3A1F28482 for ; Tue, 7 Mar 2017 00:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A88FB2848D; Tue, 7 Mar 2017 00:25: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=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DFCA28482 for ; Tue, 7 Mar 2017 00:25:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5F0358034E; Mon, 6 Mar 2017 16:25:41 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on071e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::71e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 966278034E for ; Mon, 6 Mar 2017 16:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HPEnterprise.onmicrosoft.com; s=selector1-hpe-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=imdIfRBlN5/6UXQ2n0PT+wSXxXn6vN+OfS8ANbs9CaU=; b=m7BG6xPo4f2R4jJDt0v57x1ov0JaNXMEGNWI1aQbsJ5oixaIcjflX7IQ/Yu7ryDTt3E4x/QX2GVdJ+ufIk/DgAkB8RT5cQcbZieZvKrxAgZLwFZFIt9OjJLlhta2WRhJwZ0v4y9x45q2mCSutWMUMzfftvPItVjY1lQf7X8MSfA= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none; lists.01.org; dmarc=none action=none header.from=hpe.com; Received: from hp-dl380pgen9-02.lab.bos.redhat.com (66.187.233.206) by CS1PR84MB0167.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Tue, 7 Mar 2017 00:25:37 +0000 From: Linda Knippers To: Subject: [PATCH 2/3] Allow specifying a default DSM family Date: Mon, 6 Mar 2017 19:25:05 -0500 Message-ID: <1773e8607ae49fefbb288509603a0db353a72d91.1488844291.git.linda.knippers@hpe.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [66.187.233.206] X-ClientProxiedBy: CY4PR15CA0003.namprd15.prod.outlook.com (10.172.74.13) To CS1PR84MB0167.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.139) X-MS-Office365-Filtering-Correlation-Id: 1af617b8-218c-48ff-5d77-08d464f07ab9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CS1PR84MB0167; X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 3:jS29ifli9Gf9pa5oBQbFIl4NhDOv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AUhZJlcp5F0nnlyNsEU/ri38iIgAyB/0v4K+NKlALTm/eRv9KHBRzjXeV/VJjgZKqdE9YSShI0XCL6vz+fIlpURwqD+rcWOMJ6fZyt0nt7PUSHM8lzKLSjfKn9oCtOJsPSNQR10WZK26AzbZ5zrmLUzIeApI28IkX+V7CMjFIU//GXr8/pWwqLVjuFeL5DduVCWaB4GciaeCB+OMFH+cm70djF6ps0i081VvO4tCpYPai0Vt5az2d+P0jbMRRc3sCNQmKMTBMGNtOOG+I3uczc6Ns0l/kQ1SMMOd6lwPNdUx1d8DgCkq650o+XSkOB0OqvPjq1I8QlkCgLQYUM1Uq5jbmbJuXDR9rfzZc6U94zbjpA1IxFa/eMAG/1SKFFgTzm2iUnxh++VPb5buifG/eiKbPxS4FqAcr5FSchVszva+GM4WWjUciZrq0YI5u6YERT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(227479698468861); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:CS1PR84MB0167; BCL:0; PCL:0; RULEID:; SRVR:CS1PR84MB0167; X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 4:6vm3g2F4nfJ4zpYrAQCrJnMji/NAexqAoKE+lc0i8AHTQFgdih5xAxt78F6goCM94d4BxssXBShQyCVFYs0M6WjGXl2SCOI+3BbIMD/doXK7ldy+RqJV8FTuyKCrc+kmfoyUQ0o0sL4DtbaQahZ+uQP06lF0yTXLzTB06cKdP2FWABMFl8dIKc8/JsGpvcFOJfUeG5VEQ8uh05ejxka4L9mgCUjkZFY5RpY5n8jjVx89R2r2j8YWpamH2B0KMw7bobh9nBlagD1oz9o0WSlkyKxgYLb7v54Wn+CkUDj24TEiCodgKGf1KyySd/LLt+LG+A3SP32JHzsAth590gE64hxllnqzXSKL7K9rR4KaL7y1l38oGUa16JNlPLFxAE0Pd+Y0EN7fq/x2ZGURr++g28SKag2mNI7Xqjy8vKFTQwiMNaF78BGAndS8aMdBxnjIIlFeq5iyzuJzUCAk3iYSJynHuN2Uw0k+TVAW1nOV2mLtuchVAmPoENA7k+iD5g1jk011YLhg6/XOt0rROmkHEFWkHICo37SyOtrl0OZvtQibjNOea4OIdVJx3PAvIQr0F9zO/kdoTJr6FlBzwUhK6BsKGS//haGAkIjHGjefZOhr0Khdi5I4UTsxxqGj6PueX3YFHWiKbXBdzJSuEHehVyjRIM27rlt2U2va+AvDPI8= X-Forefront-PRVS: 0239D46DB6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39840400002)(39860400002)(39850400002)(39410400002)(39450400003)(5003940100001)(2351001)(5660300001)(189998001)(33646002)(50986999)(54906002)(66066001)(47776003)(6512007)(86362001)(76176999)(81166006)(50226002)(8676002)(92566002)(36756003)(53936002)(48376002)(50466002)(118296001)(38730400002)(6506006)(6916009)(110136004)(2950100002)(6666003)(42186005)(4720700003)(2906002)(305945005)(7736002)(4326008)(6486002)(6116002)(3846002)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0167; H:hp-dl380pgen9-02.lab.bos.redhat.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CS1PR84MB0167; 23:BNbTjXKCXyh3oZjuxOlOg4XtGE/kea97jd9BpGaO0?= =?us-ascii?Q?pKpb92zWVzYhvNKjowd0wtPeFNEk7neRiuaCIXzgVk3iSCgbS0Mg7/IU67hT?= =?us-ascii?Q?uFYlL8+F2jsDz4cZg/JtRclpcWPhMt5Znv9qNN6AoX/ptEfElp1o33jK1Dxf?= =?us-ascii?Q?PIGy/NLal7AxkBPb5PKuM9bNg/X+MpAPSO9bXwYMPwWJDOLHYO/SkpOgC4ea?= =?us-ascii?Q?1SaHPGHCzwCgw5W5u0dX6rJb4+bp5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3Sjw=3D?= X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 6:vpm5QNg1fVu1S1bvF4h4l+aLAuej+djl8yAIIP8x50pTXUL9SKuzS4xZbpp9tJD9qs+HXNAID816JWMFtY7yYjgnd5CIzqPuxytgqUz/mLsCS7GSb9Lw0K/6/O3Weh2asZS1j1/Bni2+0Pbzyq2p8Fu8BVIjNqGltuX155tGJWX4QvnRdwF2/IFxXMkyu/bIcRidV7WrNDZ6u6sfBR99n4y2juyMYNj7vhe3hYauSuzm2rG04oK2/E8uy9E81lkaMz0fkFcjzNXhRodmRsOYmUSF5P5Mc4JSL1fc3eEmEIRCuSFMUjurz8d0k5uqY3C1UFtAnfyQe63BD9YWdFGRuTTQ/yQcySPAd0aGm4ag9h3GbgrC2Yq9G3CJoK2Er3qY1YoIVcIbqSaYaVVDanOOPjbNaMphA058Iv1I96sywAM=; 5:eONEzDjLuFEuq13hjQoBH2ezODCWH+cqlv9cIhuReokL5oJp3Z//SCe6nKQSQr5IDQFRavJSQd34SunfvRFDFE42vhgtBcZkLJbX9gTtW57xcRJ66PWcK1m2xlzb/0veCwC+OLGZ0B4vtrlOfh489w==; 24:ixV1MAhN3FsGOpp3jrRaJZr4/MZ5afLrVpjpUNYOpk4/2G5KmsTHK9DkMP82bJ/1Qr3lJRtrpJfIH/BPo9isalIlzImz2rik3anBiyUZ59c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 7:TakuLx9eGNVyPiekucKoiAARabapSlCnbSs5d34NiQxW3CUVVvsEQU4V2NRgBUKuPZ+1vXavqHS9VNScshmIXTEYsO16gOaq5KgvwLuIgZfsxEi7OhRgc3c32EEM/7vbEGrZLl3oOvlGSErFm9yRT+V5HnGxNJibwucCMmM3hXZkL+nY22M4pDXex8le/AqL9V6+Gdc1UJ89HgkpkUVyMdl1t12fvqumcgH0dPHQrb72qLFg6+RRrix3uCTBta2uJcLlT5rov2O5JEVOfeDU57HvEHDC8BIGR0JC3ce1jrTZWJ+KayIBXQUcHxK5NFLc0N5a2OLUhIsrI2qMJv7pmQ== X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2017 00:25:37.4666 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0167 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Provide the ability to request a default DSM family. If it is not supported, then fall back to the normal discovery order. This is helpful for testing platforms that support multiple DSM families. It will also allow administrators to request the DSM family that their management tools support, which may not be the first one found using the current discovery order. Signed-off-by: Linda Knippers --- drivers/acpi/nfit/core.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 97d42ff..78c46a7 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -55,6 +55,11 @@ module_param(override_dsm_mask, ulong, S_IRUGO); MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions"); +static int default_dsm_family = -1; +module_param(default_dsm_family, int, S_IRUGO); +MODULE_PARM_DESC(default_dsm_family, + "Try this DSM type first when identifying NVDIMM family"); + LIST_HEAD(acpi_descs); DEFINE_MUTEX(acpi_desc_lock); @@ -1371,7 +1376,7 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, struct device *dev = acpi_desc->dev; unsigned long dsm_mask; const u8 *uuid; - int i; + int i = -1; /* nfit test assumes 1:1 relationship between commands and dsms */ nfit_mem->dsm_mask = acpi_desc->dimm_cmd_force_en; @@ -1399,10 +1404,23 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, * Until standardization materializes we need to consider 4 * different command sets. Note, that checking for function0 (bit0) * tells us if any commands are reachable through this uuid. + * First check for a requested default. */ - for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) - if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) - break; + if (default_dsm_family >= NVDIMM_FAMILY_INTEL && + default_dsm_family <= NVDIMM_FAMILY_MSFT) { + if (acpi_check_dsm(adev_dimm->handle, + to_nfit_uuid(default_dsm_family), 1, 1)) + i = default_dsm_family; + else + dev_dbg(dev, "default_dsm_family %d not supported\n", + default_dsm_family); + } + if (i == -1) { + for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_MSFT; i++) + if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), + 1, 1)) + break; + } /* limit the supported commands to those that are publicly documented */ nfit_mem->family = i;