Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1238814pxb; Thu, 7 Oct 2021 03:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynVetp+vfR+s+o55FDoZ7FYGHXm279Ojri+yRAbfFGAlEyRpckuFntLUzefkU3uEyvEX5Z X-Received: by 2002:a17:902:7c10:b0:13e:e11e:8d1c with SMTP id x16-20020a1709027c1000b0013ee11e8d1cmr3197409pll.55.1633604091996; Thu, 07 Oct 2021 03:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633604091; cv=none; d=google.com; s=arc-20160816; b=uJrTMn0Hlr7ssJqtW/4OWY/Wqk+s8Cy4wHxK4LFjoGft3U1jCB8daFVvCX8wJXSu8D 8fqUyZz5B9wbsR4ukQ8rjN7Nah7gVPFgR1mfAe85QUk84G+1BFc2yDUAfZ2kz55LlHF+ 2HsdUEQP+o3EeNSNoPKL3mGWSLM0RoR8JGObvUNkJqalpCmjAY2LlYhnMm6oX77A9Ovp 21uizCUXUhyPnTun/HmOUvTadzSq50toSD7MJJhPxBtD/Vacw0940VpCpPp4JWPGNphH BUnWLsz/6wY1p/jJPgtC4FvbYs2RTriMDAziQDlKsJB0OocNUb3T93EMacaX28YRK/ro MxYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=95Ei1GYUt3m+NNbZBRpOdlFr8IKmHkvEIqfWMGbGD3k=; b=WTH35p9Bii7b7GPNXQ7rCqsAfRoj7NXqf2CU0NyoMK1BFf258YEx2c6UgrRU5lAJMd CZw/CbCpPdCskVpwWz3tUHX55xz1RMf5Li+aalcQfyyNXKOb7e2ff9OrzMqt0Suoqoz5 HegYVd0RObvPm4n3A9QCwGfXmF4cFdzSKsIu3Dfl3PmdpOK0vGIcQKF03OOzm0i5kt73 XnEIuid4D2JQr8V2sMHXObu9rh1QeHnq5zBsNI7nW9ZrCASpKEQPXA3TsyizZQ3CSEtj CBlSEWA+P+XA6hRiV4zwy5p0EzE+56/CF+YwT5ce5FwX31f4lHEfZms3SQjdhxC4EDao JGpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=aKZuTA6O; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si29492149pgv.643.2021.10.07.03.54.37; Thu, 07 Oct 2021 03:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=aKZuTA6O; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241023AbhJGKyx (ORCPT + 99 others); Thu, 7 Oct 2021 06:54:53 -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