From patchwork Fri Sep 7 00:36:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146142 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp522657ljw; Thu, 6 Sep 2018 17:36:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYQWohaFGM3P7K+HuvMDG6giXOuVI/5Wbwvn0fWCAyOP5gWKHvy/RQvS474J3iwaShPmxzd X-Received: by 2002:a62:f208:: with SMTP id m8-v6mr5715335pfh.222.1536280574323; Thu, 06 Sep 2018 17:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536280574; cv=none; d=google.com; s=arc-20160816; b=Y/y/4TqRiajD0Cl29MoXFBJghjIDPK5hbR8AyKjTiOzO6XNxlkC+vUXAO8XPx7/VvE pbrbHosoghI+MH9zGQzddO34zE2jhPlPTSm+LDuB9866PABE1dTFCKVmvW0N+2ZhxBtT nUlhk9gLfUorD+T4ejXk9v5XFtyr/I3ln1FPr9UK3ESSzIv2bspiM1uX8yq7fjAP08E6 E2WAv4alQukFyZOzkNmgX2skr7V764aBZ6FVKyoSPC0rvCrrG+S+wb0U97sbqvVndq0w avYy3PKL+/gmTeRJqcK3YDKqkrfbVsx/F/PhQuXVJ4Ax3tIis7NiRdojPgq0lbAYuZ+g /JHg== 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 :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=ErhOCor3hzm94uM81gqhWrumPTuqEQbv62tUH4dLWHc=; b=s4Y80Rq5A0BeqdBl0SdUi0BjzgZQWlJSj5kK2FcxUwlzFGc6U4JjqeE6zYC1Yo2405 YCXmzcas/IdjQm7Byh3Bg5EPOGkoS+u3SCjwJG75urQv63sU9TUDsjSuD9vV34zuAfFQ O6ZRLQayfaMNce0RIAH3kSSNuii/BHaCLNqQBtkkaup8Z4h6ITHfVfGBNs+bxxabt+zh LyLgYhiUnsxiLNBpA17Lf1B4H9XSwoi91jFAyuGIkXzlf3GuG2AH9K8vY6ddjUUAMK3N hEMCTsJdkfKeTxrXvw4kEOIJjrWQ9nAu5RE8UG3MEtovatTGISGIXRrIYy7etE9ALLVD CeCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nmnDGTvf; 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 f90-v6si6429845plf.30.2018.09.06.17.36.14; Thu, 06 Sep 2018 17:36: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nmnDGTvf; 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 S1728548AbeIGFOP (ORCPT + 32 others); Fri, 7 Sep 2018 01:14:15 -0400 Received: from mail-eopbgr710107.outbound.protection.outlook.com ([40.107.71.107]:21288 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728091AbeIGFOO (ORCPT ); Fri, 7 Sep 2018 01:14:14 -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=ErhOCor3hzm94uM81gqhWrumPTuqEQbv62tUH4dLWHc=; b=nmnDGTvf2TgP6OSKZHrpj+Tae5F3sbwh+ZkDv66HamZ/nRwoO51eRa+MEvZ9sXKX8L7FEsVed/aNJ+ZHHkE9uNFDAbApKyvCDDAsqeUwTKc4JUCNTnLQDjRt0w9MaPvRzzV/fpNq1zPq5axkloX9B5YALSVDMIYU0RG4BATXNF4= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0824.namprd21.prod.outlook.com (10.173.192.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:36:08 +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.008; Fri, 7 Sep 2018 00:36:08 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Masahiro Yamada , Sasha Levin Subject: [PATCH AUTOSEL 4.18 22/88] kbuild: add .DELETE_ON_ERROR special target Thread-Topic: [PATCH AUTOSEL 4.18 22/88] kbuild: add .DELETE_ON_ERROR special target Thread-Index: AQHURkLEaoqf5qU2/06kRAIZt9+gFQ== Date: Fri, 7 Sep 2018 00:36:07 +0000 Message-ID: <20180907003547.57567-22-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0824; 6:gpROHgkoBGKjab/yGTKmrOMz1PgysvDAwPA22SJbasZF7fK8pZhEMF114B333fVTCLclYTePr56OdSNit3mGTs5SAA2uKBJB8tnumJ4VfuISZK6vgaMRsMvBZdQrUW9vAjazn9FNl3U4D8shjQRl5uHiHncdNpMiH/9fYvI04vHKZg8CzQ7mMi9oemqATavp9LaZONx2D6aWqZuMyh2oAlHgPiQXE8DS2ajAq2qbWa9cKIIHXTts6jf0kabBbsDBVp0tb13Rq1JHcTBRsZRan0iG5KCQrCrAznhLb7IDOoEK7sDhPmk4tqJlDkPbZ2sPEIxQEuE0fWMny1OueiQETmodsz9EIP0/75IM4rBSUC/LpdeyiG10UTwFUEO1OdHZ7BqJPlcfTRA6UQmuKZ+g8eDQDpnw3erNSaJpn+QFNeLRAj/CXyeD4VZvcslwUVyeGzL9oapBJh70S2oGyQpqYw==; 5:gVodgDeHACX0N5PMOA9LmSaw33KszxqlyNC9Qxy0TI8ktoLX2IvMSTuAMnc3QtBUPIZ7t8+0d9ISkZgVdbRJ3Vj/WihBvVENTSaFZKqmIPlmkMd107Xu+Mj1ou/4flLDm05Coz/36ya1HiCidmLOZZQYiQXuu8JbFIU5baHgdbk=; 7:P/rqAoi2Ww0LFEX0zZtAEOHnLiN3deWG48r8+Ec1sFrRUU6KO1a9Qu+12OOK4NOQaYJSC2t35GF8wUMKyTj0SHTpL24XGrwUBnp2XPfX3I9HYjIBPyekwnNLdRs06myosCOjVU2YaICqUcCk5nb2VtwFbMNaxWw3+PZ4qW/LMuZ5NX9zIXXNWQ92UPiGY4THimsEr3YxiYtaiDNPQ51hvOyTi61y+PJ65zra4VLrlRlsE+JcYl0sEdM34/usFer7 x-ms-office365-filtering-correlation-id: 2ddb56e5-ea73-4a30-fc13-08d61459e719 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0824; x-ms-traffictypediagnostic: CY4PR21MB0824: 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)(93006095)(93001095)(3231344)(944501410)(52105095)(2018427008)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0824; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0824; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39860400002)(376002)(346002)(136003)(199004)(189003)(22452003)(14444005)(256004)(102836004)(6506007)(217873002)(10290500003)(186003)(26005)(5660300001)(4326008)(6346003)(81156014)(81166006)(110136005)(54906003)(72206003)(316002)(1076002)(6116002)(3846002)(8936002)(107886003)(14454004)(86612001)(2900100001)(105586002)(106356001)(5250100002)(86362001)(76176011)(2501003)(53936002)(10090500001)(68736007)(66066001)(36756003)(6436002)(99286004)(6512007)(486006)(25786009)(2906002)(6486002)(478600001)(7736002)(305945005)(2616005)(476003)(11346002)(97736004)(8676002)(446003)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0824; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: BeUURZUSuOKUS2+S7rdFExkbeHK3p9NSmTUKygyVf+KQICyGgvqlltByiIJIYfr4Ddwa/SN7bz6V0CxK6coiBK9qeEpcRD01/xoeXap2sa/oTmtWM0qFNJEtWzV9dC2Q+uRA3RLiHYNZHWl3vgSyOoG9y23w5B6z3wtlhMpOmyh99Ot7tIyBMVKed2m83sUI/lLc0pibu8QtyZAzOjKGy4LCCgE/1+R9P97+uKbSIXcVKzEEK+8YkDxw5qTFtKLYi70C4ePZMboStjxWepiR8e8ryS3h65x6kmAtOvQhmFEg9+r/lfm6g0f650/je59HAgK0k0GGNM/uzRAajtirb+i98nCdBRt7kPuZcmFHV/I= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <6956467F78DF504D9258B68FC199E95D@namprd21.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ddb56e5-ea73-4a30-fc13-08d61459e719 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:07.9907 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0824 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 9c2af1c7377a8a6ef86e5cabf80978f3dbbb25c0 ] If Make gets a fatal signal while a shell is executing, it may delete the target file that the recipe was supposed to update. This is needed to make sure that it is remade from scratch when Make is next run; if Make is interrupted after the recipe has begun to write the target file, it results in an incomplete file whose time stamp is newer than that of the prerequisites files. Make automatically deletes the incomplete file on interrupt unless the target is marked .PRECIOUS. The situation is just the same as when the shell fails for some reasons. Usually when a recipe line fails, if it has changed the target file at all, the file is corrupted, or at least it is not completely updated. Yet the file’s time stamp says that it is now up to date, so the next time Make runs, it will not try to update that file. However, Make does not cater to delete the incomplete target file in this case. We need to add .DELETE_ON_ERROR somewhere in the Makefile to request it. scripts/Kbuild.include seems a suitable place to add it because it is included from almost all sub-makes. Please note .DELETE_ON_ERROR is not effective for phony targets. The external module building should never ever touch the kernel tree. The following recipe fails if include/generated/autoconf.h is missing. However, include/config/auto.conf is not deleted since it is a phony target. PHONY += include/config/auto.conf include/config/auto.conf: $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ echo >&2; \ echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or $@ are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/Kbuild.include | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 86321f06461e..ed303f552f9d 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -400,3 +400,6 @@ endif endef # ############################################################################### + +# delete partially updated (i.e. corrupted) files on error +.DELETE_ON_ERROR: From patchwork Fri Sep 7 00:36:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146164 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp541505ljw; Thu, 6 Sep 2018 18:01:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbmGpK3J4t2N6Zok5oPje3N/r/a5IiPncaG0pYWoJ35yx8LD+wAH/AFrBhMGwo+GVmXbs2h X-Received: by 2002:a63:ed4f:: with SMTP id m15-v6mr5641155pgk.147.1536282088771; Thu, 06 Sep 2018 18:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536282088; cv=none; d=google.com; s=arc-20160816; b=OAZ2N3jfYLRNNtJ3LI1v68cin4AiVvgFCa4dychMl7WGyDGBlrAZ7s3889izPzDqGN YGV7aDws5IU79Ix4XQPB+UBu0tj65bMbKwQZJWvmWXQyQZuICezLXhpt7knm2lzA7nGn fLYgt9k5XlF9XaJwMFFLDopx+6cs0E7/itJzZNfoRn6KY1Gccj6Lz7U7dbiw1ZXR0j6N b86MmYTzhEgs+fYRH8k7ItG4kSMdswnyj8KMQ9kfJtGXViIedq5QByOODuBAjwuT4cTK ZubAOKMph4TuY2saMSjkATwdm3eOKtKAf9+6D9qhbcSdFUMdKym8V+UbNNojtLlfdZCq 9pSQ== 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; bh=urtDv5J2Q+FqJO2ldPc+6k0HTiDIMEvjESjMV+uVHVA=; b=u0V0ymd7Q5FpAcMHGKw8n9sgtFaWlzbZKhQTQTirAzkncJxq+HMd4UyGpGdeZi5dQM HdEiK0ObPdkRAjUL4lpc8AyAAKvh1UIfLSFo0qS62WcwuNNX1RwyA2gzvZgtdhzbN5WJ IGA+QCp0E9wBC0sP2PZZx1sLqnJkXRVWbU6wtnnF3LejJTHb1nhZ4RGbQo+OMshl7LyE 50yzw8Z1hKdqjRC8bgEfeEGy9542CxJfWAJ4LU9WwkDCVCjpiXPS4OmSGKfIK0jkJhD3 UWaUfB1xBsTn2qW/srbqr8gZOYn/z10q8r6/Pv/Pdh62UKHqn/SpRf8HfgipYkLiEpsm /f/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Due1ds6P; 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 17-v6si6912964pgl.166.2018.09.06.18.01.28; Thu, 06 Sep 2018 18:01:28 -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=Due1ds6P; 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 S1728693AbeIGFOT (ORCPT + 32 others); Fri, 7 Sep 2018 01:14:19 -0400 Received: from mail-eopbgr710107.outbound.protection.outlook.com ([40.107.71.107]:21288 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728163AbeIGFOQ (ORCPT ); Fri, 7 Sep 2018 01:14:16 -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=urtDv5J2Q+FqJO2ldPc+6k0HTiDIMEvjESjMV+uVHVA=; b=Due1ds6PdkbZP0ajH+dWXMM0Wq8SrqbhPzDBci362UzOlxW1zjW7LebEYz8fEd6IHKCVfvk0/ADC+4dBqlCi00gMIZSsfod0F964DItM1jpOnhBhXrF4QE/8jNcxvaG+oD/B95SbKNxr6LVDxDSDPoacVVhPU1l1gB3jbB1vio0= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0824.namprd21.prod.outlook.com (10.173.192.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:36:08 +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.008; Fri, 7 Sep 2018 00:36:08 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Masahiro Yamada , Sasha Levin Subject: [PATCH AUTOSEL 4.18 23/88] kbuild: do not update config when running install targets Thread-Topic: [PATCH AUTOSEL 4.18 23/88] kbuild: do not update config when running install targets Thread-Index: AQHURkLE+ghjyIPBsU+BKHUd/JgDLg== Date: Fri, 7 Sep 2018 00:36:08 +0000 Message-ID: <20180907003547.57567-23-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0824; 6:8U9JZ7SFxow7ODrxQ4vHyNO8yA4wh+prP7Mt/J60EpglwLPGWPxHQaIOydpCacRePE1inHkHdDGqxaZVqVksb8SesgScAAGIu3BQYDX3J7045gwGpEM5OlIJQD0rmD9u1jRQSVpcPKuKk3DY5dFaLYu7rtfqDN1mJA9/d5HbZ1k7GLLOcAKGsmvy4cMysUUe3+hgbDinCxqFkzy5O8l8x0pG5jlREIyTBuI2u+eEmvWDXDwiOvFH48xedmYjf+07U0OBKp3mZZDUqvasB6yhyERLC1Bg8dGAAPIOZLeUvgdbhMWxKp3iLBDTr/CtWkff9t+Lrem7Je/oyiHWP1funUhqLJ0yRPRZSr/XeO2KknHnzafvN+f+M3CVwWS5ZUfokqfECrhXL7J6wQOXFrk5H5EOexebd9XHKvp8Nopnn1ZddijLxJp1Z9e0INgsTSu1uT+TYj8CLlm0jNc/hZgFHg==; 5:Jm2XkewGBbMo1bxt4xoIwa7OrCuHIumGlxkk8WyQYIxxkGhoNn8OfAHAQDD5SdYIaTGT8d1pSc1cyLLtqBUJFi+YNe+EpP1B9GF0F2S8U+rv4jX6euC4ubDE4JVpS9TjJzKhd6XpF4aznh9iqS4XADKsarmAqCWRbzMRbwkBk7o=; 7:FTfEMuOPc31l4QAjC3aBcDAdPHg6hXKweoelgVmxkcuNtnrbsRRSmqsm0gXuCrgARpvCnL63JKPERFkDX4tq13EexCYtpq2m9h6Yt3iyXLoTq/srlwyBtYtbpbboewyyzydFLekxYvn048SmEzcSSvIC9bO+6p5MVv4oSHPjkikRlmYXqkElfLJKjgFTP4xwfYONrudwdpFHlzdvxLfS/RS7agBIMUc7PJx4xFX3N/YrdcWwSXgTPt+Nptc3i/sn x-ms-office365-filtering-correlation-id: c11c64c4-1c70-4188-9948-08d61459e777 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0824; x-ms-traffictypediagnostic: CY4PR21MB0824: 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)(93006095)(93001095)(3231344)(944501410)(52105095)(2018427008)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0824; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0824; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39860400002)(376002)(346002)(136003)(199004)(189003)(22452003)(14444005)(256004)(102836004)(6506007)(217873002)(10290500003)(186003)(26005)(5660300001)(4326008)(6346003)(81156014)(81166006)(110136005)(54906003)(72206003)(316002)(575784001)(1076002)(6116002)(3846002)(8936002)(107886003)(14454004)(86612001)(2900100001)(105586002)(106356001)(5250100002)(86362001)(76176011)(2501003)(53936002)(10090500001)(68736007)(66066001)(36756003)(6436002)(99286004)(6512007)(486006)(25786009)(2906002)(6486002)(15650500001)(478600001)(7736002)(305945005)(2616005)(476003)(11346002)(97736004)(8676002)(446003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0824; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: CfxGZNTjVhinrMtAOS54Zy2seO0Qyl3tyxLaQAKC23XubxVRzH/ATraR7RwCaai9ARRR4Pp1eCA7jmsXhex+N8RceSyx0uUXt56enPmqRnM2Z6wLL3GLHEQoPXs4s97NmAwy8fh8783Cz4swt18ic+hO+EJWkYiFgCO4vGtYHbVO//j/eHeLV4aDGrX+bxx9qTq+gMGHtnfgqSLu1tiXENZskXac66JcEwsqoWZdUwwADqyi3lyx5QVvvevAwedBjENOm5S3cZtxpPHTWkqxGNumCDCKA5i30T3EJmv3TrnnWDJzKkzCaw0PADmDiOIeFz8aQWTrUkGeRwHvBoAefoueISp5g6u1n/M/Mh2Yjw4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c11c64c4-1c70-4188-9948-08d61459e777 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:08.5672 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0824 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit d79424137a7312d381d131d707a462440c0e8df9 ] "make syncconfig" is automatically invoked when any of the following happens: - .config is updated - any of Kconfig files is updated - any of environment variables referenced in Kconfig is changed Then, it updates configuration files such as include/config/auto.conf include/generated/autoconf.h, etc. Even install targets (install, modules_install, etc.) are no exception. However, they should never ever modify the source tree. Install targets are often run with root privileges. Once those configuration files are owned by root, "make mrproper" would end up with permission error. Install targets should just copy things blindly. They should not care whether the configuration is up-to-date or not. This makes more sense because we are interested in the configuration that was used in the previous kernel building. This issue has existed since before, but rarely happened. I expect more chance where people are hit by this; with the new Kconfig syntax extension, the .config now contains the compiler information. If you cross-compile the kernel with CROSS_COMPILE, but forget to pass it for "make install", you meet "any of environment variables referenced in Kconfig is changed" because $(CC) is referenced in Kconfig. Another scenario is the compiler upgrade before the installation. Install targets need the configuration. "make modules_install" refer to CONFIG_MODULES etc. "make dtbs_install" also needs CONFIG_ARCH_* to decide which dtb files to install. However, the auto-update of the configuration files should be avoided. We already do this for external modules. Now, Make targets are categorized into 3 groups: [1] Do not need the kernel configuration at all help, coccicheck, headers_install etc. [2] Need the latest kernel configuration If new config options are added, Kconfig will show prompt to ask user's selection. Build targets such as vmlinux, in-kernel modules are the cases. [3] Need the kernel configuration, but do not want to update it Install targets except headers_install, and external modules are the cases. Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index a41692c5827a..d21929d160a4 100644 --- a/Makefile +++ b/Makefile @@ -225,10 +225,12 @@ no-dot-config-targets := $(clean-targets) \ cscope gtags TAGS tags help% %docs check% coccicheck \ $(version_h) headers_% archheaders archscripts \ kernelversion %src-pkg +no-sync-config-targets := $(no-dot-config-targets) install %install -config-targets := 0 -mixed-targets := 0 -dot-config := 1 +config-targets := 0 +mixed-targets := 0 +dot-config := 1 +may-sync-config := 1 ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) @@ -236,6 +238,16 @@ ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) endif endif +ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),) + ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),) + may-sync-config := 0 + endif +endif + +ifneq ($(KBUILD_EXTMOD),) + may-sync-config := 0 +endif + ifeq ($(KBUILD_EXTMOD),) ifneq ($(filter config %config,$(MAKECMDGOALS)),) config-targets := 1 @@ -606,7 +618,7 @@ ARCH_CFLAGS := include arch/$(SRCARCH)/Makefile ifeq ($(dot-config),1) -ifeq ($(KBUILD_EXTMOD),) +ifeq ($(may-sync-config),1) # Read in dependencies to all Kconfig* files, make sure to run syncconfig if # changes are detected. This should be included after arch/$(SRCARCH)/Makefile # because some architectures define CROSS_COMPILE there. @@ -621,8 +633,9 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig else -# external modules needs include/generated/autoconf.h and include/config/auto.conf -# but do not care if they are up-to-date. Use auto.conf to trigger the test +# External modules and some install targets need include/generated/autoconf.h +# and include/config/auto.conf but do not care if they are up-to-date. +# Use auto.conf to trigger the test PHONY += include/config/auto.conf include/config/auto.conf: @@ -634,7 +647,7 @@ include/config/auto.conf: echo >&2 ; \ /bin/false) -endif # KBUILD_EXTMOD +endif # may-sync-config else # Dummy target needed, because used as prerequisite From patchwork Fri Sep 7 00:36:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146143 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp523118ljw; Thu, 6 Sep 2018 17:36:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamKIKiwarG0jq1K3WNzoj047jqF8xyE3EYHuJ4qmj7hc38Ch0MsI4ZnsQiPv1Cq/aOtgWP X-Received: by 2002:a63:5b1b:: with SMTP id p27-v6mr5564300pgb.322.1536280612834; Thu, 06 Sep 2018 17:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536280612; cv=none; d=google.com; s=arc-20160816; b=jehwZHOn5K1PGEQ+mhW3svNxAJSYNy3D5saIS6J/ZBywOA4o7nsSbHxb20E6E98EuL BCt/md+gChDsEzt+0B9/kj/eWbOKXkSFblKvgIH4pB2oagSijFDH6T1Xk03tNc4SOj/r 7WCBQ0NwAwRP0A8A+r17tnQS8C803XpveTFH+wHMbeyiQNxmsiEuumPAjmSKRDNnTJp3 +4i3ATV39A1NYi0NW7ELQssNOKtejD8xlEs8YOVLpphwuSaegoYPyrANSYVM1LvLHDJn 66kOBAMKnWG1geX4i93hXeCJ7ig83ADcizZjOlwzCeZMQKAYnYnvrLJkQvexCeYnC3YS qp+Q== 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; bh=m6t77QX2AGsSdKUUZzV6XElAzxnvW2Eoz0aaKf9cjRQ=; b=IQBUzCwSRNHAgv4GmR9AaRT2jXAH3qQdcPBfsH8Z6kIkPlBAQCJmFV4He31jovoYeR D2W57WopQCguQsjnx1GS5oHaav9FDopz/3oKEisYl/u1xxrwtUGrdxVmWn7gQ9yHhkLv x3rvZhfpyuQJkbSiO2zTxlsDPslt91EdRr2DbqpEaOCRcLvTsinuU5YQwmz4Vu42dz6V Qox+g/rGJPyVcfIQBiTlIhTOhcF37f2gOK03IXgubwQGvumJlgBCCn9nrbMHYVTNC8Vm PF89goLV/KOh7/LYdxPcKV2gChoV9E7IIDDtcdkhHCdbO0ZojNijbsIg9awBjheCcog4 ZGCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b="C/J8ngy/"; 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 r7-v6si6707171pli.248.2018.09.06.17.36.52; Thu, 06 Sep 2018 17:36:52 -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="C/J8ngy/"; 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 S1729010AbeIGFOy (ORCPT + 32 others); Fri, 7 Sep 2018 01:14:54 -0400 Received: from mail-cys01nam02on0131.outbound.protection.outlook.com ([104.47.37.131]:1824 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727776AbeIGFOx (ORCPT ); Fri, 7 Sep 2018 01:14:53 -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=m6t77QX2AGsSdKUUZzV6XElAzxnvW2Eoz0aaKf9cjRQ=; b=C/J8ngy/wxD1Y8cuLpDvxqxempgEbhHo2qGjeytNyxWWd9ryjKrlbUkL3/AD9vLwfD1FSgLCF2wjjG1FpImGRYdKCPD1piST5QBSqpiSPj733lco3kL7HEj2Em72344m+/XKEwKY0/1jigo6qVEMyDcuF1jQMTKI8BnGh3eBXYE= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0469.namprd21.prod.outlook.com (10.172.121.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.6; Fri, 7 Sep 2018 00:36: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.008; Fri, 7 Sep 2018 00:36:45 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Todor Tomov , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH AUTOSEL 4.18 32/88] media: ov5645: Supported external clock is 24MHz Thread-Topic: [PATCH AUTOSEL 4.18 32/88] media: ov5645: Supported external clock is 24MHz Thread-Index: AQHURkLIvYlZYLQ7M0W/N1KAaslVcA== Date: Fri, 7 Sep 2018 00:36:15 +0000 Message-ID: <20180907003547.57567-32-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0469; 6:o34vQE5HckpW0gskzrzj5qj4BtbOjcJfvXZm5ROiAXWQjlZoa6X+rsy+Zp7dQ8lsxxxZyPBcDa7ea9ZwZ2gDjOyQbmJtFSQrKu7iPal+8HbdK/qnF70+tyNfgsw5r3PZqN69O6ieWRduxMc6J58Q7tYCMV1HyA62SouyVvmvdMD3E0JKDzghvRjPMpIb/QApknJ+cdD/LoPkAg27ldsPHLeOs9Vp/DSOOTz2xxUwZIC+qzJNIPJVLkDEoBgnfAQiCeExmn6hjBXEkD+R5M25Gnjp5M82Nx8BL0T8NV+QGmVnQ/iYGQKq2J8oGPhlCF038v6Nt5QXilPDcgKRb+wkQwmxw6DFcp1Ub+FYAFv6fGmNgurAgsZmF8HhkjgCvycvLzcm/5CWaHKwJjTp+fpmo4F9eg1v2Gxl4h/Bb1Kdt091ZaHGxRPA2crwjAg1FF+HffVyrrpXK50Ou+kyi7/dKg==; 5:ndCw0vtV1/d+uCIffQaPMvHLiSOSevQAzMuMFDkMFHnMGYAy4Jom24HwGJFc/JR86yHg4k++kgMZige2ds8WO/L0pWxgNCIi8oABi1Np+9vy5PeJoQRZ4FBRQf0Rz0hasQLtv/L0BD1Ubi/Fz1DJ9IEjc0Tj4+5eb3evnpUShD8=; 7:rTiyQ3l4aKkh3caZC+QxN1KdFAk9pyl7arXVubGw/PGT5KnDSM+6BAfNDQSXbbfTpPdbjkdeEgRhS68msN9ACV5wn2sx5RH4efHUN7ihc2hHFC1wy3hhXpf9RPhdgu0hWd3/RXiQm5RzygM2ZKcCwUHGA4hDrodwOlOipL4X7n4TTFq2nuunk40ZtMOkaMJj9F2w8GHSfuPxfmv3QzTsa7NAOz1n/d6T7J/LuqQMfUBG1NHOqaAWTPQMPGpbBBPM x-ms-office365-filtering-correlation-id: 80bfc6a1-83d7-46a1-6827-08d61459fd1a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0469; x-ms-traffictypediagnostic: CY4PR21MB0469: 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)(3231344)(944501410)(52105095)(2018427008)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0469; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0469; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39860400002)(346002)(136003)(376002)(199004)(189003)(25786009)(446003)(316002)(86612001)(54906003)(76176011)(86362001)(110136005)(256004)(6486002)(10090500001)(26005)(2900100001)(476003)(2616005)(102836004)(5250100002)(22452003)(186003)(6506007)(11346002)(53936002)(217873002)(66066001)(4326008)(575784001)(486006)(6512007)(107886003)(2906002)(8676002)(105586002)(72206003)(99286004)(1076002)(6666003)(68736007)(2501003)(7736002)(10290500003)(106356001)(305945005)(14454004)(6116002)(3846002)(5660300001)(36756003)(478600001)(81166006)(6436002)(97736004)(81156014)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0469; 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: +IcbZXo+RRhpw1oTBuWHlKKYx0ggezh4qq5ux6xU6nuqXzveAV4zbHsI2f1qBQCdkWaJWegSwqthcM1ZJ10KmzsMNBZ4ufsFk0gr3CwZu6yoWYtUCEP2zhwpudHyTHwqgFVavrEfpAL2Scp8M/yGTpqM/uN/j7jyzR3cJYdV0WtqRQzmpYX4O0RQYWMVqO6VslB4eTO4PPDV/YdZseIgXAKuGhcN1g5UhdESiCwdr0LIZgRSKWck/KVu5SwLDJBqi8O5c31b4gnRA8mAaUadQ7TJog6Oyybkoj4XYAAAiOVU3hwpUY0SEtv1Q+S2MUd9D4iHNpNtiMWG5zPiOxvYSn0fyM8uV4YR1obsvplbbLY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80bfc6a1-83d7-46a1-6827-08d61459fd1a X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:15.1176 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0469 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Todor Tomov [ Upstream commit 4adb0a0432f489c5eb802b33dae7737f69e6fd7a ] The external clock frequency was set to 23.88MHz by mistake because of a platform which cannot get closer to 24MHz. The supported by the driver external clock is 24MHz so set it correctly and also fix the values of the pixel clock and link clock. However allow 1% tolerance to the external clock as this difference is small enough to be insignificant. Signed-off-by: Todor Tomov Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/ov5645.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index b3f762578f7f..1722cdab0daf 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -510,8 +510,8 @@ static const struct reg_value ov5645_setting_full[] = { }; static const s64 link_freq[] = { - 222880000, - 334320000 + 224000000, + 336000000 }; static const struct ov5645_mode_info ov5645_mode_info_data[] = { @@ -520,7 +520,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { .height = 960, .data = ov5645_setting_sxga, .data_size = ARRAY_SIZE(ov5645_setting_sxga), - .pixel_clock = 111440000, + .pixel_clock = 112000000, .link_freq = 0 /* an index in link_freq[] */ }, { @@ -528,7 +528,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { .height = 1080, .data = ov5645_setting_1080p, .data_size = ARRAY_SIZE(ov5645_setting_1080p), - .pixel_clock = 167160000, + .pixel_clock = 168000000, .link_freq = 1 /* an index in link_freq[] */ }, { @@ -536,7 +536,7 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = { .height = 1944, .data = ov5645_setting_full, .data_size = ARRAY_SIZE(ov5645_setting_full), - .pixel_clock = 167160000, + .pixel_clock = 168000000, .link_freq = 1 /* an index in link_freq[] */ }, }; @@ -1145,7 +1145,8 @@ static int ov5645_probe(struct i2c_client *client, return ret; } - if (xclk_freq != 23880000) { + /* external clock must be 24MHz, allow 1% tolerance */ + if (xclk_freq < 23760000 || xclk_freq > 24240000) { dev_err(dev, "external clock frequency %u is not supported\n", xclk_freq); return -EINVAL; From patchwork Fri Sep 7 00:36:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146144 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp523504ljw; Thu, 6 Sep 2018 17:37:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYRdCftnt+Uf5zBWg5CwQkrjiSmGeApL8NEbvY61W2AZj5ItYI5vi/PqTNZ9igUu4UND+YS X-Received: by 2002:a62:938e:: with SMTP id r14-v6mr5836769pfk.55.1536280641386; Thu, 06 Sep 2018 17:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536280641; cv=none; d=google.com; s=arc-20160816; b=mctM0FY2ho2h+2AktC6u6omojN9Wumj/zyabDgaPoloYpfm52SNbc99WvNCvqDxB5m ZLl8bQgumgDd96nIq4cO48c22o3B4wku+aMR4VZ1+TOY4iAKWXuPzk729rRQNvha3gmx RPrv/5KwVPBtNTdYZff49Fp4rynr9a2WlI1/GM1kH24yvtio63qR49dgc4tRePL5UcH3 iDuRq/otluylWqBKuEBnlpfdt/Fe3zunYAp17x6/jiR1FJo7mwNbuAl8QOGoO3GOq0HJ O/3cdIg20MJcVETrlch5SshD94RS0hym7k3zbWiukEotrCmFEU7DtWacFlxm/sSVrDyk R/4g== 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; bh=pVTHh4bKwe0mFrMFnYXebTHMvYG2FyptkEtlIiS0VXw=; b=UOKx98Lod1+a0N+iP0F1xKSbkEwNuP2kUAcRv+by+VYWjgVNW4wk0NjLJcQmOF6R4q bBpZGyCpQhi9RFihQ+ar9es7SQGoHspBjhfwmgVskrRczGs7aosWjU0snuGnfwUVT/K7 Skch3GWjJkiZ30RXBzhVvrhp/3o07MbRZeVIDkTgsnHwWZuiZVa0p1TdEI1HDfaDKAp8 ouddjxcqtoCkXsojuzm41XPG1IfSElF/M79Tw68zVh7rOA2ZvkE+T5Lhh3FgoGxTzmyc hw2wSgroxQMKr90VZGNupdw8HYtNShBAALZY0gt2bx7XqsPSPYQFQ2MOREizEiG0cOE6 gyeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=OCpy1fOW; 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 y1-v6si7124625pfc.132.2018.09.06.17.37.20; Thu, 06 Sep 2018 17:37:21 -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=OCpy1fOW; 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 S1729311AbeIGFPW (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:22 -0400 Received: from mail-eopbgr690126.outbound.protection.outlook.com ([40.107.69.126]:51988 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729261AbeIGFPP (ORCPT ); Fri, 7 Sep 2018 01:15:15 -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=pVTHh4bKwe0mFrMFnYXebTHMvYG2FyptkEtlIiS0VXw=; b=OCpy1fOWSDlmkcCDnvBhdDnU5cJAQBZ3kO8uYp7IjPHnTA5NEcmNkpnL5MV5x/tLAF7lMgz9SdX9yhRWmkycjOajAB7bMqEYhDuJXHB/4K+cuUobTttfB6YDm1m4qiurCEGrzeNLpUMuhmpKM9jHLE93suYX2AoqIgBDPJHD9a4= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0773.namprd21.prod.outlook.com (10.173.192.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.1; Fri, 7 Sep 2018 00:36:53 +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.008; Fri, 7 Sep 2018 00:36:53 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Arnd Bergmann , Mauro Carvalho Chehab , Bartlomiej Zolnierkiewicz , Sasha Levin Subject: [PATCH AUTOSEL 4.18 49/88] omapfb: rename omap2 module to omap2fb.ko Thread-Topic: [PATCH AUTOSEL 4.18 49/88] omapfb: rename omap2 module to omap2fb.ko Thread-Index: AQHURkLQZhwRaaFQ5EOvyjNMl7xWsA== Date: Fri, 7 Sep 2018 00:36:28 +0000 Message-ID: <20180907003547.57567-49-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0773; 6:4Ko34xsj1nXv8CUAkem+8GTCm1MxEWQaMn9Pw3phoLZRKdvK9PfZoKnsO099bK/x10dsx2UNrCpWsiQEW7Og+ggOJAKTySG2pa2s7QMP+1NTOL1uqswheTzkKhdX6E3dSfJu8arMkM5Puey/dQs44r0bTXuWehz5na+KMArAkvD3FpNSm9gsehQBSipYuEyY2fV7CSoO5ryEHHXb5kRaJMDqw8uIAdV8xgkbSaL7zn9oSU5Va1oSBdT/DKPgqncvl9ZMEMfofJfsYGOY3lWCaW5qI0c3meuRvL4rah/bBAvGTR1NU426dFJlheqPgVvU8QmgwOLFGKfq3kV6/ojwvZgp2+p6u6+z/3ci506yMjT64h37gqf9ENsEHYX3rSLT2jrkrfiXjSa8yUx4JuwGXSmMdrIBsPF0vnvKEAdD6ewJUOGzfdQFg+KD3mboJm3HnHs+CzmfHNtvrUIPotKVkg==; 5:t24sPJ6wZG2zT5GIgTVGHY2NkSWnwAkG+T7aBwSdQMB48ILmA2KKNr8q8Z3ZBPQ3LBcXnenIvYLabylbtPfOawmB9zeTkSx+YSh2AcZpMPeeIKTCSVo3o157AOWtQh4QL9NbJXX5p+BLXFzM3Io08N1tSwounzXrhUAkh0py3B8=; 7:5StPTAjFxEGU7TE3kLHdThlps1gOgOh5fMustQsQ88zBr3XPx4YqBAM6/R3PvJN2sQ9YYWmZoU3FkxVIVMwDwFfrTVeVS7rBPWRGE4VgzEUEiNO9tTZXy2LjvWlxBJRDWhpzMoff3haB+dQK4t0cyJMm3wacZznqOZhEkm6JyS+rgy/qQf0nT1RYUGuWiH88MIX3fL7iigGDxTyONIpJqGw39CnFM9uvJxfaL/JF7xFtJotLI1c8v7dVLSlwzsQ0 x-ms-office365-filtering-correlation-id: 3c7dcb81-68a4-46ac-9c7a-08d6145a024b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0773; x-ms-traffictypediagnostic: CY4PR21MB0773: 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)(7411616537696); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231344)(944501410)(52105095)(2018427008)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0773; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0773; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(136003)(39860400002)(346002)(376002)(396003)(189003)(199004)(8676002)(5660300001)(106356001)(6436002)(25786009)(110136005)(54906003)(6506007)(105586002)(2906002)(486006)(53936002)(446003)(2616005)(476003)(4326008)(6666003)(11346002)(5250100002)(107886003)(2501003)(86612001)(97736004)(6512007)(478600001)(3846002)(72206003)(6116002)(10290500003)(76176011)(68736007)(14454004)(1076002)(66066001)(26005)(575784001)(6486002)(99286004)(8936002)(36756003)(81166006)(86362001)(256004)(102836004)(81156014)(305945005)(186003)(22452003)(2900100001)(7736002)(10090500001)(316002)(217873002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0773; 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: H2PX1P3OtdXm7Mr0jz4oBRlAVGcib8iYsdEsTaqWh9vMREOqfdvyDVIdT9Vh0/ayaeIvOJrt147baxn8S23PrfYXdrFdHXpO58PRWHlXXeUO7bck5KHy7M60mk6X+y/jpbLCQ/BwvCqxdEFVYf7P5xN3JOSsouBv/HcyaUyzAo+744ADLLpWxdokXMXlX87A0VN0+XhJf6nIV0EZTeVzrRSm60nvcn3D6ZSDkkvRSBQ6u4fdhxw/52bOT30aBeO9Eypx1KCoG1Fn/TDj2c8evCoftklCd9zg/0aPCOGu6ufQ405oEW1CNVZOiYji5qJRID8lQ6DXeEti5Gw8sIb2bBZA+18SinsVYsDTHszpp/g= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c7dcb81-68a4-46ac-9c7a-08d6145a024b X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:28.6839 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0773 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 4bcd8c90ac0f27d3d76fcfc50582ff3685059de9 ] In a kernel configuration with both CONFIG_FB_OMAP=m and CONFIG_FB_OMAP2=m, Kbuild fails to point out that we have two modules with the same name (omapfb.ko), but instead fails with a cryptic error message like: ERROR: "omapfb_register_panel" [drivers/video/fbdev/omap/lcd_osk.ko] undefined! This can now happen when building a randconfig kernel with CONFIG_ARCH_OMAP1, as the omap1 fbdev driver depends on that, whiel the omap2 fbdev driver can now be built anywhere with CONFIG_COMPILE_TEST. The solution is to rename one of the two modules, so for consistency with the directory naming I decided to rename the omap2 version to omap2fb.ko. Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST") Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren Cc: Mauro Carvalho Chehab Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sasha Levin --- drivers/video/fbdev/omap2/omapfb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/video/fbdev/omap2/omapfb/Makefile b/drivers/video/fbdev/omap2/omapfb/Makefile index 602edfed09df..f54c3f56b641 100644 --- a/drivers/video/fbdev/omap2/omapfb/Makefile +++ b/drivers/video/fbdev/omap2/omapfb/Makefile @@ -2,5 +2,5 @@ obj-$(CONFIG_OMAP2_VRFB) += vrfb.o obj-y += dss/ obj-y += displays/ -obj-$(CONFIG_FB_OMAP2) += omapfb.o -omapfb-y := omapfb-main.o omapfb-sysfs.o omapfb-ioctl.o +obj-$(CONFIG_FB_OMAP2) += omap2fb.o +omap2fb-y := omapfb-main.o omapfb-sysfs.o omapfb-ioctl.o From patchwork Fri Sep 7 00:36:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146146 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp523933ljw; Thu, 6 Sep 2018 17:37:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZaGGiPrXZTzr1AGipvEbAPey3b/auC7K13nXezlYVxcD++Y+6+441tsT7R39JBLcyRiYBn X-Received: by 2002:a65:6143:: with SMTP id o3-v6mr5679623pgv.52.1536280675617; Thu, 06 Sep 2018 17:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536280675; cv=none; d=google.com; s=arc-20160816; b=W2+tjJowrXnUpq955gtM4e11N4hXEgpEq3EHMwNue7ToGLcgviNv48ogswAZASvuLv PXJ/GCkE1ZO8sJkoCy2dTHA6pPSb5wXygQZxMwmqx19fCZ+6lVLZgnK3xXTsM40nciXz 7Z6XmVP18Qqmc5Oe6vEeEcGezvIRepPc2MRLrGtPrz2L7Y3//muOAswOnp7FF/YWgxB0 CgYMFHJmiL9K54SZRdSEPTRaIeQJn1fvltztjfdOw0Lsu2SyCnQZo5D+6XQblklq0gQC V+dsr/+eNrL5iO+DoOEdtnEoNgrxskOddfxznI+GxdCWS0qBY6BTsGeLbXt0dUyU9xhx MkkA== 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; bh=a8z2sCjfqJfYWNpGWHI8QENfjU86+lEERQkz8Qftr9Q=; b=el3imMtTRLSETjKMDfn8GEoO6lji6Pv5Pc+s8vDi5YJjM1y/guQ/PO2kk6wCjtudx/ yFtHtv8I1Fyim+iK94n8cZK9ZaQduGyRkQe9TTg11ae6C7TuPX1doCvZ9aPs0OQ/FGnt f5BhlYftajvBv2GIp7dxbunS6rGbc/joAWQQrUG/ipc03YQB3lsGTzZ/OHvWd22R/JDU smSj00XhMsf09Im46d87GcaRiF4h9MaKcB3sXm6hZgKq8pbl5Kns6ClnITUio6IUMW79 IJTOmYV3w8J1t3Xg4NLkIgTYBlIQp745GL5p2crt0YIZmi2R5dKpzzFhbvhpSlG8v9rZ xjyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=d8W3kdG0; 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 1-v6si6554090plo.96.2018.09.06.17.37.55; Thu, 06 Sep 2018 17:37:55 -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=d8W3kdG0; 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 S1729708AbeIGFP5 (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:57 -0400 Received: from mail-bl2nam02on0092.outbound.protection.outlook.com ([104.47.38.92]:43727 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729606AbeIGFP4 (ORCPT ); Fri, 7 Sep 2018 01:15:56 -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=a8z2sCjfqJfYWNpGWHI8QENfjU86+lEERQkz8Qftr9Q=; b=d8W3kdG04fXm7T2Z2NrK4/9Q1dBGeHZbZK6Dd2wkQI8ey55rx1TS7HUapdzyVCdkkFBE8ks/8juguqRPPmDtA/5P0I2HijQ1ZVUN6dL2rsX33TezquLMbnRMp1BHLtf2xZ5FpB8kIgAbWWnrxkttJ+9PMosvyxP2L1pjW+RubQY= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0773.namprd21.prod.outlook.com (10.173.192.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.1; Fri, 7 Sep 2018 00:36:56 +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.008; Fri, 7 Sep 2018 00:36:56 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mark Rutland , Christoffer Dall , Marc Zyngier , "kvmarm@lists.cs.columbia.edu" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 54/88] KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr() Thread-Topic: [PATCH AUTOSEL 4.18 54/88] KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr() Thread-Index: AQHURkLSMexuQhYT40WZ1l25M3vYDA== Date: Fri, 7 Sep 2018 00:36:31 +0000 Message-ID: <20180907003547.57567-54-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0773; 6:fYv5AnfFxPwlkamZvvJFFaRWOD/JZ9Q/EmvbKFFzPeYfm5T+xajdQ9hArZcJ+bAqB1zpU6kqLJ2q7VfzbBrKG4jnZtYsGix/mZwnsxD8xSlMj6PDm5WTepGReOiidWLNFCCoeIYnDZWN6diZIA8USKDMNjhXVpqPOArg+xcQ9I4DkaQGMeV27/gJLGEf76QvQ0S4K8TUAwpywLo8wTkDwEmWChvXu24co9KoFZnARCK7VXRoFHR+mV67ZTABoxVTvCnHo0ZnT8LEUDvs1b6d0gMErY53lyunGDbfEIhKwy1Zu591cA8VlomnljYmBpM8skcMLWzv0qCW5V69QA6HAcLzfGTwf5qLWBB11i9Ie/DJZzANOv9cdC8KIbsekvZlP1K/w5lpaYR0elhbn8Boqh+FFiDH6cpN6ahDpH1iVF7moEFbMpYqWdwFZvqwZ5Z3BkHuyuKoIno2UuFTfrxj8w==; 5:T9nvpsdUGPGUTLREtgu51FW/7Wx6K2XWeni4ut5Wf2UMBZ58Pghaq/+7bw1xSjsFOuNBttesuPSFMcT2hHKblfTCEwcUDaYaEHv6wRqOGilFvk3VEgUs0V6jwTMpqgXz6UbxQvfHgVH8PRcRivI2YvOeAwWsPzvteeKp/NBFFq0=; 7:k7uuGgDv9tU5VDznctN7mc1NyNC/ut1maQU0bZbV7S+VAgUHpbWrZ00MgW2WMneANI6dBazsJIdZqOaMDedqwFWsGGOPYDwMAqRWc4jlTYeqZHO7fALh8/POUaGMI3/qJkgRulL+ekd7BeWSn32xWeb3iaJCJOK6erTBF6ZaB9ZU7ti1zQZX4j58uOK1i8L9vFLhcOjEg5dmNxOBF8aT1Pi37kOIN7Kb4PhxV6xzRXNcEHeLVaScTdQZIK+s4s1h x-ms-office365-filtering-correlation-id: 5eca1c4f-5112-406d-37c2-08d6145a042d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0773; x-ms-traffictypediagnostic: CY4PR21MB0773: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171)(85170053105377); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231344)(944501410)(52105095)(2018427008)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0773; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0773; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(366004)(136003)(39860400002)(346002)(376002)(396003)(189003)(199004)(8676002)(5660300001)(106356001)(6436002)(25786009)(110136005)(54906003)(6506007)(105586002)(2906002)(486006)(53936002)(446003)(2616005)(476003)(4326008)(6666003)(11346002)(5250100002)(107886003)(2501003)(86612001)(97736004)(6512007)(478600001)(3846002)(72206003)(6116002)(10290500003)(76176011)(68736007)(14454004)(1076002)(66066001)(26005)(6486002)(99286004)(8936002)(36756003)(81166006)(86362001)(256004)(102836004)(81156014)(305945005)(186003)(22452003)(2900100001)(7736002)(10090500001)(316002)(217873002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0773; 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: XLuVSg5VTlw78ZWd4QR6VGl+mSL8gKOYb/Zz8EXWzFQs2N5gZ+NYF6gaGgc0lf96GODPNBTEv+Ek/uHbNFG92B3HctGi3ZN8dv26bsh4fOPFt6jT+gJPxN8Shw/E+5z5t/Aq6k+rBKMd264k2H5n18MMuz8Xiv1nF7BK4Vw0q33Pa2vsViED012gv0kLLXlQDL9tDZtUrHTmv3P75ZgC3JB5Y9kpnXimlIi3g5xego7XKtcphST+5/1AXXCGI+ANiufgvmYA89eyeBLtCHUXMiKEwvV8wlZNkjYknxKyswKX4LvYGrw/ckhriX7o7XekWDeZ7PoUjVVuHmxdrb/ETbY8n1yA2hdPEd2wAGATWTk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5eca1c4f-5112-406d-37c2-08d6145a042d X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:31.9366 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0773 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland [ Upstream commit 6b8b9a48545e08345b8ff77c9fd51b1aebdbefb3 ] It's possible for userspace to control n. Sanitize n when using it as an array index, to inhibit the potential spectre-v1 write gadget. Note that while it appears that n must be bound to the interval [0,3] due to the way it is extracted from addr, we cannot guarantee that compiler transformations (and/or future refactoring) will ensure this is the case, and given this is a slow path it's better to always perform the masking. Found by smatch. Signed-off-by: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- virt/kvm/arm/vgic/vgic-mmio-v2.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/virt/kvm/arm/vgic/vgic-mmio-v2.c b/virt/kvm/arm/vgic/vgic-mmio-v2.c index ffc587bf4742..64e571cc02df 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v2.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v2.c @@ -352,6 +352,9 @@ static void vgic_mmio_write_apr(struct kvm_vcpu *vcpu, if (n > vgic_v3_max_apr_idx(vcpu)) return; + + n = array_index_nospec(n, 4); + /* GICv3 only uses ICH_AP1Rn for memory mapped (GICv2) guests */ vgicv3->vgic_ap1r[n] = val; } From patchwork Fri Sep 7 00:36:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146162 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp538388ljw; Thu, 6 Sep 2018 17:57:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaoVLzHo1M6H8qdFygM+0MxRkYZKngRCtcOArSewhKvNTSxtrWGUGQHE1R8tPREj6EIU2vZ X-Received: by 2002:a62:9992:: with SMTP id t18-v6mr5735996pfk.239.1536281868340; Thu, 06 Sep 2018 17:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536281868; cv=none; d=google.com; s=arc-20160816; b=zpq0UgTtEv7ZNSzbrxlcEXO8iJltynymsDzGr5mlAi8xhfIQ0pMA1ubW1fKXxj3qoH gOncZtkSMAVJNCODPTzYC+6nSSwg4LZ71jBgOqcyW/vLgCG6Svl+aDi+XqR6UxDLKN5M LUN3JvI3Ae7sIHWqDDI+i+af3kqVApI/oYDX1K28HKnivgTxMfqqxcqbr15iuTV2q8Qk uUWmVaJUdExKJvnJj9sAwM4sa/UwL2+ItRUBgohL20rgrnqG7eZiNCnoayUg4l5TzPMa z3qLuvU2n4k/WdVESZ87Bu/QoDOBGNREHxQz9NKuQQPjPf+2PAkgE1pXIH8LTiJ563/Q 1tJA== 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; bh=ZEvL2os/yH4h4yrCGqcq1U4fMbK7ai1iQdhIai/6bbg=; b=NV3E93qb36avrPZ/rWM6+v64Pv/7tvfGy3xxWrDeoUoyc3NCnNFKj5RP+p41KGtdkX qSfEAZMSkWvnwFixLA/pVS3qJyZo8nNAPhFt9saAcLZo2YriFoJATBEHscCgrZ1zMXWj 2MBV7b9yhQNNuruRJMaPHp0TXHDWC5q8T739u1FaiirzsbdSV789sBu2GJjXcG82NVTq 1weaQW7yuLhKO/ku/wOY4NqQ2i3hpUSdkXm9DMuH/FrMoNrTwdiwGAlXR/OCyGJLQjp6 nxSkXufi1/rEjO7rYRspJqRo7kTEjueT9BnmXe8BKxz5Vep9/9wgNApbC4O2yVgNXy1V STeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bwVgCdSF; 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 b66-v6si6935865pga.60.2018.09.06.17.57.48; Thu, 06 Sep 2018 17:57:48 -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=bwVgCdSF; 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 S1729359AbeIGFPl (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:41 -0400 Received: from mail-sn1nam02on0135.outbound.protection.outlook.com ([104.47.36.135]:30237 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726361AbeIGFPk (ORCPT ); Fri, 7 Sep 2018 01:15: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=ZEvL2os/yH4h4yrCGqcq1U4fMbK7ai1iQdhIai/6bbg=; b=bwVgCdSFMGqmzpBxyKiNTVQwLQXX4/M9dWsFDGrY3sY+6pW7932RhavhEbLQx5RFJ0+YPEP2+Y8St/ZLxrY8XehiFv3l0d7y/UjlniBDdr/PHZKadmeETHdH2yjqgLrGXaNbATf1+S6cqLuAKuJ8yrGTiqXJNQCkmyFCyDrTK/8= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0118.namprd21.prod.outlook.com (10.173.189.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:37:31 +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.008; Fri, 7 Sep 2018 00:37:31 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mark Rutland , Catalin Marinas , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 4.18 64/88] arm64: fix possible spectre-v1 write in ptrace_hbp_set_event() Thread-Topic: [PATCH AUTOSEL 4.18 64/88] arm64: fix possible spectre-v1 write in ptrace_hbp_set_event() Thread-Index: AQHURkLW/HYPrPib+U+tJvUbuYzdUg== Date: Fri, 7 Sep 2018 00:36:38 +0000 Message-ID: <20180907003547.57567-64-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0118; 6:yxZO+iojknI+RZrSnilOMNQjxyk82dAXURHxHLdG1d212RjI2KILoBEaI11tudm+6+tCxEJjGZChpfN5ux7WiDnyWDcPa/uoBXv9NpTqNAzPTC49N+50TLZm8kqXioR25z4FFqAxDALj+53+6JjlGADH09IU33F+QEDmgkROS3XrNj0ttlpj0fcOy4KO0jjLBUipnkdWKYRjR3pFPAwn5xGtz5dxoSiKw/ZZNCzEYFcJDdZn1e61dNltOQ8ZmJJhAx2bir8wRdm2SlqXBdVMbq3eMrDeBe+b46eikW4HiMhiibQLihEtzmvKui7wQa+obJbl+ajQixUebEYMvT9oAp1Jh4ocIcpQPXHY7UrtLcdqVtZguN5exTwkGgqeq2nrHzbJT+5/7QUSGh3PSzKgggyxdZHic1WdO/cyRXsM72N6tQS11V67zlewE4pawuhHwTE8sYQF2A5Us929O5v4Cw==; 5:cIMxqTBAub+H3Ap65Zr/bMmpa6s9LUgESXbhKqHbw/Kx9ZDc9GPSgdR2BZS2xxtsxlvdfJJ88q4qCnhOMoFfiIxHBO7PS2mF8fn1ftN71IEleVKCIg7uqpOlEIm5fHUfNrkva8lVIKD/zNDNzcE0RVC6wTg4lk1XOgAAhFjsWiw=; 7:8tuCsXOKqOoGqfcqb18UZGeeOoJwUXtvS60FEK7KQ/i3h4vvW8lInhvO3el0MhpTkYUgh11/rnvPOgNtGLPBJPmerb9+cy87nzQ7umYYWUWCj2i1nnCwvnPJJ6dEIo6fTNdkS1ehNt6akIXdfMBCmPD4nVUVcZO4kL+S7GHslPdutQ18QMW6hQemeVGbi7PGHNP9gHrvwmPzyy79UwiOltGN28JmpgiUqXkqIueWSwQSoPC8PeHl9o65vOjCuWi6 x-ms-office365-filtering-correlation-id: b4918cdb-3872-4fd2-eaf9-08d6145a18d0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0118; x-ms-traffictypediagnostic: CY4PR21MB0118: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231344)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0118; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0118; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39860400002)(136003)(366004)(189003)(199004)(97736004)(2900100001)(53936002)(316002)(86612001)(25786009)(86362001)(2906002)(6512007)(68736007)(110136005)(54906003)(107886003)(4326008)(10290500003)(14454004)(81156014)(81166006)(66066001)(8936002)(8676002)(478600001)(6116002)(3846002)(72206003)(305945005)(7736002)(1076002)(106356001)(105586002)(36756003)(99286004)(186003)(26005)(5250100002)(446003)(256004)(217873002)(10090500001)(76176011)(5660300001)(6436002)(11346002)(6486002)(6506007)(102836004)(2501003)(22452003)(476003)(486006)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0118; 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: atEvpI6INJnqK4awUSDP0DRZf2pn5YKBlhBsqxf0IDRKYevf3L6rvj5FaK+EIQ+8bvAvSZta+THT08aeo/rlcwPKbOpr1XTZJOnb4uZ6q6dfMdpGSHMDMWy547ZVQrBXkD76dNiiRSR0/QQ7rQIjdXGgYzmpnCnWfUVjnlV3gvLd00OwyBxnsSR+96sgKtjnCgxVJ6CoTUQmsqgsHzf+Q338zTt3lxOgBKzQqV97gPxsx+FNR7IUynsdwB94jFzLVc5vqHujWcEulGWdZaliF9NyoOjsboYan3KDaJQpc0cwMMsi3YRYrqH7G51nu4tkHwKDntReJyE1cOmIhGws/QzJBlRSNnP1JfbS4/drSdk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4918cdb-3872-4fd2-eaf9-08d6145a18d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:38.3259 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland [ Upstream commit 14d6e289a89780377f8bb09de8926d3c62d763cd ] It's possible for userspace to control idx. Sanitize idx when using it as an array index, to inhibit the potential spectre-v1 write gadget. Found by smatch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/ptrace.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 5c338ce5a7fa..db5440339ab3 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -277,19 +277,22 @@ static int ptrace_hbp_set_event(unsigned int note_type, switch (note_type) { case NT_ARM_HW_BREAK: - if (idx < ARM_MAX_BRP) { - tsk->thread.debug.hbp_break[idx] = bp; - err = 0; - } + if (idx >= ARM_MAX_BRP) + goto out; + idx = array_index_nospec(idx, ARM_MAX_BRP); + tsk->thread.debug.hbp_break[idx] = bp; + err = 0; break; case NT_ARM_HW_WATCH: - if (idx < ARM_MAX_WRP) { - tsk->thread.debug.hbp_watch[idx] = bp; - err = 0; - } + if (idx >= ARM_MAX_WRP) + goto out; + idx = array_index_nospec(idx, ARM_MAX_WRP); + tsk->thread.debug.hbp_watch[idx] = bp; + err = 0; break; } +out: return err; } From patchwork Fri Sep 7 00:36:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146145 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp523717ljw; Thu, 6 Sep 2018 17:37:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY8cIqiiUcm51EhSsBmiCVyyXt1AWjStqCuRp/lJa8tjnJj1QUryEsCkB5+MTNs7Yx0k/LE X-Received: by 2002:a63:b705:: with SMTP id t5-v6mr5222680pgf.366.1536280660383; Thu, 06 Sep 2018 17:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536280660; cv=none; d=google.com; s=arc-20160816; b=ItjAznImSku9lILNz2ugZ1MKP+SMWIB9cHSQv3AoqSWyoQXCL6pDIzOmfVcXqmgnGt PEjKiyMLVV8YJgbw6RqZfoeSr3DLZzCaBpB14FwNPLNuJYHu7Lv2kGfgOJY1E5xnyDDx /MVZSqK6JPDK5usCK63DQZcYE0VYrOnp/X9VxkvrHNnA6YU9r+mosyRdlUZWaTWwdsOA AXUMxEw2j/BaaBp88cYnLzJq5bXS2BSvoAQlRE6CskS1FecPYp+Un3UGQB0ehTc7A1cH DE37j2MIqiVekl7uUnF1xctSMPlsnior79pN1uea34jDMGRtAc9953BrMP9Ejctpwrc+ XGdg== 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; bh=mXROCwI6Q01Rse4xYgLDeAbxyY1pNCqd/81qEo9U+dw=; b=LnQdtqM9JvdR2ZvTMoUO5Z2wNK+DpT5QTQAknOc+65qQNdGB5IfMDTzIrrdGBb2t7G LZy3U4hpdADnIF2HjOo2FLr9HWXL9Y0s/5rxSc44pUUNX6xToy+iAWKulnSR/FJ2SB/n V3vbbsrhKFPlas8Ebs+a5q2iuVFclTIm0ZgBJyWnnQ+xudPVyFq+fMkQlgDE2r7c5DLm xj6ngb5C0J0ICfRM5OZfvGtTzDxCfeVSrc4XW9E5CqGiREtrsmRZCWVYgmb0v+IZFdxW gT2CktuzrO/owhgo5Wq0Rn5R6c1X25oxSxSllw7zfLrgqzvCQWO50mgZSFZD1hPk/9eS 0rGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=goh8jthJ; 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 t1-v6si7428440pfb.208.2018.09.06.17.37.40; Thu, 06 Sep 2018 17:37:40 -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=goh8jthJ; 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 S1729397AbeIGFPn (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:43 -0400 Received: from mail-sn1nam02on0135.outbound.protection.outlook.com ([104.47.36.135]:30237 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729344AbeIGFPl (ORCPT ); Fri, 7 Sep 2018 01:15:41 -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=mXROCwI6Q01Rse4xYgLDeAbxyY1pNCqd/81qEo9U+dw=; b=goh8jthJzC8egt6UERwMqlJfcnueSNlaRKgDmfOlEdApWKbrxMpCZlP1XdUgt9ZtthFunHZZcWWrIIpPcpdPDYCqhF1rUsuwzQjNZ37+mH1zd5LpBHSLLnJ8xv9sM7V4H1aHYJX/llexmJl2WcLLo1m3ZZz6yO3s1JFyzL4vCsU= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0118.namprd21.prod.outlook.com (10.173.189.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:37:32 +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.008; Fri, 7 Sep 2018 00:37:32 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Ard Biesheuvel , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 4.18 66/88] efi/arm: preserve early mapping of UEFI memory map longer for BGRT Thread-Topic: [PATCH AUTOSEL 4.18 66/88] efi/arm: preserve early mapping of UEFI memory map longer for BGRT Thread-Index: AQHURkLX2hPwEEab/Eyzp7WPRQcVNg== Date: Fri, 7 Sep 2018 00:36:39 +0000 Message-ID: <20180907003547.57567-66-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0118; 6:CNLqzq9Da+HuuVKC8ds/inBZ69pUEtoMxhSXg8QU9E91RHkrtjZLqspQl3B+l7RrGVrgvGztyToPzjVs1k2o+PgE3G70BqW3lyzYVdBIIEdUCR4RaLB1LpO+19XE/sjFCmNgXSIJL8d4nbP7n/rb4wk4J6kcGFu2BIq4vDQHf9m5hJLl/F9AdNWlnip6QdElRBfn1yOru7ZJGloXSYPn1FEpmXio81qdhZ42zHOkgByohrP5sdcVBbJyU4A83B5i/Y7mYgujW5FDKw3XaJfu7zUpg8eML38+UGjNzYEqqMDPZ24+XTz0vGePJKcTA0NS79Wo9I8QiATF7AVwrX0PjsOYO7AYoceqvOJN3Ev2MIlxlq3iR9A8B4zAfeHRmCUz1upJlgP86CokhpMafHShcPSl2j0LNeOhbTyD55eyKQmq2iLeMLu6KSh+ixtye2/Nas1+5kYl2ZmnxeGbGWN3og==; 5:QGB3xmWhAHUHwDIX0HhixEP9/O3CtroGMdZDXZL8Sb99lJ8NNkeKOtslLHRhyX5SCuIjCNtcV+sd1rLRiBiGi/900WItB+5vNA0no6YQfQOzTAZx1jh8E7m9XfvYU/gfKUAdqGFNOI65pubWRTdcgZcYJIcaV8cDDf4NjcjEq/A=; 7:QqfY1pEnBT48axFpXNI3t+rRI/dZPNR7C1ALtsP8OXU/KpDS8Xb39cYVC2Ci3AOyfAtq1xE091hnFatrXYGjVIqimcDS/X3o9it/uoHpvlnNGw34KHUYr3bUPOE2Pq0cTJMZxkfOCF42j1FcDKEUcDchMVHrlWEWy55Lc2eQhDtet/n2XeS2IKOx+Wc5YeSl+TNtIbb8Bl+QFQd2MQjyqkr5JCbdGvN5aejypWNxuor1ax4n25noeT7rECEyJsjs x-ms-office365-filtering-correlation-id: 5a167454-58d2-49b4-cd1a-08d6145a1965 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0118; x-ms-traffictypediagnostic: CY4PR21MB0118: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231344)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0118; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0118; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39860400002)(136003)(366004)(189003)(199004)(97736004)(2900100001)(53936002)(316002)(86612001)(25786009)(86362001)(575784001)(2906002)(6512007)(68736007)(110136005)(54906003)(107886003)(4326008)(10290500003)(14454004)(81156014)(81166006)(66066001)(8936002)(8676002)(478600001)(6116002)(3846002)(72206003)(305945005)(7736002)(1076002)(106356001)(105586002)(36756003)(99286004)(186003)(26005)(5250100002)(14444005)(446003)(256004)(217873002)(10090500001)(76176011)(5660300001)(6436002)(11346002)(6486002)(6506007)(102836004)(2501003)(22452003)(476003)(486006)(2616005)(148743002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0118; 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: CaY9TPmquVRfcF85tsj8C6QJMOVEvTfOC+XBdEB/zefogpvbuRw1t1KuNamurJQ1aMP6HvB7ia0xmF3YgVA/Hz7WlS0Mmoxc9oxA9gKKac9pyIFogcR9ghLV4KXWEEUwwr/8cMimyPPZRjydA3dXzknaoKnIdHm+7cBnY+09Irlyxi3yFvgmzVvd3LjZEi51vs+jVcrxCv73qiKL6+8Bir61QeKICcqMvnMSB6YBiuiZmccNVKQgzuVRVOJCIu9oRjHYoyS4+6jp7QgWVPt/pJgytgP5/2uTzTEWOfaFRxEk89oUoh05EkGgQiytaq5xrvRNhvjkfUppdSV7u7hwc47PmjCNiA5wjxV+dJSAUwo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a167454-58d2-49b4-cd1a-08d6145a1965 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:39.4768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 3ea86495aef2f6de26b7cb1599ba350dd6a0c521 ] The BGRT code validates the contents of the table against the UEFI memory map, and so it expects it to be mapped when the code runs. On ARM, this is currently not the case, since we tear down the early mapping after efi_init() completes, and only create the permanent mapping in arm_enable_runtime_services(), which executes as an early initcall, but still leaves a window where the UEFI memory map is not mapped. So move the call to efi_memmap_unmap() from efi_init() to arm_enable_runtime_services(). Signed-off-by: Ard Biesheuvel [will: fold in EFI_MEMMAP attribute check from Ard] Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/firmware/efi/arm-init.c | 1 - drivers/firmware/efi/arm-runtime.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index b5214c143fee..388a929baf95 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -259,7 +259,6 @@ void __init efi_init(void) reserve_regions(); efi_esrt_init(); - efi_memmap_unmap(); memblock_reserve(params.mmap & PAGE_MASK, PAGE_ALIGN(params.mmap_size + diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 5889cbea60b8..4712445c3213 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -110,11 +110,13 @@ static int __init arm_enable_runtime_services(void) { u64 mapsize; - if (!efi_enabled(EFI_BOOT)) { + if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) { pr_info("EFI services will not be available.\n"); return 0; } + efi_memmap_unmap(); + if (efi_runtime_disabled()) { pr_info("EFI runtime services will be disabled.\n"); return 0; From patchwork Fri Sep 7 00:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146160 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp537928ljw; Thu, 6 Sep 2018 17:57:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYpj8fwM5kPPxwFelygp9uHlXCNs/PTvh2JxQhAm7jSvqhj2iycJIhzdwiy6cn9JxyJxGM6 X-Received: by 2002:a17:902:7e06:: with SMTP id b6-v6mr5552954plm.230.1536281826479; Thu, 06 Sep 2018 17:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536281826; cv=none; d=google.com; s=arc-20160816; b=R/EcqNhoxfwt6izKV456DrOFZ6ckQzuYJnUX1s04DWVsZy2T6hamqUmyBZmFtdNQft vhdSS7g+vtyDb5VG76ORQ+9HkTXturvvztdDmgghl8uXFKumZ62yreFP3N8+jwBj4KVt hpZZTURcuFHISdngu0bqIyTrCjZi8OdN2A6j1z1x33KZM7cbesqGozItnjOZeNSyuG2+ 9+kv5LjFZoIu1lK4syAlHX103aEgfd6S1AdBZqTrk42mAEzfyEmY8mTVFe+2aceoUc6H wbhB9QJ+IcMiWFG8LYVicwoCMIzCyaDC86BqFRQ42FKTACSD3PhXn62VInWt9sNCqXNf emhA== 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; bh=Q7QOV9LQq9In2/7nuSEyVfqjHhSEjHuRcd//JFQg8Ww=; b=aXmG/S8fc1PyGDwKDZI90PoGV4Vz7diijTj5OYqpAlRRYiJva7oqJEdNglfma5z0Ro kwk42p/AnlWl3/j+YoB8XRKSXUGJ2s3fXu78JqisvbgY7775Yp+wEhIATexNROLRrAzA LJECV57KI8niT9TeVJzg46LmPIA4+zs43SvBhfhhZ7+5EKcFwb9ypLe+hp1pGXQr/H+l pBe+8Y0Yv5j9BLDqLEqonI7yFQvxDYY08L+MhfIYuUmJZY72mCbDTYyiMs4hp4EY42oH Q+sZLmhy+oLi8wjfUdgvttuywF+TM3gROFRT+wvIXfj62+AkkVy67NJbhmp4uZ3tkASv +NYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=f9ntJooq; 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 m126-v6si7388487pfb.126.2018.09.06.17.57.06; Thu, 06 Sep 2018 17:57:06 -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=f9ntJooq; 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 S1729421AbeIGFPp (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:45 -0400 Received: from mail-sn1nam02on0091.outbound.protection.outlook.com ([104.47.36.91]:3440 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727799AbeIGFPo (ORCPT ); Fri, 7 Sep 2018 01:15:44 -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=Q7QOV9LQq9In2/7nuSEyVfqjHhSEjHuRcd//JFQg8Ww=; b=f9ntJooq+vLDFf0oDysX3HS6V2Q0v5SizOWu/CcdUV6dg6ZlTiy5QsnDFoXVL5GXRvsSvXuIUG+A6wpK2FfsvUqwhnYpx7J0kerH1gspxS40nyV3IKtTw6OIA6kcLnLE81WGpdzO0yM0jamGi9ATkVZAeJOurs9O/pmHpYGXYbo= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0118.namprd21.prod.outlook.com (10.173.189.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:37:34 +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.008; Fri, 7 Sep 2018 00:37:34 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Loic Poulain , Andy Gross , Sasha Levin Subject: [PATCH AUTOSEL 4.18 70/88] arm64: dts: qcom: db410c: Fix Bluetooth LED trigger Thread-Topic: [PATCH AUTOSEL 4.18 70/88] arm64: dts: qcom: db410c: Fix Bluetooth LED trigger Thread-Index: AQHURkLYpZxotgksUkOdJpokS7gG2A== Date: Fri, 7 Sep 2018 00:36:41 +0000 Message-ID: <20180907003547.57567-70-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0118; 6:KEjZGw3kppFWnygkheylcEmh2pLm4JK8ICt7gL+5xvwjORTcnWUVyH+69SvmY91xKxq41VjZNz85MJsipUgs92iy0eTpdp41aFEsO2+JtwuAXOmXM5Ezc11eHvHy5lYNGGe7IyotDaYC7ANqVz1SWSjUNyo9+7wbdWT5enleAsLlbx1K2SQRMSnK/t98L7ditXpPrHnJFNOSDp7J6q750FzxLCuxJbcqrOleWop5M/2OcSqIdRQFLzx24ZwmYqiwpCzXA8wS/oDx7zFj/ZfbbpvBo0EbY/XL+cwzNPjkGi7VYzdPyNAycmDjEb46N+sBMvsPG/SXBziuqW6JSlLJRVr0JQKTzRMjVEY6JiTMGt9t18+9ADOHbuLh7lzMyK2UgSOjnon/Mhsi6j0ouEt10yxSLn/iUY8pnd4Hj4FEnrHakQdmVKzmaQlxFhd8I1krfLaThHywBjIfyqdnMJkshw==; 5:TrhB7cpzPAvIcvhFglqCNo7J5LQaACBHozSyoT65BoegbHMTF/NQoA2uGqKKnjhITMFBq/y6yGh4fB3zpYco0/Bn3Y7GPv4cUqf28jnppsSI5T2Zjp/DV3hxtLX9OOxfmi2xgTnpmgMGU3kDQglisDBm66lakCUsNLYIO5QqSd8=; 7:tLCwnzkqt573v8gI0tOLUIpJ73tGdgovtTmZh/ZeWXfAAG2dU0amkVmaC3keO/tr3RBQftkZIZ7v/Xk7+DATEAOFrW8YEA14ra8Wv0mpWOElT9clfnra9VRnhcK9a3nReCfpEgR22t1z65T03ATMs/gND7zMvVpGTr1JBQ86TOeGRihfDB2wrRPzuotL2C3vvtajYwDxkDCUsgbYvnsgNoph7K4Jf5oOd0bc0YbNKnmzvum7HBVMejUhEa8Gm/iE x-ms-office365-filtering-correlation-id: b7ecc266-1f45-4501-aa51-08d6145a1a59 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0118; x-ms-traffictypediagnostic: CY4PR21MB0118: 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231344)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0118; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0118; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39860400002)(136003)(366004)(189003)(199004)(97736004)(2900100001)(53936002)(316002)(86612001)(25786009)(86362001)(2906002)(6512007)(68736007)(110136005)(54906003)(107886003)(4326008)(10290500003)(14454004)(81156014)(81166006)(66066001)(8936002)(8676002)(478600001)(6116002)(3846002)(72206003)(305945005)(7736002)(1076002)(106356001)(105586002)(36756003)(99286004)(186003)(26005)(5250100002)(14444005)(446003)(6666003)(256004)(217873002)(10090500001)(76176011)(5660300001)(6436002)(11346002)(6486002)(6506007)(102836004)(2501003)(22452003)(476003)(486006)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0118; 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: JmQKoR4qNBuxVFbh2Cx1Y8UiLMt8rhfA2y1kxGQuIJZrkbGFlCSdFQ+j5n8YTL3hBWs46aSGdwWq92iSxZPQWEURhzrPc6+xZB70tm0+ftf2Qbh4rB8w9LOmyroONEQWsViojDJokr6rGBjPQfNqmWNA3AimMXbdNUBcr74SUTKUxPy9Ca2SKNkt47d5ThNLV/twnOYbTp6dDE0tB1RgrnNhEpBRf/pH+ZfQAt5iiFjTnHU02s1Ql6xqzY3+0LXNN54wvJrv7J5ToliCnUmlw7PhzIy9ov8OuyO7SXqNMIWOV4g3kfSsU3eXHcC/9iFTE7i67POBgskflIKFkO5X9sF7EKjP7Y5IL0j/2TguVsM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7ecc266-1f45-4501-aa51-08d6145a1a59 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:41.8418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit e53db018315b7660bb7000a29e79faff2496c2c2 ] Current LED trigger, 'bt', is not known/used by any existing driver. Fix this by renaming it to 'bluetooth-power' trigger which is controlled by the Bluetooth subsystem. Fixes: 9943230c8860 ("arm64: dts: qcom: Add apq8016-sbc board LED's related device nodes") Signed-off-by: Loic Poulain Signed-off-by: Andy Gross Signed-off-by: Sasha Levin --- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 9ff848792712..78ce3979ef09 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -338,7 +338,7 @@ led@6 { label = "apq8016-sbc:blue:bt"; gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "bt"; + linux,default-trigger = "bluetooth-power"; default-state = "off"; }; }; From patchwork Fri Sep 7 00:36:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146161 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp538017ljw; Thu, 6 Sep 2018 17:57:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbssBJSxsHHIL5nC8pVTK2Icjx3Q1U/lCmBfMn3oSdb4oFsBXm7yqRCnZy0+fZBNSO6FY0l X-Received: by 2002:a62:25c5:: with SMTP id l188-v6mr5711302pfl.179.1536281833599; Thu, 06 Sep 2018 17:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536281833; cv=none; d=google.com; s=arc-20160816; b=Hzs27goSX52mryJA+iNLLId4YXpUV9pPCaf0B6k+G3QmKzrAUBMuSweVCWVF3Iz8lD /A0dlLl7PV4MT/El9pZ4Gy9+dg6TfSxWYNzIU/48xKhRJGdTaubT4WWXdHSm6nt4Jk4G CCZ1A6tNdTnDNUoNGs4u2wAgOaVyCZIG5U7AkLvPbfWq52naX1DR9njP9Tiy6qTcmJpS brr5DbKwJqzyysOb6hEoLV57dIJW+q201Y5xLV8MtfDh2dG1z0rwVRXpT5speezHUDU6 GF4Rc6stIB20yxgaGw5VqsVvWLX5OneZG/b/KaqL1jQnS8dAGuyMwkXnxhutOrVU/m7/ zJhQ== 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; bh=EJp4mouTM+pNfvf7dZNf1Tie7v1G5lz/PLKUwEcKmVI=; b=KkM8XT0UH+bStXUH+PGa2+6b8/bPe4Og1SSu+hhvQ5p4Q0fPzT5yBCWFgYX8APKMIA qVtuCMja38JnqIk8ZU4m71zBVYQ/B43HTabKHGpA0Fgr93luFO9ENs9cf7kkPuXSq6o+ ShhkikYXQO7VcbcA3KwL69vnkCtnD0aMh8UvCL+5jk0qVXAAy2XnT645VtJrmy4q+Ueu 7suYAtW2LEF4dGh31CdTLHSnK0Xxa2vFLSsvlCI8nZMNrirc24TK/fe87ZljZY14F28h Gs7x5PWuk2/jZ4WJ+lsO2N7g4qVaCMSvoo3hHwQisg5LHwVQqy7IYwQJp8cydQmjScuO 8tjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b="K/5qRN7f"; 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 a29-v6si6587499pgn.510.2018.09.06.17.57.13; Thu, 06 Sep 2018 17:57: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="K/5qRN7f"; 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 S1729763AbeIGFfW (ORCPT + 32 others); Fri, 7 Sep 2018 01:35:22 -0400 Received: from mail-sn1nam02on0091.outbound.protection.outlook.com ([104.47.36.91]:3440 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729344AbeIGFPo (ORCPT ); Fri, 7 Sep 2018 01:15:44 -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=EJp4mouTM+pNfvf7dZNf1Tie7v1G5lz/PLKUwEcKmVI=; b=K/5qRN7fdRv2LlmD32uYKb49fyTR3w4cm6YLRFcGP22DtnLMQl+9puYsbSfyP6LLWxpPX0qmkeOW2Hd5jDORxh4OiaWzdaKcQvIsXdPkP3sQpxclcGgDZfTagCFU1f90joCP/gt+ncf9c+yB6NHahC20G2UtL2eiRAwP2Q8atdg= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0118.namprd21.prod.outlook.com (10.173.189.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.8; Fri, 7 Sep 2018 00:37:34 +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.008; Fri, 7 Sep 2018 00:37:34 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Bjorn Andersson , Andy Gross , Sasha Levin Subject: [PATCH AUTOSEL 4.18 72/88] soc: qcom: smem: Correct check for global partition Thread-Topic: [PATCH AUTOSEL 4.18 72/88] soc: qcom: smem: Correct check for global partition Thread-Index: AQHURkLZXnfe7FAjfkiL3z6DtmZB/Q== Date: Fri, 7 Sep 2018 00:36:43 +0000 Message-ID: <20180907003547.57567-72-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0118; 6:BsBR+9ZH4hwKq3kJxC5ytNTDeQn9DsuUuyTMKuACEp7bCXL3o2I7vmh4uVfmOIQr1ABZN141gte3Xl8jjDLScg2tN2vsTd/PVXj/skE4RLbtaP6xkshJdLQ7pDQufXUL59B5SR8ld2q5og9nlSrC6/4oIeVsVnGHSKs4OvmO8JIe4WTbR+/g/greyMRbNs6f1GTH0qzaWhmgG+xq+NbGEXHswX2WgHnVBvNRoCrFzbYMLdChgEv4UBmWke+ucp76X6FYTUEao5hkWjR084sB3NftCRs8UXmf40S2XzMA2hIFFEgBz3WmCSl8tLxBcrqarCElJnXDCxojpu2KGarxFdv2956HhURbBHGUR1Bl3qSDtFIrtUUibTVXodYBYB9D/VaPcw3Q8Yc52tyr5Z4H67PwqhRbJuzkW8fPVLCigbgSsR+YMTXo4FcKCzMsH77oySxlBv/6KdCj9RiaRUT1DQ==; 5:NRsu63E+y2j7iDZ/v48eLYE6TwUW3FHt7HBZYAaSV/OzV9/yYGAgM8lJWKccz6BeIjHMD3eZh0t7YfDt7bxHI0mOiqFyh+T2VUn9fOzDJfHlVeDPeKMkgGZ9iIKeihNl+KIHsFGhLmAnSWvTLEkCQDC5ZlmMPswtxBtV8tRb5/Q=; 7:kX4tO4V1DRb4Hn3nlzlTs43wn4LttWvBwvsNqBfDTMq2lm2XYu6cPKGHqBmnJ/JfYTR6WQv9s6xTRBcbmkbbCRJShZ+SrcTgv4VnvsUzwFJTMPmoD/NcXO03KgArU+to44g57yTJwDQuNpZbT7kMwO7y6/P590zrWW8IaYX/7ysjfeh62NtyespEan61VAGEIcamnLdbSTPxFdLxW296NgYJpz6XgO/r9oNTiprmtQY3XUttBKsDS7JVbublEIh6 x-ms-office365-filtering-correlation-id: 1ca80d88-064c-4eb0-374f-08d6145a1ad3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0118; x-ms-traffictypediagnostic: CY4PR21MB0118: 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231344)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0118; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0118; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39860400002)(136003)(366004)(189003)(199004)(97736004)(2900100001)(53936002)(316002)(86612001)(25786009)(86362001)(2906002)(6512007)(68736007)(110136005)(54906003)(107886003)(4326008)(10290500003)(14454004)(81156014)(81166006)(66066001)(8936002)(8676002)(478600001)(6116002)(3846002)(72206003)(305945005)(7736002)(1076002)(106356001)(105586002)(36756003)(99286004)(186003)(26005)(5250100002)(446003)(6666003)(256004)(217873002)(10090500001)(76176011)(5660300001)(6436002)(11346002)(6486002)(6506007)(102836004)(2501003)(22452003)(476003)(486006)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0118; 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: 5qxtiOBrYRULJ/Td4MTb6qd7NapKEL7/KTkAd/g8UTs+iQjwA7rJ8k6Bh4Ibu6gksBwSKuL/4xgj3un8Uz1cs7d2JlyGWOzt31FJM2pBEiAO4qSv7wH73itvqwGsQbAhJIvFCK6V77pw+vjDePmckx4rXE28IuJ4gA1aChUxDc9vMqzkuqVacA+cT2FFdb/y9bA0u9TKsDV37+RcFQ/xYSocDIJvC2LACJTcOpeYDqBE4l/PThu0+qlcjOjK6+RPsWrLxGRHSDqMuW+UutMxCE0lbVDlIaDe02kjQu8Qwf8qmoKzYrmBny3RWZPSmS8toTHjMHMpHOc9hmTh/yk/0KTJORhLVMjIx90WvRRZw6w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ca80d88-064c-4eb0-374f-08d6145a1ad3 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:43.0938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson [ Upstream commit 0b65c59e3a5475895c93ea5f130597db16b8abf6 ] The moved check for the global partition ended up in the wrong place and I failed to spot this in my review. This moves it to the correct place. Fixes: 11d2e7edac6a ("soc: qcom: smem: check sooner in qcom_smem_set_global_partition()") Signed-off-by: Bjorn Andersson Reviewed-by: Alex Elder Signed-off-by: Andy Gross Signed-off-by: Sasha Levin --- drivers/soc/qcom/smem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 70b2ee80d6bd..bf4bd71ab53f 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -364,11 +364,6 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, end = phdr_to_last_uncached_entry(phdr); cached = phdr_to_last_cached_entry(phdr); - if (smem->global_partition) { - dev_err(smem->dev, "Already found the global partition\n"); - return -EINVAL; - } - while (hdr < end) { if (hdr->canary != SMEM_PRIVATE_CANARY) goto bad_canary; @@ -736,6 +731,11 @@ static int qcom_smem_set_global_partition(struct qcom_smem *smem) bool found = false; int i; + if (smem->global_partition) { + dev_err(smem->dev, "Already found the global partition\n"); + return -EINVAL; + } + ptable = qcom_smem_get_ptable(smem); if (IS_ERR(ptable)) return PTR_ERR(ptable); From patchwork Fri Sep 7 00:36:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146158 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp537267ljw; Thu, 6 Sep 2018 17:56:11 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb+RznCv79BYtcaxJsy7HBskbW7LREo1RXxWmRFGoJW/MpAgzJ6RyZdY1iEXlm/mYYpCSiJ X-Received: by 2002:a17:902:163:: with SMTP id 90-v6mr5420795plb.322.1536281771833; Thu, 06 Sep 2018 17:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536281771; cv=none; d=google.com; s=arc-20160816; b=PAMyFuQKakzGBWB+S/1EzGyAvTDO7NWkTXmdEQxEuxhSqMAjxp5rm2zRw1p7w54wlV ScjUl7D4YhQwp1k+JmgzDtVrXj0HdWau8JxE90kPcknSU49UIO/7tpfKVgqthLcjbR6y FppkBiOped7W1SeNSud1DCBFTt6x8/Elh1DGq8On98O19fODVvikIOuwVkObhfnPDN/x O9nHES981QTUN/ynVM5Ksd75yTbper5AzGW9YM3DL9yYYgbW6yS44sVOJCXm2cTHpb6F aXMl+EpVWrzjYGG4XJ/Ccke/ChJPX9M6dbu0S9J4BnGU6IFyYXOO1D1WhUOBRK1gO1cB V0rw== 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; bh=gjWMGmOCWI0H50YofUzIIjeemSp1DxVORryk5G8GCAE=; b=MUdQGT8qyUKdPGL3l5EgoRINVsiGKKsdtmBYdLA/+aas45mOj1ZEFqGM23QfEd4kiB avx3WVGh1hlIPU3qzfQlSPqE4mtyD3pqy+4ifcA3xpvZgIm/Og0rRMPodKaNv/EcwUd5 7FsbXbZZit69yH1HHqHq14+BT07lxvY5oDRcZKPpWaC62YIzEVk17a09HOXUARAphY3/ ebLDFPtP5SSX+OTuotUMM/wtS7ggeqiRIX0sIGyMz6WyjCrNpr0uVxcVWXe6tImB9kiY 5LBojnAMCB4us8D6eZ6n5Do3T5fdihPwGL8QVcRwKKYs7Moo2CN3ZJsyhejqKN3AXqfk Jvlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=NkVljp6X; 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 q90-v6si6589635pfa.272.2018.09.06.17.56.11; Thu, 06 Sep 2018 17:56:11 -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=NkVljp6X; 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 S1729538AbeIGFPu (ORCPT + 32 others); Fri, 7 Sep 2018 01:15:50 -0400 Received: from mail-eopbgr710095.outbound.protection.outlook.com ([40.107.71.95]:48060 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729381AbeIGFPs (ORCPT ); Fri, 7 Sep 2018 01:15:48 -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=gjWMGmOCWI0H50YofUzIIjeemSp1DxVORryk5G8GCAE=; b=NkVljp6XQUStF+8OW4BkMPHi3GtYi9K94apnvDxrqpePr5dMF1R9MJmu5FrDHMEKEfDSBUbTKmFvc/RHlYV01piF6SwCmfQ9cSqijmGCsE2LIut5GwQEcwFp9X/ZAysjWXrfoaByZh73DvYNvsSezsJI0BujbZuyDLByM3O9StQ= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0839.namprd21.prod.outlook.com (10.173.192.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.6; Fri, 7 Sep 2018 00:37:37 +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.008; Fri, 7 Sep 2018 00:37:37 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Niklas Cassel , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.18 80/88] regulator: qcom_spmi: Use correct regmap when checking for error Thread-Topic: [PATCH AUTOSEL 4.18 80/88] regulator: qcom_spmi: Use correct regmap when checking for error Thread-Index: AQHURkLcK6vHpdBEXE6dIMEZt5PebQ== Date: Fri, 7 Sep 2018 00:36:48 +0000 Message-ID: <20180907003547.57567-80-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0839; 6:IfhqkcdTvgle9zPdReNt2djP4FmdRj/xauOdFbOSEOb0x5MvoKa9rh0mOHZqViVMucglckATPRAflnPk/WtK/6l2gghS2+DZE2mdOxX5zoRt96mPLpo6NNcChgtbH5+X3M9U7g+CcmHd0IE0um5BZU226buLkGYsC/W5EnTqkF45x+Jg02Lc6epb4MQeVKHoOhtY+ADcG4/ucs7Wel3OKiEVEUiY/tIKkC/qL68/C9+5C3PPUO5nvusNN3HrKET2HfjTR1bRe8i9v3sGPANXk1W1+isFgRMwO7DgXVGuRCE8CvlAPOiTwfMrknLkisgNIfo4GXn4hX3E3u/dK2Wj7kmpq/DHTxnuUg7O8+i28jqL+sWx3zTcepY+Lb3ZeE59fjIw6eTciLDKOJpCNfMbYHnd/rIPXczkVzWH8tAxag9fjYbqJBa9TH0+xQ98/oVyw24dpNaVq+pZzeEfItM5DQ==; 5:aBXDoSY6OKtpr6J4JC+bCd52Pz4GZ9nkCtvT8L+pgxvXKgNQs4OVQwTjXG0Zmy5R8/YZYkghngAwYGX2RrEUkob6hYZxX21wNzixyHNkwRUkCQg3ckztg3QaWHaOdJu9UXZ9RvRS3wbIxrdBX4FUTo5p7t8QC+jHaKX6n/ZFJog=; 7:NGXIQN0tPvy69IRIQrqB9NhB5T/jtbiFI7ZxLe6ea1zEboUuAnHk3kYBMOkdGpfD2Bw90K9+UwXG9Ieyw+Fv6jgigVY5/SqTiwRPCYr8ZYr5eB1J5l1sFrAZzfLzONpfhP9/CmiS76fKcnau+Xwd6Be3OyD8R5cDHg5TwTsMA4yYjoAHNEGT85nVewORzPzvzr3YU8lf4xBLUAnFTXDjNkMpjZ5pHO164kzLKn7Ff4PC9b1R0WTmhiHtSz46C8WB x-ms-office365-filtering-correlation-id: 23a0bd78-df7d-4fe1-2b54-08d6145a1c9d 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:CY4PR21MB0839; x-ms-traffictypediagnostic: CY4PR21MB0839: 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)(3002001)(10201501046)(3231344)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0839; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0839; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(136003)(346002)(39860400002)(189003)(199004)(10290500003)(99286004)(10090500001)(105586002)(106356001)(102836004)(76176011)(97736004)(6512007)(53936002)(2900100001)(6346003)(316002)(54906003)(110136005)(256004)(14444005)(26005)(6436002)(107886003)(2906002)(86362001)(186003)(478600001)(5660300001)(6486002)(446003)(476003)(68736007)(7736002)(86612001)(11346002)(8936002)(1076002)(22452003)(25786009)(2501003)(36756003)(2616005)(486006)(81166006)(81156014)(66066001)(6666003)(217873002)(4326008)(6506007)(5250100002)(6116002)(3846002)(305945005)(8676002)(72206003)(14454004); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0839; 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: IuBZVj0PirLziWqT8hFXRoMmkyHuWXdkRK3t4y5XREx071wFgh9LXcTW7XzisaUNwVfIVopMb5n/IUAz7wuzKZCbxZ/xbE0M1jH2mkCkgpw064Xkp8Qur1gYMC381EKdTCXemgooxZGA1gvxt6D5XeKUKvKZCprYiQd8jin844ydWWNPHXTaSHE3u/z8F1Bxw8PRQefgJ0NLxRevKQFThuF2FkQdYN3hgLlNO29jHND/sFoleLrVVnwDdvKhhwr53S1wHEIagsVyjTJo7zWovbLwmPAWeTJgWsN8D+7X9+dA2JPyzQDVXhM6B+fr6LqRGk7cJBphs8ePXQ7WqLzZgiEeCXh7XFdKskG3GxGnF9M= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23a0bd78-df7d-4fe1-2b54-08d6145a1c9d X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:48.3402 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0839 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel [ Upstream commit 85046a15529606466bc778e1205f4cab8e3724d1 ] Since we have just assigned saw_regmap, and since the error message refers to saw_regmap, it feels safe to assume that it is saw_regmap, and not regmap, that should be checked for errors. Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/qcom_spmi-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 9817f1a75342..8d5cd624b4b8 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -1774,7 +1774,7 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev) syscon = of_parse_phandle(node, "qcom,saw-reg", 0); saw_regmap = syscon_node_to_regmap(syscon); of_node_put(syscon); - if (IS_ERR(regmap)) + if (IS_ERR(saw_regmap)) dev_err(dev, "ERROR reading SAW regmap\n"); } From patchwork Fri Sep 7 00:36:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 146159 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp537403ljw; Thu, 6 Sep 2018 17:56:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJ1+PC7jgqkUCzRdnn5BYvkhZI9xjzrrwwLtXZnRg3UMMnn87kTYoRXZRhXDTVVbxM6ZX3 X-Received: by 2002:a63:c347:: with SMTP id e7-v6mr5704476pgd.240.1536281779902; Thu, 06 Sep 2018 17:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536281779; cv=none; d=google.com; s=arc-20160816; b=LgFIuM15QT3hHo49hbXNj+oShQflL0CA352G0iToacRarO5XhO0afav//04SQbEMBm t1QEy4z6ksAMcaz2GEb3P07Yh7t0+z5PS/C3OpXz0/uqa6ndVAOpqlZZ9q5OWRyY6O7x c8DN/vIrCeB6iB5Vpza1644oK+batjuIgzRtG99Wqw4O7kpOpgL067CZauOili689cPA jwqrtIDJ5MHkKt5OAlmRxjxMY3sO/wP5CjvIrnSNFHS3f7chv5bJvAgUgiaM9lPmnFJi dn1r5LfD909+3arEhKxvGaNoLOxVgiXc7neUMfGIikHBnByBmA9nX1Yt+QM2Km/I/QIl 82sA== 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; bh=OCWhcMhm5Jz0+eXtQLn+C8eZscpHTLcr8yilSl+9YDI=; b=jh2scmLGXFgOuS9fiHd+oOVcBJlVGGsZohrygUOuYyzmPstJ1dlxM9n2/D5jlxwMxk 5FimN0ECvEc3iBYIBho1dc1xWBLCpcrZINX3IX/JlJ97PEogin9HX56lHZXkURGNQjj1 ZxbSo06VgNyZ0r8E+j1bwQ8EIk8IYDRTDdYYabN+q6WEFi7L6cypuB/SVk5+rufHX63W XSnPPNQejOuw81xzRiBms+XrX28WROPpib9OL3bgR4w8yNmB/EZkPhrE8+sp85nl4KjA xOLvOgPJnEMTneVhjpF5LZrYshgU4YdllSooQK0U1510AT7Ts1Zq4K0bmZMQ2urIMuIu GKGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b="ZM/vdSqX"; 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 k1-v6si6369695pld.424.2018.09.06.17.56.19; Thu, 06 Sep 2018 17:56:19 -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="ZM/vdSqX"; 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 S1729948AbeIGFe1 (ORCPT + 32 others); Fri, 7 Sep 2018 01:34:27 -0400 Received: from mail-eopbgr710095.outbound.protection.outlook.com ([40.107.71.95]:48060 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728044AbeIGFPt (ORCPT ); Fri, 7 Sep 2018 01:15:49 -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=OCWhcMhm5Jz0+eXtQLn+C8eZscpHTLcr8yilSl+9YDI=; b=ZM/vdSqX5czYrPnDe3h6dae7A+ufEH6/JWp2yxtu43Wsp9Q3BKrrHWJm5dGsVnir7DwNiSXmZK/teVRd5lGpazr/NKJzGGM0tYCa4y65tmXzesfROCFxUAcT3O6D+friCkTkriQcNCzGAHbrQS1P2TSJndk5K+LuFefMKuGIrko= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0839.namprd21.prod.outlook.com (10.173.192.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.6; Fri, 7 Sep 2018 00:37:38 +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.008; Fri, 7 Sep 2018 00:37:38 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Niklas Cassel , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.18 81/88] regulator: qcom_spmi: Fix warning Bad of_node_put() Thread-Topic: [PATCH AUTOSEL 4.18 81/88] regulator: qcom_spmi: Fix warning Bad of_node_put() Thread-Index: AQHURkLcVQddM5979kCFJf1UZ9oPRg== Date: Fri, 7 Sep 2018 00:36:48 +0000 Message-ID: <20180907003547.57567-81-alexander.levin@microsoft.com> References: <20180907003547.57567-1-alexander.levin@microsoft.com> In-Reply-To: <20180907003547.57567-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; CY4PR21MB0839; 6:KrkavnTiIk6RURPrm0DUATERNNhf+WczCBaweBrnkyxU4fZtcK90SlQkKkYHg0DzCTyhZeMeObgxTsQosu+beznFYH+v9P6hfB3CsLxbAvsJK8HKV3EQYhqw3Sxerh0G+e8ttcsDUiSa2SXfFu0N1+Kri8ebY9oIGeZMP7EMp9PWBsP898zimuNLs5e5xogVK4H03aq/+wqLuLXrLMnPW/7u3M4nrE/efQa4C7DflpfUirBMgrBfxd0DBa/iv/3XDUDeKIrBqxKX2argm+kHS6Z2TCBnid38TXiQGmGa0aHNRYwSkiF79EaICxmVva5TKYJNvg096Q8uLpS/OKaxO4EqGUR7Y++W+a8IZIsYCw4BbhdDs60sC+QfnBZWFyRK7hR5qVCqrt7YzcHkgVZesgTjVsDmeh3TwOgMpot+enJtk/7jJ2tPMAN23pMvjskXG9ogZeOgcHuvmNOtmOS2Tw==; 5:ltQ5QWBzjgq7f8+VgChlUg1SyzS4GwydiNA4W9WiMhGnvav4wt80HqfLmFU9gDrUVOe02guJTEIcFfPd2B3jBXypX+30TSwEE0+RgtQASiBaF6LxO9jkPUKLfbyyrjMD2nwXpkzdJJ4YzNmNLsfa8g14/d9MDIUy2ergX0g44Ak=; 7:vWP5D8oiGGPQ/2NTPtRskyPoehwFBsFHjl3TiXLrad/ZgTckVkot0rhIApwXO3dmU+/n0Abs35i1+ERAJEcUGLVqDWYk+wVbncxZbSLApV9VnpdFBRlVQaGVXovRhVA6NZOEIuV70g2XTW0HQXOjxNz36Wcy8LsnqdcuQT1XljNJTqgh+8mVFGUEWzr6L5lYfUBZypCl6FXAexOZf8xmHz0I1unYLOcAk1XUix6H1lsQ6UMu8Hlt1aJ957WArFOk x-ms-office365-filtering-correlation-id: c7cf6e25-46b4-42b8-f334-08d6145a1cce 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:CY4PR21MB0839; x-ms-traffictypediagnostic: CY4PR21MB0839: 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)(3002001)(10201501046)(3231344)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0839; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0839; x-forefront-prvs: 07880C4932 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(136003)(346002)(39860400002)(189003)(199004)(10290500003)(99286004)(10090500001)(105586002)(106356001)(102836004)(76176011)(97736004)(6512007)(53936002)(2900100001)(6346003)(316002)(54906003)(110136005)(256004)(14444005)(26005)(6436002)(107886003)(2906002)(86362001)(575784001)(186003)(478600001)(5660300001)(6486002)(446003)(476003)(68736007)(7736002)(86612001)(11346002)(8936002)(1076002)(22452003)(25786009)(2501003)(36756003)(2616005)(486006)(81166006)(81156014)(66066001)(6666003)(217873002)(4326008)(6506007)(5250100002)(6116002)(3846002)(305945005)(8676002)(72206003)(14454004); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0839; 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: hN0xu8E/ya9pZB6xrfiocflnx5Lo+bnxS548olaBRImO7406dvxv8IP3pVY90HqEF3uS6LgN66fGXJ829VzOzyc9eyEe0yZceVl0pdXvjx29acxiW+uQJrkfqwM89rcF0PaknUx9ffvObIjch5s/91TtR8W82o/Dx9OWFkjOXTRcTNSK67+XZy4NsdK9KLVkmLo7ZIlGOTKEM8LkSKV2rwdkxPzO65cq7ioA5fT5Cik6H7VFGDPZXHp54uFmrFG+X7P5unjEOYk1jYZ3fhnaV8koDvstlMZ6jWsG3usp1gmD7wqkOl579iIiBs8KPFtoqx46rbGPm1gwBwS5c/MyB+u9BVC/X4WtFlJEI1LPZq0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7cf6e25-46b4-42b8-f334-08d6145a1cce X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Sep 2018 00:36:48.9207 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0839 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel [ Upstream commit fffe7f52eb5db41eedadba9a8038e982dcfaee0c ] For of_find_node_by_name(), you typically pass what the previous call returned. Therefore, of_find_node_by_name() increases the refcount of the returned node, and decreases the refcount of the node passed as the first argument. of_find_node_by_name() is incorrectly used, and produces a warning. Fix the warning by using the more suitable function of_get_child_by_name(). Also add a missing of_node_put() for the returned value, since this was previously being leaked. OF: ERROR: Bad of_node_put() on /soc/qcom,spmi@400f000/pmic@3/regulators CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 4.18.0-rc4-00223-gefd7b360b70e #12 Hardware name: Qualcomm Technologies, Inc. DB820c (DT) Call trace: dump_backtrace+0x0/0x1a8 show_stack+0x14/0x20 dump_stack+0x90/0xb4 of_node_release+0x74/0x78 kobject_put+0x90/0x1f0 of_node_put+0x14/0x20 of_find_node_by_name+0x80/0xd8 qcom_spmi_regulator_probe+0x30c/0x508 Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW") Signed-off-by: Niklas Cassel Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/qcom_spmi-regulator.c | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 8d5cd624b4b8..ba3d5e63ada6 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -1752,7 +1752,8 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev) const char *name; struct device *dev = &pdev->dev; struct device_node *node = pdev->dev.of_node; - struct device_node *syscon; + struct device_node *syscon, *reg_node; + struct property *reg_prop; int ret, lenp; struct list_head *vreg_list; @@ -1780,10 +1781,13 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev) for (reg = match->data; reg->name; reg++) { - if (saw_regmap && \ - of_find_property(of_find_node_by_name(node, reg->name), \ - "qcom,saw-slave", &lenp)) { - continue; + if (saw_regmap) { + reg_node = of_get_child_by_name(node, reg->name); + reg_prop = of_find_property(reg_node, "qcom,saw-slave", + &lenp); + of_node_put(reg_node); + if (reg_prop) + continue; } vreg = devm_kzalloc(dev, sizeof(*vreg), GFP_KERNEL); @@ -1816,13 +1820,17 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev) if (ret) continue; - if (saw_regmap && \ - of_find_property(of_find_node_by_name(node, reg->name), \ - "qcom,saw-leader", &lenp)) { - spmi_saw_ops = *(vreg->desc.ops); - spmi_saw_ops.set_voltage_sel = \ - spmi_regulator_saw_set_voltage; - vreg->desc.ops = &spmi_saw_ops; + if (saw_regmap) { + reg_node = of_get_child_by_name(node, reg->name); + reg_prop = of_find_property(reg_node, "qcom,saw-leader", + &lenp); + of_node_put(reg_node); + if (reg_prop) { + spmi_saw_ops = *(vreg->desc.ops); + spmi_saw_ops.set_voltage_sel = + spmi_regulator_saw_set_voltage; + vreg->desc.ops = &spmi_saw_ops; + } } config.dev = dev;