+ net-irda-ircomm_ttyc-use-flip-buffers-to-deliver-data.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     net/irda/ircomm_tty.c: use flip buffers to deliver data
has been added to the -mm tree.  Its filename is
     net-irda-ircomm_ttyc-use-flip-buffers-to-deliver-data.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: net/irda/ircomm_tty.c: use flip buffers to deliver data
From: Amit Virdi <amit.virdi@xxxxxx>

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: Amit Virdi <amit.virdi@xxxxxx>
Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
Acked-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 net/irda/ircomm/ircomm_tty.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff -puN net/irda/ircomm/ircomm_tty.c~net-irda-ircomm_ttyc-use-flip-buffers-to-deliver-data net/irda/ircomm/ircomm_tty.c
--- a/net/irda/ircomm/ircomm_tty.c~net-irda-ircomm_ttyc-use-flip-buffers-to-deliver-data
+++ a/net/irda/ircomm/ircomm_tty.c
@@ -38,6 +38,7 @@
 #include <linux/seq_file.h>
 #include <linux/termios.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>		/* for MODULE_ALIAS_CHARDEV_MAJOR */
 
@@ -1132,7 +1133,6 @@ static int ircomm_tty_data_indication(vo
 				      struct sk_buff *skb)
 {
 	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;
-	struct tty_ldisc *ld;
 
 	IRDA_DEBUG(2, "%s()\n", __func__ );
 
@@ -1161,15 +1161,11 @@ static int ircomm_tty_data_indication(vo
 	}
 
 	/*
-	 * 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
+	 * Use flip buffer functions since the code may be called from interrupt
+	 * context
 	 */
-
-	ld = tty_ldisc_ref(self->tty);
-	if (ld)
-		ld->ops->receive_buf(self->tty, skb->data, NULL, skb->len);
-	tty_ldisc_deref(ld);
+	tty_insert_flip_string(self->tty, skb->data, skb->len);
+	tty_flip_buffer_push(self->tty);
 
 	/* No need to kfree_skb - see ircomm_ttp_data_indication() */
 
_

Patches currently in -mm which might be from amit.virdi@xxxxxx are

net-irda-ircomm_ttyc-use-flip-buffers-to-deliver-data.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux