From patchwork Thu Mar 18 15:11:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 12148409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43775C433DB for ; Thu, 18 Mar 2021 15:15:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E209164F2B for ; Thu, 18 Mar 2021 15:15:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E209164F2B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CDFCA169C; Thu, 18 Mar 2021 16:14:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDFCA169C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1616080511; bh=JU26kSYAxWeB3dUE7oyxXRbBG8oGWy45s1h2h6cM8+Q=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j6bvceDGQ6bCn88AjJ5qbXamyzCkvzOQMMSyYAYFv6FDn+bBo+taKz0a60k6TkK38 4hfuiXVikutR3bPjqq9/A7EAanKSn85mPNQgCOgENK4cI14sGBVqQhb2c2qW/ciEcx +T4D4to0wTjFOnaKbHPlmfAPWTw+jD8pT99iHPJc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6E5F3F80163; Thu, 18 Mar 2021 16:13:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F36F0F80163; Thu, 18 Mar 2021 16:13:33 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7D72EF80163 for ; Thu, 18 Mar 2021 16:13:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7D72EF80163 IronPort-SDR: EdIVBrCYaLKRvFpDrxkhY+TKw/K3B9C532eHOzDBcHcZD4tWN8RL5EirEwkukxPJCu9fW5w+41 rtTw68gXCvNw== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="209702407" X-IronPort-AV: E=Sophos;i="5.81,258,1610438400"; d="scan'208";a="209702407" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 08:13:21 -0700 IronPort-SDR: llGvNA/9szs4dA/FLzFYFmOXqkoYLJ2KIIC2LAHfyp5ZkNW5fzfp6XByJgdfiPR7WQP2PYIUVg 3/E4D/Cie9gg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,258,1610438400"; d="scan'208";a="606207196" Received: from pi-desktop.igk.intel.com ([10.237.148.102]) by fmsmga005.fm.intel.com with ESMTP; 18 Mar 2021 08:13:19 -0700 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Takashi Iwai Subject: [PATCH 1/3] ALSA: pcm: Add debug print on memory allocation failure Date: Thu, 18 Mar 2021 16:11:20 +0100 Message-Id: <20210318151122.2493096-2-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210318151122.2493096-1-amadeuszx.slawinski@linux.intel.com> References: <20210318151122.2493096-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , alsa-devel@alsa-project.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add debug prints after calls of do_alloc_pages. One simplification would be to move print into do_alloc_pages, however it would cause spam in logs, as preallocate_pcm_pages loops over do_alloc_pages trying lower values in case of failures. Signed-off-by: Amadeusz Sławiński --- sound/core/pcm_memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 289dd1fd8fe7..2878c4c23583 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -176,6 +176,10 @@ static void snd_pcm_lib_preallocate_proc_write(struct snd_info_entry *entry, substream->dma_buffer.dev.dev, size, &new_dmab) < 0) { buffer->error = -ENOMEM; + pr_debug("ALSA pcmC%dD%d%c,%d:%s: cannot preallocate for size %zu\n", + substream->pcm->card->number, substream->pcm->device, + substream->stream ? 'c' : 'p', substream->number, + substream->pcm->name, size); return; } substream->buffer_bytes_max = size; @@ -400,6 +404,10 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) substream->dma_buffer.dev.dev, size, dmab) < 0) { kfree(dmab); + pr_debug("ALSA pcmC%dD%d%c,%d:%s: cannot preallocate for size %zu\n", + substream->pcm->card->number, substream->pcm->device, + substream->stream ? 'c' : 'p', substream->number, + substream->pcm->name, size); return -ENOMEM; } }