Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp999599ybc; Tue, 12 Nov 2019 12:32:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxYocsC+mKdeCi+W5Re22+J8JUB/njqi83fUP0+xJKi5ihnNkk9WyW3zrJayQYWO9XfB44R X-Received: by 2002:a50:8e43:: with SMTP id 3mr34613546edx.217.1573590740184; Tue, 12 Nov 2019 12:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573590740; cv=none; d=google.com; s=arc-20160816; b=BIHP52jVxR2sy+GvCZooDArvQTAgVTQGs3Yy7/DdDeAtlOelfiBP+U8i3dKFYa354J pwIzrDGhqnNYL4QUDQHTCJ7RhD+3dy9qftMLWmLvZxliQOFPtdFLdbsyH3gGOAOFx302 yWPQz856vbT/k0T0ENh7VjhK6A6WOUwbW8UYwcyBi0XZs78sF+wAuhIoRDpZz49TG2eT jYnB5eSgRSYJydktTERIXDPD8xwoVCkB9FEJhhGmVYxmwGbTMSrlave5DP68ryuc+r4Z /CFP5POZ4lZvz2TOGy8biYNLqCRrahzM+9/Y2yRTzXuFUPcqHsy121mXZQfHvC9ae13M 6j8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aXBtYEeaj2udm4Rhycd3z2r+ghGmae+UF61ffhYlm5Q=; b=QwWoIJH0dF4tk0sMCQYoY+qV3eamH+J8Xvvlf2b6BM7sjxAAjVpuEPPOQgufAXqDT/ KC+6UqVzH5B4rIct1MvpWM1KwuRzzVrOFJUXILIf9pDv2E0cWkEgeQsXLSKioQnbmhyA b+HVLVggHR6Jg8cNd85GYJQOAbbG187FgyHfoaJrGEEb7TvKBy0NcQQNRU1ISs/wnsYt C/H1zlNuaoCdE5me3AHUEBfTJmLjViBRk5CT+D+AcLVGZD4Sn0A/rf/tB6ww7N+SJ0WW 8x2+9aqOhbzqyQB/Uxg0UNIe5JHYd62thWfGJ14Ae1YTKmWRLQF4xO+9Apb9t8cF8vpx DCxg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si751130ejd.314.2019.11.12.12.31.54; Tue, 12 Nov 2019 12:32:20 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727077AbfKLU1j (ORCPT + 99 others); Tue, 12 Nov 2019 15:27:39 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:15672 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726388AbfKLU1j (ORCPT ); Tue, 12 Nov 2019 15:27:39 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xACKQcJY111776; Tue, 12 Nov 2019 15:27:35 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w82qsa1k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Nov 2019 15:27:34 -0500 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id xACKQmAE112557; Tue, 12 Nov 2019 15:27:32 -0500 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w82qsa1jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Nov 2019 15:27:32 -0500 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xACKQO0Y023436; Tue, 12 Nov 2019 20:27:31 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma05wdc.us.ibm.com with ESMTP id 2w5n369w0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Nov 2019 20:27:31 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xACKRUnQ48366078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Nov 2019 20:27:30 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DFA2136051; Tue, 12 Nov 2019 20:27:30 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FB0E136053; Tue, 12 Nov 2019 20:27:29 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 12 Nov 2019 20:27:29 +0000 (GMT) From: Stefan Berger To: linux-integrity@vger.kernel.org, jsnitsel@redhat.com, jarkko.sakkinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Stefan Berger Subject: [PATCH] tpm_tis: Move setting of TPM_CHIP_FLAG_IRQ into tpm_tis_probe_irq_single Date: Tue, 12 Nov 2019 15:27:25 -0500 Message-Id: <20191112202725.3009814-1-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-12_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911120174 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Berger Move the setting of the TPM_CHIP_FLAG_IRQ for irq probing into tpm_tis_probe_irq_single before calling tpm_tis_gen_interrupt. This move handles error conditions better that may arise if anything before fails in tpm_tis_probe_irq_single. Signed-off-by: Stefan Berger Suggested-by: Jerry Snitselaar --- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 8af2cee1a762..6b6605890c7d 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -790,6 +790,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, return rc; priv->irq_tested = false; + chip->flags |= TPM_CHIP_FLAG_IRQ; /* Generate an interrupt by having the core call through to * tpm_tis_send @@ -1060,7 +1061,6 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, } tpm_chip_start(chip); - chip->flags |= TPM_CHIP_FLAG_IRQ; if (irq) { tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED, irq); -- 2.14.5