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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 8B314C48BDF for ; Sun, 13 Jun 2021 07:30:57 +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 26D82611CE for ; Sun, 13 Jun 2021 07:30:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26D82611CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@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 8BA2C178A; Sun, 13 Jun 2021 09:30:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8BA2C178A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1623569454; bh=ZFcX/bxORa+FvnBC4ajDClKn0Jbmvk5NVGpUYYBsJhw=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=B1YZkhASg5h6KbWd7dmHwb3Nf1wpQgb4tBvV0RF0L2NtmOmebBESRntN+Sgpqdst0 JAqyaV1BE4qga1m2KfTGoVoeCdeWMn0CVFGkPmjIP6POgFdva0k5obQE26tNusEpPI +/Pn6nka8uu4oDqnrn2E4tR/05GC2sTndiVZ589E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E3E6AF80165; Sun, 13 Jun 2021 09:29:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 410F2F80165; Sun, 13 Jun 2021 09:29:54 +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 3BEEAF800FB for ; Sun, 13 Jun 2021 09:29:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3BEEAF800FB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lb6oBreh"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="StDuDjsv" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 781641FD2D; Sun, 13 Jun 2021 07:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623569390; 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=WhduT0sYydM4ELZXqbR/OJ0jePGmvtRZMzB6L+JAb8o=; b=lb6oBreh/mqFLkmHp2kEJ13eBzgSzjZxrtc/w0RKiifA5ywXrrOrynsKCMQxU8sa/NmSMH HrKZNkkaGESuWDYrTq5hxZOlsjJVigBQ3nWh1vRWjjEXLpV0KHWqH2X1HnOZNYLNhMdemS rII8jjgUqnN6JgAibielbIhOj2o5uJE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623569390; 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=WhduT0sYydM4ELZXqbR/OJ0jePGmvtRZMzB6L+JAb8o=; b=StDuDjsvl7VblfeZg2wWSetieXJ5+yWuPBdry0qXyhRg+5We2+l5ECrbDWURmFfgUdptOv NK6vST23DTIKY3Bw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 7102DA3B83; Sun, 13 Jun 2021 07:29:50 +0000 (UTC) Date: Sun, 13 Jun 2021 09:29:50 +0200 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart Subject: Re: [PATCH 8/8] ASoC: SOF: Intel: add .ack support for HDaudio platforms In-Reply-To: <20210610205326.1176400-9-pierre-louis.bossart@linux.intel.com> References: <20210610205326.1176400-1-pierre-louis.bossart@linux.intel.com> <20210610205326.1176400-9-pierre-louis.bossart@linux.intel.com> 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, broonie@kernel.org, Ranjani Sridharan , Kai Vehmanen 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 Thu, 10 Jun 2021 22:53:26 +0200, Pierre-Louis Bossart wrote: > > +/* update SPIB register with appl position */ > +int hda_dsp_pcm_ack(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream) > +{ > + struct hdac_stream *hstream = substream->runtime->private_data; > + struct hdac_ext_stream *stream = stream_to_hdac_ext_stream(hstream); > + struct snd_pcm_runtime *runtime = substream->runtime; > + ssize_t appl_pos, buf_size; > + u32 spib; > + > + if (!hda_disable_rewinds) > + return 0; > + > + /* > + * paranoia check: if a rewind request took place after the RUN bits were programmed, > + * deny it since hardware only supports monotonic (modulo) increments for SPIB. > + */ > + if (hstream->running) { > + if (runtime->control->appl_ptr < stream->old_appl_ptr) > + return -EINVAL; This condition won't be enough when the appl_ptr overlap the buffer boundary. It's still possible on 32bit architecture. thanks, Takashi