Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp893057imu; Mon, 5 Nov 2018 10:19:40 -0800 (PST) X-Google-Smtp-Source: AJdET5dfNie0zkIf1rmWxYJZHUWkF3E2DCiW+ahirpDFzOo8I+g62QP40X+CJNbJiPd2wkTnCOB0 X-Received: by 2002:a17:902:201:: with SMTP id 1-v6mr23203424plc.307.1541441980588; Mon, 05 Nov 2018 10:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541441980; cv=none; d=google.com; s=arc-20160816; b=kjw5P58vjDIgpsiPgHRsowTWQaL6J9oOia62riBfs1MG+ktJELpl3lkUFaulb7tXCu 0CDlQGBSQQZipL2QB0830sC8oV2JHJ1q5R0h+odrADqRm3ETHLAbKpK06tr0mRVLL/u5 YUsQF+21zzHxRE99PFxZG48JoqyS9xf2M7vSZwnnEhmkaspvl/23mZ9bVKx9aS7Uq6Uh +8XqZuo7p4p2/6X1zm3Ive+Lr/YcV6OS8CkTZ/vWWW5qkGzcAdcRQnehgYWJ7k80hyk4 I91G9k2WzUdE5L+zLgOTXJvuAud6lZ6TB7ZFVUw+Y0qWHafNqrH9sYPAz1ciODK8TpmH PWzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=q+JcKSFCOmT4W/BqS3lEbHS4ARZSZvJS/Aovjx6RXVY=; b=uf1OJOr8o2SWGhQCLCxge1q36NznwmzS1H9gasokVBtFH3Kz2c1lt4rLkajXrVTchT RIS8p/NBVe/9EvgN2DwCELjV6xsSXshtIkg1OJcTivFeT87hYBqc80LG8UJis2ev6vTw uG5tWFLaic3xCN5NwX9+gCCMRFe96jJ3ESsW9777uoaSv+QM//tvTVhsp1ZxM/5xA7t9 RilUpYHWJ0BM5aDK+b/6rY+aImYKlHQjyJhnulfqMxkf3Ndk3U8SMMCEi4nQ1vk8Od0T WXpdFEtk+62NgpzAjmRndEfw/TrFgvT0ywMi+lrQSfVw4JCpBFvA4ubE85qVuXsHE13W DElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YIG0pepM; dkim=pass header.i=@codeaurora.org header.s=default header.b=fcQkNgWQ; 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 p64-v6si5982411pfg.45.2018.11.05.10.19.24; Mon, 05 Nov 2018 10:19:40 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=YIG0pepM; dkim=pass header.i=@codeaurora.org header.s=default header.b=fcQkNgWQ; 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 S2387760AbeKFDjX (ORCPT + 99 others); Mon, 5 Nov 2018 22:39:23 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38582 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387561AbeKFDjX (ORCPT ); Mon, 5 Nov 2018 22:39:23 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E207B60247; Mon, 5 Nov 2018 18:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541441905; bh=fud8+z0XNdizFTvZ6fQNf7xg0CMZ48kNSbr0s+zbujw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YIG0pepMNAgbLEAtq6c1iRF+GKnDAJr/0g1PsNtshGFSqD2con9nxokFYzDxaU7BR w874+JdEXZXdPoKognw3D/TEKGq9QpCgl1lJ21mYvsw5UuIiFIT4uTcV0W1NvB+xkd t208G55BMX6rc48xyHEUBDYIo5FWoCWSWg8Fw7X0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.100.6] (unknown [183.83.160.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8BE1D61307; Mon, 5 Nov 2018 18:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541441712; bh=fud8+z0XNdizFTvZ6fQNf7xg0CMZ48kNSbr0s+zbujw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=fcQkNgWQGt73gAJJoXUdfbFFH3Bgl1hhmP3aQJe+CXG4CA9D0upl/9/cnZQh/53NG MrToP361b7QAA/xiau6xkf7HcYHDckSvDBJDFTaIcfXP789bxYeZHvPsocX+xsZEMP ezanGmwyLUZHmqukYQKPA5XgDZicu0HrJd0q6RGc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8BE1D61307 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org Subject: Re: [alsa-devel] [PATCH] ASoC: core: Invoke pcm_new() for all DAI-link To: Arnaud Pouliquen , Takashi Iwai , olivier.moysan@st.com Cc: rohkumar@qti.qualcomm.com, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, linux-kernel@vger.kernel.org, plai@codeaurora.org, tiwai@suse.com, lgirdwood@gmail.com, broonie@kernel.org, srinivas.kandagatla@linaro.org References: <1541075929-29323-1-git-send-email-rohitkr@codeaurora.org> <48c78f67-8178-2d07-e35d-2e4eca51ccbc@codeaurora.org> <791d4587-4db3-3ffa-331a-f79d0993ca8c@st.com> From: Rohit Kumar Message-ID: <3616f01f-6a00-6eb1-0bdd-f161b7ce15e6@codeaurora.org> Date: Mon, 5 Nov 2018 23:44:44 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <791d4587-4db3-3ffa-331a-f79d0993ca8c@st.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > Regards > Arnaud > >> Thanks, >> Rohit >>> thanks, >>> >>> Takashi Thanks, Rohit -- Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.