Received: by 10.213.65.68 with SMTP id h4csp453079imn; Tue, 13 Mar 2018 09:31:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELsGTh9QXVgn8VHRl+RFqWpspc4OrHZy5gEjfewAQtG+43mBtRG762EBH/O66KRpaTe3VKkC X-Received: by 10.101.77.7 with SMTP id i7mr983574pgt.330.1520958669671; Tue, 13 Mar 2018 09:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958669; cv=none; d=google.com; s=arc-20160816; b=m8meFk8p97+b5GtPFwg8HHPsyWPGtcCT8ASyuIbfZsGf1h4+OfKZEjCdR8wc7mSaga 5k2ezJP3IYdpTJWSyZNVspGTOk8NZFwqoOhWibrm/UoGdx2LGCikwpl9X+3TMWgqGbyf rAMjaJpfEUWHSLfVs1dIjEwhUDbcnkGcfkQvtN15zenPPxMiBxgL8dRwFPY2KIJPQnY+ ak7SXC+fM0QutxfMD5zARRpjKlHx9eP8SfirW81vc4TyLR5/OMHppDa1iaLyW8XCRyqC nAW3S+VfHfL/i/3ypir6FG2vxvui4CIFwwpX/MlLFHPfplKH/I2jBedC1TafuuVMsUs0 +LHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=e3c7R1BQBtGv10IZfCFrK3uyUEwSU0DTnEOFYwDr/BU=; b=ZNYyP57bEHJ/B9ZD85Uo6nYxJlDx18UPmi7TvgB7NZ08JlSi3qxkLV3poylHV/v0ie PQXdjzscOBBgCopH9u0CA15WpbOCLF2S//WJvTTZPRDTTDxCZawv63fL748r4UWgLiFl qNvY5PRtiBW0mBk4cRUdsnV57uo07hXkAQEOWPqA9JVKxAEoPWHDypLolDGsW2QZw8v0 LWN7UTshGinlGU9M+pmbnoufQB3nf1Q+PPnCsPsdUmELE8QHsa89wyYUwvkusyPOdlco 5UlJgcls682S4OQW1pBkRYSbN0OkFDjm3D/IE5SAlbdyS8MiiY9a1+zul4ihjXfZ01+l H4/A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2-v6si147521pli.438.2018.03.13.09.30.54; Tue, 13 Mar 2018 09:31:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933504AbeCMPdT (ORCPT + 99 others); Tue, 13 Mar 2018 11:33:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60052 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbeCMPdO (ORCPT ); Tue, 13 Mar 2018 11:33:14 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 436C91221; Tue, 13 Mar 2018 15:33:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarkko Sakkinen , Javier Martinez Canillas Subject: [PATCH 4.15 120/146] tpm: delete the TPM_TIS_CLK_ENABLE flag Date: Tue, 13 Mar 2018 16:24:47 +0100 Message-Id: <20180313152329.551210976@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Javier Martinez Canillas commit 764325add6c2ad1641199edde7b2995495fc2d7c upstream. This flag is only used to warn if CLKRUN_EN wasn't disabled on Braswell systems, but the only way this can happen is if the code is not correct. So it's an unnecessary check that just makes the code harder to read. Suggested-by: Jarkko Sakkinen Signed-off-by: Javier Martinez Canillas Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm_tis.c | 15 --------------- drivers/char/tpm/tpm_tis_core.c | 2 -- drivers/char/tpm/tpm_tis_core.h | 1 - 3 files changed, 18 deletions(-) --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -138,9 +138,6 @@ static int tpm_tcg_read_bytes(struct tpm { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - if (is_bsw() && !(data->flags & TPM_TIS_CLK_ENABLE)) - WARN(1, "CLKRUN not enabled!\n"); - while (len--) *result++ = ioread8(phy->iobase + addr); @@ -152,9 +149,6 @@ static int tpm_tcg_write_bytes(struct tp { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - if (is_bsw() && !(data->flags & TPM_TIS_CLK_ENABLE)) - WARN(1, "CLKRUN not enabled!\n"); - while (len--) iowrite8(*value++, phy->iobase + addr); @@ -165,9 +159,6 @@ static int tpm_tcg_read16(struct tpm_tis { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - if (is_bsw() && !(data->flags & TPM_TIS_CLK_ENABLE)) - WARN(1, "CLKRUN not enabled!\n"); - *result = ioread16(phy->iobase + addr); return 0; @@ -177,9 +168,6 @@ static int tpm_tcg_read32(struct tpm_tis { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - if (is_bsw() && !(data->flags & TPM_TIS_CLK_ENABLE)) - WARN(1, "CLKRUN not enabled!\n"); - *result = ioread32(phy->iobase + addr); return 0; @@ -189,9 +177,6 @@ static int tpm_tcg_write32(struct tpm_ti { struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - if (is_bsw() && !(data->flags & TPM_TIS_CLK_ENABLE)) - WARN(1, "CLKRUN not enabled!\n"); - iowrite32(value, phy->iobase + addr); return 0; --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -698,7 +698,6 @@ static void tpm_tis_clkrun_enable(struct return; if (value) { - data->flags |= TPM_TIS_CLK_ENABLE; data->clkrun_enabled++; if (data->clkrun_enabled > 1) return; @@ -729,7 +728,6 @@ static void tpm_tis_clkrun_enable(struct * sure LPC clock is running before sending any TPM command. */ outb(0xCC, 0x80); - data->flags &= ~TPM_TIS_CLK_ENABLE; } } --- a/drivers/char/tpm/tpm_tis_core.h +++ b/drivers/char/tpm/tpm_tis_core.h @@ -86,7 +86,6 @@ enum tis_defaults { enum tpm_tis_flags { TPM_TIS_ITPM_WORKAROUND = BIT(0), - TPM_TIS_CLK_ENABLE = BIT(1), }; struct tpm_tis_data {