From patchwork Fri Jun 29 08:13:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Collard X-Patchwork-Id: 10495793 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 D2860601C7 for ; Fri, 29 Jun 2018 08:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA096298FE for ; Fri, 29 Jun 2018 08:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE5E429937; Fri, 29 Jun 2018 08:14: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=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 4F954298FE for ; Fri, 29 Jun 2018 08:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934799AbeF2IOD (ORCPT ); Fri, 29 Jun 2018 04:14:03 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:41633 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934805AbeF2IN7 (ORCPT ); Fri, 29 Jun 2018 04:13:59 -0400 Received: by mail-pf0-f193.google.com with SMTP id a11-v6so3860063pff.8 for ; Fri, 29 Jun 2018 01:13:59 -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=nuJPLZWgMy5x/DllJ0f9bws6EJn7EuTd+YXMnVmC2T2b4rRmf9TRFtSkb8NpDXRsEP XkaJCY3S+a8UexVNdudRr5+d9iZ9SfwjTG4Lz6W9ZGHTTEjIgjTVcdNJ7aZi/n5rQr2C mIkdSZ0LjMrbOepYeph1BaT0zETYWtgV5Hmqw= 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=Dr/mdQvbNvUG4dpWqWA/vr8Zcclxic4n67SVOeH8ssWAWT+zzrhsw5mXkOjjdp727F StQCBhEcGQ57jKEExwsxrbASy984JsSoxdfO6AVAC53WGqOZNVgB3xJJgu5AFmB0K50h 5fajp3YMJiu7htZfwda2ijSMlSDcRRXAPxMdXxi04gEwrMIGdSuxVIg85BNmhiKeHJ5t FqxxXRMl+I57V/r8ZMxA1KeKxTR1KkiacmZuo7eGvL57mPLY/ahxaF8fL2oBBCXmBY/g RhNzn7t1wRNTfZjdWTl0pNio0zdgxUU6Efm9SSifDm9mF67OU+4vDzpFOAMfQbaoFj79 o9Og== X-Gm-Message-State: APt69E1v5A9Dg9wcFa8Ub4a1Tp/464+6IM/yFBXuNy+CtKxC37Wtmlvo oktMcggvnvpiK5G4+Ln2a+tVVgus+8Q= X-Google-Smtp-Source: ADUXVKI4IIgRqhwccVLliC3PUz0EbFQJGPdvShoSOUhiYOP7cEV17WGQdu6uP/KT0lAgeaLU7R7jmw== X-Received: by 2002:a63:107:: with SMTP id 7-v6mr11490038pgb.289.1530260039314; Fri, 29 Jun 2018 01:13:59 -0700 (PDT) Received: from excession.tpe.corp.google.com ([2401:fa00:1:10:3987:9bf6:3352:7574]) by smtp.gmail.com with ESMTPSA id p19-v6sm5494749pfd.75.2018.06.29.01.13.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jun 2018 01:13:58 -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:13:55 +0800 Message-Id: <20180629081355.155317-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 Reviewed-by: Jarkko Sakkinen --- 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 {