Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp354080lqb; Tue, 4 Jun 2024 13:28:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWf9R9iWdjNr9csJS8xBGrFtg3bQP34o25y87Q+dTPFmKEt6QcgT9nCLDy/AHpt7Bm8gESjjq1NheS7IlCfkTVW6oWMUT2w3+sv5RkAXg== X-Google-Smtp-Source: AGHT+IHloVbea3dNiuAECdrD/vnIoWAD+IYdfxje7Q4l9U4bXGqORXQYXj8EdNHhMY78riTMoEHH X-Received: by 2002:a17:90b:e04:b0:2c0:76b:f466 with SMTP id 98e67ed59e1d1-2c27db03e68mr600541a91.5.1717532880216; Tue, 04 Jun 2024 13:28:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717532880; cv=pass; d=google.com; s=arc-20160816; b=acX9ZArc41l0L4/KU3RsdWAA1jkRhF71v2IAi6rXNuFrPusAbejYXdjuHtmFESlk1w 51x/rlr3NTxXh7a6K9nHge9Vj+habYfOoQhJQyP6V+Ru6yAdX7H5Ac2ZBN9KRO1S1KBU ZlwccWT98Vyd+gIi44TCONG6MFptjfvOE6MLkvDZGUiaIovHL3WjECf9FSlYhUmdXjaX nvMNdLzEGzR8azbqzhv/g+7epaZL67ume3ItG8qNuK6xg5l4XTBykW7GMfVbqklnRA3t svBDvveeyPyn/Thmer70iTyyJWiTlyZDLdJHgKQdXA0XuwIB7W/jY8pTC0+zGHApwoGJ /UDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=AJlhoYzof/mRafggBtXFJd4aZlpnbFLxb93rZdMSkuM=; fh=x4JEXdITJ03f7fvdFTw1BV69Q5AynuprZNh65fG5IYU=; b=Np4W+qkACA5HbQMxZuRyFRzVvaJVKdNOfbZgS7i02S90BM5dPVYaOAEnaezbeStlB3 J4zxnORgtiwRh1/L5FR4YMw5p0sr8l4H5mMMBLmidt/65wjeYL4aLE2Bun3xue89Oyq5 R2qLgXy876TV5eh+bBXMhctWMCHtYYClzUCQcod5bJgrnrl8mbIVUVfmJFMUhzDhKnt3 9x+Lfj41e49oVIUSwTMdtkwUkMOooRzESCNKNaxixLhKaFExJpHUBR3bYyhbQDsceauS IejzRIEXygtVcaMh/O0dByj2Je5aQCwl3hsfOm9IjtYrpI1H1eIbKEr5JyddwLlxgNwH qKVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=smGaAySO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1c2840b44si576107a91.161.2024.06.04.13.27.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 13:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=smGaAySO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D370D2850F7 for ; Tue, 4 Jun 2024 20:27:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EEE314B978; Tue, 4 Jun 2024 20:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="smGaAySO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4465E372; Tue, 4 Jun 2024 20:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717532868; cv=none; b=mRzbTVWP9uhSC3HwDTz0t+3hqPxn7HSJ7gY+OpTVgejn8JKLbrD/Fx/azeNLoucaowXI5MyYcZ+iUGv3hNIqa5MKoUlekLavK5JOzpoRPP/cc1gxOZxy/MKBV+AXwl54+0K/hbhhSkFJcwVHwuXraaLapnztRr0my9w2zz0UW+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717532868; c=relaxed/simple; bh=1WFPt6YbL8G4ZsYp/yQJxcMU9eiBBdcr3RYbZ6QX754=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=Yyk9BWJBsr5kni2PywsSPTJwKzY+OOTcz6IUHWZ9/whLoJoJp1TJOF12ImURKNFoxEhWbZvttfilbnuez+IkeWLD407W9Gnu9Ts5MnmQFoiWqQHbthbTLnK2XjCd+QKmGMqsmXxc/mj7sKQOaBpzzQ45sLVrfHL3VfLzVGPfX3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=smGaAySO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF80EC3277B; Tue, 4 Jun 2024 20:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717532867; bh=1WFPt6YbL8G4ZsYp/yQJxcMU9eiBBdcr3RYbZ6QX754=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=smGaAySOhkWIJykMXHinTp+dGQnhmzYqqhi1VLJH+Z29+8A6YD6CJ/NU2QmUdkOoW jsqnsaeIhP1DTiF7LsEi5hZFOS5vVWW5iezALy7DR4tdBjPZgmV8c8GypDxhJRIKAz Wxpmwg2VabkC0bzd5g9Q1cEjntEqWPI3zwvEJZeYBPws0USxWgQKrYmz8L7lBQf6Ab FpZsjcU0GJvOh2MJjn6ChFV1hrVKM8zuf0hvKWFUBTleIAsUP4qJICuE52/G7oUmtc Itw+MsrusyEgkV4Qe+vJn5Ef0B6954fQjgoJiTRjQIFQ75VFhE+XXsxO9d063YXT6+ KZyVye3hR+ihw== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 04 Jun 2024 23:27:40 +0300 Message-Id: Cc: , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v9 17/19] tpm: Add sysfs interface to allow setting and querying the preferred locality From: "Jarkko Sakkinen" To: "Ross Philipson" , , , , , , , , X-Mailer: aerc 0.17.0 References: <20240531010331.134441-1-ross.philipson@oracle.com> <20240531010331.134441-18-ross.philipson@oracle.com> In-Reply-To: <20240531010331.134441-18-ross.philipson@oracle.com> On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: > Expose a sysfs interface to allow user mode to set and query the preferre= d > locality for the TPM chip. > > Signed-off-by: Ross Philipson > --- > drivers/char/tpm/tpm-sysfs.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c > index 94231f052ea7..5f4a966a4599 100644 > --- a/drivers/char/tpm/tpm-sysfs.c > +++ b/drivers/char/tpm/tpm-sysfs.c > @@ -324,6 +324,34 @@ static ssize_t null_name_show(struct device *dev, st= ruct device_attribute *attr, > static DEVICE_ATTR_RO(null_name); > #endif > =20 > +static ssize_t preferred_locality_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct tpm_chip *chip =3D to_tpm_chip(dev); > + > + return sprintf(buf, "%d\n", chip->pref_locality); > +} Disagree with the naming. BR, Jarkko