Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3221267pxb; Sun, 7 Feb 2021 01:55:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5TKo7sxgzinJUhkEQ0VqhTPWruK5yhfepnIMu/av5U4a2RHudf+oCPKlrE/0LNethAov2 X-Received: by 2002:a50:b5c5:: with SMTP id a63mr11921996ede.227.1612691717633; Sun, 07 Feb 2021 01:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612691717; cv=none; d=google.com; s=arc-20160816; b=gNdAgvUZXwS8es9/vMRyzUouDRbLlBG5ERA1y3MZplsHuCp8A/lMQyaVSO55nrzYxN MVqFePMYR0S2BVSoRgDx4jZOakGZY2F/5sNOQHLO2Y+ZeG2E6dwszxN/uvO7pyUceR7W /qygMx9B6UU9ttsphdAUvLJO6Q8rMI/BEK+5G21oFJjnKo5t4I83Ko4Ug5BDKXAL3rcJ BHqwzuJJXWgmB4bPMtKb5Mh7StJmc0ufEeakStjnttCWnrZFZ/kMQUKkIwaBhFUtYGoa abqnuViWP1rB4eu/RwhFmdr28qkXKFoUjxwCpF0zFioon2XguLLT9muPvsY2OdeOlvhS iW4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dZ4pFx7u5BUDAgelezxkYQyF+xKN7GGALoSIhITUj+o=; b=CHbuj5C1mexy0iZAv1ZQSzYWpXqzy4rJmsbPxxD7187+njUicjsTlFnvHTB+Ayh0Yy pcbIu2K4JiSkmiS+cj2lxFQ9zdLRrUNIFbuIxUth3fXwhsYPF1hKI41V5bP2CVqhu3DF bZF7BX1Wfz7gOkzhYsbWlWqq3HXjvUHdbrst/H6oJf7qEwJ9t8913BPfBjodTW+3EVDV 9SZl3v0CjGYoC6oRxch92EDU1Y5rXPieYHcdHwDZpRToV7b+6r5kC5tyFKE4L6Tj8Rvs 8Dx+9jaEnHSYbJ824XIMbgxlpy3WIGBKaI73e8Q9DTVVwY29bDd1pix8enl6IjJNW8f0 EMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pDgcBRam; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si9357406eds.433.2021.02.07.01.54.54; Sun, 07 Feb 2021 01:55:17 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=pDgcBRam; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbhBGJvc (ORCPT + 99 others); Sun, 7 Feb 2021 04:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhBGJv1 (ORCPT ); Sun, 7 Feb 2021 04:51:27 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2F25C06174A; Sun, 7 Feb 2021 01:50:46 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id 2so5691329qvd.0; Sun, 07 Feb 2021 01:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dZ4pFx7u5BUDAgelezxkYQyF+xKN7GGALoSIhITUj+o=; b=pDgcBRamMSdoUB2BEpAst1f1B9nv0WmaS1Vvz3pxn90Bo2k1jjA+Rmy0x4aLBo07mY asda/mt0rtnitVvzATsvxfXHA32w6sTXiqJjs1JBXExweSz1LhjNLHlAe1y/uJwVoXPP wMZxM9NPideQw1Zn+3YhCfTxp2iE+jS49MhfAhBXlxoCTbo27Rn9tle+lHnmbjfbFvXp X0hAwsQSyOLaIiM0VA16unpVG4z8pP0NFOokUPDV4c6WWuDTv7Mspy8/5jiWRxPdTYZ2 ot4n0YWlHpRfnib2YaYfQTZxNBV6VLrvkNQtRO3nOIMXZmsratGIKOhZWgirQuqokfd3 5XYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dZ4pFx7u5BUDAgelezxkYQyF+xKN7GGALoSIhITUj+o=; b=DM4qRCoLpOPrYi/jp8FGcYGahkaI+sZnWvVqgGMZTF+xaPtVKBznilQgf0JBmeUA8w DedvQstdH7smZf4aX/gEIDOIraOZ/TqnnvY6gf3//Zap7Ws4gE2WEkmllLoCrHdB1lDK xfCjoKsTuDj0/QCttEFtAmdxmMXuUYPENauavDo192ltaO15Y4sMM/HDlMvLwikXwgh9 Mz+Eh5MGGwj560LTQzGZKCy69Qq5yvDz8Q0MF9Q9fvyY867wcC6jwxzmPsXMudGcf+T2 9kGnUHA+QhuP6jShd9MounSwJHu/oWUj4bg3e4f8txyqedeWOxmoGhwonsm9DlCFW2at YUmw== X-Gm-Message-State: AOAM5339Ju3krDsKeGDHxfmXT/q7ibkROgDeQAPhFksYxRcr8P9et6Q8 uCZke8KfJUQa0+7ffrUX3bm59llgYmpA/aPL1bI= X-Received: by 2002:a05:6214:76f:: with SMTP id f15mr11458355qvz.56.1612691446129; Sun, 07 Feb 2021 01:50:46 -0800 (PST) MIME-Version: 1.0 References: <1612508250-10586-1-git-send-email-shengjiu.wang@nxp.com> <1612508250-10586-6-git-send-email-shengjiu.wang@nxp.com> <20210205145816.GD4720@sirena.org.uk> In-Reply-To: <20210205145816.GD4720@sirena.org.uk> From: Shengjiu Wang Date: Sun, 7 Feb 2021 17:50:35 +0800 Message-ID: Subject: Re: [PATCH 5/7] ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg To: Mark Brown Cc: Shengjiu Wang , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , alsa-devel@alsa-project.org, Timur Tabi , Liam Girdwood , linuxppc-dev@lists.ozlabs.org, Xiubo Li , linux-kernel , Takashi Iwai , Nicolin Chen , Rob Herring , Fabio Estevam Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2021 at 11:00 PM Mark Brown wrote: > > On Fri, Feb 05, 2021 at 02:57:28PM +0800, Shengjiu Wang wrote: > > > + if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE) > > + msg->s_msg.param.format = RPMSG_S16_LE; > > + else if (params_format(params) == SNDRV_PCM_FORMAT_S24_LE) > > Again this should be a switch statement. > > > + if (params_channels(params) == 1) > > + msg->s_msg.param.channels = RPMSG_CH_LEFT; > > + else > > + msg->s_msg.param.channels = RPMSG_CH_STEREO; > > Shouldn't this be reporting an error if the number of channels is more > than 2? > > > + /* > > + * if the data in the buffer is less than one period > > + * send message immediately. > > + * if there is more than one period data, delay one > > + * period (timer) to send the message. > > + */ > > + if ((avail - writen_num * period_size) <= period_size) { > > + imx_rpmsg_insert_workqueue(substream, msg, info); > > + } else if (rpmsg->force_lpa && !timer_pending(timer)) { > > + int time_msec; > > + > > + time_msec = (int)(runtime->period_size * 1000 / runtime->rate); > > + mod_timer(timer, jiffies + msecs_to_jiffies(time_msec)); > > + } > > The comment here is at least confusing - why would we not send a full > buffer immediately if we have one? This sounds like it's the opposite > way round to what we'd do if we were trying to cut down the number of > messages. It might help to say which buffer and where? > > > + /** > > + * Every work in the work queue, first we check if there > > /** comments are only for kerneldoc. Thanks Mark, I will update them. Best regards wang shengjiu