Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp733359imm; Fri, 29 Jun 2018 05:37:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ12gkckKIqMPMUrjF7pjUQzUF9V99JfrFskbVB66L9TFEYSzd7BBuTMslxHgdOx207TjLh X-Received: by 2002:a17:902:1005:: with SMTP id b5-v6mr14865396pla.207.1530275855044; Fri, 29 Jun 2018 05:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530275855; cv=none; d=google.com; s=arc-20160816; b=Nh2fzGk103SCBtnNi8cc+8Fpmwc/m46fEOuknCn6R/3RiNrEOSnu0Fg1X6j8HsLrsG 9sxwUWrTlp5UMhEIINLl2B2oIfB6j4gSNkXeicBCevfXiZCZ9FExRoN3KdCxxWlJfcBh kSk51sVkunlc52rmBpCM+XUCzDDagtzK7AHfXoABA2c0YBwA3wFTwYUe0Lha86ONxuBJ gbzq2pbUEeSQckBixkbWB/cyyYD0b+WCk4NzTbW4QEJKvHyOH87T8FAxmRAEh8Rr2+FU F6W8K2PKtnah5ekgLBnv4hKs/sA7vvCr7wL+X1W8Eax+X5eCWYbJgN5X4sWrA84el3RN MaXQ== 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=GBE7ezPR5Z79IEyf9sU2dSkQnHG+/2+anpKorA0W7i5q5bDzxGMauNaC1PPneu/lr1 i6mbBa4x/NqFJfgL8Er84SjrnYFicGzKm2SGiISKLUdnM6U523HXJoDaJV/dWX9hhZ13 DFV5WEU97NmHj51AOuyPW4+4MhjLzk21AV0agKOINVbd6CgqY4cTzffX5cImtJcF8djM 665NyhoVNIVQEWx2yNtgrAAw2SLY0mEAsLFcugLJxbUC+kN8OWlaH1HY9/uuUCyzs1ui 37Nnk9c4ml1W8OBoMtKTBKOpBU/xQt2U3u1QLmkoFMoRppYmD/y2qbNbi0yGZYpAlrXl 8W9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nuJPLZWg; 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 t127-v6si9633391pfc.174.2018.06.29.05.37.20; Fri, 29 Jun 2018 05:37:35 -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=nuJPLZWg; 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 S934837AbeF2IOD (ORCPT + 99 others); Fri, 29 Jun 2018 04:14:03 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:37573 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934799AbeF2IN7 (ORCPT ); Fri, 29 Jun 2018 04:13:59 -0400 Received: by mail-pf0-f193.google.com with SMTP id h20-v6so1934989pfn.4 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=AeE+5cFajPNa5fzFSjpy2u51KL2REhT8oo5xnZsTq16ud7XW5i9u9jHyQn4ox6HQpU Nw5R+0XtckLOpMZMyUDZf7fNB6o0qmGK6WAULxLlihGJ0qG9SyhzZsy5qP5kcP5meerm KAeJgDk6a7msal3ZYS30/F1KEtSwVLGkrcpwXcD6DmA9OQB43WN9kpvijbtMsLgFZsxp SxkT0zCmN9yiZeNMR6hX5qdMs6Macs5vTNRqxo3eRvwFtWaJe2F4IxWIymisqk5THjJ7 ASRUWCrR+C0hf8UCDEQ+cXxI5orMglsUlvOTfW/TjZ/2Hkg8rrBaeVLJhmMo/isNM6/R 1voQ== X-Gm-Message-State: APt69E0iiBM75WNyq5MAfXuhhgJcktBrzLsfHYQTx6krrFxbcRJXV3Ol YNEajy0alaWa1t/f88DyZcTFfqe3NJU= 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-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