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 948C3C433F5 for ; Thu, 7 Oct 2021 10:53:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 751A8610A5 for ; Thu, 7 Oct 2021 10:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241032AbhJGKyz (ORCPT ); Thu, 7 Oct 2021 06:54:55 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:60050 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240896AbhJGKyw (ORCPT ); Thu, 7 Oct 2021 06:54:52 -0400 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 Cc: Arnd Bergmann , alsa-devel@alsa-project.org, Takashi Iwai , Baolin Wang , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Mark Brown , Baolin Wang 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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