From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Gadiyar, Anand" <gadiyar@ti.com>,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430
Date: Mon, 13 Oct 2008 17:42:40 +0400 [thread overview]
Message-ID: <20081013134239.GB13565@2ka.mipt.ru> (raw)
In-Reply-To: <062801c92d37$3413bdd0$LocalHost@wipultra1303>
Hi.
On Mon, Oct 13, 2008 at 06:55:43PM +0530, Madhusudhan Chikkature (madhu.cr@ti.com) wrote:
> >> +static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
> >> +{
> >> + int ret;
> >> + u8 tmp_status;
> >> + unsigned long irqflags;
> >> +
> >> + *status = 0;
> >> +
> >> + spin_lock_irqsave(&hdq_data->hdq_spinlock, irqflags);
> >> + /* clear interrupt flags via a dummy read */
> >> + hdq_reg_in(hdq_data, OMAP_HDQ_INT_STATUS);
> >> + /* ISR loads it with new INT_STATUS */
> >> + hdq_data->hdq_irqstatus = 0;
> >> + spin_unlock_irqrestore(&hdq_data->hdq_spinlock, irqflags);
> >> +
> >> + hdq_reg_out(hdq_data, OMAP_HDQ_TX_DATA, val);
> >> +
> >> + /* set the GO bit */
> >> + hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS, OMAP_HDQ_CTRL_STATUS_GO,
> >> + OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO);
> >> + /* wait for the TXCOMPLETE bit */
> >> + ret = wait_event_interruptible_timeout(hdq_wait_queue,
> >> + hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT);
> >> + if (ret < 0) {
> >> + dev_dbg(hdq_data->dev, "wait interrupted");
> >> + return -EINTR;
> >> + }
> >
> > Is this desirable? The user hits ^C and the driver bails out?
> >
> > I assume so, but was this tested?
>
> Andrew, What is the test scenario you mean here? A user hitting ^C when the driver is waiting for the TXCOMPLETE bit?
Just plain return looks suspicious, is there some kind of a race between
calling code (which for example frees hdq_data) and the path, which sets
the bit and wakes up this thread?
--
Evgeniy Polyakov
next prev parent reply other threads:[~2008-10-13 13:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 7:16 Gadiyar, Anand
2008-10-08 19:59 ` Evgeniy Polyakov
2008-10-10 20:38 ` Andrew Morton
2008-10-13 13:25 ` Madhusudhan Chikkature
2008-10-13 13:42 ` Evgeniy Polyakov [this message]
2008-10-13 15:53 ` Andrew Morton
2008-10-14 8:51 ` Madhusudhan Chikkature
2008-10-14 12:50 ` Andrew Morton
2008-10-14 13:42 ` Evgeniy Polyakov
2008-10-14 14:30 ` Andrew Morton
2008-10-14 14:55 ` Evgeniy Polyakov
2008-10-16 7:05 ` Madhusudhan Chikkature
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=20081013134239.GB13565@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=akpm@linux-foundation.org \
--cc=gadiyar@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=madhu.cr@ti.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
all inboxes | Powered by JetHome®