All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Madhusudhan Chikkature" <madhu.cr@ti.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: gadiyar@ti.com, johnpol@2ka.mipt.ru,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430
Date: Tue, 14 Oct 2008 14:21:50 +0530	[thread overview]
Message-ID: <015c01c92dda$1b754340$LocalHost@wipultra1303> (raw)
In-Reply-To: 20081013085323.f8bd7efb.akpm@linux-foundation.org


----- Original Message ----- 
From: "Andrew Morton" <akpm@linux-foundation.org>
To: "Madhusudhan Chikkature" <madhu.cr@ti.com>
Cc: <gadiyar@ti.com>; <johnpol@2ka.mipt.ru>; <linux-kernel@vger.kernel.org>; <linux-omap@vger.kernel.org>
Sent: Monday, October 13, 2008 9:23 PM
Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430


>> On Mon, 13 Oct 2008 18:55:43 +0530 "Madhusudhan Chikkature" <madhu.cr@ti.com> wrote:
>> 
>> ----- Original Message ----- 
>> From: "Andrew Morton" <akpm@linux-foundation.org>
>> To: "Gadiyar, Anand" <gadiyar@ti.com>
>> Cc: <johnpol@2ka.mipt.ru>; <linux-kernel@vger.kernel.org>; <linux-omap@vger.kernel.org>; <madhu.cr@ti.com>
>> Sent: Saturday, October 11, 2008 2:08 AM
>> Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430
>> 
>> 
>> >> +       /* 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?
> 
> Yes.
> 

Yes. It is desired to return an error if the condition in the wait is not met. I need to change the check for return value to check for zero and neg value.

I spent some time to test this perticular scenario.I could not really see any impact of hitting ^C when an application is 
transfering data in the background. When the h/w is programmed to transfer data and the driver issues a wait, I see that 
TXCOMPLETE interrupt comes immediately and wakes up as expected. 

So guess I am unable to hit ^C exactly when the driver is waiting in wait_event_interruptible_timeout(before the condition 
is met) for it to catch the signal. Is it generally suggested to use wait_event_timeout so that ^C signal is not caught?

Regards,
Madhu

WARNING: multiple messages have this Message-ID (diff)
From: "Madhusudhan Chikkature" <madhu.cr@ti.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: <gadiyar@ti.com>, <johnpol@2ka.mipt.ru>,
	<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430
Date: Tue, 14 Oct 2008 14:21:50 +0530	[thread overview]
Message-ID: <015c01c92dda$1b754340$LocalHost@wipultra1303> (raw)
In-Reply-To: 20081013085323.f8bd7efb.akpm@linux-foundation.org


----- Original Message ----- 
From: "Andrew Morton" <akpm@linux-foundation.org>
To: "Madhusudhan Chikkature" <madhu.cr@ti.com>
Cc: <gadiyar@ti.com>; <johnpol@2ka.mipt.ru>; <linux-kernel@vger.kernel.org>; <linux-omap@vger.kernel.org>
Sent: Monday, October 13, 2008 9:23 PM
Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430


>> On Mon, 13 Oct 2008 18:55:43 +0530 "Madhusudhan Chikkature" <madhu.cr@ti.com> wrote:
>> 
>> ----- Original Message ----- 
>> From: "Andrew Morton" <akpm@linux-foundation.org>
>> To: "Gadiyar, Anand" <gadiyar@ti.com>
>> Cc: <johnpol@2ka.mipt.ru>; <linux-kernel@vger.kernel.org>; <linux-omap@vger.kernel.org>; <madhu.cr@ti.com>
>> Sent: Saturday, October 11, 2008 2:08 AM
>> Subject: Re: [PATCH 1/5] HDQ Driver for OMAP2430/3430
>> 
>> 
>> >> +       /* 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?
> 
> Yes.
> 

Yes. It is desired to return an error if the condition in the wait is not met. I need to change the check for return value to check for zero and neg value.

I spent some time to test this perticular scenario.I could not really see any impact of hitting ^C when an application is 
transfering data in the background. When the h/w is programmed to transfer data and the driver issues a wait, I see that 
TXCOMPLETE interrupt comes immediately and wakes up as expected. 

So guess I am unable to hit ^C exactly when the driver is waiting in wait_event_interruptible_timeout(before the condition 
is met) for it to catch the signal. Is it generally suggested to use wait_event_timeout so that ^C signal is not caught?

Regards,
Madhu

  reply	other threads:[~2008-10-14  8:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  7:16 [PATCH 1/5] HDQ Driver for OMAP2430/3430 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:25     ` Madhusudhan Chikkature
2008-10-13 13:42     ` Evgeniy Polyakov
2008-10-13 15:53     ` Andrew Morton
2008-10-14  8:51       ` Madhusudhan Chikkature [this message]
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='015c01c92dda$1b754340$LocalHost@wipultra1303' \
    --to=madhu.cr@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=gadiyar@ti.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.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.