All of lore.kernel.org
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/12] serial: mxs-auart: convert to clk_prepare/clk_unprepare
Date: Wed, 21 Dec 2011 02:06:40 +0100	[thread overview]
Message-ID: <201112210206.40859.marek.vasut@gmail.com> (raw)
In-Reply-To: <20111220222442.GH2577@n2100.arm.linux.org.uk>

> On Tue, Dec 20, 2011 at 10:28:26PM +0100, Marek Vasut wrote:
> > > On Tue, Dec 20, 2011 at 03:07:50PM +0100, Uwe Kleine-K?nig wrote:
> > > > Hello,
> > > > 
> > > > On Tue, Dec 20, 2011 at 02:49:13PM +0100, Marek Vasut wrote:
> > > > > > The patch converts mxs-auart driver to clk_prepare/clk_unprepare
> > > > > > by using helper functions
> > > > > > clk_prepare_enable/clk_disable_unprepare.
> > > > > > 
> > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > > > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > > > > Cc: Alan Cox <alan@linux.intel.com>
> > > > > > ---
> > > > > > 
> > > > > >  drivers/tty/serial/mxs-auart.c |    8 ++++----
> > > > > >  1 files changed, 4 insertions(+), 4 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/tty/serial/mxs-auart.c
> > > > > > b/drivers/tty/serial/mxs-auart.c index 7e02c9c..c33500a 100644
> > > > > > --- a/drivers/tty/serial/mxs-auart.c
> > > > > > +++ b/drivers/tty/serial/mxs-auart.c
> > > > > > @@ -424,7 +424,7 @@ static int mxs_auart_startup(struct uart_port
> > > > > > *u)
> > > > > > 
> > > > > >  {
> > > > > >  
> > > > > >  	struct mxs_auart_port *s = to_auart_port(u);
> > > > > > 
> > > > > > -	clk_enable(s->clk);
> > > > > > +	clk_prepare_enable(s->clk);
> > > > > > 
> > > > > >  	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_CLR);
> > > > > > 
> > > > > > @@ -453,7 +453,7 @@ static void mxs_auart_shutdown(struct
> > > > > > uart_port *u)
> > > > > > 
> > > > > >  	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN |
> > > > > >  	AUART_INTR_CTSMIEN,
> > > > > >  	
> > > > > >  			u->membase + AUART_INTR_CLR);
> > > > > > 
> > > > > > -	clk_disable(s->clk);
> > > > > > +	clk_disable_unprepare(s->clk);
> > > > > > 
> > > > > >  }
> > > > > >  
> > > > > >  static unsigned int mxs_auart_tx_empty(struct uart_port *u)
> > > > > > 
> > > > > > @@ -634,7 +634,7 @@ auart_console_setup(struct console *co, char
> > > > > > *options)
> > > > > > 
> > > > > >  	if (!s)
> > > > > >  	
> > > > > >  		return -ENODEV;
> > > > > > 
> > > > > > -	clk_enable(s->clk);
> > > > > > +	clk_prepare_enable(s->clk);
> > > > > > 
> > > > > >  	if (options)
> > > > > >  	
> > > > > >  		uart_parse_options(options, &baud, &parity, &bits,
> > 
> > &flow);
> > 
> > > > > > @@ -643,7 +643,7 @@ auart_console_setup(struct console *co, char
> > > > > > *options)
> > > > > > 
> > > > > >  	ret = uart_set_options(&s->port, co, baud, parity, bits, flow);
> > > > > > 
> > > > > > -	clk_disable(s->clk);
> > > > > > +	clk_disable_unprepare(s->clk);
> > > > > > 
> > > > > >  	return ret;
> > > > > >  
> > > > > >  }
> > > > > 
> > > > > DTTO here, are you sure all of them are not called from atomic ctx?
> > > > 
> > > > the startup callback is called with irqs off.
> > > 
> > > It shouldn't be, as it has to do things like request_irq() which can
> > > sleep.  The documentation in Documentation/serial/driver is now out
> > > of date, and can't be relied upon.
> > 
> > auart_rx/tx_empty() shouldn't be called from atomic context? It
> > doesn't really look that way. The name is probably misleading though.
> 
> I can't find an auart_rx nor auart_rx_empty() function.
> 
> The tx_empty function should only be called while the port is started-up,
> and in any case is only called from process context.  (Functions calling
> this also call put_user(), msleep() or other functions which can cause
> schedule events.)

Well then this is cleared up :)

M

  reply	other threads:[~2011-12-21  1:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 12:00 [PATCH 0/12] Add clk_prepare/clk_unprepare for mxs clock api Shawn Guo
2011-12-20 12:00 ` [PATCH 01/12] clk: add helper functions clk_prepare_enable and clk_disable_unprepare Shawn Guo
2011-12-20 13:48   ` Marek Vasut
2011-12-20 14:09     ` Shawn Guo
2011-12-20 12:00 ` [PATCH 02/12] arm/mxs: convert platform code to clk_prepare/clk_unprepare Shawn Guo
2011-12-20 13:44   ` Marek Vasut
2011-12-20 21:11     ` Russell King - ARM Linux
2011-12-20 21:28       ` Marek Vasut
2011-12-20 12:00 ` [PATCH 03/12] net: fec: add clk_prepare/clk_unprepare Shawn Guo
2011-12-20 13:45   ` Marek Vasut
2011-12-20 12:00 ` [PATCH 04/12] dma: mxs-dma: convert to clk_prepare/clk_unprepare Shawn Guo
2011-12-20 13:45   ` Marek Vasut
2011-12-23 17:35     ` Vinod Koul
2011-12-20 12:00 ` [PATCH 05/12] mmc: mxs-mmc: " Shawn Guo
2011-12-20 13:45   ` Marek Vasut
2011-12-20 12:00 ` [PATCH 06/12] mtd: gpmi-lib: " Shawn Guo
2011-12-20 13:46   ` Marek Vasut
2011-12-20 12:00 ` [PATCH 07/12] net: flexcan: " Shawn Guo
2011-12-20 13:48   ` Marek Vasut
2011-12-20 14:23     ` Shawn Guo
2011-12-20 12:00 ` [PATCH 08/12] serial: mxs-auart: " Shawn Guo
2011-12-20 13:49   ` Marek Vasut
2011-12-20 14:07     ` Uwe Kleine-König
2011-12-20 21:15       ` Russell King - ARM Linux
2011-12-20 21:28         ` Marek Vasut
2011-12-20 22:24           ` Russell King - ARM Linux
2011-12-21  1:06             ` Marek Vasut [this message]
2011-12-20 14:27     ` Shawn Guo
2011-12-20 12:00 ` [PATCH 09/12] video: mxsfb: " Shawn Guo
2011-12-20 13:49   ` Marek Vasut
2011-12-21  2:11   ` Florian Tobias Schandinat
2011-12-20 12:00 ` [PATCH 10/12] ASoC: mxs-saif: " Shawn Guo
2011-12-20 11:55   ` Mark Brown
2011-12-20 13:49   ` Marek Vasut
2011-12-20 12:00 ` [PATCH 11/12] clk: add config option HAVE_CLK_PREPARE into Kconfig Shawn Guo
2011-12-20 12:00 ` [PATCH 12/12] arm/mxs: select HAVE_CLK_PREPARE for clock Shawn Guo
2011-12-20 13:43 ` [PATCH 0/12] Add clk_prepare/clk_unprepare for mxs clock api Marek Vasut
2011-12-20 14:05   ` Shawn Guo
2011-12-20 13:59     ` Marek Vasut
2011-12-20 14:21       ` Shawn Guo

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=201112210206.40859.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.