From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0BABCA0EFA for ; Thu, 21 Aug 2025 09:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=obRsX/8A/9Qh0CwHqev9anKpmT+VLQgy8OH1fNMPrdM=; b=ujC3qAxyyrvvbyKizsx9WYBMOK GLIhHxpYjwL9ArFphYI7ezFWBgBOAnQvAWK72FXlDUlCVFh/UnCa2sQ9beVAJyH8fACpDLDo2dlSo vrqJxvoeo6RY5Tq44/fLVscADYKdFGJF9XGxZ54hsgAJGhs20Dg7E6JT1Yhu+3tZ7p34zGasF7+fN po2SAMJI9fQNmf5r4/bNax+oPCqjaqrXEYxe6QpGZK8O9POrAHac0UP1qiOhi3mZb6LLv7LMBZash iZIBpvHHHLwO8OgS5XXBrJe2GR68LWJmDwd9wcR+IzyAC+xZsS8qT74HKwa3CVTZIdLTqRy9wnIkT Cr/NO2Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1up1lp-0000000GQF2-06EP; Thu, 21 Aug 2025 09:39:45 +0000 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uozZP-0000000G56M-1BPT for linux-arm-kernel@lists.infradead.org; Thu, 21 Aug 2025 07:18:48 +0000 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 53EA21F7C7; Thu, 21 Aug 2025 07:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755760724; 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=obRsX/8A/9Qh0CwHqev9anKpmT+VLQgy8OH1fNMPrdM=; b=e3/tC8Batqv8H9ZmNUKiG7yJYW8iDf+1WBR1MIywyIXa6M60v+uLf1VhTzwsh6NtJaO4FH kKEH/uA+m/0p9x9k3kShBk91xRkrGb/ZKfeLZwtOfkldMh29GySsOi4l/GmUByWyOUgX9V Y4Ha+B0DSM8BDhAl4IKfKFaIPPzPRjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755760724; 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=obRsX/8A/9Qh0CwHqev9anKpmT+VLQgy8OH1fNMPrdM=; b=I1gAEid1hDYculmly3aGsaMofmBg4pB/7b6HHinl9NPBv17cK2mooBC12/Mcgh3VuT03aD 7KNy3OBuB5psPwDg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="e3/tC8Ba"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=I1gAEid1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1755760724; 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=obRsX/8A/9Qh0CwHqev9anKpmT+VLQgy8OH1fNMPrdM=; b=e3/tC8Batqv8H9ZmNUKiG7yJYW8iDf+1WBR1MIywyIXa6M60v+uLf1VhTzwsh6NtJaO4FH kKEH/uA+m/0p9x9k3kShBk91xRkrGb/ZKfeLZwtOfkldMh29GySsOi4l/GmUByWyOUgX9V Y4Ha+B0DSM8BDhAl4IKfKFaIPPzPRjs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1755760724; 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=obRsX/8A/9Qh0CwHqev9anKpmT+VLQgy8OH1fNMPrdM=; b=I1gAEid1hDYculmly3aGsaMofmBg4pB/7b6HHinl9NPBv17cK2mooBC12/Mcgh3VuT03aD 7KNy3OBuB5psPwDg== 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 A540413867; Thu, 21 Aug 2025 07:18:43 +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 NREmJ1PIpmihAQAAD6G6ig (envelope-from ); Thu, 21 Aug 2025 07:18:43 +0000 Date: Thu, 21 Aug 2025 09:18:43 +0200 Message-ID: <87bjo96t2k.wl-tiwai@suse.de> From: Takashi Iwai To: Joris Verhaegen Cc: Vinod Koul , Charles Keepax , Takashi Iwai , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Cezary Rojewski , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Pierre-Louis Bossart , Srinivas Kandagatla , Daniel Baluta , Orson Zhai , Baolin Wang , Chunyan Zhang , Kunihiko Hayashi , Masami Hiramatsu , kernel-team@android.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, linux-arm-msm@vger.kernel.org, sound-open-firmware@alsa-project.org, linux-arm-kernel@lists.infradead.org, Miller Liang Subject: Re: [PATCH v4 2/3] ALSA: compress_offload: Add SNDRV_COMPRESS_TSTAMP64 ioctl In-Reply-To: References: <20250801092720.1845282-1-verhaegen@google.com> <20250801092720.1845282-3-verhaegen@google.com> <87h5ym1f75.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-2.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; 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)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[29]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[kernel.org,opensource.cirrus.com,suse.de,perex.cz,suse.com,gmail.com,intel.com,linux.intel.com,linux.dev,nxp.com,linux.alibaba.com,socionext.com,android.com,vger.kernel.org,alsa-project.org,lists.infradead.org,google.com]; RCVD_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TAGGED_RCPT(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLzj6aswpe58r68z1acwzd13oz)]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim] X-Rspamd-Queue-Id: 53EA21F7C7 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250821_001847_467881_977BB01E X-CRM114-Status: GOOD ( 25.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 19 Aug 2025 07:08:08 +0200, Vinod Koul wrote: > > On 18-08-25, 15:05, Charles Keepax wrote: > > On Tue, Aug 05, 2025 at 07:59:42AM +0200, Takashi Iwai wrote: > > > On Tue, 05 Aug 2025 06:47:59 +0200, > > > Vinod Koul wrote: > > > > On 01-08-25, 10:27, Joris Verhaegen wrote: > > > > > ret = snd_compr_update_tstamp(stream, &tstamp64); > > > > > if (ret == 0) { > > > > > - snd_compr_tstamp32_from_64(&tstamp32, &tstamp64); > > > > > - ret = copy_to_user((struct snd_compr_tstamp __user *)arg, > > > > > - &tstamp32, sizeof(tstamp32)) ? > > > > > + if (is_32bit) { > > > > > + snd_compr_tstamp32_from_64(&tstamp32, &tstamp64); > > > > > + copy_from = &tstamp32; > > > > > + copy_size = sizeof(tstamp32); > > > > > + } > > > > > > > > Most of the applications and people would be 32bit right now and we > > > > expect this to progressively change, but then this imposes a penalty as > > > > default path is 64 bit, since we expect this ioctl to be called very > > > > frequently, should we do this optimization for 64bit here? > > > > > > Through a quick glance over the patch, I don't think you'll hit the > > > significant performance loss. It's merely a few bytes of extra copies > > > before copy_to_user(), after all. But, of course, it'd be more > > > convincing if anyone can test and give the actual numbers. > > That would be better > > > I am inclined to agree the impact should be very minimal and the > > only alternative is a more complex implementation. I would vote > > for leaving this as is. > > But yes, we can for now, go ahead. It is internal kernel flow can be > adapted anytime :-) OK, Joris, could you submit v5 with correction of what Vinod suggested in reviews? thanks, Takashi