From patchwork Sun Sep 24 18:42:25 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: 114141 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1807295qgf; Sun, 24 Sep 2017 11:45:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAC8l1EZijqbke6s3gw9O5Xla3rQ8+tUcbJY2d2hur/aU/T/pmTcWJBJEc0DQMP1a5TwCO9 X-Received: by 10.98.209.5 with SMTP id z5mr5381740pfg.241.1506278710464; Sun, 24 Sep 2017 11:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278710; cv=none; d=google.com; s=arc-20160816; b=VfGseRbickzRZBslKTpWhFkp8YM/2H9ja/2C20K9gdIWqbd3monlx8M4mvlb3fLepn jo82LS40vOpR/ZyMvOuMyAPb3WtNd2aiGqjQkKcF/YbRC/HktIh5leA3yc0Ti/BcKjRp 8pjGtQvtx32Bu5m6N7h/7v8FGJZNoWKqaMZ14vF2O2DuUzhDpzsOnqso+8bh7aVe2MnG 2GnpjuVpMtQ+mRKo02pRatyl1XWRi6oa+wgC9C7mrv4t1U/MmDxSC0NFhlJWJmCaOoGb tzwNz88k6uNnlCzJ/LYJcu+mNuOWPNLnpT2WbN1lUIHjNlRFZwl3Y/PaGzY1OpgBCbdF YACQ== 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=NuPHS+nVvSw1Om8LcxzjjOrf5f/ZcXnHfk1Q/7BOdHg=; b=02qN2c3aUmlz89GYQw26KSH+IOjgI9ytoTPw1tHMMS8Eti4jKt2HCGXXOja4fGtHl2 ixK14Fvbuny3QmCW9OaoIEPK9KgoMwKKJW687u0fypDD1TnFbUo4lyDXH2qkhMTsEGpo +zTsEUeRRbdzJy0gWyRa6WFlhW+RY/3flTpMpT6iMqDCUWEj06JDCKJw+egc9ODW6cnS YrvqeBirhu1lFT2trHn9BeOMvaOZDSY0FQBbs6PnhLGipH8wmU49+B4LsifURHAxnnaQ b3V18jwgkzet36CW/1z2QerGbFdML8ZDM6bBylgSKUb0rHuH4aN1Ss06ChocJ01FgbHQ uE6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=MoqbQhd9; dkim=fail header.i=@verizon.com header.s=corp header.b=EWz8O/Oq; dkim=fail header.i=@verizon.com header.s=corp header.b=EWz8O/Oq; 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.45.10; Sun, 24 Sep 2017 11:45:10 -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=MoqbQhd9; dkim=fail header.i=@verizon.com header.s=corp header.b=EWz8O/Oq; dkim=fail header.i=@verizon.com header.s=corp header.b=EWz8O/Oq; 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 S1752997AbdIXSpJ (ORCPT + 8 others); Sun, 24 Sep 2017 14:45:09 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:31995 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753004AbdIXSpG (ORCPT ); Sun, 24 Sep 2017 14:45:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278706; x=1537814706; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=MoqbQhd9Ed7lC3lUI3Gtx8uRtBzi1EWJnlhe3Z0SUJxvoH10DlwNBeBA YhLOwoVgu6SpYo9yguPpw/PkpadIxmUEkvHySkpG18JjhgrkRsBTjKm9X fbWwYT/PVZ2+t85f9SAuiiI3wPZCk6JKaXedy2jJ+J81hKUltFxclb36x E=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by omzsmtpe02.verizonbusiness.com with ESMTP; 24 Sep 2017 18:45:04 +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 fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:44:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278697; x=1537814697; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=EWz8O/Oq2sAm1P4BGZUCgqHcnrTcxxoiNDueNThUKPqHZdd2qiEySf4g rju+bXifKSfh2aFB+STV41hVP+JJOzEILJCZCNAMEf8m4xkUldBA0JM/G +dUg7dt92OwO4Q4Yuly4BdjAFE/59o7LGxM2hvJGJ8IB0u6AKRb/dmY9Z s=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:44:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278697; x=1537814697; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=EWz8O/Oq2sAm1P4BGZUCgqHcnrTcxxoiNDueNThUKPqHZdd2qiEySf4g rju+bXifKSfh2aFB+STV41hVP+JJOzEILJCZCNAMEf8m4xkUldBA0JM/G +dUg7dt92OwO4Q4Yuly4BdjAFE/59o7LGxM2hvJGJ8IB0u6AKRb/dmY9Z s=; X-Host: discovery.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:44:56 +0000 Received: from scwexch05apd.uswin.ad.vzwcorp.com (153.114.130.24) 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:44:55 -0700 Received: from OMZP1LUMXCA18.uswin.ad.vzwcorp.com (144.8.22.196) 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:44:54 -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:44:53 -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:44:53 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.4 25/46] ASoC: dapm: handle probe deferrals Thread-Topic: [GIT PULL for-4.4 25/46] ASoC: dapm: handle probe deferrals Thread-Index: AQHTNWTd2bFZhbJlV0+gvbEc7f7sUA== Date: Sun, 24 Sep 2017 18:42:25 +0000 Message-ID: <20170924184213.29599-26-alexander.levin@verizon.com> References: <20170924184213.29599-1-alexander.levin@verizon.com> In-Reply-To: <20170924184213.29599-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 b8a256dfed7e..df036afb2197 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; @@ -3278,11 +3286,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; } @@ -3304,6 +3323,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; @@ -3322,6 +3343,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; @@ -3435,6 +3458,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", @@ -3701,6 +3734,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 70396d3f6472..e3f34a86413c 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1481,6 +1481,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:42:25 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: 114143 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1807434qgf; Sun, 24 Sep 2017 11:45:24 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAfLJuMMZ21cKwAaRzEWDf525GANF/FJDaqoUFVeu1MbilU4mSEmnvzydvCTlHI5ucIauZF X-Received: by 10.99.109.68 with SMTP id i65mr5463678pgc.335.1506278724532; Sun, 24 Sep 2017 11:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278724; cv=none; d=google.com; s=arc-20160816; b=tgNdvLTKlpjqlSWMG95hm1DSa/7X7vQ+D4eH5WsVtS9Em/0RbVI73FscIN6pp3X7vh OoK3HCarN0fP5zWJUTKgA/s2SzqNpzPTR2lBNs4GuOD/ZV/KV2SXV5S5ELDiE4CrVS9k +aLxpecjtkOhd9t7IPxsS6QOTC37Qkve3t23U5mWM9Ur8zHq4N85wWK8T1DPvWQWOJV4 D8E2F798uH6WwQSqapV89dtalX2dNwejyFWywJgWXlvQAEkMNZoQhsoUTH7n33PpBZD1 k86WNPKPfVUwb3+sh/J8Npuq4HOMJIh1bGt5OsVw5vXUOjjpIjYcRrVjoU0uL5E0NVbe V4/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 :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=s0qM7fF7Ld1kB+83wa61A4A6qijfTYbSUGHrH2Q0e+I=; b=C1alfzUoM2+y+S/Y0z8ohLIHpZwRrghMlUaPbK7IKqoaX0YVhZ15xuxQkVIVFDWpBt Ka6cfLnvtLqQmnOXItWQwmpkOAxr2o/Ojq3yQrV7pnFcECNmfIskLaZ8WDdWLdxlS12y Uem6Qaz7/4J3/IUvZrlzocQKmz7QQIeR9PhcSRRg6E186sr6oguVHcpt3iC1I702MvlL yaavtZHpYt+lgenVOia4wayif+tbP3vlHbbi3ZyB5cCouKX3X0ecQg52FtGg8CmoHXo+ x67LqrfEKauxXVkdHE6ooQg8L8EG9nKSV41BsUcPrC8ln4cmqKcS+BIrHcYx/3/86l5J ZOvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=jLwObZv9; dkim=fail header.i=@verizon.com header.s=corp header.b=mulr3Csz; dkim=fail header.i=@verizon.com header.s=corp header.b=DKyvzYzS; 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.45.24; Sun, 24 Sep 2017 11:45:24 -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=jLwObZv9; dkim=fail header.i=@verizon.com header.s=corp header.b=mulr3Csz; dkim=fail header.i=@verizon.com header.s=corp header.b=DKyvzYzS; 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 S1753050AbdIXSpX (ORCPT + 8 others); Sun, 24 Sep 2017 14:45:23 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:35807 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753036AbdIXSpM (ORCPT ); Sun, 24 Sep 2017 14:45:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278711; x=1537814711; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=jLwObZv9UOVxshQqbqsj0WY1bhyOTI2OiEzX8u9muI9HBFfKeCvZFdb9 pNK6n48sh5C6oN7zOlPmR/3L2I4XDK0El3erZxl5tbnd4t2SGqPhw7exY f8p8ks+QnZXsKxYUSi72QII3KE/qBPwYAPCIpp/S9Hk9fm9hlY4jCfo7x Q=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 24 Sep 2017 18:45:10 +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:45:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278709; x=1537814709; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=mulr3Csz8GFscUqwfQthkW/2YQlQ07W7aqHxd+gjzhAjSj+DmcuRly3R XDNIpVnRawR8cjxSiEKfkcowHXMsG7CqdxBCr0djyaC38cMXhXXNOMfjr d/8TuAbbLwt4t6ncnOwkZ+y/P8x7h4Uotnf9EikATHv+cuWYpGMzhck6V 0=; 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:45:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278710; x=1537814710; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=DKyvzYzSpptzrnXhoxugdhzxYft9/kRHwV3/k+nRkDiDib0dMASTQBGT iLbsHzIWXFKtUxDCzXRJZUF9VFktBJCQZagZgEznjYqLjBT2cqGWL5Izj gswAzEiwE5CUsGChszUvLr+GE5Our+5P5TCuF3gcYqdBQHAaZPQXJ09Vq Q=; X-Host: discovery.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:45:10 +0000 Received: from scwexch26apd.uswin.ad.vzwcorp.com (153.114.130.45) 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:45:09 -0700 Received: from OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) by scwexch26apd.uswin.ad.vzwcorp.com (153.114.130.45) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:45:08 -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:44:55 -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:44:55 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.4 28/46] ASoC: dapm: fix some pointer error handling Thread-Topic: [GIT PULL for-4.4 28/46] ASoC: dapm: fix some pointer error handling Thread-Index: AQHTNWTdoQLwQ4a9l0WlUwxovgLSeQ== Date: Sun, 24 Sep 2017 18:42:25 +0000 Message-ID: <20170924184213.29599-29-alexander.levin@verizon.com> References: <20170924184213.29599-1-alexander.levin@verizon.com> In-Reply-To: <20170924184213.29599-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 df036afb2197..6a438a361592 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3794,6 +3794,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); @@ -3813,6 +3823,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:42:26 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: 114142 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1807324qgf; Sun, 24 Sep 2017 11:45:13 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCdxPLbsLKcBZzhchrspuw1/y1Pru/WrJo8RILKlzRMYx27xoLGRvg3rAXezSrG6PtnmaNm X-Received: by 10.99.117.81 with SMTP id f17mr5273721pgn.181.1506278713790; Sun, 24 Sep 2017 11:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506278713; cv=none; d=google.com; s=arc-20160816; b=u2ObsRkyusleedzLrjjQiXm5+XiaNaOR5ByJ6HQjGdz2pDXR8hZdO+qRuIx5O4kfmd btYCf4LzZlvB6KbM8LAOCJH/IaUN+IBgRvCGQ5r825JA+aqhZI6pD/VIoXOQJPwn9DT1 hPLhExMOORyZ5jG7NhMX5kDQyYNOdCKphNWlhoIDiDdjxDcb0BLvXTaZSbdHGrA+3cq8 MTHfsP1SKO2Wag591L3rvxsAlXf3a+TCLULnKRRo934Z9RfrEok+C13CFUH9dhCSDT6h 5jNOw51Eh3bSN/7m/WY74OFfDP2W48VjIF5ZLpwGrhm3jGYhmNXhjWm0+c2GPUDmv7DK 3Tdg== 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=RLheaW3NL0g4N2nIQMPXYjJ0PiIyPFK5Z0H3Pvm5Ns4=; b=Kkem8OqwXXekAeLx/g+/VxZx1qtBz03ARjqtR6rZZdHKUuc1fCoB/xOVpLTFtAH3uP UcisI1JBpO5cxVxwdr6ZZx+oLix8bzpR36QpvFeQqb6ctyKfnSb65VrG/x6VvOwf2H+I wqx/VR5wxVjnenwNt44h+cynbgoKYlx4irCc4aINj+IUbam76b3Plu7riayPjGB5QFap BPBn48ktDv0THpHstAK3C2YOzXZqJF9BmGm8L5luEuyJZ8ZJ9M7aL9a3StqobUcwEhgr /sGcdsV3GXvtrxbSVknIaLJlm4aI3G8nOCkkV4Llw1XvtsSKtRm/Pipa8845bgJRm+Lr 3OkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=Ba9yK8IC; dkim=fail header.i=@verizon.com header.s=corp header.b=uOZKZVbO; dkim=fail header.i=@verizon.com header.s=corp header.b=uOZKZVbO; 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.45.13; Sun, 24 Sep 2017 11:45:13 -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=Ba9yK8IC; dkim=fail header.i=@verizon.com header.s=corp header.b=uOZKZVbO; dkim=fail header.i=@verizon.com header.s=corp header.b=uOZKZVbO; 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 S1753038AbdIXSpL (ORCPT + 8 others); Sun, 24 Sep 2017 14:45:11 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:26008 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbdIXSpH (ORCPT ); Sun, 24 Sep 2017 14:45:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278707; x=1537814707; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=Ba9yK8ICz1zWVkO1Ihg6tspfxAi5HEDZskD31Cz8HH/gHJI7jJ2RhG4H tslpH8lb6Ive1QTKP+TgzZPc7LDNV1UllfZ+lUogXW6JLTtIMJNPveuax rAXm4BHP9ArXpoo1QuF1abaxyUNEy38XatDOHGRgxrtW7k38+QjcXQZK5 g=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by omzsmtpe02.verizonbusiness.com with ESMTP; 24 Sep 2017 18:45:05 +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 fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 18:44:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278699; x=1537814699; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=uOZKZVbOZDhOmt6j7mtqhAU+OTyqnjG1iwbsm1e+u/DWqV7t5MYFC/6p YAcTxKRr4E0VzFkF1C5eRgys9YwgKG+VNtx+creauCwBIl3UutxlH1Sp4 wuYV0vZqQewbYDaki6I6jQ+SDUrr8gjKYsvjwJKnfArxrtehG0g+Uhm39 4=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2017 14:44:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506278699; x=1537814699; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=uOZKZVbOZDhOmt6j7mtqhAU+OTyqnjG1iwbsm1e+u/DWqV7t5MYFC/6p YAcTxKRr4E0VzFkF1C5eRgys9YwgKG+VNtx+creauCwBIl3UutxlH1Sp4 wuYV0vZqQewbYDaki6I6jQ+SDUrr8gjKYsvjwJKnfArxrtehG0g+Uhm39 4=; 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:44:58 +0000 Received: from scwexch02apd.uswin.ad.vzwcorp.com (153.114.130.21) 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:44:58 -0700 Received: from OMZP1LUMXCA12.uswin.ad.vzwcorp.com (144.8.22.187) by scwexch02apd.uswin.ad.vzwcorp.com (153.114.130.21) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sun, 24 Sep 2017 11:44:57 -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:44:56 -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:44:56 -0500 To: "gregkh@linuxfoundation.org" CC: "stable@vger.kernel.org" Subject: [GIT PULL for-4.4 29/46] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Topic: [GIT PULL for-4.4 29/46] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Index: AQHTNWTe1gIEcw9ZhEOO2PF308Uh4Q== Date: Sun, 24 Sep 2017 18:42:26 +0000 Message-ID: <20170924184213.29599-30-alexander.levin@verizon.com> References: <20170924184213.29599-1-alexander.levin@verizon.com> In-Reply-To: <20170924184213.29599-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 daf580ce5ca2..2528181232fd 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,