From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796227437; b=48B8LymgJkYlZk1uWN+dV/SaEjWwwlgaWvYYm1aYbYTEBflooz7rt1QPV/dIUYWEbzaB fQK3m2Lw4KtIttfrO+d/GHFPUfNvd0vkRmxoCtoLsq3g8BD006kv7HTPxI6Y8x1pXoWBP ggZMoJYQI1Pf7oPa3XZeVjbGPAMCwW0xMjacgjlJ9bIX6I3wzB2Fm9BsL2mCBn3NqSdr8 v+JTO1m09CCHe44fX94dTvjobFOT4SkDa1w7VcEuiYzq6VXbQs3iPrIyjfOBGVUZjGhoE uj8LD8dMqmk5sMWQrnlOFx9qFMCdtRrjIs//gxGwFKTO6NDbwNxsLZUdgyCLe55PcRQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227437; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:DKIM-Signature: DKIM-Signature:Received:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-Spamd-Result:X-Rspamd-Server:X-Rspamd-Action:X-Spam-Flag: X-Spam-Score:X-Spam-Level:X-Rspamd-Queue-Id; bh=B93tZhtC7y2t1dvCBRu0jzUIVIrPKxio8D/Ban6tGB0=; b=AOqpy5gnJNTIshAmnAcg40bXTRHepwoepyvFWD96WlYJPGMJw7URynmTZ/FxOKja8b/z 9Bi6+7EsWaMdSAc2/QwWIbB+l/TiXUGE8Jl4qEbC9wiphGwwZD7OTMyRPROKNtGqRAlh2 RJX2C8ktgvno0Fn2ILGMk7wzHZV96kS/x/ifTHCHs2aEQ5RKriEBMOhJCxI7bCa9zOXmO +l7Mz31vadrmcuQx3aa+h7A3Ano9RjL2Pxf3D6edG2gdXGCkC9+KAubHo4pWUn+E9BHtu 6+UEHucD1zVNZm4oD122KCICjRzk3zwMuTvgcLy2nQK09UX6m5OzeCoPwAOBiy453bA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=tqvN1cU6; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Nxws0ZAQ; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=DYILEr78; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AqQOrYyI; arc=none smtp.remote-ip=195.135.223.131 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6A6C606A32C for ; Wed, 2 Dec 2026 16:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C6A6C606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=tqvN1cU6; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Nxws0ZAQ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=DYILEr78; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AqQOrYyI Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6B9E5202C4; Wed, 2 Dec 2026 16:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796227434; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B93tZhtC7y2t1dvCBRu0jzUIVIrPKxio8D/Ban6tGB0=; b=tqvN1cU64X0EH+VZ9fqC0sxbLNz3XyM8mLkn1g7xrf4weR4mESWmjAYJys2urGvvmekEOe zH/6H4vBjpsQ+u9xypJketKgX/CTseh7MkCEHwZtbH/XHTC1EzMt4jGQfJF98+KG+87oXj j0iaoy1Uwcgz+kf11rtYWWGGEl1y2N8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796227434; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B93tZhtC7y2t1dvCBRu0jzUIVIrPKxio8D/Ban6tGB0=; b=Nxws0ZAQ5MgayzBnjROHOuNNfMP9RR7V6qdCrtVLh2mi9Pj5OPrvy9GDY5dz65qrYX+J/o bIw57Ud9t3UjkZDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DYILEr78; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=AqQOrYyI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796227433; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B93tZhtC7y2t1dvCBRu0jzUIVIrPKxio8D/Ban6tGB0=; b=DYILEr78pzTBH7U1IBilGONEce2L1VfYHdvGXel2DOUhBk2R9kcIpStNUxml9Q33Gtimlm Wtqu+mic54ffPd1krGwHOZaYQIGcnB/ArlOoaqQt2u6Bt0wcYbGg3HIHZ0eR8mNfzOhDab fQQo2+3gxnIHqVt1l2kjax6LNuoJZQc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796227433; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B93tZhtC7y2t1dvCBRu0jzUIVIrPKxio8D/Ban6tGB0=; b=AqQOrYyIT7FwJgURWWDgaS7ZME2ZiT3oNjyEgn04Fe4YQDeC4yCUB/25s3Jzi+S95cSXIi cgeFh5Jp2ase7aCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 20A741348F; Wed, 2 Dec 2026 16:03:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id uuk3OmhBEGvZRQAAD6G6ig (envelope-from ); Wed, 02 Dec 2026 16:03:53 +0000 Date: Wed, 02 Dec 2026 17:03:52 +0100 Message-ID: <87fqwfwtxz.wl-tiwai@suse.de> From: Takashi Iwai To: Hao Ge Cc: Takashi Iwai , Jaroslav Kysela , linux-sound@vger.kernel.org, sashiko-reviews@lists.linux.dev Subject: Re: [PATCH] ALSA: pcm: derive the audio timestamp for the DEFAULT type In-Reply-To: <213256a2-fc43-454d-9f8d-aad65fbe4235@linux.dev> References: <20261130074144.120573-1-hao.ge@linux.dev> <213256a2-fc43-454d-9f8d-aad65fbe4235@linux.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/30.2 Mule/6.0 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-12.51 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,linux.dev:email] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -12.51 X-Spam-Level: X-Rspamd-Queue-Id: 6B9E5202C4 On Mon, 30 Nov 2026 09:16:21 +0100, Hao Ge wrote: > > > > On 2026/11/30 15:56, sashiko-bot@kernel.org wrote: > > Thank you for your contribution! Sashiko AI review found 1 potential > > issue to consider: > > - [Low] ALSA: pcm: Fixes trailer cites 4eeaaeaea1ce instead of > > 3179f6200188 > > -- > > > > commit 22b28b123f8965cc05b0606befd025969a4f6aef > > Author: Hao Ge > > > >> ALSA: pcm: derive the audio timestamp for the DEFAULT type > >> > >> snd_pcm_update_hw_ptr0() calls ->get_time_info() only when > >> audio_tstamp_config.type_requested is not DEFAULT, while > >> update_audio_tstamp() derives the timestamp from the buffer position > >> only when audio_tstamp_report.actual_type is DEFAULT. The two > >> conditions do not line up for a stream that requests the DEFAULT > >> type. The callback is never called for such a stream, so actual_type > >> stays at SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT, the zero value a > >> kzalloc'ed runtime starts with, and update_audio_tstamp() reads the > >> local audio_tstamp that was never written. This path never reaches a > >> driver, so it cannot be fixed driver-side. > >> > >> BUG: KMSAN: uninit-value in update_audio_tstamp+0x728/0x880 [snd_pcm] > >> update_audio_tstamp+0x728/0x880 [snd_pcm] > >> snd_pcm_update_hw_ptr0+0x189c/0x1c50 [snd_pcm] > >> snd_pcm_delay+0x258/0x890 [snd_pcm] > >> snd_pcm_common_ioctl+0x2ef/0xbc0 [snd_pcm] > >> snd_pcm_ioctl+0x72/0xd0 [snd_pcm] > >> __se_sys_ioctl+0x1be/0x340 > >> do_syscall_64+0x138/0x4b0 > >> entry_SYSCALL_64_after_hwframe+0x76/0x7e > >> Local variable audio_tstamp created at: > >> snd_pcm_update_hw_ptr0+0x9f/0x1c50 [snd_pcm] > >> > >> The reports come from a PipeWire stream querying > >> SNDRV_PCM_IOCTL_DELAY and SNDRV_PCM_IOCTL_STATUS64, and from the > >> period elapsed interrupt. > >> > >> Also take the requested type into account in > >> update_audio_tstamp(), and derive the timestamp from the buffer > >> position when the caller asked for DEFAULT, which is what the type > >> means. > >> > >> Fixes: 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps") > >> Cc: stable@vger.kernel.org > >> Signed-off-by: Hao Ge > > > > [Severity: Low] > > Should the Fixes tag reference 3179f6200188 ("ALSA: core: add > > .get_time_info") instead of 4eeaaeaea1ce ("ALSA: core: add hooks for > > audio timestamps")? > > > > Commit 4eeaaeaea1ce ("ALSA: core: add hooks for audio timestamps") only > > added the legacy .wall_clock hook. Commit 3179f6200188 ("ALSA: core: add > > .get_time_info") introduced update_audio_tstamp(), the type_requested != > > SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT guard around ->get_time_info(), and > > the mismatched actual_type == SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT check. > > > > Thanks. I'll wait for the review comments from Takashi and Jaroslav, > and fold them together with the Fixes tag correction into v2. LGTM, please submit v2. thanks, Takashi