Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4537132imm; Mon, 17 Sep 2018 16:05:14 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdby+xxOv+0g7qExZa1o29rEYP6aR54H9typiAOw2qMOFE615s7yicn6+zXP3vLdpKQ2U/tR X-Received: by 2002:a62:1e81:: with SMTP id e123-v6mr27860103pfe.24.1537225514401; Mon, 17 Sep 2018 16:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225514; cv=none; d=google.com; s=arc-20160816; b=Q+k29Ty1kDLj2SPkj7et+Jn9q6ZoG+SO26kWx5EcHNSfZ3LM3eqqVzk/oC0t/StrDK oNVTq7BURn/a3dz1UzyuycqnWzFVRcQT2ZvxGJdCzBaS6skSB4VdC92zgNiTXEAuoSZh Z6wHPbbBh0eY/jSnkHyO0c14NVk27uY0m0zdcNEfTJJ07ZfbNVgPJ0CRcC5ADixbLT1l O4nFQnouzlguWcgRCYJOFn4cnRkQ16bZhs0HdglUfuku+77B+IR78mqers2OrKYA04LI 1vyhWk1H5vFZh8r13uCAVmxuvNQSwB//r2KfUn+nKpCgsGUqInff82X9mf5NKcmVAzOG 52Aw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=ggAkQC3ARRD4rbs758N6dQjOpjkzOfpQGinxw4npyQw=; b=1FuUNcUn5rCEj1h6eD/syP6ItXjh0gCDs3C7ADMCHTldsWptLWTT8quuDTbYFLx1eX /ETabm2Ic0Y5U18BjD/HnrSXCRa19o1+R0kVH5epPjEIxbeRS7LM+QJsTL3z3HG6MalL bEpKOhrT4ssRTdByDXO4Inlf8/CbysnVdQYUWCInZONQLL+8tVv3dIEwlCcDf+uwME9X zaWCl0Q8z9CZ6CRoMY8Ld0HocG5ffrcnmGZO1aWY1OraoLiVUZha1BtGDh5eJcRPrrvk NjDFx642KJMfxMp+cFl71mDG4s76Jh8567BWa9b0mOjcpgnbhaMCIniwFWag+Ql/nrO1 d6+w== 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 h5-v6si15574542pll.385.2018.09.17.16.04.58; Mon, 17 Sep 2018 16:05:14 -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 S1730607AbeIREcy (ORCPT + 99 others); Tue, 18 Sep 2018 00:32:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeIREcx (ORCPT ); Tue, 18 Sep 2018 00:32:53 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DFF1CC03; Mon, 17 Sep 2018 23:03:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Linus Walleij , Jarkko Sakkinen , Sasha Levin Subject: [PATCH 4.14 071/126] tpm_tis_spi: Pass the SPI IRQ down to the driver Date: Tue, 18 Sep 2018 00:41:59 +0200 Message-Id: <20180917211708.919873396@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit 1a339b658d9dbe1471f67b78237cf8fa08bbbeb5 ] An SPI TPM device managed directly on an embedded board using the SPI bus and some GPIO or similar line as IRQ handler will pass the IRQn from the TPM device associated with the SPI device. This is already handled by the SPI core, so make sure to pass this down to the core as well. (The TPM core habit of using -1 to signal no IRQ is dubious (as IRQ 0 is NO_IRQ) but I do not want to mess with that semantic in this patch.) Cc: Mark Brown Signed-off-by: Linus Walleij Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/char/tpm/tpm_tis_spi.c @@ -188,6 +188,7 @@ static const struct tpm_tis_phy_ops tpm_ static int tpm_tis_spi_probe(struct spi_device *dev) { struct tpm_tis_spi_phy *phy; + int irq; phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy), GFP_KERNEL); @@ -200,7 +201,13 @@ static int tpm_tis_spi_probe(struct spi_ if (!phy->iobuf) return -ENOMEM; - return tpm_tis_core_init(&dev->dev, &phy->priv, -1, &tpm_spi_phy_ops, + /* If the SPI device has an IRQ then use that */ + if (dev->irq > 0) + irq = dev->irq; + else + irq = -1; + + return tpm_tis_core_init(&dev->dev, &phy->priv, irq, &tpm_spi_phy_ops, NULL); }