Commit cbfd1526 authored by Amit Virdi's avatar Amit Virdi Committed by David S. Miller

net/irda/ircomm_tty.c: Use flip buffers to deliver data

use tty_insert_flip_string and tty_flip_buffer_push to deliver incoming data
packets from the IrDA device instead of delivering the packets directly to the
line discipline. Following later approach resulted in warning "Sleeping function
called from invalid context".
Signed-off-by: default avatarAmit Virdi <amit.virdi@st.com>
Acked-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7f267051
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/termios.h> #include <linux/termios.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h> /* for MODULE_ALIAS_CHARDEV_MAJOR */ #include <linux/device.h> /* for MODULE_ALIAS_CHARDEV_MAJOR */
...@@ -1132,7 +1133,6 @@ static int ircomm_tty_data_indication(void *instance, void *sap, ...@@ -1132,7 +1133,6 @@ static int ircomm_tty_data_indication(void *instance, void *sap,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
struct tty_ldisc *ld;
IRDA_DEBUG(2, "%s()\n", __func__ ); IRDA_DEBUG(2, "%s()\n", __func__ );
...@@ -1161,15 +1161,11 @@ static int ircomm_tty_data_indication(void *instance, void *sap, ...@@ -1161,15 +1161,11 @@ static int ircomm_tty_data_indication(void *instance, void *sap,
} }
/* /*
* Just give it over to the line discipline. There is no need to * Use flip buffer functions since the code may be called from interrupt
* involve the flip buffers, since we are not running in an interrupt * context
* handler
*/ */
tty_insert_flip_string(self->tty, skb->data, skb->len);
ld = tty_ldisc_ref(self->tty); tty_flip_buffer_push(self->tty);
if (ld)
ld->ops->receive_buf(self->tty, skb->data, NULL, skb->len);
tty_ldisc_deref(ld);
/* No need to kfree_skb - see ircomm_ttp_data_indication() */ /* No need to kfree_skb - see ircomm_ttp_data_indication() */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment