linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
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	[thread overview]
Message-ID: <1556102081-11820-4-git-send-email-info@metux.net> (raw)
In-Reply-To: <1556102081-11820-1-git-send-email-info@metux.net>

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 <info@metux.net>
---
 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


  parent reply	other threads:[~2019-04-24 10:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 10:34 libata fixes for NVME + OPAL Enrico Weigelt, metux IT consult
2019-04-24 10:34 ` [PATCH 1/3] drivers: nvme: target: core: fix build break Enrico Weigelt, metux IT consult
2019-04-24 17:07   ` Sagi Grimberg
2019-04-25  1:00   ` Chaitanya Kulkarni
2019-04-26 11:48     ` Enrico Weigelt, metux IT consult
2019-04-25 14:48   ` Christoph Hellwig
2019-04-24 10:34 ` [PATCH 2/3] drivers: libata: introduce sysctl directory Enrico Weigelt, metux IT consult
2019-04-24 10:34 ` Enrico Weigelt, metux IT consult [this message]
     [not found] ` <CGME20190424103521epcas3p44a7fc17a216b5696a6feefc781136699@epcms2p8>
2019-04-25  6:36   ` [PATCH 1/3] drivers: nvme: target: core: fix build break Minwoo Im

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1556102081-11820-4-git-send-email-info@metux.net \
    --to=info@metux.net \
    --cc=axboe@kernel.dk \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).