From patchwork Wed Sep 20 04:45:06 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: 113082 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp323529qgf; Tue, 19 Sep 2017 21:58:58 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAPrDmMIs7Do8OEGf5WPsx9oEUp9wifmdYIbBfO0WXsJgAT44w+4e5zuSb8E/7siymYeCao X-Received: by 10.84.141.1 with SMTP id 1mr893605plu.234.1505883538261; Tue, 19 Sep 2017 21:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505883538; cv=none; d=google.com; s=arc-20160816; b=QzCeh+jtw7j953Ev1XM2LEqFdHw4/g9FOyBPYb2qDexBbBzyOFjP+HUy7h38uVDQAr J0TQO4lElFbMQzkvSagy2FOHRzBlF3DjcvSstMWiF8MI9C+Vu2XSjxozi6/hZteXqTcz n4GePnOWm2GNrwMX75Ut2J8TgBfKk5BIYQENoU5HE82Qt3ChDuOUjYHIw0559uO0ee0R mYc1hnbhjl1OSyL0TpU4GPoeUFYZrQImOBknsYbGsAU9EYaz9GHoy/kvKwD4olEo0VRT PKhGWykorccCwoRPrQKb6UIS8uHkmbQ5lRAsTBecByt92x4YePzCASNvEdFHvdDqis8P UTZw== 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:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=NuPHS+nVvSw1Om8LcxzjjOrf5f/ZcXnHfk1Q/7BOdHg=; b=FokxNYf0nzgVELt5EE4YUR3sid9lyrntWguKPoFKZPIkyMkVNvEbmJCoNv+xx+Himf rnjytEIPknuRmCzPymiATniIIFpxQB4CKd9b//2xLdQ+rWbX05YcT/3Ei8/GAs2xU+PN +F+aYKDqsxG5leyLrEC6XcDOv3iVrYONsLWRZuvfxmWphknMpfD0NRYpok79SYJfd/Vo FHAFWPdGICPbu7Kar/LtPkySkler+1h39hymqTHkZMtMpCao4s/qGiLBBSiiARoDIqNG 9nT/GGUYz3hyBgdt6Kd+/51cNC9Lt8WfWMerqFx+xiB+KGb7Ic2NKE7/evzSxDvX2aDg o9/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=YBaoLiCj; dkim=fail header.i=@verizon.com header.s=corp header.b=uzY2oku1; dkim=fail header.i=@verizon.com header.s=corp header.b=uzY2oku1; 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 127si1314129pfe.378.2017.09.19.21.58.58; Tue, 19 Sep 2017 21:58:58 -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=YBaoLiCj; dkim=fail header.i=@verizon.com header.s=corp header.b=uzY2oku1; dkim=fail header.i=@verizon.com header.s=corp header.b=uzY2oku1; 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 S1751619AbdITE64 (ORCPT + 7 others); Wed, 20 Sep 2017 00:58:56 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:52637 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbdITEqA (ORCPT ); Wed, 20 Sep 2017 00:46:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882759; x=1537418759; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=YBaoLiCj9hcrsTdKdma50LIXIu5iWoO1mYYNV9ftvs25qGEbfsxLQQtF mXGkmxdJ1l90SeNGtYbEfUS0rRp/RMx13/WUCfp4Jy7noTXoBOJpsdZnX nz2bMlkFSyPxpX7aeClKxu45kzwGykxS7XbDaiH48/KnW7z+Ip+o39JTL E=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 20 Sep 2017 04:45:49 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Linus Walleij , Mark Brown , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi03.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Sep 2017 04:45:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882718; x=1537418718; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=uzY2oku1CCwPrnL1rAJU02o17UU4VqYDobmQEit92gXjkePQT4UeSzS7 uuJlgy+zOt+dSmIAjJIExij2fCjV3qTsOLJJTphQJJa1sx+19NNJsGGhY kWZIPNEbpLmnQgcGVEQwH2quOq7a8cxj12ziZY5XsFrtDFBfN0tZfkjTa k=; 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; 20 Sep 2017 00:45:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882718; x=1537418718; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=SPvnBhJpVwEVuRcnF3is4dhcjo1LTB3J2IODyX3u8xg=; b=uzY2oku1CCwPrnL1rAJU02o17UU4VqYDobmQEit92gXjkePQT4UeSzS7 uuJlgy+zOt+dSmIAjJIExij2fCjV3qTsOLJJTphQJJa1sx+19NNJsGGhY kWZIPNEbpLmnQgcGVEQwH2quOq7a8cxj12ziZY5XsFrtDFBfN0tZfkjTa k=; 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; 20 Sep 2017 04:45:17 +0000 Received: from scwexch07apd.uswin.ad.vzwcorp.com (153.114.130.26) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Sep 2017 21:45:17 -0700 Received: from OMZP1LUMXCA11.uswin.ad.vzwcorp.com (144.8.22.186) by scwexch07apd.uswin.ad.vzwcorp.com (153.114.130.26) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 19 Sep 2017 21:45:16 -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; Tue, 19 Sep 2017 23:45:15 -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; Tue, 19 Sep 2017 23:45:15 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH review for 4.4 26/47] ASoC: dapm: handle probe deferrals Thread-Topic: [PATCH review for 4.4 26/47] ASoC: dapm: handle probe deferrals Thread-Index: AQHTMcs6gEY95AjyJEW+bo2XjMmWlA== Date: Wed, 20 Sep 2017 04:45:06 +0000 Message-ID: <20170920044445.7392-26-alexander.levin@verizon.com> References: <20170920044445.7392-1-alexander.levin@verizon.com> In-Reply-To: <20170920044445.7392-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 Wed Sep 20 04:45:06 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: 113081 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp323499qgf; Tue, 19 Sep 2017 21:58:56 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDzIuWxC7pBIIyyi4AEoB/2NGCdGw55p1NUUxITnIWgHAq4D4MthH2I3e865b2vCwhcMuWV X-Received: by 10.84.247.131 with SMTP id o3mr879896pll.365.1505883536371; Tue, 19 Sep 2017 21:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505883536; cv=none; d=google.com; s=arc-20160816; b=KncILCEU1hGSb6SdApLpHuitkwo2pjf0S20N3ZQZgWT+2bPoUzLRYPtvz0B8pxeVYB wk+1YDHTPWczaENW5GdAOumfeXcu1A2SkJPSV559/1i8jNTj6aWZVIib5nSjFqyTQCWp Z5wEC3mLQIFOhWbn4ajJ6phZLB0Jwi6cS1/cxCXjF5dyLI8exJv2DGFUOYefybNMDcb9 TCb3kxCdmiLGdKEh51T3jrgySpccmcuPEHZ2w7e0W28XdQ9DCuy4BhKHUowyDCpAgxNm 7fNcJfKaoECgT96T434dGQVmLH1jSiOkgv7pL7Opdw5yraMaJow9hgEG4u0HI6GSbTnb sJFg== 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:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=s0qM7fF7Ld1kB+83wa61A4A6qijfTYbSUGHrH2Q0e+I=; b=0lP9XcrDmdpJqk/nBW71Xl8gY+RwSGdYu0A3Na7KiQaYGftE+YJErKvM2Bfb8rninb eS6eS0wF3rRKyDdTe0A6v3at3FR4zyu6IJ1EnbQEXPkmo09LApv/tygDYCQTj0eeb4LB ucduFIbIr+e/o2hbHaz8s3NCaj1rzMCkP5/TboOyukzSlNMA8E6vfyy6dzLSa0umL4H+ aG5QOTKF90FE0629JEXSbvEFvNSv41k+CMRZBAnQn/RNvMrEZp3KCjcG1rV1gt9TghMB lH7PVlV9RlDqGGKPOTWWujhnESfQsbtbf8EmQtsyeynGe6ZNXg5SSJsoiS86JO18vMfA RIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=VghmM5GD; dkim=fail header.i=@verizon.com header.s=corp header.b=nqziIYVc; dkim=fail header.i=@verizon.com header.s=corp header.b=nqziIYVc; 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 q3si730366pll.696.2017.09.19.21.58.56; Tue, 19 Sep 2017 21:58:56 -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=VghmM5GD; dkim=fail header.i=@verizon.com header.s=corp header.b=nqziIYVc; dkim=fail header.i=@verizon.com header.s=corp header.b=nqziIYVc; 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 S1751828AbdITE6y (ORCPT + 7 others); Wed, 20 Sep 2017 00:58:54 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:63874 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbdITEqA (ORCPT ); Wed, 20 Sep 2017 00:46:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882760; x=1537418760; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=VghmM5GDDhChc97dC1+osNe9nR50hj2pCsx052OFcdE5qEKsLyk9Y3QG vr+Echv9x4FuyiA7siXL14PtNYOSlx1UAsE/KuejftHc5VTv9uL51rtKS +aM8KocyRUPw1EPHwtX+FNSJVPGwI56+TIcwBho731PmFQ274ToPc3Dwj M=; Received: from unknown (HELO fldsmtpi03.verizon.com) ([166.68.71.145]) by omzsmtpe01.verizonbusiness.com with ESMTP; 20 Sep 2017 04:45:49 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Linus Walleij , Mark Brown , "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; 20 Sep 2017 04:45:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882730; x=1537418730; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=nqziIYVcFkQnWeGJch+uuCmBGYLrQuDq16jxi5XrZW6YxXKbtbuXy+JR ljOTNfGSv1k8CyVWkv2XX2y6KL8fH1vJKo/jk+NziToTVBW69G15rmwHA JAAOKA2i7nX0t8QdehA/FeSUT5PNxve72L2cD3y2nX+GaXsJomIlaU6qW Y=; 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; 20 Sep 2017 00:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882730; x=1537418730; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ys/SH9t+UZZg6XH6nC4RpJYN1sWalwh4lHvIM4LaTSQ=; b=nqziIYVcFkQnWeGJch+uuCmBGYLrQuDq16jxi5XrZW6YxXKbtbuXy+JR ljOTNfGSv1k8CyVWkv2XX2y6KL8fH1vJKo/jk+NziToTVBW69G15rmwHA JAAOKA2i7nX0t8QdehA/FeSUT5PNxve72L2cD3y2nX+GaXsJomIlaU6qW Y=; 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; 20 Sep 2017 04:45:29 +0000 Received: from scwexch30apd.uswin.ad.vzwcorp.com (153.114.130.49) by CASAC1EXH003.uswin.ad.vzwcorp.com (10.11.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Sep 2017 21:45:18 -0700 Received: from OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) by scwexch30apd.uswin.ad.vzwcorp.com (153.114.130.49) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 19 Sep 2017 21:45:18 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 19 Sep 2017 23:45:16 -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; Tue, 19 Sep 2017 23:45:17 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH review for 4.4 29/47] ASoC: dapm: fix some pointer error handling Thread-Topic: [PATCH review for 4.4 29/47] ASoC: dapm: fix some pointer error handling Thread-Index: AQHTMcs7aKA7A5jkkEGGB0dINauT+g== Date: Wed, 20 Sep 2017 04:45:06 +0000 Message-ID: <20170920044445.7392-29-alexander.levin@verizon.com> References: <20170920044445.7392-1-alexander.levin@verizon.com> In-Reply-To: <20170920044445.7392-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 Wed Sep 20 04:45:07 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: 113079 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp314130qgf; Tue, 19 Sep 2017 21:45:48 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCIwucbBpE0Rx6FlxsAJG/wn0cckNzpr0F1k3SB8gAWVtaSG3DvckSJ4iEAOqY4dGnOslVg X-Received: by 10.99.100.70 with SMTP id y67mr918831pgb.248.1505882748227; Tue, 19 Sep 2017 21:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505882748; cv=none; d=google.com; s=arc-20160816; b=aM2ib0uqGFlMP7RfDExJOPMG0oYRQCc7pNvdDlh/9wlgg/o6OqBdA5lpMJdCppysJU LgBiEUsUAPzOnNKv2KFsrCYzlos5FcrecOdjZ6oTTTJ9sie2UmC08CmOqEa2iCL/QtHi E9yF68DzN+u/FiBxgp5VN8/WiZqne9Hi1dzYxR8pepHh62xwBQbFvb//GFDFXwJkpNNz vt2p20ZqpyIvjF2V1O5VUJtrDhoQqPISOcZ/ZCEZFCwjIplo3X5ukLGWJEa7uuqV6YxD d6bPcRrwJ6g1gsWLB8HAhqruf3q/mAjZmxAbMSa2rU91th+GA2OUdvHrwUpvaONbcHQ7 4lXQ== 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:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=RLheaW3NL0g4N2nIQMPXYjJ0PiIyPFK5Z0H3Pvm5Ns4=; b=WlI1fkgfOfL9648sKitJyiMWLWXPinnNgQSbqCJyKESKxUydtoUMdivXS5UvUcRty/ oqo95XYuvqXBmS/igmQp/XNg1Zuq67lJ5tU0VBff6lpA7KFtuNUtwpMvXVU3xf5g6ERU Opi0WJj1wHuhGeUnSDO94ZaCWsMRBStOCLAkOcQZE9+vqCbGIC1PIF1Qlgs4G2Wi77qg jwiznOhgXA+iuD8n/B8k8kn171AOfqECcIDkkZTmgidas6YtVmk9OkAR6Ay9CYiQn7/l 7Fu0+P78RkVKrS/WVzutiD2MTsTa5T3GvKo/erAK3hQnW/eUWom3kGbdDx215Xue79Xf vBKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=SKs/JuHG; dkim=fail header.i=@verizon.com header.s=corp header.b=N5i0sZEi; dkim=fail header.i=@verizon.com header.s=corp header.b=sUfTHvE1; 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 j9si2580610pgs.702.2017.09.19.21.45.48; Tue, 19 Sep 2017 21:45:48 -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=SKs/JuHG; dkim=fail header.i=@verizon.com header.s=corp header.b=N5i0sZEi; dkim=fail header.i=@verizon.com header.s=corp header.b=sUfTHvE1; 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 S1751599AbdITEpp (ORCPT + 7 others); Wed, 20 Sep 2017 00:45:45 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:11831 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbdITEp3 (ORCPT ); Wed, 20 Sep 2017 00:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882729; x=1537418729; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=SKs/JuHGI14Csvk3Zj7ECiZZGOBpq9vyMu5F9jIKKunXAdEapcbpYPvM DkBte0J56AUbhvAjQiMmKlkWRIYRt22/u0CGdYoSBzbeGtO2Ib4flA3qk 71X6awKJkj2UU60ATiQAcAGsXmRkc1QotSeBBXVKORYAro+hY87ap3zSs o=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 20 Sep 2017 04:45:26 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Arnd Bergmann , John Crispin , "linux-mips@linux-mips.org" , Ralf Baechle , "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; 20 Sep 2017 04:45:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882721; x=1537418721; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=N5i0sZEiemNvrh3TIy0rGqZYn3bmum3v4vi4e1C9PBRWLuFpnfBKeg3B rTZXFFVuNGghemkNGLllUAkMgjV6SJSXVKLZ2ISof2HIWGeF8+FnvyjZp yYusYbYMbqWsj7qB2E9LIxuqWJVHPi/1zyKu4AaO9uB/11nRbUG8DS2v5 w=; Received: from viking.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.26]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Sep 2017 00:45:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505882720; x=1537418720; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1yontPG1P74X54WmVcMbw2nWm8YKYQddXpV6SIhxGWw=; b=sUfTHvE1OTvQ6hORyXNXFr4j22hO+3J53LOnYxQO+wOiNEthrQ7P8g2E BXb71hfYU7UkMOd4Cko7pJw0nyHOyvLSiZKMHqQBaJL/JTMj3aDlcHbKu 3f7zkdtv2m+JaojhBKG7MKJKkq5PFUBOjWAf2mwSRb+F2sXvynqmhNDmV 8=; 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; 20 Sep 2017 04:45:19 +0000 Received: from scwexch18apd.uswin.ad.vzwcorp.com (153.114.130.37) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 19 Sep 2017 21:45:19 -0700 Received: from OMZP1LUMXCA14.uswin.ad.vzwcorp.com (144.8.22.189) by scwexch18apd.uswin.ad.vzwcorp.com (153.114.130.37) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 19 Sep 2017 21:45:18 -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; Tue, 19 Sep 2017 23:45:17 -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; Tue, 19 Sep 2017 23:45:17 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH review for 4.4 30/47] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Topic: [PATCH review for 4.4 30/47] MIPS: Lantiq: Fix another request_mem_region() return code check Thread-Index: AQHTMcs7JSUhJYXtEkSs2C8QyTbM+g== Date: Wed, 20 Sep 2017 04:45:07 +0000 Message-ID: <20170920044445.7392-30-alexander.levin@verizon.com> References: <20170920044445.7392-1-alexander.levin@verizon.com> In-Reply-To: <20170920044445.7392-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,