Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp192483pxj; Tue, 18 May 2021 00:50:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNKtEXa6LcStgZg6WIAK6R/YQtWDtyISY49QOi2uysKtJKPsYDEy0FbttVhf4kF58MO7V5 X-Received: by 2002:a17:906:fa81:: with SMTP id lt1mr4623207ejb.465.1621324212306; Tue, 18 May 2021 00:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621324212; cv=none; d=google.com; s=arc-20160816; b=n/6pBOYoaNAorXj+sG6R8GwokECnogcaOTUaFXkvh8cGnzuMemz120QFWDpoRYnVEa Eo0oWHiSXYJqitvdsFiFIL1YNdqs5ZkDNGL57FgpxFWRBsNVygnpt/r1X2mUsnM15ZTm pvUsfhNWTa/iSn8sFyV8WElxHtoBYC2Mcb8qq5d+1HCQkODywlE41MVk/3vYSBOIuiYP DWGEGvJ3xnMAf+09qqSLWyO8hkMtAg8eKMoNx9O89sgdj9hfXIsBrPDHEqwPdgxxujEo YAxgM2C1iRwI/R/r4VLhmBk6ND8qK89DPpACMEZqw05gY4+znfwZeg3Z9tVGVgmrpoxA MWGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pOrlDJcB2rSZv7aaOoH5wgUz1ZOn7s3q6WQwI9KTOHE=; b=pKkHWuxxLd31kyrZe+NfYEd0JkWLUxTqSm8OWvyZcNnD1C4flsD04Ojn6Fk9UpqYTN swCzs21ZBw8qQttdyzR6oc3YetAkaeEjamj6bmlT1L532YTL7iPKso+mCQV5zaGL2seN W/q6gIyREbLu8tGbVXlHpRBu/HOWqcLQd+yqPT/u5jf91Ylc/4m+IpyLU7TGvpftA4BN iQQb/FhG3pG3KwLEjm9YQb2pPRmjPHPG0T8xGQwDnCnDHom2N7ZOM+bApWTx/6hQIOAO NBaumyQfVuofeY0QV055tQPQlstW0a1e1WfAk6fCFKeZvfJpw3YBdnhg2ACZf0NEShRA rdhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ss6c3VfP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si14963967edy.163.2021.05.18.00.49.48; Tue, 18 May 2021 00:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ss6c3VfP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241407AbhEQO6L (ORCPT + 99 others); Mon, 17 May 2021 10:58:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:39742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239860AbhEQOsm (ORCPT ); Mon, 17 May 2021 10:48:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F8656197C; Mon, 17 May 2021 14:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261353; bh=7xF696LXr3hj3CzUc54YkDy9CBiMSi/sfyJM0364i7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ss6c3VfP3f5qNjzOgwQgX2yAhXbwvLTPN4ja3U7qARjZG5IbbIAJi7+wmiwfLKdYE GFMtGoMP7EyX3ItZGctpFuFJnB9M4AdBYth5VrPDqed7jjsM+dJ5uJW1IhCYOYIanD m4VIG9SWLM9i4s8uHjS+AeYIJdseWqYPaQ/TFFUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lino Sanfilippo , Hans de Goede , Jarkko Sakkinen Subject: [PATCH 5.10 004/289] tpm, tpm_tis: Reserve locality in tpm_tis_resume() Date: Mon, 17 May 2021 15:58:49 +0200 Message-Id: <20210517140305.300906206@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jarkko Sakkinen commit 8a2d296aaebadd68d9c1f6908667df1d1c84c051 upstream. Reserve locality in tpm_tis_resume(), as it could be unsert after waking up from a sleep state. Cc: stable@vger.kernel.org Cc: Lino Sanfilippo Reported-by: Hans de Goede Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()") Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm_tis_core.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -1125,12 +1125,20 @@ int tpm_tis_resume(struct device *dev) if (ret) return ret; - /* TPM 1.2 requires self-test on resume. This function actually returns + /* + * TPM 1.2 requires self-test on resume. This function actually returns * an error code but for unknown reason it isn't handled. */ - if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) + if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) { + ret = request_locality(chip, 0); + if (ret < 0) + return ret; + tpm1_do_selftest(chip); + release_locality(chip, 0); + } + return 0; } EXPORT_SYMBOL_GPL(tpm_tis_resume);