From patchwork Fri Jun 29 08:12:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Collard X-Patchwork-Id: 10495783 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 C13096022E for ; Fri, 29 Jun 2018 08:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A64D7298FE for ; Fri, 29 Jun 2018 08:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9931029937; Fri, 29 Jun 2018 08:13:24 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B04298FE for ; Fri, 29 Jun 2018 08:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934739AbeF2INV (ORCPT ); Fri, 29 Jun 2018 04:13:21 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:43291 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934613AbeF2INR (ORCPT ); Fri, 29 Jun 2018 04:13:17 -0400 Received: by mail-pg0-f67.google.com with SMTP id a14-v6so3655844pgw.10 for ; Fri, 29 Jun 2018 01:13:17 -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=JZQVev4jFwsWZ2LjDaPP10AAtEKumGXbTnxh+PQ2EE1m3VRGf5bu0E13p4nsUUTyq+ s1zaJwM0sBaXfAtmHxKXjJP2DQh7svoQzmM/obDEu18SjeY+q3ymt2BPqR1ekUmmgC2N SIsXiCtM+qYfjasNA9SFlpSztckKZ4tFTNKkCEWLn9hONm2Bfb36aWLd6NCaMLZBOblO zswa/zwpmp8UKa0lCWQBB2X5nDx7PNgPb8bj6nzUBc44wCTjCFp+TfkpsYNpHlCVKb9r rZsa0+lVErYk4Oc/UXXloDOrhNfUQVyaYfK0rhXj1BrBgXY+aJXE6nhSSrKmuYbzMPEL /xsg== X-Gm-Message-State: APt69E3m4UXvs1MTqb9q6Mdjc7qLxvC6WkO0kmvigclbKrIhJi4Zxk+7 wMjzdj0ogEVENWEPbgax/AVOOqIzJDQ= X-Google-Smtp-Source: AAOMgpcR8iip0WWnl+/LDgt9DfNzfBKeUGJC7WriRxuY96KCzwXSD1uEgYVQy9AWjWfE6lCTezmLdg== 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-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 {