From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7406240DFD1; Mon, 4 May 2026 04:07:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777867650; cv=none; b=PWGgz4WqjVPff/cNNq+MX1wiYieZGPBEPqRn506MTjpANZ9dxy9ZSzixNxWJIj7T35dddRSU45cz8PeIR1d0rm1LTnBjl/Zr0mWJilosX6fDvgxtJKGZwx8MpZC3/5bMMCIiTftIQoXQT+TGYjoUQXsEFi407yn3dlD9D2tyBUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777867650; c=relaxed/simple; bh=MNLfm31CuSD9bY0fB2ljoYFQmQ0yfp1g+94VYHm6ffo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hskl1/gV/zP9yYh13YY+bIdeVe2ykIkYHkSSJqosxxE1eCyOioyMVAdW0CYybk8soIZJwhI+SkkATMOS+qM5G4M/+tpHbSOWXH+RuSpLtsW7WEp/6YJ38BRcKiZJXsD8Vkq6p3HnOyN3k//A5zmSjSUsLeEURyNC4q61XeKLu3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=L12JVhGo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IIHU4632; arc=none smtp.client-ip=103.168.172.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="L12JVhGo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IIHU4632" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 889081400065; Mon, 4 May 2026 00:07:26 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 04 May 2026 00:07:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1777867646; x=1777954046; bh=umlJXxAcNxZ9Q2Ni2iGink1BMJ+a6L1A SXDw2P3E0s8=; b=L12JVhGo6Bhd51mZ0iBkKnO0FXg0oyxoPCig2IF0O5esKfzX 0FG1HLxqZsd104NZXZ/BEUspQfoJyc4tVO4qRnH+vJ1P6kwT9E9c3u+v/VHHbBiw n+sN1ubCLJNj/qVZLySyViCo0gbOc2LRPf4svF00qInwtbHa6HEC6CoCK0J80RIJ kWqCazS8kELn1LPpVa2fwX29nIEiLo1F1J6Qe8KDjp9TBI5ROPSqnOl/iYICjvKp +B9M9SUGwHmjPvSKmiYrn/GGUgnMAgt2bZTjKVgF3DqTIDgvc7xd9AqPvTknoIPO ArkfK6jX91RGv4gxT80UxAIXPLwoXn6l0v3t4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1777867646; x= 1777954046; bh=umlJXxAcNxZ9Q2Ni2iGink1BMJ+a6L1ASXDw2P3E0s8=; b=I IHU4632/4OFqGYSMke/fs+xURqhcyOkmbNlhqMjmlT6QtFP/ScmkVqJyC/f1zAVu Q07a6MKv+mX9/ZRcdWMg+s/XuPe2Z+PdjDkfvSPIyWfpvofgIusJf268SvHpeNBb S728xWCDOQGljKB4AXaK5i/hHyKmbaPsYvEDBSGsBn1IoVjzHPNTOBYPjELr+iYs sjRVYubr0bLu2INAtcx59VnYFCJhk2iw4+k+mdvdX6lxwtGx6W7Vp/r0t0jQtkZG AgM/+VpWjQPSV61bD+J7ZoRHsOx6APdRolnLGSGicgrdayObGVGa2vCWg3QR57Pt sF6/aHb/YO7gIbQ1Jb57A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeljeekgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgesthekredttddtudenucfhrhhomhepvfgrkhgrshhh ihcuufgrkhgrmhhothhouceoohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph eqnecuggftrfgrthhtvghrnhepieffjeetjedvgfejffekuefgtdehjefhgeethfehvdej ueffueduteejtdfghfejnecuffhomhgrihhnpehmshhgihgurdhlihhnkhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhi sehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopeejpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopegtrghsshhiohhgrggsrhhivghltghonhhtrghtohesghhm rghilhdrtghomhdprhgtphhtthhopegtlhgvmhgvnhhssehlrgguihhstghhrdguvgdprh gtphhtthhopehtihifrghisehsuhhsvgdrtghomhdprhgtphhtthhopehpvghrvgigsehp vghrvgigrdgtiidprhgtphhtthhopehlihhnuhigqdhsohhunhgusehvghgvrhdrkhgvrh hnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgv rhhnvghlrdhorhhgpdhrtghpthhtohepshhtrggslhgvsehvghgvrhdrkhgvrhhnvghlrd horhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 May 2026 00:07:24 -0400 (EDT) Date: Mon, 4 May 2026 13:07:21 +0900 From: Takashi Sakamoto To: =?iso-8859-1?Q?C=E1ssio?= Gabriel Cc: Clemens Ladisch , Takashi Iwai , Jaroslav Kysela , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] ALSA: firewire-tascam: Do not drop unread control events Message-ID: <20260504040721.GA398619@sakamocchi.jp> Mail-Followup-To: Takashi Sakamoto , =?iso-8859-1?Q?C=E1ssio?= Gabriel , Clemens Ladisch , Takashi Iwai , Jaroslav Kysela , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260503-alsa-firewire-tascam-read-queue-v2-1-126c6efd7642@gmail.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260503-alsa-firewire-tascam-read-queue-v2-1-126c6efd7642@gmail.com> Hi, On Sun, May 03, 2026 at 09:55:52PM -0300, Cássio Gabriel wrote: > tscm_hwdep_read_queue() copies as many queued control events as fit in > the userspace buffer. When the buffer is smaller than the current > contiguous queue segment, length is rounded down to the number of bytes > that can be copied. > > However, after copying that shortened length, the code advances pull_pos > to the original tail_pos, marking the whole contiguous segment as > consumed. Any events between the copied portion and tail_pos are lost. > > Limit tail_pos to the position after the entries actually copied before > updating pull_pos. When the whole segment fits, this is equivalent to the > old tail_pos update; when the buffer is smaller, the remaining events > stay queued for the next read. > > Fixes: a8c0d13267a4 ("ALSA: firewire-tascam: notify events of change of state for userspace applications") > Cc: stable@vger.kernel.org > Suggested-by: Takashi Sakamoto > Signed-off-by: Cássio Gabriel > --- > Changes in v2: > - Recompute tail_pos after shortening length instead of adding a separate > entries_copied variable, as suggested. > - Add Suggested-by tag. > - Link to v1: https://patch.msgid.link/20260501-alsa-firewire-tascam-read-queue-v1-1-7baa4ba1a4de@gmail.com > --- > sound/firewire/tascam/tascam-hwdep.c | 1 + > 1 file changed, 1 insertion(+) Looks good to me;) Reviewed-by: Takashi Sakamoto Or as a second Co-Author, Co-developed-by: Takashi Sakamoto Signed-off-by: Takashi Sakamoto To maintainer, please feel free to assign the above tags according to your preferences. Thanks Takashi Sakamoto