From patchwork Sun Sep 2 13:14:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 145727 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1482766ljw; Sun, 2 Sep 2018 06:24:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbAeBFqhw8WUEMlk37Dt8Fb/Qlua5EezsGGcSj5IDl+QGo5tJtaXiUa7igxBWEc3DN3y+ua X-Received: by 2002:a62:f208:: with SMTP id m8-v6mr24677309pfh.222.1535894653644; Sun, 02 Sep 2018 06:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535894653; cv=none; d=google.com; s=arc-20160816; b=t5Qf8XIY2myRc9Z63rB0mMZxYcxX0Eafm+rqRfbHma/Yr4JKBTs3ou6C3JkfujLwKb 0o31SUlhmRIiDC3o3FpN72AgW/z+AsS1LKa6ujUtKYiy3fIQ7zst0yJCU7D83Sx9tARI OkCH2uPvSqhyhte8kRbAPO/Sfgu/ajhRIZlXlARvoauXjlsA1bwoNVtT+OsLiBfh0iZH 7KBMr2D0N6ZOwene1A/2826TtTJB0cFstF1yvsoOx/THAsL15Unf4JKew3IKkEioKqXw ZtoYBfSUR8yJ6lMsAaTkr9Q1S6hflHOYNpKYwP+ZqvflgG4/fUWQOdNGb3DnB1dElk0K PgFg== 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=6q0mNKrUVZzE/fPHf3iy6kQUxjMu6PHm0MKjkatitis=; b=PJaMEmZ7fTifUuXkYoypNpSVG8q5/QxsbwoZArCYWETPr/d5tglKPI16rwKdoc9FkM It080Xz5u0vXeJHh0Ux+4yUZUUs2yfkhd/lpP20Fk3a0A3yB1iPU/YP2wxv+c6oZn2Hk RCbiIrKhNI19sNE3Qdwg7kHOn2QW0igYeG7GDJZrViQmK84rm7wdGTUrsenqA52x9f5h TCEwP/PvoHbg0v7jG52v5RFKuWPzVJSHTAJnTGdhWoKlHnqlPBLBq20Y0tojTHIHdXqj XwTubacdV3fzPYVj+d8kp/uQ1jdVc7NkmxX8UWrPd7CaqPBiQAR0RLgUDq7nh0CAe0sf LtZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=fnq2nf1B; 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 s14-v6si14742619pga.21.2018.09.02.06.24.13; Sun, 02 Sep 2018 06:24:13 -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=fnq2nf1B; 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 S1729329AbeIBRkA (ORCPT + 32 others); Sun, 2 Sep 2018 13:40:00 -0400 Received: from mail-co1nam03on0123.outbound.protection.outlook.com ([104.47.40.123]:41136 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729276AbeIBRaU (ORCPT ); Sun, 2 Sep 2018 13:30:20 -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=6q0mNKrUVZzE/fPHf3iy6kQUxjMu6PHm0MKjkatitis=; b=fnq2nf1B77UBtxYdbyKoMZbUlSSfJXSKyEZiPSN9cj7Dyc9j6Y+GfIXV1vy3NLjOSQkDOJnO5Ig4wlySoZBKL6g1QI14S710RQ8+MPxC9MZqrYlm49R7rzQVxbDxPixAgdrLdvunGXp39jBkMxOczA4X8Tb/L5+RzIVr28Cefk4= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0120.namprd21.prod.outlook.com (10.173.189.14) 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:14:26 +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:14:26 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Loic Poulain , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL 4.9 21/62] wlcore: Set rx_status boottime_ns field on rx Thread-Topic: [PATCH AUTOSEL 4.9 21/62] wlcore: Set rx_status boottime_ns field on rx Thread-Index: AQHUQr7fWQGkf43yvk6HaFWQCzmfzg== Date: Sun, 2 Sep 2018 13:14:26 +0000 Message-ID: <20180902131411.183978-11-alexander.levin@microsoft.com> References: <20180902131411.183978-1-alexander.levin@microsoft.com> In-Reply-To: <20180902131411.183978-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; CY4PR21MB0120; 6:jePItx4z3CbL4ABFClxBU2LPhNIPmSeW2Dm9znZRGrxWdVr6K0HXpXK866madcp+uaaedmSUBfXjKTqktYqXZ203cRxU/KsvLgn7Krzql6L49JvmwRGTZPOKDUxRZ8K+fcYxvSTrrX+15WEZOixEDgOakhzvEspgBZcdKmuxOaMXzbtdADwvQg2X5ZKyLL/lgcweDmuujZimPNTPKWdtDhl+lsWBTo2QMNiW0kZDXMMzVipZ7p5I73MwGIwI8rbcm6vUFg5KV78px+C+bIhcVq5zVXvxrNnSVmFG1L1UrPQmfEDIkXo0o0xW39sGS8beD9g5LHwJfCG52Ufaqj3mTAN3ToDOLJG0IQgicOeJaMuoFtVELrYAZNJPjfX6P9S1uISmfrlJLh+q8+lt+2v5GgtvX8VoWUzwumOiuqm5URGA8UIps6FLLTbstZox5ZVPKRNxKvGCxGzwdvFgcx7F5Q==; 5:11cXlPEpunI3QAqs/9YH3VxtzZTX2w4uHxMnwQ8KH2gXSJ6a+evfmaoxJgZ6HfWwnqOUvnAAAFmnBh0hZ8gJeF7ywfp/DZC4BqvM0doAaKkeF286qgHUVOpY+MOuu5d50dJtSGG3c5L49ZTTp+lugX7Jfj1S38NFwIOaGCN6+04=; 7:cIk8wK4HonBd3HIyKbcxATsV5oZVemtuS8Mo8RJSob7G0U630VFNTezAkQYECWg3pChZtSx+QP7PtX3XtgyPCUQe9C2xZhOLwUV5H5zdCWdxnmtFbqwNqwPoC/izGuDLqCUGyLJdj+AVvdyS5xLBiL9MQDMFZ/btt/4MAXQZw52Bf1m1EX7VMEy6lBuEcMqy74uTqvQHxPruLpM5KfJq8DEH5Q8LSkH9VSW7YCXu6shmFWSav6xyoVQD/kSX05aV x-ms-office365-filtering-correlation-id: ae9bfff8-7ad4-4f79-bc0d-08d610d60266 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:CY4PR21MB0120; x-ms-traffictypediagnostic: CY4PR21MB0120: 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); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231340)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0120; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0120; x-forefront-prvs: 078310077C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(346002)(136003)(376002)(396003)(366004)(189003)(199004)(106356001)(53936002)(72206003)(5250100002)(22452003)(97736004)(6512007)(10090500001)(2616005)(2501003)(446003)(11346002)(478600001)(10290500003)(476003)(14454004)(81166006)(186003)(486006)(25786009)(4326008)(36756003)(102836004)(8676002)(81156014)(105586002)(8936002)(2900100001)(99286004)(66066001)(68736007)(110136005)(26005)(107886003)(6506007)(5660300001)(76176011)(14444005)(54906003)(316002)(1076002)(86612001)(3846002)(6116002)(256004)(7736002)(6486002)(86362001)(6436002)(305945005)(217873002)(2906002)(83323001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0120; 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) x-microsoft-antispam-message-info: gX8q2H6fmjCEcX+2H/gUI9egASm5DM3Ev516YmAxhAYGj4PFhALJ2xdP44KooGnwj+qy2heai7kMTlLGykt+oHizfyDQ7AAXiUej5riZ1gXu9uN14P5T7aWhYnOKM+GuRNbAK4DndXuSOjlH+uOOG/du4p+a6W5ixXUakSxR/HcfL0WCd/uy+RhkGUjaYMVnKJQF31Uj0sEkG2XEo6wdtLpKHpvWitPhxapNYpe+cMbkBPgLBfXuKnws6FKU/GzKqdMGAtLjDDz3Q/kgMm9/bQsPgi1VpfZpV/OTtWniNPekKElZ8csm47Wuilr1MhFsDK5jwgFO3JIAJ2pDrTo4oQlv7p/DrucEkB30CnKCM08= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae9bfff8-7ad4-4f79-bc0d-08d610d60266 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2018 13:14:26.7625 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0120 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit 37a634f60fd6dfbda2c312657eec7ef0750546e7 ] When receiving a beacon or probe response, we should update the boottime_ns field which is the timestamp the frame was received at. (cf mac80211.h) This fixes a scanning issue with Android since it relies on this timestamp to determine when the AP has been seen for the last time (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter). Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ti/wlcore/rx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index b9e14045195f..7367f0947825 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c @@ -59,7 +59,7 @@ static u32 wlcore_rx_get_align_buf_size(struct wl1271 *wl, u32 pkt_len) static void wl1271_rx_status(struct wl1271 *wl, struct wl1271_rx_descriptor *desc, struct ieee80211_rx_status *status, - u8 beacon) + u8 beacon, u8 probe_rsp) { memset(status, 0, sizeof(struct ieee80211_rx_status)); @@ -106,6 +106,9 @@ static void wl1271_rx_status(struct wl1271 *wl, } } + if (beacon || probe_rsp) + status->boottime_ns = ktime_get_boot_ns(); + if (beacon) wlcore_set_pending_regdomain_ch(wl, (u16)desc->channel, status->band); @@ -194,7 +197,8 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length, if (ieee80211_is_data_present(hdr->frame_control)) is_data = 1; - wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon); + wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon, + ieee80211_is_probe_resp(hdr->frame_control)); wlcore_hw_set_rx_csum(wl, desc, skb); seq_num = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4; From patchwork Sun Sep 2 13:14:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 145724 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1474442ljw; Sun, 2 Sep 2018 06:14:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZuZ5YUuweUnN2RqmKkfIyJrls2JxrKEGTDqd9CnDkbCvnDay6bwBjVDPmwGiMSMfMla1um X-Received: by 2002:a17:902:9a83:: with SMTP id w3-v6mr24529449plp.75.1535894091163; Sun, 02 Sep 2018 06:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535894091; cv=none; d=google.com; s=arc-20160816; b=gTe54yO41VvUlMg8ab5lyu/MP1+2mwCWpAZH9OFDBC/7CRRRu7OBbYSfvv5zdbvpcP VzxiNNf49DPsO7l2T+chfVTj7vCkeer96e/pD5S/rihTIsbaIj3OPVAE5Yq9lKE+Zi2I y4ycMyd5k5NBnVOApIu97GGOtPWs0boYn1O4N7tyJRr0KGzVBreuNP6NlANuL1S5MZwD 3sZ+EYkyxyo7VyeYGzbtxS7Hgscvk4QVACYIOzoLFlx3Ie7sXCyIfWWHghoa/7P/+lBr IKC5wKRyWqPiTCSnh0S5OgXm6Pydm9bh77BIWbf3KqWUMQjrF8A8ou3Jzk1fUCiMtu9A BVcA== 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=Ob3fKpOeQN7jhyRFJW1+lxplHY4U+02iTSG9bzdVSvI=; b=IvPZZN1DViJy+kAesQ+TPzcsTKcQIdWW11zwb9u9DbYwvryKslhw6/unNijEVgBgkO 0UANz5LmK7/+clttDEE19vViR4WHjlVGo+zQHqZHzSOE4CbnmaiCnkgQFyp67Sfa1oNa oqT4y6jmp80kM7Cs6xz3Q0qxe7Agj8EI6ZG8SgnknWMLBmUHMnX1xAZ5LThds76uVh7c PSHjfB3HjtPkTD8wNv8Rc4iJwz6X4IYgyGgDLaA/t10nJEzPlTIcQXIza2nEpg2HDIiT j97v0W+QhrvYeh2PPN3X3ISRrJUDlS4Y8xWqav8CGEaL8lO0brvyYDyUiHm2WcUPdiYb QEPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=kAVOI2Y7; 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 g26-v6si15226683pgb.349.2018.09.02.06.14.50; Sun, 02 Sep 2018 06:14:51 -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=kAVOI2Y7; 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 S1729836AbeIBRae (ORCPT + 32 others); Sun, 2 Sep 2018 13:30:34 -0400 Received: from mail-eopbgr680125.outbound.protection.outlook.com ([40.107.68.125]:33856 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728081AbeIBRae (ORCPT ); Sun, 2 Sep 2018 13:30:34 -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=Ob3fKpOeQN7jhyRFJW1+lxplHY4U+02iTSG9bzdVSvI=; b=kAVOI2Y7iot+xg2xvJI8wfINIHWG54RlabsJ3YavN1hl4mNMQOr7lGfhaqaBpc5YXi3/rtiSOwlHPJJqONRWfm2ULV/nlarSN7VBfBQ0I3rE0Ctz0v1uealJqYncTlVWQjlv37K9OZvRmtHQKluDyczxufnFm0uyj+QNb8ta8eM= 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:14:45 +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:14:45 +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.9 33/62] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Topic: [PATCH AUTOSEL 4.9 33/62] tpm_tis_spi: Pass the SPI IRQ down to the driver Thread-Index: AQHUQr7rRqJ1u+DlqkKxe1KV5NL2eg== Date: Sun, 2 Sep 2018 13:14:45 +0000 Message-ID: <20180902131411.183978-23-alexander.levin@microsoft.com> References: <20180902131411.183978-1-alexander.levin@microsoft.com> In-Reply-To: <20180902131411.183978-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:K19Kmi39qKddP6hPHB4ltQl2A6GqX1eDLlFt88aVC/lUkacSvU8L5nIKz9LDU9tGgFHqj07089z5gwDrIKfB9Wsw2klFZh9kh0OWOlwODi+38Ayx4fnkDf6Jod45AG4sWQE7UwTpnxzJJb0Q2N0vVoHNedIPB64PVvwmqmBfBlm72girw4QdBlrodV1iQ75t7POYjUzRm5wAWtS2ga2P7QBpShYc1DOddgQiSrLZvkMDmc209Hq4Bp8GZ0MmV11lmNtMAosxz04lVeIvWVvVaDtxw6IcB0vKvYG31ZSLyE36ecI70KYFnLCkfpg86FR+wYbx7etQ79l860RKYF+ahup/cbBoR6adOZBve81AtZRmcRbGeeyZNcp+S1F2hKBae59qoxuR+vzmxuJ713yuuigMIPo4DgxSLR7ikJWRjUob9SJBRhIWM7gnUSGvdOWcbURsI8ro/xbw/+zuAubAPg==; 5:MwrkvL+sep2pnSX5xTovInslK6ppSApuHWKZCdvNF5mnPK1yrRVOvtPOlFHrmgw0xzJtmmSVYj7AN76OEH/+nCOAVCZWmUWyUbp+4HXDu2fOSGiynMEwKiZnDhwC2Qe5W+2dDROh7Wo0BmttS+5uHHNky/pK2M5XBYt1HAB7YSQ=; 7:+70AawfjK3UbBFseZPnXshme2A4fopsdfTJ8tYRVFZcf6RzJYQs7wiDfG2SzrNqw+WV1fmm/i2Lf6YwZzdt3aldqP0kIVcKqevSZrhiTowSCrG/5bK4cbhOGZHobOfF3qSsYG4xZPG2zjjrldQHgSr1OOnzWfLNCpmqvmUF2vCUUMd1D1FB65tTQkmF8cIyTNu5QbXtDpBOe/EKN3SmOGRvShNmiNYfNjTX4ulhIhYo2uRYD8FOwiO8MU0qtDuK8 x-ms-office365-filtering-correlation-id: 5ad558ce-a6c0-42c3-241d-08d610d60d9d 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)(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: UdQEYRfdMhYOtw+jg6JFPFMuBi7kM38FZ/ZYkP2Nxrf/QFHQR+jzutG1EY0bZ62wuMi5qR6Pg6+cYDPWsPavN8RatQE0P5Ov+gzUezkTWFfGGmxccY+qU+623PXWjasuICKMOtW+6bTEBHLO5f4eCfh7DB3MqPaVVt1J4f7lTuoHLNXsWN0+Y+j8/NJlY4SbNfcIVSRglYYfsaDgLshX4yleCjmtVjq9ZclQ2eQFElI5qOwXdD3LmIeNuJAV0keJ2yeyaFE7FrTsdTw5hWARSaSKrVNA3Scznoxj2Ja421rHx02OyB+r9nA55BT2/cDflECh5jbnAPPjXwYQYFIWRwYZJhNXAPf0nhaJSL5VYlY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ad558ce-a6c0-42c3-241d-08d610d60d9d X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2018 13:14:45.5640 (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 01eccb193b5a..950c2d28d81d 100644 --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/char/tpm/tpm_tis_spi.c @@ -189,6 +189,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); @@ -201,7 +202,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); }