From patchwork Sun Sep 2 13:04:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 145731 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1489457ljw; Sun, 2 Sep 2018 06:32:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6o6XWVA9aHY5I0AeUofQ4ErELeyAjexdws+lctHVf7btWgddprTkNqAEmPOWwa3ss5YYq X-Received: by 2002:a63:f111:: with SMTP id f17-v6mr21728098pgi.87.1535895123086; Sun, 02 Sep 2018 06:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535895123; cv=none; d=google.com; s=arc-20160816; b=JUGBNl7CZDEF3tWlmlEKDaedLVan2bcHsHndZIB2PC+k26+TdD5ICfWjQybYsArRH8 wPBGyI+lnifNlk/XuMIc3Vg7L9IUuzymCPHT7MAsAahI9Ie0D5N3U7uM+5aC7d9mIyOx Kiu0ZM8+QEVFS7fCb041StFpaxTTX6blWOu49kee6YdAZgeWgfgr/XYd7ko7TCCkKorY MWsJBo/Myn3OaULXNczZ/W4G2M2fkxrBPFOaURlDrK1Vgnjz/ON6oElq/yEPrBNUX1A9 Tl+qlbp2fLaRnvy5INPTrrukL09oeuiEIyPnsFo89I317o5AzyGK+TKW+QELTx/xpVVY FxNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=EHBt9x17oBRrvbN47Z5BjhAaRNnswYEzHWR5o7Qxiio=; b=omsJxYhDOwEZbTZKtb00TtTG/xOJ9SAddcszAjyBVzfht78/yiak5uhr4qd3uCfnVm bMnQOzvJrSeylC75br/784APsJW0DpCcSB2RuivJ2o6VjbjZjibo+YqFREd6Bi3ZPnSE g3Q/logvt6TKZVSZ2DvvrpCW7tCA5rtAS256om7ZblwgSy3r4reovIYqGDkU1hQSZUpj QepEH/b7Nr5CKpWRX/b0Z5cs7vWyqGvsP8ILbBWNgwe6S9ZiqqEENZqhRIYAfhhSd3z/ DgfNEc2ZnF4S2lWzTkgDz4N9QAwmlOJCjqAok6RKZNdlmBgrSwPECUifhYKnk0hIjU7d S4mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ZQ6cHIYA; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u64-v6si15863406pfd.297.2018.09.02.06.32.02; Sun, 02 Sep 2018 06:32:03 -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=@microsoft.com header.s=selector1 header.b=ZQ6cHIYA; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728831AbeIBRrv (ORCPT + 32 others); Sun, 2 Sep 2018 13:47:51 -0400 Received: from mail-eopbgr680109.outbound.protection.outlook.com ([40.107.68.109]:62112 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728338AbeIBRUw (ORCPT ); Sun, 2 Sep 2018 13:20:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EHBt9x17oBRrvbN47Z5BjhAaRNnswYEzHWR5o7Qxiio=; b=ZQ6cHIYA9I96BCUwF+EhNeXEPL5lG+MDAUM35k96jkM3wr8oqvK/ST9KfFDjlNIQ0jSIZJ8+51jgdpQyd6v+Tdr+8Vlar2M0qGc8JdhHudoZjzKKS/xLEMWhwJHtWo0iVVP5iGUKywaXTUQaeU0CawrznjR/Fpf3vGzju+41rNY= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0741.namprd21.prod.outlook.com (10.173.189.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.2; Sun, 2 Sep 2018 13:04:58 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::7c3a:eea8:1391:1611]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::7c3a:eea8:1391:1611%7]) with mapi id 15.20.1143.000; Sun, 2 Sep 2018 13:04:58 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Linus Walleij , Mark Brown , Jarkko Sakkinen , Sasha Levin Subject: [PATCH AUTOSEL 4.18 084/131] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Topic: [PATCH AUTOSEL 4.18 084/131] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Index: AQHUQr2IhILDvwAsdE2smrUPalRh3Q== Date: Sun, 2 Sep 2018 13:04:50 +0000 Message-ID: <20180902064601.183036-84-alexander.levin@microsoft.com> References: <20180902064601.183036-1-alexander.levin@microsoft.com> In-Reply-To: <20180902064601.183036-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0741; 6:VareT7CWq99loQnMbN/Zq05YV8RWLAXp6u7SZ/LPbnAl/qGjNUW0ZewcwO+Q+B0xIZjq+jNgmbp+mBdLFy6mr/TeftFbcvtI4hTTHmr8yw3xfdq6aYrLu9Eb8ZVlOAsDWvy8u4gyB47V/pm7o/hFqWcJlI7u9sLdc4imE8wYsZTBhLRqgKXBJs+92nlA6NdTfEw4eUepuRijgH8wfBKJ25tvnJ0dg11DTJhK2Lm50CEWtuJlDTr781lX3K9Gl+YAGFs8Rk0Yc4nCeqnlwuVljS/m8HKtnO5IqK+D94A/tBtwhzlu2m9lVVdM6kTlAmnt1++yLal1Q8mHayt5UBgjdEUEYYx6R+nHju20fcYhTA5fXbIMzgbz0+DZj5ZJ6tn4MGU8GM/QkhbQnUd7K4HG8PH8deqZ8gFKSTNs0u3kL6sO6GUDsN5SPSKnpH0V2hMW7j7vGbnRYfEfSebnD6pfOw==; 5:HORlnWAZMzS8F4xsgMGV2OVWU59iuOwS7zDNaz5VIaF5/ZwlEaf1EQ8h+jGBY+PRgqIIp3Xkw20il132ZF1Y58Fj5jmaZtYpY1xO6tHvnq+PZu1xje5X5WPf6AUu3iT6JSUCxPWeK17RuMe7Gcqg0/hEUEhawei7rpkKRuhEBG4=; 7:zzpg5xD7VYUxiswTsetW/JmvQKoZ+x5V/kobB+ol9Vu2G8QWTSOzXYRsvSplxtE86Shtbi4rsuwT+WwSlEpJz+uuPdmnlftXNLyieylhLNn/4kF2xHmvCXwz9v5a1ukilpd5WcOOQNlaOE93PX/Nsyd+MjBJu2OqvboF9tIXVYLQTJETOsubFKv+vvI+nztOwsxTVL196jP4p5X30t5bd0TPHhD4vWJqM2/f5QcTFrQxPOlczy/F4vv97nSJAEMc x-ms-office365-filtering-correlation-id: 00e0ad7f-022f-416d-5787-08d610d4af63 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(4534165)(4627221)(201703031133081)(201702281549075)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0741; x-ms-traffictypediagnostic: CY4PR21MB0741: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231340)(944501410)(52105095)(2018427008)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0741; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0741; x-forefront-prvs: 078310077C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(136003)(346002)(396003)(376002)(199004)(189003)(97736004)(2906002)(186003)(26005)(256004)(14444005)(102836004)(11346002)(25786009)(476003)(486006)(2616005)(446003)(305945005)(66066001)(5250100002)(2501003)(7736002)(6506007)(8676002)(68736007)(76176011)(6666003)(99286004)(6486002)(105586002)(81156014)(81166006)(53936002)(5660300001)(22452003)(478600001)(6436002)(86362001)(14454004)(54906003)(36756003)(106356001)(110136005)(6512007)(4326008)(107886003)(217873002)(3846002)(2900100001)(316002)(8936002)(1076002)(10090500001)(6116002)(72206003)(86612001)(10290500003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0741; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: pGnVhHlgRu0/70YarIdJDReYbifTGCpQFIchx0bH+wm/CtdwJR90QsbjRECTS6OuieXEW/mh0UYpZhd5YT/HcCGWdTx5w61Um9ie59RCwHBV9kN4juzSEvjLh0w3xCUwrM6/3gpzdxcNLeE8Vt1x09AqrjJ+8cUFDvz3n9sQ8UENcWIO1HL9lv7n+xkRZ8J8S4OVVoYUhsGSFMigknICQibx1b8DJoW17QoB7tu5gfjAhlfXlcUBB+Ys4VZRTZxawLsPB+lrvcU6v1OoXsPFDG1y74toj9Q/oQDwZjPy5L6d+Lp4m8D/JMiuFXOrkZRcEkrS9aYWJObYAeT5CLiue1hA2xFvzKOF9xdtt8se9fM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00e0ad7f-022f-416d-5787-08d610d4af63 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2018 13:04:50.0331 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0741 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c index 424ff2fde1f2..9914f6973463 100644 --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/char/tpm/tpm_tis_spi.c @@ -199,6 +199,7 @@ static const struct tpm_tis_phy_ops tpm_spi_phy_ops = { 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); @@ -211,7 +212,13 @@ static int tpm_tis_spi_probe(struct spi_device *dev) 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); }