All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Virdi <amit.virdi@st.com>
To: Alan Cox <alan@linux.intel.com>
Cc: "samuel@sortiz.org" <samuel@sortiz.org>,
	Armando VISCONTI <armando.visconti@st.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Shiraz HASHIM <shiraz.hashim@st.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: sleeping function called from invalid context
Date: Wed, 11 May 2011 14:13:21 +0530	[thread overview]
Message-ID: <4DCA4C29.20403@st.com> (raw)
In-Reply-To: <20110510103256.58d61861@bob.linux.org.uk>

Hey Alan,

On 5/10/2011 3:02 PM, Alan Cox wrote:
>> On analysis, I found that this is due to the change introduced in
>> tty_ioctl.c where the termios mutex is taken to protect against
>> parallel throttle/unthrottle. Probably IrCOMM stack code wasn't
>> tested before merging this patch.
>>
>> Please suggest what should be done with the IrCOMM protocol stack
>> code to resolve this problem?
>
> It looks like the comments are wrong
>
>          /*
>           * Just give it over to the line discipline. There is no need to
>           * involve the flip buffers, since we are not running in an
>          interrupt
>           * handler
>           */
>
>
> appears to be completely untrue
>
> I suspect it just needs to use the tty_flip_buffer functions properly
> instead of trying to do clever shortcuts
>
>
> 	tty_insert_flip_string(self->tty, skb->data, skb->len);
> 	tty_flip_buffer_push(self->tty);
>
> .
>

I incorporated the change suggested by you and tested the stack again. 
It is working perfectly fine - no stack trace is printed now. I'll be 
sending the patch soon.

Thanks n Regards
Amit Virdi

WARNING: multiple messages have this Message-ID (diff)
From: amit.virdi@st.com (Amit Virdi)
To: linux-arm-kernel@lists.infradead.org
Subject: sleeping function called from invalid context
Date: Wed, 11 May 2011 14:13:21 +0530	[thread overview]
Message-ID: <4DCA4C29.20403@st.com> (raw)
In-Reply-To: <20110510103256.58d61861@bob.linux.org.uk>

Hey Alan,

On 5/10/2011 3:02 PM, Alan Cox wrote:
>> On analysis, I found that this is due to the change introduced in
>> tty_ioctl.c where the termios mutex is taken to protect against
>> parallel throttle/unthrottle. Probably IrCOMM stack code wasn't
>> tested before merging this patch.
>>
>> Please suggest what should be done with the IrCOMM protocol stack
>> code to resolve this problem?
>
> It looks like the comments are wrong
>
>          /*
>           * Just give it over to the line discipline. There is no need to
>           * involve the flip buffers, since we are not running in an
>          interrupt
>           * handler
>           */
>
>
> appears to be completely untrue
>
> I suspect it just needs to use the tty_flip_buffer functions properly
> instead of trying to do clever shortcuts
>
>
> 	tty_insert_flip_string(self->tty, skb->data, skb->len);
> 	tty_flip_buffer_push(self->tty);
>
> .
>

I incorporated the change suggested by you and tested the stack again. 
It is working perfectly fine - no stack trace is printed now. I'll be 
sending the patch soon.

Thanks n Regards
Amit Virdi

WARNING: multiple messages have this Message-ID (diff)
From: Amit Virdi <amit.virdi@st.com>
To: Alan Cox <alan@linux.intel.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"samuel@sortiz.org" <samuel@sortiz.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Shiraz HASHIM <shiraz.hashim@st.com>,
	Armando VISCONTI <armando.visconti@st.com>,
	Viresh KUMAR <viresh.kumar@st.com>
Subject: Re: sleeping function called from invalid context
Date: Wed, 11 May 2011 14:13:21 +0530	[thread overview]
Message-ID: <4DCA4C29.20403@st.com> (raw)
In-Reply-To: <20110510103256.58d61861@bob.linux.org.uk>

Hey Alan,

On 5/10/2011 3:02 PM, Alan Cox wrote:
>> On analysis, I found that this is due to the change introduced in
>> tty_ioctl.c where the termios mutex is taken to protect against
>> parallel throttle/unthrottle. Probably IrCOMM stack code wasn't
>> tested before merging this patch.
>>
>> Please suggest what should be done with the IrCOMM protocol stack
>> code to resolve this problem?
>
> It looks like the comments are wrong
>
>          /*
>           * Just give it over to the line discipline. There is no need to
>           * involve the flip buffers, since we are not running in an
>          interrupt
>           * handler
>           */
>
>
> appears to be completely untrue
>
> I suspect it just needs to use the tty_flip_buffer functions properly
> instead of trying to do clever shortcuts
>
>
> 	tty_insert_flip_string(self->tty, skb->data, skb->len);
> 	tty_flip_buffer_push(self->tty);
>
> .
>

I incorporated the change suggested by you and tested the stack again. 
It is working perfectly fine - no stack trace is printed now. I'll be 
sending the patch soon.

Thanks n Regards
Amit Virdi

  reply	other threads:[~2011-05-11  8:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  5:38 BUG: sleeping function called from invalid context Amit Virdi
2011-05-10  5:38 ` Amit Virdi
2011-05-10  5:38 ` Amit Virdi
2011-05-10  9:32 ` Alan Cox
2011-05-10  9:32   ` Alan Cox
2011-05-10  9:32   ` Alan Cox
2011-05-11  8:43   ` Amit Virdi [this message]
2011-05-11  8:43     ` Amit Virdi
2011-05-11  8:43     ` Amit Virdi
  -- strict thread matches above, loose matches on Subject: below --
2006-09-11  8:50 Neil Bird
2003-09-09 15:03 Samuel Flory
2003-09-09 19:47 ` Matt Mackall
2003-09-09 20:10   ` Samuel Flory

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=4DCA4C29.20403@st.com \
    --to=amit.virdi@st.com \
    --cc=alan@linux.intel.com \
    --cc=armando.visconti@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel@sortiz.org \
    --cc=shiraz.hashim@st.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 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.