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=-0.8 required=3.0 tests=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 C0C83C433FF for ; Tue, 6 Aug 2019 08:05:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A111520651 for ; Tue, 6 Aug 2019 08:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732343AbfHFIF4 (ORCPT ); Tue, 6 Aug 2019 04:05:56 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:18367 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727259AbfHFIFx (ORCPT ); Tue, 6 Aug 2019 04:05:53 -0400 Date: 06 Aug 2019 17:05:52 +0900 X-IronPort-AV: E=Sophos;i="5.64,352,1559487600"; d="scan'208";a="23455750" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 06 Aug 2019 17:05:52 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 254DA415C8CC; Tue, 6 Aug 2019 17:05:52 +0900 (JST) Message-ID: <87sgqe203g.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Jiada Wang Cc: , , , , , , Subject: Re: [PATCH v1 2/3] ASoC: rsnd: Allow reconfiguration of clock rate In-Reply-To: <731330d0-e177-f9cb-50d2-91701f8dff0a@mentor.com> References: <20190722072403.11008-1-jiada_wang@mentor.com> <20190722072403.11008-3-jiada_wang@mentor.com> <87a7d6h3b2.wl-kuninori.morimoto.gx@renesas.com> <731330d0-e177-f9cb-50d2-91701f8dff0a@mentor.com> User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiada > > 2nd, can we keep usrcnt setup as-is ? > > I guess we can just avoid rsnd_ssi_master_clk_start() if ssi->rate was not 0 ? > > I don't fully understand your 2nd question, > in case of rsnd_ssi_master_clk_stop(), if avoid > rsnd_ssi_master_clk_stop() when ssi->rate is 0 by apply following > change > > static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod, > struct rsnd_dai_stream *io) > { > ... > - if (ssi->usrcnt > 1) > + if (ssi->rate == 0) > return; > ... > } > > then when any IO stream with same SSI calls .hw_free, > the other IO stream's clock will be stopped too. I think we can find more simple solution if we can find good ideas. For example, how about to add new counter for hw_params/hw_free ? Anyway, [3/3] patch is too much over-kill to me. And, please don't exchange usrcnt inc/dec position at [2/3]. It is for open/close. Thank you for your help !! Best regards --- Kuninori Morimoto