From: Paul Mundt <lethal@linux-sh.org>
To: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: linux-fbdev-devel@lists.sourceforge.net,
akpm@linux-foundation.org, Magnus Damm <magnus.damm@gmail.com>,
linux-sh@vger.kernel.org
Subject: Re: [PATCH] video: SuperH Mobile LCDC Driver
Date: Fri, 30 May 2008 06:07:36 +0900 [thread overview]
Message-ID: <20080529210736.GA13663@linux-sh.org> (raw)
In-Reply-To: <20080529200951.434093d3.krzysztof.h1@poczta.fm>
On Thu, May 29, 2008 at 08:09:51PM +0200, Krzysztof Helt wrote:
> > --- /dev/null
> > +++ work/drivers/video/sh_mobile_lcdcfb.c 2008-05-29 17:21:48.000000000 +0900
> > @@ -0,0 +1,742 @@
> > +/*
> > + * SuperH Mobile LCDC Framebuffer
> > + *
> > + * Copyright (c) 2008 Magnus Damm
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License
> > + *
>
> English is not my native language but the last line sounds suspicious (either what?)
>
Yes, there's overzealous trimming here. This should be amended to refer
to GPLv2 only, though as the MODULE_LICENSE() its already get this right,
it's mostly a cosmetic change.
> put lcdc_priv and channel number (or base address and and channel pointer)
> as arguments to break the circular link.
> You can make these functions inline as well.
>
As the 'circular' link is being used in a pre-defined way, it's not clear
that there's a problem with it existing in the first place. It's
obviously a matter of convenience.
> > +static void lcdc_write(struct sh_mobile_lcdc_priv *priv,
> > + int reg_offs, unsigned long data)
> > +{
> > + iowrite32(data, priv->base + reg_offs);
> > +}
> > +
> > +static unsigned long lcdc_read(struct sh_mobile_lcdc_priv *priv,
> > + unsigned long reg_offs)
> > +{
> > + return ioread32(priv->base + reg_offs);
> > +}
> > +
>
> These two functions can be inline.
>
The compiler will do this automatically, there's no need to mark it
explicity.
> > +static void lcdc_sys_write_index(void *handle, unsigned long data)
> > +{
> > + struct sh_mobile_lcdc_chan *ch = handle;
> > +
> > + lcdc_write(ch->lcdc, _LDDWD0R, data | 0x10000000);
> > +
> > + while (lcdc_read(ch->lcdc, _LDSR) & 2)
> > + ;
> > +
>
> As Andrew Morton put it it would be better to put
> cpu_relax() inside this loop (or do some other
> cpu releasing). There are more busy loops
> in the driver's code.
>
cpu_relax() doesn't really matter here. It's good to include for general
coherency, since we don't have the same barriers in the ioread() path,
but it's hardly critical.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2008-05-29 21:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-29 9:24 [PATCH] video: SuperH Mobile LCDC Driver Magnus Damm
2008-05-29 9:40 ` Andrew Morton
2008-05-30 2:31 ` Magnus Damm
2008-05-29 18:09 ` [Linux-fbdev-devel] " Krzysztof Helt
2008-05-29 21:07 ` Paul Mundt [this message]
2008-05-30 4:26 ` Krzysztof Helt
2008-05-30 2:50 ` Magnus Damm
2008-05-30 4:59 ` Nobuhiro Iwamatsu
2008-05-30 5:15 ` Manuel Lauss
2008-05-30 6:50 ` Magnus Damm
2008-05-30 8:14 ` Nobuhiro Iwamatsu
2008-05-30 5:24 ` Magnus Damm
2008-05-30 8:30 ` Nobuhiro Iwamatsu
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=20080529210736.GA13663@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=akpm@linux-foundation.org \
--cc=krzysztof.h1@poczta.fm \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
/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).