Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp450209yba; Wed, 24 Apr 2019 04:15:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgWegVj9kg/hJboeUXox/htaIjLqlnWRceREHuNZ3la5J7sMPMsIW7vbWq2dyliodyereF X-Received: by 2002:a17:902:b20f:: with SMTP id t15mr14084837plr.341.1556104504007; Wed, 24 Apr 2019 04:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556104503; cv=none; d=google.com; s=arc-20160816; b=ZXDNnRLb1THpSxqFHb+qvDK/xRgCX39IHdV1y0GBi2qYLvITrgLot5EAc8mGGbsKav IuD0wUHFGwgOhzhY+etseO13fCqXEfJxjBgo00rAM1M8axt6E2+YHr51PeUibbI3Pgqj PPXP/P0HrCn4ViBCTxvRB/bcPDYI4dqN5PKNMPj5SjieQHZivCGH+Ly/g9LQw7k2uVdH 9o5fwmSjFLui1LFZgA4JQH1+WWtKDteTEv+3xcDY3uFVfJKEHI9Dhv09k5sIL75n6r/g 9xi1N+oKNwS25jZ/LpZgp9W9AlGDTLTrZzW6T7Jk8r+ZsIkskYIhqYpOakGVRnLTEVUA /hzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0NVEl0/mP64PnevzOMKYjhPQK/rE1xp9CZKfxlxkfuk=; b=TSLjPE1CVZJ7F+E3dGuP1UIn12IZoZXJiD50lXgWFujnNJezILqlno1xTSEZQVooxd /xKPp8UWbbZAyiYkqfdN5HuP0nBiIDT7Eu0xvZo4i4DOHBS60FC35PHp2WdmHrFxVj30 vPRY7sOpPRyVuoKcBO/dhh+J8BUssOGfvHyoQrzsM8AHzL5zD0/fyhPPIGLq6lVjszNI 6bqOvQCGNTUSopC7Q0vYWTg16BHjEg/LGBmw/ymfbZqff7oLzyqvIsgz/u7tN1RPP8yD swXOAPnm1ZpIK7xuAJPl67blfFI8bQPwqkXZbXlteBifOWhpKExW0zuPgrOfuDSIndTk vOiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si19215825pfr.242.2019.04.24.04.14.48; Wed, 24 Apr 2019 04:15:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbfDXKfJ (ORCPT + 99 others); Wed, 24 Apr 2019 06:35:09 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:43711 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbfDXKfA (ORCPT ); Wed, 24 Apr 2019 06:35:00 -0400 Received: from orion.localdomain ([95.114.95.254]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MqK2d-1gy9Zw3L63-00nQ5I; Wed, 24 Apr 2019 12:34:51 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: axboe@kernel.dk, linux-ide@vger.kernel.org, linux-nvme@lists.infradead.org Subject: [PATCH 3/3] drivers: libata: add sysctl: 'libata.allow_tpm' for self-encrypted devices Date: Wed, 24 Apr 2019 12:34:41 +0200 Message-Id: <1556102081-11820-4-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556102081-11820-1-git-send-email-info@metux.net> References: <1556102081-11820-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1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linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org libata tpm functionality, needed for self encrypted devices (OPAL, ...), is currently disabled per default and needs to be enabled via kernel command line. This patch allows enabling it via sysctl. The implementation might look a bit 'naive', as there aren't any locks or barriers, etc. As we're dealing just w/ a plain boolean value, that's only checked when an tpm-related ioctl is called, we're fine w/ that. Signed-off-by: Enrico Weigelt, metux IT consult --- drivers/ata/libata-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d3044c9..80ba844 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -177,6 +177,13 @@ struct ata_force_ent { MODULE_VERSION(DRV_VERSION); static struct ctl_table ctl_libata[] = { + { + .procname = "allow_tpm", + .data = &libata_allow_tpm, + .maxlen = sizeof(libata_allow_tpm), + .mode = 0644, + .proc_handler = proc_dointvec, + }, {} }; -- 1.9.1