From: hjk@hansjkoch.de (Hans J. Koch)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 1/1] PRUSS UIO driver support
Date: Tue, 1 Mar 2011 19:33:35 +0100 [thread overview]
Message-ID: <20110301183334.GC20497@local> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB593024BF3601C@dbde02.ent.ti.com>
On Tue, Mar 01, 2011 at 10:15:27AM +0530, TK, Pratheesh Gangadhar wrote:
> Hi,
>
> > -----Original Message-----
> > From: Hans J. Koch [mailto:hjk at hansjkoch.de]
> > Sent: Tuesday, March 01, 2011 2:57 AM
> > To: TK, Pratheesh Gangadhar
> > Cc: linux-kernel at vger.kernel.org; hjk at hansjkoch.de; gregkh at suse.de;
> > tglx at linutronix.de; sshtylyov at mvista.com; arnd at arndb.de; Chatterjee, Amit;
> > davinci-linux-open-source at linux.davincidsp.com; linux-arm-
> > kernel at lists.infradead.org
> > Subject: Re: [PATCH v6 1/1] PRUSS UIO driver support
> >
> > On Tue, Mar 01, 2011 at 02:31:35AM +0530, Pratheesh Gangadhar wrote:
> > > +
> > > + /* Register PRUSS IRQ lines */
> > > + p->irq = IRQ_DA8XX_EVTOUT0 + cnt;
> > > + p->handler = pruss_handler;
> > > +
> > > + ret = uio_register_device(&dev->dev, p);
> > > +
> > > + if (ret < 0)
> > > + goto out_free;
> > > + }
> > > +
> > > + spin_lock_init(&lock);
> >
> > That's too late. uio_register_device() enables the irq, and your spin_lock
> > is not ready at that time.
>
> This is ok in this context as "modprobe uio_pruss" is pre-requisite for
> running PRUSS firmware and without firmware running PRUSS won't
> generate interrupts. Actually PRUSS INTC is not setup till we start
> user application.
What if the user application is stopped, UIO driver module unloaded
and loaded again?
Anyway, please don't use that kind of argumentation. The next newbie
developer might copy your work as a basis for his new driver, and there
it probably won't work.
Simply put the spin_lock_init before the loop.
Thanks,
Hans
next prev parent reply other threads:[~2011-03-01 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 21:01 [PATCH v6 0/1] Add PRUSS UIO driver support Pratheesh Gangadhar
2011-02-28 21:01 ` [PATCH v6 1/1] " Pratheesh Gangadhar
2011-02-28 21:26 ` Hans J. Koch
2011-03-01 4:45 ` TK, Pratheesh Gangadhar
2011-03-01 9:53 ` Thomas Gleixner
2011-03-01 18:33 ` Hans J. Koch [this message]
2011-03-01 21:19 ` TK, Pratheesh Gangadhar
2011-03-01 21:38 ` Thomas Gleixner
2011-03-01 9:51 ` Thomas Gleixner
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=20110301183334.GC20497@local \
--to=hjk@hansjkoch.de \
--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 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).