From patchwork Sun Sep 2 13:07:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 145721 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1467694ljw; Sun, 2 Sep 2018 06:08:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ0yPFJ/JLSaIyy/9aWcFsDuSp1wAW1KKuADR7Act60+1SwuPfPRR5zXzhYzeKKS4P8h9WU X-Received: by 2002:a62:1192:: with SMTP id 18-v6mr24994060pfr.54.1535893680587; Sun, 02 Sep 2018 06:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535893680; cv=none; d=google.com; s=arc-20160816; b=DKYCXZxWKUu8FDnuB3Z32ysHoJO7RkFWQXvUC/xqoC09sZFi1oIPH6Uy+pUKgiMP3V IEfCY8WOgKNk3dAr3Yo3ADQMicyZbXr2IF3JMkPq8oMcz5cDlwtllfgl/jAV1lt63HEJ d04DNeAx37kyaKdcQfLw1RB8YKqessEJkYJFnGst7jVXYY/ba/d850c2A7Chx635jK2Y wjxKtsxad2dbx180isHEEuXmTdtbVfA/mzBj5XbKDP5ly6r3YswiRZJQo4guLB+5yqXl AQJC5RZXUvW3Y6Qtei0IMlLSQlHTGa/hDLI6pkubQK97k7gyzav30QBrogqDJ00onni/ xBFQ== 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=rEjb63thZGdR/7lPbJcxES4cFxgOApFFnWtR84K3lWg=; b=IrlmPs8qs9/P8b2wykOlXv3d7/KpsbCwqK8VSkLedOIyF5PbybfmD6m5pkwE3CmVzH CbLgl02TVoFhPc/KpvhYCvzpMtGfzt2LDRiTdEsBr7zCZC2H77ffLXr/VeJwgxkgkYV4 Brf6h0ynLoDxwzmnwNK6YcTw7OjiZsZmgeV3cRszpXEFERSRZsAlAEdRexdWoT9HPhvI 83w/M0MmZeXkS73BI1kCHMkrtM3/qNK80Yx1Tp9/VbqQYXJM2gQWAMbmJAW5QSVknoYL thMb/vgycvVJG/W8JxfufHPt3WWdtXnTGDEMrvpiDP5tVIFdH+VxY4skp1BncY8yeVoZ A1DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=k4kenb74; 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 f3-v6si14886854plb.207.2018.09.02.06.08.00; Sun, 02 Sep 2018 06:08:00 -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=k4kenb74; 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 S1729434AbeIBRXl (ORCPT + 32 others); Sun, 2 Sep 2018 13:23:41 -0400 Received: from mail-sn1nam02on0134.outbound.protection.outlook.com ([104.47.36.134]:59648 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729415AbeIBRXk (ORCPT ); Sun, 2 Sep 2018 13:23:40 -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=rEjb63thZGdR/7lPbJcxES4cFxgOApFFnWtR84K3lWg=; b=k4kenb745dVL9jcQOAHEcrtCW+6+3sxJx25+q3oOaYYz5RYuL3zA43uw1H/8vfuaWXiIwtLXn9Y1UxIXO7QOxYLR2S8P43GD8ggShUp49ZpkDgovx8+n5KF9QF0baCk+4GZ7enqowI2BN8PmiozjqGyWOWYQ8LvpWLOI6GfDljw= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0503.namprd21.prod.outlook.com (10.172.122.13) 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:07:47 +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:07:47 +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.14 57/89] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Topic: [PATCH AUTOSEL 4.14 57/89] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Index: AQHUQr3htuNG/5fCWk6/7FBGlmrVZQ== Date: Sun, 2 Sep 2018 13:07:19 +0000 Message-ID: <20180902064918.183387-57-alexander.levin@microsoft.com> References: <20180902064918.183387-1-alexander.levin@microsoft.com> In-Reply-To: <20180902064918.183387-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; CY4PR21MB0503; 6:vOEtARdN6ECiVp10R1gM9yAQBiosa2pN5v1F8hlfQ1bvexoHJfl30tXSzx8Tyi9OemwAJP2cBRa7Fo/OWI9Wr1PpZRl3idDziliRuCXnHeb/SD/GvMjS9f5eX/MUhS0t60VVROq9xLiBSxDN6g/3l7PPcRZhlINfqrMiDYit/G1+APput1wg3IwqT91JzX3B2zwBQ97o0RnGSvpSGwNF9qVfgyvBs42hrXo8fJrwzmwzEJp6Lc1WKevd5FISJXZXmFyK+LG3E/rbkkMgFguRiemoDG5Zenpw87ITcX5TCdecFNtYEEal8xuJjLaabqdosRiwprLl5zn/dpPtuigv5hmCsj/h2suE4pwCG0Xjd1y87ZuX2ZgcRYS5ou65/FT8IhD3jhkuRR/GzdY8d2SID1VIzx/FK9HjTSLfmDRF+8KqVWZpSie1ijTK0unx8tRLvCdKlhmQ1yDIymtklDFQ8w==; 5:iKIGJE5O1u00pQRRRpP+Z26eWGTu0UEdg7JHxW93uzNHbp3M3PXUL/o8yzX/fRBoKsOlEsTFGCB58VkF2ybamM5Ih6zTH6bDbkwqSl47SW5aO0nKDywBTdUktxR25wXTOM/gPjywEFpJn7iq2KWbYMhvkiog+8vpnxZH46cmrvM=; 7:HBQczZcbNUV1mkpDnEhC41V8zA4E9a2wtLam3EBJkZPqVfBW7V8IbseM8DHVE69b0LK4C+ZHZhfXU6bFZcnGA1nKe6U5Zy8o2xWzXilT1Gr+mQv2ypSTWi4Uehx+QmNvjKS+9GsDwdVqoi3aZgLWXLbaBpuXCSc1BssQR4GjEUGtNKb//3gEjrEpkR0GC4HLg0vIqXJ7rABUzO0qscmrGEUyM0zgqde9sckgBHFeC6q86mHRPgByohTqN8/Kk5pG x-ms-office365-filtering-correlation-id: 3aa0de9b-bc53-4a08-f582-08d610d51442 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:CY4PR21MB0503; x-ms-traffictypediagnostic: CY4PR21MB0503: 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)(2017102700009)(2017102701064)(6040522)(2401047)(5005006)(8121501046)(2017102702064)(20171027021009)(20171027022009)(20171027023009)(20171027024009)(20171027025009)(20171027026009)(2017102703076)(93006095)(93001095)(10201501046)(3231340)(944501410)(52105095)(2018427008)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0503; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0503; x-forefront-prvs: 078310077C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(136003)(376002)(346002)(366004)(189003)(199004)(105586002)(8936002)(102836004)(6346003)(68736007)(2900100001)(6116002)(217873002)(186003)(36756003)(81156014)(81166006)(1076002)(99286004)(26005)(5660300001)(66066001)(6666003)(8676002)(54906003)(256004)(316002)(305945005)(22452003)(3846002)(10090500001)(7736002)(110136005)(14444005)(106356001)(2906002)(6506007)(10290500003)(2501003)(478600001)(2616005)(72206003)(6512007)(53936002)(575784001)(86362001)(86612001)(107886003)(6436002)(14454004)(76176011)(486006)(25786009)(476003)(97736004)(446003)(11346002)(6486002)(4326008)(5250100002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0503; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: fnH7HPcF/S7oG9qDd5plfzopVQmgfzZdZaodgY/fpbvl9PLw1znq8l1RIKutDxE5G2rK2m+/inBFEXQpfFoTyMYa/tqgN20iw5FY5j+UN/5KCTpWa7Lf6XHOT39kAyGfsEUX3kPSie89GAkNHwAyppESDkkDGfaxOegCkuD1oMfNONLsN2sg6/aE2T4aH6sXXMX4lT0oQcQEbGfC1hdHvM/5A5jU8akF8y/49RzJc86JOy1i0FIdTV+f4MOmDFAZcgsAOX3YLRb7gt9yE48JtwjO9Qdjh9/yExjVbpkgUKNbcdqfSu9zVTv2Ib8CDa3oGLhwnvkyteGW/MaKflHGek8PF9sS2h3LwBvS8EcbBxA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aa0de9b-bc53-4a08-f582-08d610d51442 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2018 13:07:19.8746 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0503 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 8ab0bd8445f6..b00388fc41c8 100644 --- 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_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); @@ -200,7 +201,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); }