From patchwork Sun Sep 24 18:41:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114135 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1805556qgf; Sun, 24 Sep 2017 11:42:28 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD6lFw79Gxx4QqZI7rNcDdM3JBtKb/w6EYiik+Vc1KukYF2nMqn1l+/bhSZQt+/RXfDmIaK X-Received: by 10.99.60.13 with SMTP id j13mr5258384pga.384.1506278548686; Sun, 24 Sep 2017 11:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278548; cv=none; d=google.com; s=arc-20160816; b=JIz1ejrAXFTj0RlGsT4Iayb5EV9D3x+x2HfD2UiJffnDW+6EBJbAcuoR7U6MLr3PLw yE6EDDQ7zq8UrNOmQTgf75rOhyjOZKdopdbFS4PkXfjMTKV6FomOAjXehHrmgBr3QZzc dtN+mKhj4xqYeuY0BThcGHH0LzeKugOa2FWDl8RsryqxB1nlKadnEugEj5fvmK0uXGvV IZBPVh1T/TmA4MWWXWqSNuTHWhmOEMiwJYAxgTMn80g9FT6A4CQWtjfa3JEnQW4a/Lv4 wWcHUGDN1sSMCX9Q0OKP+xXjoSTvc2D2+PwR8DW2y2xzvKR3xVXMAdPWCSOeBnX3kNDx vUkw== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=NddrKFDrI7erpBBDH26JtzIg5y4Ou7gE758BPkEMXfE=; b=zhUOQPYci+ewMi+KUDZVvTexvP8MdT8VWCDi38RA5w6pM1uU/5azYgLclPmp2onvPJ /LGnAetF5esgeGttVyMusbxlpFeaAAK98P3XReMZNUqmsVedATxuhquhtr5P752EBUI9 CYs5ERY3dd3ir/n40l5eYDnl8+r6nZ5AKYm10aAKhEqhNbXpcvi79ufHVfHVrnt00SHn n4bLE+xubohZh+kdz5rxnxxhrJ4ZJDmFuwlb72Aoui5ltYTbaS4r8Lvk+JlUz7lN9zZb X63o2sN8ctHzcYv6TKWzUdI2xR3ih8G8btS5H35mfXyqh6ZHsLXDnSBEG9m1hOIzNUIo se7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=Ol+B9gk9; dkim=fail header.i=@verizon.com header.s=corp header.b=nRuG6bI4; dkim=fail header.i=@verizon.com header.s=corp header.b=NzaR8QP1; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.42.28; Sun, 24 Sep 2017 11:42:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=Ol+B9gk9; dkim=fail header.i=@verizon.com header.s=corp header.b=nRuG6bI4; dkim=fail header.i=@verizon.com header.s=corp header.b=NzaR8QP1; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752837AbdIXSm1 (ORCPT + 8 others); Sun, 24 Sep 2017 14:42:27 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:7737 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752781AbdIXSmX (ORCPT ); Sun, 24 Sep 2017 14:42:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278543; x=1537814543; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DAPoxS6wzmi01pRQQUCfEL5YurCzoG/LqHlBAFeO1u4=; b=Ol+B9gk9FzdeUCnot/W51lrjeGs/XG8htg68eCD1v+1mUUmQYFrF23u/ BjV0L1M+yuYFN0LMS88c57gSQX1xR7PBmh5cGN/HJdpjE3Q+6phJk5Cpx 3oAKGxbBW+p7e2OhtZx3doij3bFAQcPYpqmCc8Quqb4H4vAwEx0rRhn4h c=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 24 Sep 2017 18:42:21 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:41:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278512; x=1537814512; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DAPoxS6wzmi01pRQQUCfEL5YurCzoG/LqHlBAFeO1u4=; b=nRuG6bI48NjF/juMpE03tVIjxiuo2uEK8FVXKcxI3/arGhynY0MRc2ui 1aFoF3MkOcvp2i9f+omU+Zpm6LX3aW9GgABH9Y+4qv6KLGBdGryNtOJuI vhS2E8fL7U6WrBe011HtQmbwyt29vh44fh8j6iNbMhBRxcSWKo8kj99gQ o=; Received: from ranger.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.27]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278514; x=1537814514; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DAPoxS6wzmi01pRQQUCfEL5YurCzoG/LqHlBAFeO1u4=; b=NzaR8QP1G5ytji5UYmbqjuXES6+3UObDe+NUm0jWv4fFrYc1d7ugBma8 Tgsn4ex7m8UbZbJ9P/R3oCfHD/p9WF70Dnl6m1fNpB4sAirdS5kpctTch PJJ3leS2cz5Kvs9Q6aqnkS4i+29C0eoMJJMwQOddL5hc7ebn7osMZeBvd M=; X-Host: ranger.odc.vzwcorp.com Received: from casac1exh003.uswin.ad.vzwcorp.com ([10.11.218.45]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:41:54 +0000 Received: from scwexch05apd.uswin.ad.vzwcorp.com (153.114.130.24) by CASAC1EXH003.uswin.ad.vzwcorp.com (10.11.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:41:50 -0700 Received: from OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) by scwexch05apd.uswin.ad.vzwcorp.com (153.114.130.24) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:41:50 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:41:49 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:41:49 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 19/96] reset: ti_syscon: fix a ti_syscon_reset_status issue Thread-Topic: [GIT PULL for-4.9 19/96] reset: ti_syscon: fix a ti_syscon_reset_status issue Thread-Index: AQHTNWTDi9wbp8Mh40uKxSR2nHtPyw== Date: Sun, 24 Sep 2017 18:41:41 +0000 Message-ID: <20170924184130.29445-20-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jiancheng Xue [ Upstream commit 5987b4bf512101137fa60c5c0ccac3db51541221 ] If STATUS_SET was not set, ti_syscon_reset_status would always return 0 no matter whether the status_bit was set or not. Signed-off-by: Jiancheng Xue Fixes: cc7c2bb1493c ("reset: add TI SYSCON based reset driver") Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/reset/reset-ti-syscon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c index 47f0ffd3b013..1799fd423901 100644 --- a/drivers/reset/reset-ti-syscon.c +++ b/drivers/reset/reset-ti-syscon.c @@ -154,8 +154,8 @@ static int ti_syscon_reset_status(struct reset_controller_dev *rcdev, if (ret) return ret; - return (reset_state & BIT(control->status_bit)) && - (control->flags & STATUS_SET); + return !(reset_state & BIT(control->status_bit)) == + !(control->flags & STATUS_SET); } static struct reset_control_ops ti_syscon_reset_ops = { From patchwork Sun Sep 24 18:41:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114136 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1805959qgf; Sun, 24 Sep 2017 11:43:04 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC+cHNiiW8r0j7+AcA52QikQoxXu+rad864zGeDqfehXNvo9fZBxnc6Q8W8jmgu/NT70YnU X-Received: by 10.84.254.70 with SMTP id a6mr5260942pln.71.1506278584187; Sun, 24 Sep 2017 11:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278584; cv=none; d=google.com; s=arc-20160816; b=pHrkyZcOoFlg8siUzg8GWWj+ZmlcahFToF/biUUPht9B1I9si0swVU8uRWjZIwe35D MdaTFW2Kucj9A9/qvha0eFAa6xKTUbPjOPJ6hR08yb5cx3j8pHFr634/x9moTR22On2D dw95NLPqL1LpqvFJTLgPo+BzkrluwfMf4pXbS+3tD4arhtrSFv6QM0k30sGk6lAjxYnk hGijyZ1kvIjMj0X5/gnqLQB+/sV0baho6Kgr0k6H0ryERQ8+gJkB7RVynfe/oRg8DS4V MJF6JOYWKxtQEYdVLlKoPP0KIXYMJco4hQOtCvbcq4yunmHnY/pR/ZB7ymdmMlQc909z R9ig== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=t5rmPww2Lkgxv9Cxka3gBmkOP6pbpJcnvIljvMJ87Ck=; b=fRYSnmidtFoAvZhPIWDmUKjYGwuVUgJhZ0oTFCqqqjlrw59lhhkIu1Qj0r3xMiHiZR fkaJcijzNGD5sCYubCrJgjewic3Ns4my+lhr320mWrOJdVASHIa5O8ObyNVjvOP7lOB8 JrbI3wueLhBDe/dKWBt2IoRD1jhecvYxhN/8u2wTVkgXUQEnDk3Gpl99onOx9hdfN6Id 02ECM/kd5m1QAAqqyfml7BzdH8bTwlNW/AGL7iEzN/pJLfq4JkdaUElJozSw5kGInKFZ tOZ+N1xrsRP/5e7uqqSCZHFbh+dludTRIxddjuQ3740Plfa/MB36HDsElmCoVMFYIw5f YaLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=m3yMN+8Z; dkim=fail header.i=@verizon.com header.s=corp header.b=qCkDy0zi; dkim=fail header.i=@verizon.com header.s=corp header.b=M/CDTpuu; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.03; Sun, 24 Sep 2017 11:43:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=m3yMN+8Z; dkim=fail header.i=@verizon.com header.s=corp header.b=qCkDy0zi; dkim=fail header.i=@verizon.com header.s=corp header.b=M/CDTpuu; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbdIXSnD (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:03 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:24044 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbdIXSmz (ORCPT ); Sun, 24 Sep 2017 14:42:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278575; x=1537814575; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iniMhNTvFQYnIkM2zSS3udLL1OwO9VyK+jucFiTa/yE=; b=m3yMN+8Z/BTEUCD4oMrAXKOG+ewu8iHFzbrDHQp3ZZFAAkZC/hMOs5+N A26jshrDjFKLl3+AAZA0p7PEbGQvbI/OgIe13EkMh6deYhPRA2wbh19Zx QxNefNZ66Znvwrot3zg8lu1IX5lWJ1oAWQG6YmOSBzQLVMMm02AhAFNPg 4=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe02.verizonbusiness.com with ESMTP; 24 Sep 2017 18:42:52 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:42:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278558; x=1537814558; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iniMhNTvFQYnIkM2zSS3udLL1OwO9VyK+jucFiTa/yE=; b=qCkDy0ziGmZd0+fkOkHIZbW854hsqcXXJvBLmhbaZhHNXKd/QP5+8SsW bwnSN1D5fXM0N4wG6TQmCT9G/ry3pUBWAnt26cPE2cx2V0NT4OVFLMAfx XWcQ4iHrrrScdwU9xU8G0z9chAKhjdd1UkEP4HQaITzAL7jVC/6qNKypR I=; Received: from ranger.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.27]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278559; x=1537814559; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iniMhNTvFQYnIkM2zSS3udLL1OwO9VyK+jucFiTa/yE=; b=M/CDTpuuYlZqkrc9Oc5s/+n814IuZrHIj0r+9t9RqgaUNxgFVefBRHta bnxH5i63dEWoAWwsHcAsvheZJL1B901onl1m6eBoWjmxp9QrJCx0ipl2s nNnEs1UVhEv6AxTJazUziGZ63LQE+6EfF0Q+RQ/czSUyzh9ngx9V9eRFt M=; X-Host: ranger.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:42:39 +0000 Received: from scwexch01apd.uswin.ad.vzwcorp.com (153.114.130.20) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:42:36 -0700 Received: from OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) by scwexch01apd.uswin.ad.vzwcorp.com (153.114.130.20) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:42:36 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:42:34 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:42:34 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 44/96] ASoC: dapm: handle probe deferrals Thread-Topic: [GIT PULL for-4.9 44/96] ASoC: dapm: handle probe deferrals Thread-Index: AQHTNWTHv+hDuwcbAES8ya9zawYKaQ== Date: Sun, 24 Sep 2017 18:41:47 +0000 Message-ID: <20170924184130.29445-45-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit 37e1df8c95e2c8a57c77eafc097648f6e40a60ff ] This starts to handle probe deferrals on regulators and clocks on the ASoC DAPM. I came to this patch after audio stopped working on Ux500 ages ago and I finally looked into it to see what is wrong. I had messages like this in the console since a while back: ab8500-codec.0: ASoC: Failed to request audioclk: -517 ab8500-codec.0: ASoC: Failed to create DAPM control audioclk ab8500-codec.0: Failed to create new controls -12 snd-soc-mop500.0: ASoC: failed to instantiate card -12 snd-soc-mop500.0: Error: snd_soc_register_card failed (-12)! snd-soc-mop500: probe of snd-soc-mop500.0 failed with error -12 Apparently because the widget table for the codec looks like this (sound/soc/codecs/ab8500-codec.c): static const struct snd_soc_dapm_widget ab8500_dapm_widgets[] = { /* Clocks */ SND_SOC_DAPM_CLOCK_SUPPLY("audioclk"), /* Regulators */ SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0), So when we call snd_soc_register_codec() and any of these widgets get a deferred probe we do not get an -EPROBE_DEFER (-517) back as we should and instead we just fail. Apparently the code assumes that clocks and regulators must be available at this point and not defer. After this patch it rather looks like this: ab8500-codec.0: Failed to create new controls -517 snd-soc-mop500.0: ASoC: failed to instantiate card -517 snd-soc-mop500.0: Error: snd_soc_register_card failed (-517)! (...) abx500-clk.0: registered clocks for ab850x snd-soc-mop500.0: ab8500-codec-dai.0 <-> ux500-msp-i2s.1 mapping ok snd-soc-mop500.0: ab8500-codec-dai.1 <-> ux500-msp-i2s.3 mapping ok I'm pretty happy about the patch as it it, but I'm a bit uncertain on how to proceed: there are a lot of users of the external functions snd_soc_dapm_new_control() (111 sites) and that will now return an occassional error pointer, which is not handled in the calling sites. I want an indication from the maintainers whether I should just go in and augment all these call sites, or if deferred probe is frowned upon when it leads to this much overhead. Signed-off-by: Linus Walleij Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-dapm.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/soc-topology.c | 9 +++++++++ 2 files changed, 51 insertions(+) -- 2.11.0 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3bbe32ee4630..411f7574dd0b 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -358,6 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, snd_soc_dapm_new_control_unlocked(widget->dapm, &template); kfree(name); + if (IS_ERR(data->widget)) { + ret = PTR_ERR(data->widget); + goto err_data; + } if (!data->widget) { ret = -ENOMEM; goto err_data; @@ -392,6 +396,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, data->widget = snd_soc_dapm_new_control_unlocked( widget->dapm, &template); kfree(name); + if (IS_ERR(data->widget)) { + ret = PTR_ERR(data->widget); + goto err_data; + } if (!data->widget) { ret = -ENOMEM; goto err_data; @@ -3311,11 +3319,22 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); w = snd_soc_dapm_new_control_unlocked(dapm, widget); + /* Do not nag about probe deferrals */ + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create DAPM control %s (%d)\n", + widget->name, ret); + goto out_unlock; + } if (!w) dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n", widget->name); +out_unlock: mutex_unlock(&dapm->card->dapm_mutex); return w; } @@ -3338,6 +3357,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, w->regulator = devm_regulator_get(dapm->dev, w->name); if (IS_ERR(w->regulator)) { ret = PTR_ERR(w->regulator); + if (ret == -EPROBE_DEFER) + return ERR_PTR(ret); dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", w->name, ret); return NULL; @@ -3356,6 +3377,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, w->clk = devm_clk_get(dapm->dev, w->name); if (IS_ERR(w->clk)) { ret = PTR_ERR(w->clk); + if (ret == -EPROBE_DEFER) + return ERR_PTR(ret); dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", w->name, ret); return NULL; @@ -3474,6 +3497,16 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); for (i = 0; i < num; i++) { w = snd_soc_dapm_new_control_unlocked(dapm, widget); + if (IS_ERR(w)) { + ret = PTR_ERR(w); + /* Do not nag about probe deferrals */ + if (ret == -EPROBE_DEFER) + break; + dev_err(dapm->dev, + "ASoC: Failed to create DAPM control %s (%d)\n", + widget->name, ret); + break; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n", @@ -3750,6 +3783,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template); + if (IS_ERR(w)) { + ret = PTR_ERR(w); + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(card->dev, + "ASoC: Failed to create %s widget (%d)\n", + link_name, ret); + goto outfree_kcontrol_news; + } if (!w) { dev_err(card->dev, "ASoC: Failed to create %s widget\n", link_name); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 6b05047a4134..8a758c994506 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1473,6 +1473,15 @@ widget: widget = snd_soc_dapm_new_control(dapm, &template); else widget = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(widget)) { + ret = PTR_ERR(widget); + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(tplg->dev, + "ASoC: failed to create widget %s controls (%d)\n", + w->name, ret); + goto hdr_err; + } if (widget == NULL) { dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n", w->name); From patchwork Sun Sep 24 18:41:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114137 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1806184qgf; Sun, 24 Sep 2017 11:43:22 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDrlJ/oOfmVLNd8iEBW1CZiQGeFpwfuiK+ccVExeY2fmNTmLUemqWPVA2kDa5YSX/1Sqshy X-Received: by 10.98.36.132 with SMTP id k4mr5376616pfk.148.1506278602457; Sun, 24 Sep 2017 11:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278602; cv=none; d=google.com; s=arc-20160816; b=CCX+U+O4GNuf4GGh7vIRhtkU8x8FRanMzpMQiLhPYTBsLcYSrAfSQmLZHEvlcapFPI SwysjhuCwvp3k5P9sU8uWXOqp0pKZ2d7wUD3HYwJP4qvkRpAjSvBeFCqfkgTbYVXQmwn pyXzKsSokmsGpEdzYzWUiec8VxKr0nK80x5HgCQavLGVyUtXoBzXyjFqYl6u8zWkCrtc 7nhQRaLLfsF9sdJIKAiPnluy36xpEm3G+nOAu+eSLhu8vqLqXq/4qvaLPyfTAj0B2EL7 vbADQtfTnKHeMfpAQg1Foz8TdrcLaeypx4RiZdMSkvDviCX67Xy+dtV0JIzWBPuGzK1j TzPA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=y7+wut6CO/gJZEmbYWipy6uDn6cO5fNJNMywC2PK0YY=; b=Ozhhc/texYZJZ8WC130cVVpFAuzLPnNSjfXZZL6sJu1q1vRXikYwHpIInWe/gp86a8 QCfqUnPlct7qhN0RYX2WfNJZIRIVDmltdDy7i0WKbnb9UbZ2IdfbWAhwtlipR7u5FC0E AKmTOZVFmW9ia4wMBlfk4cOG8ArA3FJ8vIid9BkTi5/d4Oxmbjt2z+HzMiTrpx4SG8Yw A7n7+67OeYEfN1afFUBlRAzKRsAhApiX2JNs3zmXFERKsfx02JOal9mE9ntqedgivTgp ZmLnK/q4nU7xHRKF6rskcPqeXW7lBWaShHef0YxGXaaVgXZ/jtTm4IKnrAOLj7NflciO GXwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=W+JIU5i7; dkim=fail header.i=@verizon.com header.s=corp header.b=YD+Kymtv; dkim=fail header.i=@verizon.com header.s=corp header.b=nYbwoukS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.22; Sun, 24 Sep 2017 11:43:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=W+JIU5i7; dkim=fail header.i=@verizon.com header.s=corp header.b=YD+Kymtv; dkim=fail header.i=@verizon.com header.s=corp header.b=nYbwoukS; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752867AbdIXSnU (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:20 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:23149 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752869AbdIXSnG (ORCPT ); Sun, 24 Sep 2017 14:43:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278586; x=1537814586; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=W+JIU5i7jUUwT9MqFqg3bRF11e7GhmhPT6/LvUl+0285xTyBLiVS97vf iSYxirvb4ACPoQoKPjD8Bu3LeD5jdKy+1yijGPQckM7r5gQZVkFXNT38v HAtjdwGTLdVgDnedZF2LRiLBIkW5rZiaslXqqQZMdrflph1focLiOJ/Nq w=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 24 Sep 2017 18:42:53 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:42:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278563; x=1537814563; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=YD+KymtvOFG4pvgcNCfQpE5C5Yej97qk34Ge+8JSnO3VbdnuvEDUBYLq Z/JDwj2O5no/RALpOWaBtMQVH6Y/fElZ6t6SrKPcWm1H9y1c3WGK1EO8L eU/AfsmRLVkBF2qGd1olJBeTLEh+xUGySxhwS/+QuGhGCJmnaCQLz3tD+ g=; Received: from ranger.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.27]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:42:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278564; x=1537814564; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=nYbwoukSUZ9DucLRhiu1kouxB7Bh5nV/e123EaxViHlYh7Z4KsQ35r7v sapI27eztVcVQKfcr6KxPmpP3xwCjgElXDIrDixd45ESiLr1HQmIyR8v+ 6RznTS+CATIPzrg+NMS2k6xNjroyGErgOQYmkp0ECcPKBt1JxRiwSpGC/ 8=; X-Host: ranger.odc.vzwcorp.com Received: from casac1exh002.uswin.ad.vzwcorp.com ([10.11.218.44]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:42:44 +0000 Received: from scwexch04apd.uswin.ad.vzwcorp.com (153.114.130.23) by CASAC1EXH002.uswin.ad.vzwcorp.com (10.11.218.44) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:42:41 -0700 Received: from OMZP1LUMXCA19.uswin.ad.vzwcorp.com (144.8.22.197) by scwexch04apd.uswin.ad.vzwcorp.com (153.114.130.23) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:42:40 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA19.uswin.ad.vzwcorp.com (144.8.22.197) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:42:39 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:42:39 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 51/96] ASoC: dapm: fix some pointer error handling Thread-Topic: [GIT PULL for-4.9 51/96] ASoC: dapm: fix some pointer error handling Thread-Index: AQHTNWTI21pHqfeUH0K/DD01RxNvrg== Date: Sun, 24 Sep 2017 18:41:49 +0000 Message-ID: <20170924184130.29445-52-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit 639467c8f26d834c934215e8b59129ce442475fe ] commit 66feeec9322132689d42723df2537d60f96f8e44 "RFC: ASoC: dapm: handle probe deferrals" forgot a to update some two sites where the call was used. The static codechecks quickly found them. Reported-by: Dan Carpenter Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals") Signed-off-by: Linus Walleij Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-dapm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.11.0 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 411f7574dd0b..6780eba55ec2 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3843,6 +3843,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->playback.stream_name); @@ -3862,6 +3872,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->capture.stream_name); From patchwork Sun Sep 24 18:41:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114138 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1806196qgf; Sun, 24 Sep 2017 11:43:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDir3G4GLE4lvahQ/MhWdg3pENt4cFT3Kv1mkaj+ssQoTm9mEgBI6JNg70mm8pnwMQXlxCE X-Received: by 10.99.98.131 with SMTP id w125mr5401519pgb.214.1506278603523; Sun, 24 Sep 2017 11:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278603; cv=none; d=google.com; s=arc-20160816; b=wdgGa1tvpmyLr+p1X78fhrw0tDvitc13OequUXwNQl503QSBDn1hbT6aZvJaGEebcS 2ljDWBooKit6b47F705DzGoJpWk6LJDIjrl0+57hfTpm60tZLyhTrRKGx0Q2EuN/jea4 VpKWJ9N/AXBvxgcib+Q8tVLPPbX4s9O/2aGrHk2AavkQx+VonUDJMXsfs6sotzz7SqKh Uo5n6ANfLTem2U872bJxdpOsT1STOOWfqhC4mbJALQTep1dNfvqOXodfk3jn1C3Lxm6Q hRIpHQ410QeN/PV8ROEM0dxJAsl5QnQbFYWTIfgqIumdW/s1/8vUl0X5lvjPnFrspkCV epLA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=FaIBPOeKN7aA/nVQqJMBW1U/UzfmqdYiv38BUq+K5JA=; b=jJlzDFw7FE69DHgAm7uKINj09MJF8X/yIJapEtZ4phfieTE9KO51TNfpeEUnBOhVhl elIzj8k0b+SEIlhaD7jebxrXyVS8qo4nH6fO5K4z6Ri+DxXrusvrIpAdCtrw/6AXRysJ /tYexrgLJXCS2cMp7XMcpH7wDpON5y8+S2yzbOpTptYQexNRwSYI3D2//15GUR351Emf AIenePDMtVEldkt1f9C91DJISHOUGPWW9ka+/tETvlzaIObTibuh7AtFSNa6BEy5UEU+ AFIB8Lj9cBzTN1XAsQVRf4/okTVEagCvGbyvAMkovAiIhwjmgSkP0EB8eQ63bsK1RjPV o0aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=UlHwdLzg; dkim=fail header.i=@verizon.com header.s=corp header.b=MweFY5FX; dkim=fail header.i=@verizon.com header.s=corp header.b=MweFY5FX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.23; Sun, 24 Sep 2017 11:43:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=UlHwdLzg; dkim=fail header.i=@verizon.com header.s=corp header.b=MweFY5FX; dkim=fail header.i=@verizon.com header.s=corp header.b=MweFY5FX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836AbdIXSnW (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:22 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:5356 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752851AbdIXSnH (ORCPT ); Sun, 24 Sep 2017 14:43:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278587; x=1537814587; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=yNRUdmY/S5Rebb/GBqI5y/FHVkkGrnjFXCDH8vc404w=; b=UlHwdLzggNxLTmv+fGeMbx03m4933s1oLqmA9pKyIHggoB+bUV035gHp GJm4RHF9Bt92jY61MGhlnoecYXQVwEzySgscke3+/wQJuh9LOka5BxISA oS6ymbaNz1jH5UFFQjQp7QGfTlt3gb6b3P4nZqm6sCqanAxf87f5x+OG4 k=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 24 Sep 2017 18:42:53 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:42:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278564; x=1537814564; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=yNRUdmY/S5Rebb/GBqI5y/FHVkkGrnjFXCDH8vc404w=; b=MweFY5FXPNcVhOw6TI70LbukRYONZ16nCKk8tD+j26bl7CaUBGzwK7J0 NIsOVDsasoCi50Qe4/3YGT4DV0OIvBZi/+AnSIW03sdFWUFzI0utVRged 464S1pXnUGwQq/Lq6KJAELbPj2VO0TDO680bmwVrl6RMHZYDfI51yjc0v U=; Received: from challenger.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.24]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:42:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278564; x=1537814564; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=yNRUdmY/S5Rebb/GBqI5y/FHVkkGrnjFXCDH8vc404w=; b=MweFY5FXPNcVhOw6TI70LbukRYONZ16nCKk8tD+j26bl7CaUBGzwK7J0 NIsOVDsasoCi50Qe4/3YGT4DV0OIvBZi/+AnSIW03sdFWUFzI0utVRged 464S1pXnUGwQq/Lq6KJAELbPj2VO0TDO680bmwVrl6RMHZYDfI51yjc0v U=; X-Host: challenger.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:42:44 +0000 Received: from scwexch14apd.uswin.ad.vzwcorp.com (153.114.130.33) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:42:43 -0700 Received: from OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) by scwexch14apd.uswin.ad.vzwcorp.com (153.114.130.33) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:42:42 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA16.uswin.ad.vzwcorp.com (144.8.22.194) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:42:41 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:42:41 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 55/96] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Topic: [GIT PULL for-4.9 55/96] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Index: AQHTNWTIcd+bqKBMxUuIg+2dgdBu/A== Date: Sun, 24 Sep 2017 18:41:50 +0000 Message-ID: <20170924184130.29445-56-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 98ea51cb0c8ce009d9da1fd7b48f0ff1d7a9bbb0 ] Hauke already fixed a couple of them, but one instance remains that checks for a negative integer when it should check for a NULL pointer: arch/mips/lantiq/xway/sysctrl.c: In function 'ltq_soc_init': arch/mips/lantiq/xway/sysctrl.c:473:19: error: ordered comparison of pointer with integer zero [-Werror=extra] Fixes: 6e807852676a ("MIPS: Lantiq: Fix check for return value of request_mem_region()") Signed-off-by: Arnd Bergmann Cc: John Crispin Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/15043/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin --- arch/mips/lantiq/xway/sysctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index 90565477dfbd..95bec460b651 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c @@ -469,8 +469,8 @@ void __init ltq_soc_init(void) panic("Failed to load xbar nodes from devicetree"); if (of_address_to_resource(np_xbar, 0, &res_xbar)) panic("Failed to get xbar resources"); - if (request_mem_region(res_xbar.start, resource_size(&res_xbar), - res_xbar.name) < 0) + if (!request_mem_region(res_xbar.start, resource_size(&res_xbar), + res_xbar.name)) panic("Failed to get xbar resources"); ltq_xbar_membase = ioremap_nocache(res_xbar.start, From patchwork Sun Sep 24 18:41:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114139 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1806394qgf; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCmah1GM2HALV0krSwXRMwqXGUe9Q9CFJLxmPfEyLSDGdGlV0ZJofuoujLmrf0dL8ahXW5M X-Received: by 10.99.117.30 with SMTP id q30mr5513824pgc.106.1506278622607; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278622; cv=none; d=google.com; s=arc-20160816; b=ADx4nv+ahFunzjT93kLqtuZKxlhFXx4MlosoOFyzQLf4r6EvCtXK1AMYzO0A2FaYL1 y6shWhH+7InEu4fHqwfLeq9Voy0Z+ueqe4ATiw9WG6cIOhqzQ6drFqRkDBI/NrXmZcsL tIgFjOBrTrh3YIp36HbF6WuzKnYxS1muCZId03ZpMmgqJAUDOSf9K1VFmWcbHQ4BpNDT 7MGN6I6EL48qXZCGFGBCi/6kt+oq3EXoVQenp6OwuU8Al4Nw3VRdU5r9nNGH1LqK2zq+ 7JfBb0eHmYyuwYlzI6qKDqZoR87pfqUOe1aLGE4/ba1L2yDu+o0KEbbY4eYyPZ6weq68 /fPw== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=+XPnKNbdsXMP7jSb+NQlHpY4rcUh7JcfYhCM+kui+yc=; b=HXzump75B5G+6ZoN9cK8KcU1jqNMH8lW91+8olnyY9iLAIdaBjF0Pyzud1cImpweFv ohXzvgOzM2bLK5iqRxp/ezlloa/O8dzTkMeFDXMkt+TblIODL2ZfSWjfk39CgOdlbeDB X2+bMvzxzyx+u4RbnBj6ps9jqJAvwtY5bf5QLwFdI/qtyudE1bSPndifAVatu+Y1zk1j BBReeapvjI0DIS+G0RVJ+MPv509HxPNXzNGEQBWlWGYLzL5/BPFhuPCxbOsstRxq3nBA V2mvAdnYAaS3Nr7U36Gswve6Lda8gdzeOR9THvhNit1IXR5onmfJCKUJ5CtQxVBU6Rxv VBoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=j1Ew41nB; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.42; Sun, 24 Sep 2017 11:43:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=j1Ew41nB; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; dkim=fail header.i=@verizon.com header.s=corp header.b=F/BvllTx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925AbdIXSnl (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:41 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:4427 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdIXSnh (ORCPT ); Sun, 24 Sep 2017 14:43:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278617; x=1537814617; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=j1Ew41nBIP9YfRy+9QM8h02DIFFjV0S8xV88jzke5m3p9m/TiWTP3IsX TS2LPCjFNP+XUTUaLbZvuLN29U1MoYM1/w5zGo2PzrQmysAWz4NYlmOhv GwhV3sJQQ/ynm5P2Fw1Y6Qkse82F4/y2x8mkMGxnnBbcn0QC2FPE3nybb I=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 24 Sep 2017 18:43:31 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:43:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278607; x=1537814607; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=F/BvllTxdgbzMQzxcuG71ecPHwUMg3sWO9RQExj4xUNsFArrym8NQaME dPpZi8xVb60cdy2hWhNt0KQV4LoxSR0Zs7b5mDyUkkPXYQYD/WdQt5EDA 2rnUDUAZkpoNAyAoR2YizoEBL833+QsIDVJcsfELGkro0arYE73QNRE8x w=; Received: from viking.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.26]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:43:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278607; x=1537814607; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=p6DzerX/AbFBvat85smsisxrauDZIeOg/7oWXsJZr50=; b=F/BvllTxdgbzMQzxcuG71ecPHwUMg3sWO9RQExj4xUNsFArrym8NQaME dPpZi8xVb60cdy2hWhNt0KQV4LoxSR0Zs7b5mDyUkkPXYQYD/WdQt5EDA 2rnUDUAZkpoNAyAoR2YizoEBL833+QsIDVJcsfELGkro0arYE73QNRE8x w=; X-Host: viking.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:43:27 +0000 Received: from scwexch17apd.uswin.ad.vzwcorp.com (153.114.130.36) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:43:26 -0700 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by scwexch17apd.uswin.ad.vzwcorp.com (153.114.130.36) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:43:25 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:43:24 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:43:24 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 75/96] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Topic: [GIT PULL for-4.9 75/96] iommu/exynos: Block SYSMMU while invalidating FLPD cache Thread-Index: AQHTNWTLJiIQJQQP3UKjVt6YRFvxCw== Date: Sun, 24 Sep 2017 18:41:55 +0000 Message-ID: <20170924184130.29445-76-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marek Szyprowski [ Upstream commit 7d2aa6b814476a2e2794960f844344519246df72 ] Documentation specifies that SYSMMU should be in blocked state while performing TLB/FLPD cache invalidation, so add needed calls to sysmmu_block/unblock. Fixes: 66a7ed84b345d ("iommu/exynos: Apply workaround of caching fault page table entries") CC: stable@vger.kernel.org # v4.10+ Signed-off-by: Marek Szyprowski Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/exynos-iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 30808e91b775..c7820b3ea80e 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -542,7 +542,10 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, spin_lock_irqsave(&data->lock, flags); if (is_sysmmu_active(data) && data->version >= MAKE_MMU_VER(3, 3)) { clk_enable(data->clk_master); - __sysmmu_tlb_invalidate_entry(data, iova, 1); + if (sysmmu_block(data)) { + __sysmmu_tlb_invalidate_entry(data, iova, 1); + sysmmu_unblock(data); + } clk_disable(data->clk_master); } spin_unlock_irqrestore(&data->lock, flags); From patchwork Sun Sep 24 18:41:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 114140 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1806578qgf; Sun, 24 Sep 2017 11:43:57 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDAL3N3DYWcdwzUrR3/NYTwBq7p/MnJj8r2y2RptaXIl85Rt6TIkWhYcQRl5dM2yuURQdz0 X-Received: by 10.98.64.212 with SMTP id f81mr5235687pfd.321.1506278637106; Sun, 24 Sep 2017 11:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278637; cv=none; d=google.com; s=arc-20160816; b=ceuGol0Y8g1Y38lbDxk7xHdzQk5POkD+17fU6yK9o97I0vBloWzTShwS7Sq5/NOEZP byDJKeLKL39sEylyiQIt/sK+wumBNXeJKAXwcMM0DX3OOMgS/LnQPbOqfa28sGaEvexZ 0HkIExqbPgpTKY2xzVeGXuiQ82QKHZ7IkYAuF7nuLdkXUo096aiR5wiBLdjyRXt1YoZG kvltGV2DO2qwpMtG/fJyQnmBdGEXUTzlKiwE4vf+oTMPk6AmhIBaf/Dz3LfB/UAPNU82 BMQ5HmA9VW2iv+JcyW1yn4f1ueXNvHpa9CEjwp8mvsO/Og27SCI+TAFbcaw8/DkeKme0 lKUA== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:dkim-signature :dkim-signature:from:dkim-signature:arc-authentication-results; bh=CDDXsDP3GLbvlD4Ti9gJTorvZFGS29IvkglT7FT9wZU=; b=f7Je1tka8iZNU0iWtER8ABu1T/EcbJsIBRWjTPpknL5vOOZ51azPuSf5e6+y0jWcmx Q6XZMV9XfkreGWpy+tOcz4R4cqlHvDLUhc+piAGkDkQQx0G/+5dXG0kO0zp067sbAt7Q wPxhdwOMnhR79ncESNn/nH2mhnOL5Zb+CBERuhu27/wQSpZvDn8QopM8FRFecihKvtT0 fSkqhu8gBoeiyBDf2Q0iEbb97fJQnAO6svtaxqacGg02TNOEDVrXJDtYqMgunMPz9peR MsZ4vcPqieSTEvQcZJ2QG02JS73ebQkSJZ/DQm5DFcdstMAmV0ZrqFWlMo0DhU5Ha7Al GM7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=Db+q7WVe; dkim=fail header.i=@verizon.com header.s=corp header.b=RfFqGzlm; dkim=fail header.i=@verizon.com header.s=corp header.b=vGNQ6Fpi; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si3003187pgs.34.2017.09.24.11.43.56; Sun, 24 Sep 2017 11:43:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@verizon.com header.s=corp header.b=Db+q7WVe; dkim=fail header.i=@verizon.com header.s=corp header.b=RfFqGzlm; dkim=fail header.i=@verizon.com header.s=corp header.b=vGNQ6Fpi; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752938AbdIXSnz (ORCPT + 8 others); Sun, 24 Sep 2017 14:43:55 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:19071 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdIXSns (ORCPT ); Sun, 24 Sep 2017 14:43:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278628; x=1537814628; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QXhAbpnm9Uly5vQNNBMTDelBwnqfx8sK/+dNJ7MMEOc=; b=Db+q7WVe6HFb839eHyYZNb3T2YpDp8tKKepv9V8vi6bwkbD7YtdTnxeu 1DsfGVKeDm4WY0sU4xxDFkdkH02CGLueYjJaRRfRH3T97BD7YA2vRJUxY 11BTW4hWqZOtrZFLJUrt1eG2bJrLEhUPETJzOZmlayQNKt14lZlxqU2KG I=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 24 Sep 2017 18:43:41 +0000 From: "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO apollo.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:43:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278620; x=1537814620; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QXhAbpnm9Uly5vQNNBMTDelBwnqfx8sK/+dNJ7MMEOc=; b=RfFqGzlmL/84qiQtkKrb3bM1Gh/xw9DWlbsQsp574iwYzAvk8zYyfsa6 7ez0UbYRUCp9ZmHQe8RwWOqEJhmoCfiogJbDaTke4gA/pYF77NPVmT6iS qxPgFn+wQ9bdaXyNty3xhdEYOkO4BgfRJPv66fnDYSLARQqeZkjgTa5cG 8=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by apollo.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:43:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278621; x=1537814621; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=QXhAbpnm9Uly5vQNNBMTDelBwnqfx8sK/+dNJ7MMEOc=; b=vGNQ6FpiJxVT2L9TvUzBD81v/PbvB4JHhYAqogYn5Vy+JoJbYP8Wdv+q mn/NFA5KhY6PX/fGVRrAj9vkxTWhM0ke53GMi6Ma59Q4H7CXX8lh8Zrak 7W+A5gk4ijGCRoOvJYyAIxUkck7MlqWVCtp3Jzf+r41HL2OUaoZphERz0 8=; X-Host: discovery.odc.vzwcorp.com Received: from casac1exh002.uswin.ad.vzwcorp.com ([10.11.218.44]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 24 Sep 2017 18:43:40 +0000 Received: from scwexch19apd.uswin.ad.vzwcorp.com (153.114.130.38) by CASAC1EXH002.uswin.ad.vzwcorp.com (10.11.218.44) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 24 Sep 2017 11:43:39 -0700 Received: from OMZP1LUMXCA18.uswin.ad.vzwcorp.com (144.8.22.196) by scwexch19apd.uswin.ad.vzwcorp.com (153.114.130.38) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:43:38 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA18.uswin.ad.vzwcorp.com (144.8.22.196) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 13:43:31 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sun, 24 Sep 2017 13:43:31 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.9 86/96] arm64: kasan: avoid bad virt_to_pfn() Thread-Topic: [GIT PULL for-4.9 86/96] arm64: kasan: avoid bad virt_to_pfn() Thread-Index: AQHTNWTNlJW/DzMyoUqZ7tdX6qwfrQ== Date: Sun, 24 Sep 2017 18:41:58 +0000 Message-ID: <20170924184130.29445-87-alexander.levin@verizon.com> References: <20170924184130.29445-1-alexander.levin@verizon.com> In-Reply-To: <20170924184130.29445-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Rutland [ Upstream commit b0de0ccc8b9edd8846828e0ecdc35deacdf186b0 ] Booting a v4.11-rc1 kernel with DEBUG_VIRTUAL and KASAN enabled produces the following splat (trimmed for brevity): [ 0.000000] virt_to_phys used for non-linear address: ffff200008080000 (0xffff200008080000) [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/arm64/mm/physaddr.c:14 __virt_to_phys+0x48/0x70 [ 0.000000] PC is at __virt_to_phys+0x48/0x70 [ 0.000000] LR is at __virt_to_phys+0x48/0x70 [ 0.000000] Call trace: [ 0.000000] [] __virt_to_phys+0x48/0x70 [ 0.000000] [] kasan_init+0x1c0/0x498 [ 0.000000] [] setup_arch+0x2fc/0x948 [ 0.000000] [] start_kernel+0xb8/0x570 [ 0.000000] [] __primary_switched+0x6c/0x74 This is because we use virt_to_pfn() on a kernel image address when trying to figure out its nid, so that we can allocate its shadow from the same node. As with other recent changes, this patch uses lm_alias() to solve this. We could instead use NUMA_NO_NODE, as x86 does for all shadow allocations, though we'll likely want the "real" memory shadow to be backed from its corresponding nid anyway, so we may as well be consistent and find the nid for the image shadow. Cc: Catalin Marinas Cc: Will Deacon Acked-by: Laura Abbott Signed-off-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/mm/kasan_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c index 757009daa9ed..ff43da269fe8 100644 --- a/arch/arm64/mm/kasan_init.c +++ b/arch/arm64/mm/kasan_init.c @@ -153,7 +153,7 @@ void __init kasan_init(void) clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END); vmemmap_populate(kimg_shadow_start, kimg_shadow_end, - pfn_to_nid(virt_to_pfn(_text))); + pfn_to_nid(virt_to_pfn(lm_alias(_text)))); /* * vmemmap_populate() has populated the shadow region that covers the