Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2009225imu; Tue, 6 Nov 2018 07:44:13 -0800 (PST) X-Google-Smtp-Source: AJdET5dkjPfvU2DGQUP6L0J8nfh84rD2vPLNop8CfwijIENqeplVSiKqjDa+q77dogEa1NLOu1Tk X-Received: by 2002:a63:62c3:: with SMTP id w186mr24498299pgb.345.1541519053203; Tue, 06 Nov 2018 07:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541519053; cv=none; d=google.com; s=arc-20160816; b=XoIoSQE22yqvW8iv+09RWVlZckEQntjUdfiYaSJG2Q+9bd+R57vJV7n6lSTFvW5jIO BfpDOfLRcF6+iY2tUkZwjCoOgXxd3PXK68GKvMKtfCRso51iUO1fGjj6EmM+O5r3PIrK 0cBPakaqUWA+dm8VStN6ap49Kieu40fBW6jjjOxvElFxEbM82z/xyqb+DN6CA4u2bUpW 6gW9p9sGSL7/AocMpNRei4G18eunSLMyPVfqeX6mEc6yWV8pVYjuDJFCkcDvMTMvdsKs wLqfj7jxg+2S/3qMyepoAUcrmI6Jrm3H2A+6r0jf/mX9mdjHsVZYoY8ruzLMJjqGfAws mViQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=J1j3E/E3cfPokBvUgdlvpKORxAm8/ghYbGLghM1ud/0=; b=XEEt4KQ3wfh2C00QhYAHjRvnbNrsQ8LoL4DCXNIJ7K85he8K5qnmiDp9oa8zb4F9hp BjLmXuYFqRbIwLQ5ZUKEE5oP16NyG53vj0sRNfmBpOY0bLt0tVlYB+Qtu4dKSEtJy0Nm 0TP/ZxOMZQk7TvaeOK3pGxgYdRkNs38bM5D9lKVoimiNG8K6cSEZEiXktfFVEb5Jj854 /q/fkxcQA0Jd3v3nipdrj4JQRnQHGsih7ngYndEj87rJpFsWkg190cxkSYIbgDnwscqU y208Xk1dKepM5ybAo42oqKyw+MP842LQrqRmsEfqbQWZm1PgZZC1EZqSRAcB/QDPIsBZ Du2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g86-v6si57785721pfa.285.2018.11.06.07.43.49; Tue, 06 Nov 2018 07:44:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389176AbeKGBHb (ORCPT + 99 others); Tue, 6 Nov 2018 20:07:31 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:26296 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389138AbeKGBHb (ORCPT ); Tue, 6 Nov 2018 20:07:31 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wA6FcZj8015673; Tue, 6 Nov 2018 16:41:26 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nh211ga2q-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 06 Nov 2018 16:41:26 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 442CB34; Tue, 6 Nov 2018 15:41:25 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E0360589D; Tue, 6 Nov 2018 15:41:24 +0000 (GMT) Received: from [10.201.23.162] (10.75.127.45) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 6 Nov 2018 16:41:24 +0100 Subject: Re: [alsa-devel] [PATCH] ASoC: core: Invoke pcm_new() for all DAI-link To: Rohit Kumar , Takashi Iwai , CC: , , , , , , , , References: <1541075929-29323-1-git-send-email-rohitkr@codeaurora.org> <48c78f67-8178-2d07-e35d-2e4eca51ccbc@codeaurora.org> <791d4587-4db3-3ffa-331a-f79d0993ca8c@st.com> <3616f01f-6a00-6eb1-0bdd-f161b7ce15e6@codeaurora.org> From: Arnaud Pouliquen Openpgp: preference=signencrypt Autocrypt: addr=arnaud.pouliquen@st.com; prefer-encrypt=mutual; keydata= xsFNBFZu+HIBEAC/bt4pnj18oKkUw40q1IXSPeDFOuuznWgFbjFS6Mrb8axwtnxeYicv0WAL rWhlhQ6W2TfKDJtkDygkfaZw7Nlsj57zXrzjVXuy4Vkezxtg7kvSLYItQAE8YFSOrBTL58Yd d5cAFz/9WbWGRf0o9MxFavvGQ9zkfHVd+Ytw6dJNP4DUys9260BoxKZZMaevxobh5Hnram6M gVBYGMuJf5tmkXD/FhxjWEZ5q8pCfqZTlN9IZn7S8d0tyFL7+nkeYldA2DdVplfXXieEEURQ aBjcZ7ZTrzu1X/1RrH1tIQE7dclxk5pr2xY8osNePmxSoi+4DJzpZeQ32U4wAyZ8Hs0i50rS VxZuT2xW7tlNcw147w+kR9+xugXrECo0v1uX7/ysgFnZ/YasN8E+osM2sfa7OYUloVX5KeUK yT58KAVkjUfo0OdtSmGkEkILWQLACFEFVJPz7/I8PisoqzLS4Jb8aXbrwgIg7d4NDgW2FddV X9jd1odJK5N68SZqRF+I8ndttRGK0o7NZHH4hxJg9jvyEELdgQAmjR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1qXSjmq3ZrD3SSZVa+LhYfijFYuEgKjs4s+Dvk/xVL0JYWbKkpGWRz5M82 Pj7co6u8pTEReGBYSVUBHx7GF1e3L/IMZZMquggEsixD8CYMOzahCEZ7UUwD5LKxRfmBWBgK 36tfTyducLyZtGB3mbJYfWeI7aiFgYsd5ehov6OIBlOz5iOshd97+wbbmziYEp6jWMIMX+Em zqSvS5ETZydayO5JBbw7fFBd1nGVYk1WL6Ll72g+iEnqgIckMtxey1TgfT7GhPkR7hl54ZAe 8mOik8I/F6EW8XyQAA2P Message-ID: <4f22e4e5-84f0-1560-1ba7-5e77d44fd312@st.com> Date: Tue, 6 Nov 2018 16:41:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <3616f01f-6a00-6eb1-0bdd-f161b7ce15e6@codeaurora.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG3NODE3.st.com (10.75.127.9) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-06_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Rohit On 11/5/18 7:14 PM, Rohit Kumar wrote: > Hello Arnaud, > > > On 11/5/2018 4:43 PM, Arnaud Pouliquen wrote: >> Hello Rohit, >> >> On 11/2/18 1:06 PM, Rohit Kumar wrote: >>> On 11/2/2018 1:12 PM, Takashi Iwai wrote: >>>> On Thu, 01 Nov 2018 13:38:49 +0100, >>>> Rohit kumar wrote: >>>>> Remove no_pcm check to invoke pcm_new() for backend dai-links >>>>> too. This fixes crash in hdmi codec driver during hdmi_codec_startup() >>>>> while accessing chmap_info struct. chmap_info struct memory is >>>>> allocated in pcm_new() of hdmi codec driver which is not invoked >>>>> in case of DPCM when hdmi codec driver is part of backend dai-link. >>>>> >>>>> Below is the crash stack: >>>>> >>>>> [   61.635493] Unable to handle kernel NULL pointer dereference at >>>>> virtual address 00000018 >>>>> .. >>>>> [   61.666696]   CM = 0, WnR = 1 >>>>> [   61.669778] user pgtable: 4k pages, 39-bit VAs, pgd = >>>>> ffffffc0d6633000 >>>>> [   61.676526] [0000000000000018] *pgd=0000000153fc8003, >>>>> *pud=0000000153fc8003, *pmd=0000000000000000 >>>>> [   61.685793] Internal error: Oops: 96000046 [#1] PREEMPT SMP >>>>> [   61.722955] CPU: 7 PID: 2238 Comm: aplay Not tainted 4.14.72 #21 >>>>> .. >>>>> [   61.740269] PC is at hdmi_codec_startup+0x124/0x164 >>>>> [   61.745308] LR is at hdmi_codec_startup+0xe4/0x164 >>>>> >>>>> Signed-off-by: Rohit kumar >>>> Did you check whether all drivers have no side-effect by this change? >>>> The hdmi-codec isn't the only driver that has pcm_new ops, so we have >>>> to make sure that such a fundamental change wouldn't bring any >>>> regressions. >>>> >>> Below are the drivers calling pcm_new() other than hdmi codec driver. >>> sound/soc/meson/axg-frddr.c >>> sound/soc/meson/axg-toddr.c >>> These two drivers are frontend DAI drivers and should not be impacted >>> because of this. >>> >>> Other than this, pcm_new() is called from sound/soc/stm/stm32_sai_sub.c >>> I could not get much info about this driver. However, it is just adding >>> kcontrols in pcm_new() which uses internal private structs in >>> get()/put(). >>> Olivier Moysan can too confirm on this. >> First, i'm answering  for Olivier: no regression identified for the SAI >> driver, it is not a DPCM driver. >> >> Then i have a concern about the call of pcm_new for a no-PCM backend. >> Does it make sense? In DPCM concept, the backend is not linked to the >> PCM device... >> >> Instead, I would suggest that you add protection in HDMI_codec on >> chmap_info pointer. >> >> The drawback would be that the control is no more available...do you >> need it? > I don't need chmap_info, but ELD kcontrol is also defined in pcm_new() > which > we need. We should probably update the driver to make it compatible with > DPCM. Any suggestions? I would say force device to 0 if no_pcm (need probably to create the control in hdmi_of_xlate_dai_id instead of hdmi_codec_pcm_new). But keep in mind that solution has to work in case of multi HDMI codec instances, perhaps using prefix... Anyway, i'm not a DPCM expert so perhaps more elegant solutions exist. Regards Arnaud >> Regards >> Arnaud >> >>> Thanks, >>> Rohit >>>> thanks, >>>> >>>> Takashi > Thanks, > Rohit >