From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BC23368952 for ; Fri, 27 Mar 2026 03:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774581446; cv=none; b=cSKoqlzpb7hIdmQVKyurU5sP2rjRCJojB7yzNFx/9rcRUqheo7FCb+78qdRZGL8wGmft4BadERu3Ab/Xxtg8i5l71+va/19PqeuRM7XxzXuegTF17oNGL4C52RiFs0iVV1fjREK8UOsoXB1wB4+hYmuAy3JwSriqCFRqDyZl4CU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774581446; c=relaxed/simple; bh=js/iV+JQYJfOWCqwLXObYEO4q+j9k6QcS/1h0yga8XA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=i+jZPTtq022jitfShLHbghj42JajuCxWy/AooqNXFyPF+sdK41t4TG95DL320voU0cZd2l66XQjnoghjiUW9jNxmwVFIQT72EWw2+leugZSTwjpyE9PrpEzoOxdP3Y5r9knSTfoFL/KHwdnaWuJ9x5rYFbEVOyX6EJRAnuxUxLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jg70meUi; arc=none smtp.client-ip=74.125.82.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jg70meUi" Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-2c175635a33so1088373eec.0 for ; Thu, 26 Mar 2026 20:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774581443; x=1775186243; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Tr4fog4gmIs86XZzl/XYBaiJRPRO3+BQhmPV4D4emLw=; b=jg70meUiKZUe8kbUuBHFXYjKlea2Ila1RfjDnh9t2q6ZpHxvFDBpr5uNlVcSvA9S9I pfpT0yi9/gQ7HK8cXatRaxhTXSJSMO3FjOfpf7uF6crszqDEkz1ncDAt4cg/hN4n10IC 525CFZaBWyUzyV9HQcJi4mmYE8/UrGqtrJT0qcu4RLaaRRdtVHniC27MMcHSgqfRq7ls VG5ZOHxaxLYO3LXOQDTZYYWDN8RV/b8itkoSnOSlKrDqbyK2u3elXjKZ58nQzgeW7y+Q KU7FgToWSnw4dMGsEWEsHlJDQJDefeyiSKX6k2MLJ7b1LkIK656PAnAze56aUevziqFv 68Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774581443; x=1775186243; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tr4fog4gmIs86XZzl/XYBaiJRPRO3+BQhmPV4D4emLw=; b=E6J/qTqxKkIiejoUoI4bY9iJX4QqOXiZQ0HHlhiYeJ2+ho8sahhiS/iKL8K61TnYwo D31695Nx0yL3Q0/NZRLJP5KoNxn8Mhoq01SYgBOLs2bI9lHULMTy7bntEGQxMyn712rg KZAcXlXgjLVnZamwOSRZSfEljour0qlI5RaBOU5k64loCPEKHb8oqZYq3OKcNPfg40ic Nlf6PeUdXKZLRw98CRy6hU0uCh6GQ7qt6FoyO9g9H/VtRbKa/+6Z5SSXCKwiCy/q1nUv EwBQ3LhSo+ZUy33nBsUIZeWI1ZSW7K/DOr04/cYBeWTCBWfLYqJejZeadiR8apB69tKz m6mw== X-Forwarded-Encrypted: i=1; AJvYcCXi0znlL7mFZDlWySHl5se8AFYHk2rsPruabA8FZORiDPsisAxfoI4LWKYgTN70uoeEKwTL4J5C8EIc9mk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+8iUwG1scVgN0EUYA2XYJdZ0E5Z2ll8T0wG56l+CfENDVoMDs y3cJSj6DOrhhq/3cJ47SGkoASCB4wHIrymPRkuU3STLYRoPD2Tq4UPNq X-Gm-Gg: ATEYQzxDwXjg5pQfN8bp73pUMZsirTK2lakivQ7Y29gtoB+P0ngQbJMiNjWzsEmmseN YEXDBl4Fmx2nVVj2mr2b1NGaYhWKwcB0y3cZtHiuH8nqm/uz9Izjct9Jvz0u3rpuD1ztaAs9HLy IHV029JBBpQ7tB2ohuqydK7diRqySXhf7vrlnjlEMKwc+YxLiZagIOI+R4pWyWwzkzbAabobn35 nEE28sRHCIIvuQ43evxvewI8PbIsJENjHihgKlIn3BzxznIa73heZiSboNVM13tQlO4NgDR3G/4 MGqGdpgSDzLFp44tIF9U7JIJTmon4sYZ4Y8zZytwSx6bWnTni0kIdqRJY8I7OCxadZJ1QqsSlme ZVdSNS7FodVVu977tS78HzoDfwvQohcCTwVXDmXJ864zs//JGfiIWC0jWR6TwN+HXjDLk6F0jas 90nT0Cefl3qLw5v1c8vptjG/Nyo8rzd6MSvNvhv6xONZLHCJW9cBtykXsDOM1yZPgIA6LOiPd/w A== X-Received: by 2002:a05:693c:3113:b0:2b7:1abc:a6e9 with SMTP id 5a478bee46e88-2c185dd38e1mr617445eec.12.1774581443338; Thu, 26 Mar 2026 20:17:23 -0700 (PDT) Received: from [192.168.1.18] (177-4-161-78.user3p.v-tal.net.br. [177.4.161.78]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c16ec7f9c9sm5609118eec.12.2026.03.26.20.17.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2026 20:17:22 -0700 (PDT) Message-ID: <902117a1-8389-49c5-8c09-0566f1d8447e@gmail.com> Date: Fri, 27 Mar 2026 00:17:19 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ASoC: generic: keep fallback dai_name stable across rebind To: Kuninori Morimoto Cc: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260326-asoc-generic-fallback-dai-name-rebind-v1-1-ac9da3cbd606@gmail.com> <877bqyxej1.wl-kuninori.morimoto.gx@renesas.com> From: =?UTF-8?Q?C=C3=A1ssio_Gabriel_Monteiro_Pires?= Content-Language: en-US In-Reply-To: <877bqyxej1.wl-kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, Kuninori On 3/26/26 22:11, Kuninori Morimoto wrote: > > Hi Cássio > > Thank you for your patch > >> simple_parse_dai() and graph_util_parse_dai() first try to identify a >> DAI via dai_args. When that works the card can rebind without relying on >> dlc->dai_name. >> >> The fallback path still calls snd_soc_get_dlc(), which returns a >> borrowed dai_name pointer. If the CPU or codec component is unbound >> while the sound card stays registered, the generic card keeps that >> pointer and the next rebind may compare stale memory while matching the >> DAI. >> >> Stage the fallback result in a temporary dai_link_component and move >> only a card-owned copy of dai_name into the live link component. Use >> devm_kstrdup_const() so static names are reused and dynamic ones remain >> valid for the lifetime of the card device. >> >> Signed-off-by: Cássio Gabriel >> --- > > It looks good to me. > > Acked-by: Kuninori Morimoto > > 1 concern is that this function is using goto, ad your code is fixing > (A) part. > > int graph_util_parse_dai(...) > { > ... > dai = snd_soc_get_dai_via_args(...); > if (dai) { > ... > => goto parse_dai_end; > } > > (A) ... > > parse_dai_end: > ... > } > > > I think it is good timing to use if-else here ? > > int graph_util_parse_dai(...) > { > ... > dai = snd_soc_get_dai_via_args(...); > if (dai) { > ... > + } else { > + (A) ... > + } > ... > } > > That makes sense, and it’s clearer. I’m going to send the v2 patch with the changes. > > Thank you for your help !! > > Best regards > --- > Kuninori Morimoto -- Thanks, Cássio