Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EEC7C433F5 for ; Mon, 20 Sep 2021 17:23:14 +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 713A3632AC for ; Mon, 20 Sep 2021 17:23:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 713A3632AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=perex.cz 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 5FAC716CE; Mon, 20 Sep 2021 19:22:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5FAC716CE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1632158591; bh=GaxkjuU+KgKhteyAoZiAcsi/wMnz4mcxGxkGFRVh518=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nCoeZJ0+vZSkZW5BhuKo2VZm8EPcafvA5TXXkzc53A/wkrwSXBCQGksbZ1QbyWihZ UnInD3s7qMmUKbc8aIKxLJQcoWDw80QSy/nZ4B2SaSxSfhn3XMpy6MBEZZIg4bvr+3 8wgtxdAEBRM+PiftzjlAFU1dcLmE5mbgYraAHuCY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C0A3BF80124; Mon, 20 Sep 2021 19:22:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2CCC3F8025D; Mon, 20 Sep 2021 19:22:19 +0200 (CEST) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 18B97F80124 for ; Mon, 20 Sep 2021 19:22:11 +0200 (CEST) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id AB079A003E; Mon, 20 Sep 2021 19:22:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz AB079A003E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1632158529; bh=kv1wbMFRgrQwqZvmZ0oJ5ioIGhCcRDJN/8c1FRurspo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=qR33ooaatNG1KZGYW/PaTHDhk9NVO85VHu4vwR6+SBf0/YpiK+5I2rH76ktzHoinR csOO+R9WM8r79hvNlAFUCJU0sbPpxa5ZWCZtGDQZUku8YPAzr2NrcH/syZAxJubT6I fFMCHiO1kyjF8RtDsVMl/Vs4wRfBDsiAoods8I38= Received: from p1gen2.localdomain (unknown [192.168.100.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Mon, 20 Sep 2021 19:22:05 +0200 (CEST) Subject: Re: [PATCH] ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION To: David Henningsson , ALSA development References: <20210920083538.128008-1-perex@perex.cz> <5f2b66ef-01f2-f371-e8af-afa236f10cc5@diwic.se> From: Jaroslav Kysela Message-ID: <88bd2d00-20af-4fd5-8a76-a81247ed331a@perex.cz> Date: Mon, 20 Sep 2021 19:22:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5f2b66ef-01f2-f371-e8af-afa236f10cc5@diwic.se> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: Takashi Iwai , stable@vger.kernel.org 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 20. 09. 21 18:42, David Henningsson wrote: > > On 2021-09-20 10:35, Jaroslav Kysela wrote: >> The new framing mode causes the user space regression, because >> the alsa-lib code does not initialize the reserved space in >> the params structure when the device is opened. >> >> This change adds SNDRV_RAWMIDI_IOCTL_USER_PVERSION like we >> do for the PCM interface for the protocol acknowledgment. >> >> Cc: David Henningsson >> Cc: >> Fixes: 08fdced60ca0 ("ALSA: rawmidi: Add framing mode") >> BugLink: https://github.com/alsa-project/alsa-lib/issues/178 >> Signed-off-by: Jaroslav Kysela >> --- >> include/sound/rawmidi.h | 1 + >> include/uapi/sound/asound.h | 1 + >> sound/core/rawmidi.c | 9 +++++++++ >> 3 files changed, 11 insertions(+) >> >> diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h >> index 989e1517332d..7a08ed2acd60 100644 >> --- a/include/sound/rawmidi.h >> +++ b/include/sound/rawmidi.h >> @@ -98,6 +98,7 @@ struct snd_rawmidi_file { >> struct snd_rawmidi *rmidi; >> struct snd_rawmidi_substream *input; >> struct snd_rawmidi_substream *output; >> + unsigned int user_pversion; /* supported protocol version */ >> }; >> >> struct snd_rawmidi_str { >> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h >> index 1d84ec9db93b..f906e50a7919 100644 >> --- a/include/uapi/sound/asound.h >> +++ b/include/uapi/sound/asound.h >> @@ -784,6 +784,7 @@ struct snd_rawmidi_status { >> >> #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) >> #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) >> +#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('A', 0x02, int) > > How come it's not 'W' here but 'A' instead? Good catch. I sent v2 of this patch with this correction. Thank you. https://lore.kernel.org/alsa-devel/20210920171850.154186-1-perex@perex.cz/ Jaroslav > > Looks good otherwise, given a quick glance. It'll need a corresponding > alsa-lib patch to actually call SNDRV_RAWMIDI_IOCTL_USER_PVERSION. > > Thanks for helping to sort this out. > > // David > -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.