linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: mach-shmobile: ap4evb: add fsib 44100Hz rate
Date: Mon, 15 Nov 2010 05:43:40 +0000	[thread overview]
Message-ID: <20101115054340.GC8489@linux-sh.org> (raw)
In-Reply-To: <uhbpex68f.wl%morimoto.kuninori@renesas.com>

On Mon, Nov 15, 2010 at 12:11:09PM +0900, Kuninori Morimoto wrote:
> Tested-by: Tony SIM <chinyeow.sim.xt@renesas.com>
> Tested-by: TAKEI Mitsuharu <takei.andr@gmail.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  arch/arm/mach-shmobile/board-ap4evb.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
> index 63c2fca..5c14c73 100644
> --- a/arch/arm/mach-shmobile/board-ap4evb.c
> +++ b/arch/arm/mach-shmobile/board-ap4evb.c
> @@ -582,7 +582,14 @@ static int fsi_set_rate(int is_porta, int rate)
>  	if (IS_ERR(fsib_clk))
>  		return -EINVAL;
>  
> +	while (fdiv_clk->usecount)
> +		clk_disable(fdiv_clk);
> +

Uhm, no.  Whatever this thinks its doing, is horribly, horribly wrong. 

The refcount exists for a reason. If your driver wants to change the
rate, then it can drop the usecount itself and give it a go. If that
fails, then that means that some other driver also has a handle on the
same clock, and simply changing the rate underneath it is precisely the
sort of thing that the refcounting exists to prevent!

>  	switch (rate) {
> +	case 44100:
> +		clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 11283000));
> +		ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
> +		break;

This part looks fine, and I'll apply it, while pretending like I never
saw the first part.

When you fix your driver to get the refcounting right, feel free to
submit a follow-up patch for that.

  parent reply	other threads:[~2010-11-15  5:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18  7:44 [PATCH] ARM: mach-shmobile: ap4evb: Add SCIFA0 support Kuninori Morimoto
2010-02-18  8:58 ` [PATCH] ARM: mach-shmobile: ap4evb: Add tiny document Kuninori Morimoto
2010-02-18  9:32 ` [PATCH] ARM: mach-shmobile: ap4evb: Add SCIFA0 support Paul Mundt
2010-02-23  7:07 ` [PATCH] ARM: mach-shmobile: ap4evb: Add KEYSC support Kuninori Morimoto
2010-02-23  7:53 ` Kuninori Morimoto
2010-02-25  7:55 ` Paul Mundt
2010-03-12 10:07 ` [PATCH] ARM: mach-shmobile: ap4evb: Add SW43, SW3 tiny document Kuninori Morimoto
2010-05-13  1:08 ` [PATCH] ARM: mach-shmobile: ap4evb: Add FSI2 support Kuninori Morimoto
2010-05-13  1:08 ` [PATCH] ARM: mach-shmobile: ap4evb: Add MMC support Kuninori Morimoto
2010-05-20  3:16 ` [PATCH] ARM: mach-shmobile: ap4evb: Add FSI2 support Paul Mundt
2010-05-31  4:49 ` [PATCH] ARM: mach-shmobile: ap4evb: Add MMC support Paul Mundt
2010-06-04  3:15 ` [PATCH] ARM: mach-shmobile: ap4evb: Add LCD panel selection Kuninori Morimoto
2010-06-04  5:20 ` Paul Mundt
2010-07-14  7:01 ` [PATCH] ARM: mach-shmobile: ap4evb: Add ts_get_pendown_state for Kuninori Morimoto
2010-07-14  7:01 ` Kuninori Morimoto
2010-10-18 10:13 ` [PATCH] ARM: mach-shmobile: ap4evb: Add HDMI sound support Kuninori Morimoto
2010-10-31 14:54 ` Paul Mundt
2010-11-15  3:11 ` [PATCH] ARM: mach-shmobile: ap4evb: add fsib 44100Hz rate Kuninori Morimoto
2010-11-15  5:43 ` Paul Mundt [this message]
2010-11-16  4:12 ` [PATCH] ARM: mach-shmobile: ap4evb: add fsib 44100Hz rate fixup Kuninori Morimoto
2010-11-16  4:30 ` Paul Mundt
2010-11-16  6:22 ` Kuninori Morimoto
2010-11-16  6:24 ` Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101115054340.GC8489@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).