From patchwork Thu Jul 20 18:43:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 9855577 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 ECAE4602BA for ; Thu, 20 Jul 2017 18:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0A5D2884B for ; Thu, 20 Jul 2017 18:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D56F42884E; Thu, 20 Jul 2017 18:43:58 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 7B0CA2884B for ; Thu, 20 Jul 2017 18:43:58 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 804B721CE749F; Thu, 20 Jul 2017 11:42:01 -0700 (PDT) X-Original-To: intel-sgx-kernel-dev@lists.01.org Delivered-To: intel-sgx-kernel-dev@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7771A21CE7466 for ; Thu, 20 Jul 2017 11:42:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jul 2017 11:43:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,384,1496127600"; d="scan'208";a="113640684" Received: from sjchrist-ts.jf.intel.com ([10.54.74.20]) by orsmga002.jf.intel.com with ESMTP; 20 Jul 2017 11:43:56 -0700 From: Sean Christopherson To: intel-sgx-kernel-dev@lists.01.org Date: Thu, 20 Jul 2017 11:43:55 -0700 Message-Id: <1500576235-9494-1-git-send-email-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [intel-sgx-kernel-dev] [PATCH] intel_sgx: register sgx_dev with a dynamic minor X-BeenThere: intel-sgx-kernel-dev@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Project: Intel® Software Guard Extensions for Linux*: https://01.org/intel-software-guard-extensions" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-sgx-kernel-dev-bounces@lists.01.org Sender: "intel-sgx-kernel-dev" X-Virus-Scanned: ClamAV using ClamSMTP The sgx device was being created with an implicit minor number of 0, as miscdevice.minor was not being initialized. Registering a fixed, unofficial minor number can result in /dev/sgx being unavailable, e.g. if another device is (also incorrectly) registered at 10,0. Signed-off-by: Sean Christopherson Reviewed-by: Jarkko Sakkinen --- drivers/platform/x86/intel_sgx/sgx_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/intel_sgx/sgx_main.c b/drivers/platform/x86/intel_sgx/sgx_main.c index 8124d02..32214cd 100644 --- a/drivers/platform/x86/intel_sgx/sgx_main.c +++ b/drivers/platform/x86/intel_sgx/sgx_main.c @@ -153,6 +153,7 @@ static const struct file_operations sgx_fops = { }; static struct miscdevice sgx_dev = { + .minor = MISC_DYNAMIC_MINOR, .name = "sgx", .fops = &sgx_fops, .mode = 0666,