From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@osdl.org>
Cc: rpurdie@rpsys.net, lenz@cs.wisc.edu,
linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk
Subject: Re: [patch] collie: enable frontlight
Date: Sun, 6 Nov 2005 16:55:27 +0100 [thread overview]
Message-ID: <20051106155524.GC28618@elf.ucw.cz> (raw)
In-Reply-To: <20051104151751.32c1abe7.akpm@osdl.org>
Hi!
> Pavel Machek <pavel@ucw.cz> wrote:
> >
> > +static spinlock_t fl_lock = SPIN_LOCK_UNLOCKED;
> > +
> > +#define LCM_ALC_EN 0x8000
> > +
> > +void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
> > +{
> > + unsigned long flags;
> > +
> > + spin_lock_irqsave(&fl_lock, flags);
> > + locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
> > + udelay(100);
> > + locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
> > + locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
> > + spin_unlock_irqrestore(&fl_lock, flags);
> > +}
>
> ick, a 100 microsecond glitch, quite unnecessary. Why not use a semaphore
> here, if any locking is actually needed? (It's called from device probe -
> there's higher-level serialisation, no?)
Oops, I see; I invented my own lock when I should have used
lchip->lock. Fixed locally, I'll push it up eventually.
Pavel
--
Thanks, Sharp!
prev parent reply other threads:[~2005-11-06 15:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 23:21 Pavel Machek
2005-11-04 23:17 ` Andrew Morton
2005-11-06 15:45 ` Pavel Machek
2005-11-06 15:55 ` Pavel Machek [this message]
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=20051106155524.GC28618@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@osdl.org \
--cc=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®