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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B07A1C433EF for ; Thu, 7 Oct 2021 10:53:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB2AD610C7 for ; Thu, 7 Oct 2021 10:53:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB2AD610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1A246822; Thu, 7 Oct 2021 12:53:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1A246822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633604037; bh=29h1oeZusIIvVcNa1mdT3BamRJuYV6vNC4v0+Rth06o=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BPbHiI5+JtII7MVH13sXXs/cCfnTH85yywUrljgJDdKwaCEwXnIi5wBk7Xat9DRcM TNw8MoShbkgiMfDMYCDFXDs/LNipmBHMRZfD7oRr3FnR4Jpj1dRg9hY0bkIdQD2RMg 4pwOvRa4J3rLDjCJi6BqmvIs2ZzSQh1kG0QTWkY8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A4BA4F80259; Thu, 7 Oct 2021 12:53:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BC945F8027D; Thu, 7 Oct 2021 12:53:05 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 49F70F800FE for ; Thu, 7 Oct 2021 12:52:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 49F70F800FE Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="aKZuTA6O"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="R/Bga+Dz" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 91D07200A1; Thu, 7 Oct 2021 10:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1633603978; 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=95Ei1GYUt3m+NNbZBRpOdlFr8IKmHkvEIqfWMGbGD3k=; b=aKZuTA6OE6k8DIL6+Ctv7s26oLOW+4hk5kiVeN8x4DFtPPt+nPluDEYrt8dpBnwWlvMRuv 0A1FslcfNpPfYNRP/tnU0KQxWOt1LqLkOLozaf8FbHu4MaAfVKssAk8WTWE+jcz5Xm4hak Im3vzkbV+kF6vk4iFXhsgNteZFdPAWg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1633603978; 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=95Ei1GYUt3m+NNbZBRpOdlFr8IKmHkvEIqfWMGbGD3k=; b=R/Bga+DzKrTGMSJ7EJfCXNR2z8djLrJQo0N27eq3ATqZ3haIzBoaK4NQVVyJLZUw5YTXo2 3II93E02dHBkJ4BQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 7DDC9A3B84; Thu, 7 Oct 2021 10:52:58 +0000 (UTC) Date: Thu, 07 Oct 2021 12:52:58 +0200 Message-ID: From: Takashi Iwai To: Michael Forney Subject: Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control In-Reply-To: <29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org> References: <20191211212025.1981822-1-arnd@arndb.de> <20191211212025.1981822-9-arnd@arndb.de> <29QBMJU8DE71E.2YZSH8IHT5HMH@mforney.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, Arnd Bergmann , Baolin Wang , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Takashi Iwai , Mark Brown , Baolin Wang X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, 06 Oct 2021 19:49:17 +0200, Michael Forney wrote: > > Arnd Bergmann wrote: > > +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) > > +typedef char __pad_before_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; > > +typedef char __pad_after_uframe[0]; > > +#endif > > + > > +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) > > +typedef char __pad_before_uframe[0]; > > +typedef char __pad_after_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; > > +#endif > > + > > +struct __snd_pcm_mmap_status64 { > > + __s32 state; /* RO: state - SNDRV_PCM_STATE_XXXX */ > > + __u32 pad1; /* Needed for 64 bit alignment */ > > + __pad_before_uframe __pad1; > > + snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ > > + __pad_after_uframe __pad2; > > + struct __snd_timespec64 tstamp; /* Timestamp */ > > + __s32 suspended_state; /* RO: suspended stream state */ > > + __u32 pad3; /* Needed for 64 bit alignment */ > > + struct __snd_timespec64 audio_tstamp; /* sample counter or wall clock */ > > +}; > > + > > +struct __snd_pcm_mmap_control64 { > > + __pad_before_uframe __pad1; > > + snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ > > + __pad_before_uframe __pad2; > > I was looking through this header and happened to notice that this > padding is wrong. I believe it should be __pad_after_uframe here. > > I'm not sure of the implications of this typo, but I suspect it > breaks something on 32-bit systems with 64-bit time (regardless of > the endianness, since it changes the offset of avail_min). Right, that's the expected breakage. It seems that the 64bit time on 32bit arch is still rare, so we haven't heard a regression by that, so far... In anyway, care to send a formal fix patch? Thanks for catching this! Takashi