From patchwork Fri Jun 8 07:11:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Collard X-Patchwork-Id: 10453913 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 42E89601D4 for ; Fri, 8 Jun 2018 07:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 302F129234 for ; Fri, 8 Jun 2018 07:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2493929294; Fri, 8 Jun 2018 07:12:06 +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=unavailable 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 21E8529234 for ; Fri, 8 Jun 2018 07:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbeFHHLw (ORCPT ); Fri, 8 Jun 2018 03:11:52 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38600 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbeFHHLv (ORCPT ); Fri, 8 Jun 2018 03:11:51 -0400 Received: by mail-pl0-f66.google.com with SMTP id b14-v6so7756107pls.5 for ; Fri, 08 Jun 2018 00:11:51 -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=8jAQmTuGvAX+EIfu45cbzVZ46i/vDGVTiU+n/4q2ACE=; b=gODOUihyYvnFgbfb4ViIFYxA6u59yecXX99beK4saeMNqG9fKnjt7BSGo+3Woaigz2 9G9KtH0hUV/+WFP/MWyiQu1ku3IRo5bOThWplRx9+U2jnUDmTsJ9/pZkdOrPMS07S2AQ vrgRhdxVjlSM1j3kx7fj3+O/T1WTpAQs3KyNw= 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=8jAQmTuGvAX+EIfu45cbzVZ46i/vDGVTiU+n/4q2ACE=; b=AQ3S9B2e4csD1/9rC6oLjyrNcWrWBbH9oiWd4d7dE9oC0OfXA8M8u01oSSiT6NyH0R Jqeba/oSnb9h50DqeYrY+hpP4qqizu3kutPQUZfm+Fh3TbXS6Sm15nmYJ+b1GD02rxcz KseSNVsH/sHPFf/XVLGSr+utNiL8yjNbehoEnkDdRl2aLlyWCrr8utoQAoj05LhR/AvX Oct+5LRQfV7rpUrqpPUxpUQdRpwLo9UXyZVMFnwL4HRDd7bfDnRt8Cg8ZIp20b0KBNy1 7T7UGVp7ASe/z7zpQTv0nVndxqGG6a3Q4lpDCkXe57ejylCy5VadIZGEOujA2qK6bXOP Mjhg== X-Gm-Message-State: APt69E1HwC0QcAMNjCrXD9RlS1TppNbEUrveFD9caUfF1AI9xn76bK1e +tG8KqrRiYmFAGNId359vGmfXKbavIA= X-Google-Smtp-Source: ADUXVKISNaQ+RYgnsP1sl8ohRVYdvqKMaJdXLrJHmi3JY82kqU/8MENrkrM3987WpqbRG+Yob2rs1A== X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr5272387plc.146.1528441910951; Fri, 08 Jun 2018 00:11:50 -0700 (PDT) Received: from excession.tpe.corp.google.com ([2401:fa00:1:10:3987:9bf6:3352:7574]) by smtp.gmail.com with ESMTPSA id a27-v6sm15421764pfc.18.2018.06.08.00.11.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jun 2018 00:11:50 -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] tpm: Allow tpm_tis drivers to set hwrng quality. Date: Fri, 8 Jun 2018 15:11:46 +0800 Message-Id: <20180608071146.110567-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 --- 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 {