From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943901AbcJSSM5 (ORCPT ); Wed, 19 Oct 2016 14:12:57 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35425 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753924AbcJSSM4 (ORCPT ); Wed, 19 Oct 2016 14:12:56 -0400 Date: Wed, 19 Oct 2016 21:12:05 +0300 From: Krzysztof Kozlowski To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela , alsa-devel@alsa-project.org, Sangbeom Kim , Liam Girdwood , Mark Brown , Takashi Iwai , Sylwester Nawrocki , Krzysztof Kozlowski Subject: Re: [RFC PATCH 2/2] ASoC: samsung: Print a one-time message if the snow driver's probe defers Message-ID: <20161019181205.GA10034@kozik-lap> References: <1476897666-13974-1-git-send-email-javier@osg.samsung.com> <1476897666-13974-3-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1476897666-13974-3-git-send-email-javier@osg.samsung.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 19, 2016 at 02:21:06PM -0300, Javier Martinez Canillas wrote: > If the snd_soc_register_card() fails due a missing resource and the probe > has to be deferred, the driver prints an error message. > > But since many probe retries can happen before a resource is available, > the printed messages can spam the kernel log buffer and slow the boot. > > The information is useful to know that a dependency was not meet and a > defer happened, but isn't necessary to print it on each probe deferral. > > Signed-off-by: Javier Martinez Canillas > > --- > > sound/soc/samsung/snow.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c > index d8ac907bbb0d..068bfb78a668 100644 > --- a/sound/soc/samsung/snow.c > +++ b/sound/soc/samsung/snow.c > @@ -103,7 +103,13 @@ static int snow_probe(struct platform_device *pdev) > > ret = devm_snd_soc_register_card(&pdev->dev, card); > if (ret) { > - dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); > + if (ret == -EPROBE_DEFER) > + dev_err_once(&pdev->dev, > + "snd_soc_register_card deferred (%d)\n", > + ret); dev_warn_once? I understand you didn't want to change the logic behind this but this is not really an error condition. Probe deferral happens and one should not be worried seeing it once in 'dmesg -l err'. Another point is now we would miss different error condition - infinite (or very long) probe deferral. I am not sure how useful it might be but theoretically seeing many deferrals is a sign of something to fix. Best regards, Krzysztof