Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp571138imm; Fri, 29 Jun 2018 02:47:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezDm7ws78+98FKzTtwssWUmJpoXQIgP4RynrquzGCB97/U9oIABdq5OTkB3JQHGa/Kk4Ng X-Received: by 2002:a62:3d0c:: with SMTP id k12-v6mr10582494pfa.179.1530265658073; Fri, 29 Jun 2018 02:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530265658; cv=none; d=google.com; s=arc-20160816; b=utNlmPz+eAYlUOgoHUM8EICraSNCpfuffokKwEA2zQM++biM4PKY/QUxZGDup0I5e7 TXstrye9NlMyEUvdgfmmu8eeMiYSHl5wSVOUQvaCv02/Ib/5yhZpSjWgpS7uCCSS39BL Qt6xFbAYqJ9tZ1LevomXCDJDF470TLCkg41FiWnDpfDZADRG4RvQtapxSGhfactV2TvA Zl4z6JjEZQn6Bw3IfCPcaqD3ou/jP52AUW3EWuKeb3VrRt9O4t1zwn1aAeQA2TPOiDTL 78h7UJ0q7a+rF3hSFnqFJsa46Ct+QkNF6tMK2RxuMYgooDuURSeykF9GDr5RdmTLG2Wf mCuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=OzgGn+Q4isfRNiycbtBKaigAmf6rTndiL1fQJSnnjt4=; b=qQ4mdiNW9CEJi0KvtyZLkRWXTmTUozLWP0+YnGd4XrC3+ORgdXsZWAEBtAYv9+EC/I 9seNeoZBkfOcHR4zCG3lKwnXPYOayCtXUXA4Vf9MGNizH63mzxU9B2o6NppubH+McWRk ygyUiGVYNN5lLii5jzrWaXKsNts2PNfmHAqPq4lZ4jNMLzGRPM/C24BXf/+8JUJG99DR 7WuRcfxW3hQcrJPOphIU6DAVcaZh8dS9b+y463TH28IQEHCX07HCudsA0+VtyxB/cXi5 +PnLEsqxntUkNtwQlG4km9gAX19ro82BS4xCGYb90dA+oaEblVlugLxFKpbRyfPXeEjs UIVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MQN0n0cY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e72-v6si9178829pfd.352.2018.06.29.02.47.23; Fri, 29 Jun 2018 02:47:38 -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; dkim=pass header.i=@chromium.org header.s=google header.b=MQN0n0cY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934779AbeF2INV (ORCPT + 99 others); Fri, 29 Jun 2018 04:13:21 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35044 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934739AbeF2INR (ORCPT ); Fri, 29 Jun 2018 04:13:17 -0400 Received: by mail-pg0-f67.google.com with SMTP id i7-v6so3659312pgp.2 for ; Fri, 29 Jun 2018 01:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=OzgGn+Q4isfRNiycbtBKaigAmf6rTndiL1fQJSnnjt4=; b=MQN0n0cYBJrBiAfwmygEa8LMaowCTm8fdnpUdHO4d/aVjKxAHCFy06vKj37KPtmnJY FUnhMmVB5Bop7IWhhUF6QVTdQkZkpMxBAl8kFJgyGIU5uRTHsiQzVLqsGnzpOGQV7YW0 H+k0it/rvZgOi+GmWfv7sKx6cfsw27/3BT0mw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OzgGn+Q4isfRNiycbtBKaigAmf6rTndiL1fQJSnnjt4=; b=MBL1tHyjEuyC8IR8ccyoV2nk7g9amvYsLUSohCgTlUyvIJKxeEP1bJVZTY3o5lkKY3 cF1nQ9aAK9pQfFArIILCcoACnKkyXPAglNpOyaLAqpeJFX1NvWt2Ml8dgO2JEyZmuJjl lttInIM+uYNhg9eTdAOMqhLJ+deqKuBnpYFVkzmL7TC4l7R8g3DiAavRrG4rGV9KsAQS k1rqJqQR9urORSLS6Wv9Wr4/aT0zDlXoQYkWT47RUCGQL/wPTN5CGVi7Mg9r+Pt+eMel g7CKzP61oqSHoza5KnwCDw5GY9my6ioaXxhmmhGawp6HiG7IGx8rhANmc3ml05sUCimn 4JeA== X-Gm-Message-State: APt69E1QbLAdi184m/eieR/3Tj87CH3STr/BX7t+BqtUjsrpxWr2MeMg FEYZSD0mmxxuNIV9p/b0AD1BxQ== X-Received: by 2002:a62:fe19:: with SMTP id z25-v6mr13190972pfh.167.1530259996608; Fri, 29 Jun 2018 01:13:16 -0700 (PDT) Received: from excession.tpe.corp.google.com ([2401:fa00:1:10:3987:9bf6:3352:7574]) by smtp.gmail.com with ESMTPSA id h13-v6sm12994488pgp.13.2018.06.29.01.13.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jun 2018 01:13:15 -0700 (PDT) From: Louis Collard To: linux-integrity@vger.kernel.org Cc: Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, apronin@chromium.org Subject: [PATCH v2] tpm: Allow tpm_tis drivers to set hwrng quality. Date: Fri, 29 Jun 2018 16:12:58 +0800 Message-Id: <20180629081258.155228-1-louiscollard@chromium.org> X-Mailer: git-send-email 2.13.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds plumbing required for drivers based on tpm_tis to set hwrng quality. Signed-off-by: Louis Collard --- Changes since v1: - based on (hopefully!) correct git tree drivers/char/tpm/tpm_tis_core.c | 2 ++ drivers/char/tpm/tpm_tis_core.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 8b46aaa9e049..d2345d9fd7b5 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -875,6 +875,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, chip->acpi_dev_handle = acpi_dev_handle; #endif + chip->hwrng.quality = priv->rng_quality; + /* Maximum timeouts */ chip->timeout_a = msecs_to_jiffies(TIS_TIMEOUT_A_MAX); chip->timeout_b = msecs_to_jiffies(TIS_TIMEOUT_B_MAX); diff --git a/drivers/char/tpm/tpm_tis_core.h b/drivers/char/tpm/tpm_tis_core.h index f6e1dbe212a7..f48125f1e6e0 100644 --- a/drivers/char/tpm/tpm_tis_core.h +++ b/drivers/char/tpm/tpm_tis_core.h @@ -99,6 +99,7 @@ struct tpm_tis_data { wait_queue_head_t int_queue; wait_queue_head_t read_queue; const struct tpm_tis_phy_ops *phy_ops; + unsigned short rng_quality; }; struct tpm_tis_phy_ops { -- 2.13.5