Linux Serial subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH] serial:ifx6x60:Delete SPI timer when shut down port
From: Greg KH @ 2012-11-26 23:45 UTC (permalink / raw)
  To: chao bi; +Cc: Alan Cox, richardx.r.gorby, jun.d.chen, linux-serial,
	linux-kernel
In-Reply-To: <1353634413.22077.15.camel@bichao>

On Fri, Nov 23, 2012 at 09:33:33AM +0800, chao bi wrote:
> 
> When shut down SPI port, it's possible that MRDY has been asserted and a SPI
> timer was activated waiting for SRDY assert, in the case, it needs to delete
> this timer.

This doesn't apply without fuzz, so I don't know what tree you are
working against here.

Please redo it against the latest version of the tty-next tree.

greg k-h

^ permalink raw reply

* Re: [PATCHv3] tty: Added a CONFIG_TTY option to allow removal of TTY
From: Jiri Slaby @ 2012-11-26 23:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Joe Millenbach, Alan Cox, linux-serial, linux-kernel,
	Josh Triplett
In-Reply-To: <20121126233824.GA8868@kroah.com>

On 11/27/2012 12:38 AM, Greg Kroah-Hartman wrote:
> Can you rediff this once 3.8-rc1 is out and send it to me then?

So if you are going to respin, please take care of the newly added
drivers like drivers/staging/fwserial.

thanks,
-- 
js

^ permalink raw reply

* Re: [PATCHv3] tty: Added a CONFIG_TTY option to allow removal of TTY
From: Greg Kroah-Hartman @ 2012-11-26 23:38 UTC (permalink / raw)
  To: Joe Millenbach
  Cc: Alan Cox, Jiri Slaby, linux-serial, linux-kernel, Josh Triplett
In-Reply-To: <1353033035-4928-1-git-send-email-jmillenbach@gmail.com>

On Thu, Nov 15, 2012 at 06:30:35PM -0800, Joe Millenbach wrote:
> The option allows you to remove TTY and compile without errors. This
> saves space on systems that won't support TTY interfaces anyway.
> bloat-o-meter output is below.
> 
> The bulk of this patch consists of Kconfig changes adding "depends on
> TTY" to various serial devices and similar drivers that require the TTY
> layer.  Ideally, these dependencies would occur on a common intermediate
> symbol such as SERIO, but most drivers "select SERIO" rather than
> "depends on SERIO", and "select" does not respect dependencies.
> 
> bloat-o-meter output filtered to not show removed entries with awk
> '$3 != "-"' as the list was very long.
> 
> add/remove: 0/385 grow/shrink: 2/18 up/down: 14/-54016 (-54002)
> function                                     old     new   delta
> chr_dev_init                                 193     205     +12
> selinux_setprocattr                         1167    1169      +2
> static.__warned                              557     556      -1
> start_kernel                                 840     835      -5
> proc_root_init                               167     162      -5
> unregister_console                           165     157      -8
> sys_setsid                                   213     205      -8
> sys_vhangup                                   37      21     -16
> daemonize                                    689     673     -16
> t_stop                                        72      54     -18
> t_next                                       129     108     -21
> static.do_acct_process                       838     806     -32
> release_task                                1157    1125     -32
> do_exit                                     2325    2288     -37
> t_start                                      269     221     -48
> static.__func__                            18289   18219     -70
> do_task_stat                                2962    2892     -70
> flush_unauthorized_files                     740     614    -126
> static._rs                                  1440    1280    -160
> static.__key                                8560    8384    -176
> 
> Signed-off-by: Joe Millenbach <jmillenbach@gmail.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>

This is a nice idea, but I feel it's a bit too late in the 3.8 merge
window cycle for me to add this to linux-next at this point in time.

Can you rediff this once 3.8-rc1 is out and send it to me then?  That
way we can get a lot more testing in linux-next in order to make sure
it's ready for 3.9?

thanks,

greg k-h

^ permalink raw reply

* [GIT PATCH] TTY/Serial fix for 3.7-rc7
From: Greg KH @ 2012-11-26 23:19 UTC (permalink / raw)
  To: Linus Torvalds, Alan Cox, Jiri Slaby
  Cc: Andrew Morton, linux-kernel, linux-serial

The following changes since commit f4a75d2eb7b1e2206094b901be09adb31ba63681:

  Linux 3.7-rc6 (2012-11-16 17:42:40 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git/ tags/tty-3.7-rc7

for you to fetch changes up to b1a925f44a3a21c538144e30b08f966cad7adb63:

  tty vt: Fix a regression in command line edition (2012-11-21 16:45:32 -0800)

----------------------------------------------------------------
TTY fix for 3.7-rc7

Here is a single fix for a reported regression in 3.7-rc5 for the tty
layer.  This fix has been in the linux-next tree and solves the reported
problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

----------------------------------------------------------------
Jean-François Moine (1):
      tty vt: Fix a regression in command line edition

 drivers/tty/vt/vt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v3] tty: Add driver unthrottle in ioctl(...,TCFLSH,..).
From: Ilya Zykov @ 2012-11-26 23:15 UTC (permalink / raw)
  To: Alan Cox; +Cc: Greg Kroah-Hartman, linux-serial, linux-kernel, ilya

Sorry. Correct patch format.

Regression 'tty: fix "IRQ45: nobody cared"'
Regression commit 7b292b4bf9a9d6098440d85616d6ca4c608b8304

  Function reset_buffer_flags() also invoked during the ioctl(...,TCFLSH,..). 
At the time of request we can have full buffers and throttled driver too. 
If we don't unthrottle driver, we can get forever throttled driver, because,
after request, we will have empty buffers and throttled driver and 
there is no place to unthrottle driver.
It simple reproduce with "pty" pair then one side sleep on tty->write_wait,
and other side do ioctl(...,TCFLSH,..). Then there is no place to do writers wake up.


Signed-off-by: Ilya Zykov <ilya@ilyx.ru>
---

diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 12b1fa0..a038be1 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -1098,10 +1098,12 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
 	case TCIFLUSH:
 		if (ld && ld->ops->flush_buffer)
 			ld->ops->flush_buffer(tty);
+		tty_unthrottle(tty);
 		break;
 	case TCIOFLUSH:
 		if (ld && ld->ops->flush_buffer)
 			ld->ops->flush_buffer(tty);
+		tty_unthrottle(tty);
 		/* fall through */
 	case TCOFLUSH:
 		tty_driver_flush_buffer(tty);

^ permalink raw reply related

* [PATCH v3] tty: Add driver unthrottle in ioctl(...,TCFLSH,..).
From: Ilya Zykov @ 2012-11-26 22:09 UTC (permalink / raw)
  To: Alan Cox; +Cc: Greg Kroah-Hartman, linux-kernel, linux-serial, ilya

Regression 'tty: fix "IRQ45: nobody cared"'
Regression commit 7b292b4bf9a9d6098440d85616d6ca4c608b8304

  Function reset_buffer_flags() also invoked during the ioctl(...,TCFLSH,..). 
At the time of request we can have full buffers and throttled driver too. 
If we don't unthrottle driver, we can get forever throttled driver, because,
after request, we will have empty buffers and throttled driver and 
there is no place to unthrottle driver.
It simple reproduce with "pty" pair then one side sleep on tty->write_wait,
and other side do ioctl(...,TCFLSH,..). Then there is no place to do writers wake up.


Signed-off-by: Ilya Zykov <ilya@ilyx.ru>
---

diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 12b1fa0..a038be1 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -1098,10 +1098,12 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
        case TCIFLUSH:
                if (ld && ld->ops->flush_buffer)
                        ld->ops->flush_buffer(tty);
+               tty_unthrottle(tty);
                break;
        case TCIOFLUSH:
                if (ld && ld->ops->flush_buffer)
                        ld->ops->flush_buffer(tty);
+                tty_unthrottle(tty);
                /* fall through */
        case TCOFLUSH:
                tty_driver_flush_buffer(tty);

^ permalink raw reply related

* [PATCH -next] tty/serial: fix ifx6x60.c declaration warning
From: Randy Dunlap @ 2012-11-26 19:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Cox, linux-serial
  Cc: Stephen Rothwell, linux-next, linux-kernel, Andrew Morton,
	Russ Gorby
In-Reply-To: <20121127011738.9ecd7971a7ea2e3d09a9450d@canb.auug.org.au>

From: Randy Dunlap <rdunlap@infradead.org>

Fix gcc warning of mixed data/code:

drivers/tty/serial/ifx6x60.c:516:2: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Russ Gorby <russ.gorby@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
---
 drivers/tty/serial/ifx6x60.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-next-20121126.orig/drivers/tty/serial/ifx6x60.c
+++ linux-next-20121126/drivers/tty/serial/ifx6x60.c
@@ -510,10 +510,11 @@ static int ifx_spi_write(struct tty_stru
 	unsigned char *tmp_buf = (unsigned char *)buf;
 	unsigned long flags;
 	bool is_fifo_empty;
+	int tx_count;
 
 	spin_lock_irqsave(&ifx_dev->fifo_lock, flags);
 	is_fifo_empty = kfifo_is_empty(&ifx_dev->tx_fifo);
-	int tx_count = kfifo_in(&ifx_dev->tx_fifo, tmp_buf, count);
+	tx_count = kfifo_in(&ifx_dev->tx_fifo, tmp_buf, count);
 	spin_unlock_irqrestore(&ifx_dev->fifo_lock, flags);
 	if (is_fifo_empty)
 		mrdy_assert(ifx_dev);

^ permalink raw reply

* Re: Serial: Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs
From: Matt Schulte @ 2012-11-26  2:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-serial, Alan Cox, Theodore Ts'o
In-Reply-To: <20121126022222.GA5046@kroah.com>

On Sun, Nov 25, 2012 at 8:22 PM, Greg Kroah-Hartman <greg@kroah.com> wrote:
> On Sun, Nov 25, 2012 at 06:54:11PM -0600, Matt Schulte wrote:
>> On Wed, Nov 21, 2012 at 5:37 PM, Greg Kroah-Hartman <greg@kroah.com> wrote:
>> > On Mon, Nov 19, 2012 at 09:12:04AM -0600, Matt Schulte wrote:
>> >> Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs.
>> >>
>> >> Built against tty-next 54d5f88f25c38e5500a17b16240cb3775af00876
>> >
>> > This patch was line-wrapped, and I had to hand-edit it to get it to
>> > apply.  Next time, please fix your email client to not do that.
>> >
>>
>> Sorry about that, don't know why that last one line-wrapped and the rest didn't.
>
> The others did to, I edited them by hand :)

Then a very big thank you!

^ permalink raw reply

* Re: Serial: Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs
From: Greg Kroah-Hartman @ 2012-11-26  2:22 UTC (permalink / raw)
  To: Matt Schulte; +Cc: linux-serial, Alan Cox, Theodore Ts'o
In-Reply-To: <CAJp1Oe5yS2MOfCpMs3=_DnQ5Jo1mUwhO0rSBSd9oNynSBRCPtQ@mail.gmail.com>

On Sun, Nov 25, 2012 at 06:54:11PM -0600, Matt Schulte wrote:
> On Wed, Nov 21, 2012 at 5:37 PM, Greg Kroah-Hartman <greg@kroah.com> wrote:
> > On Mon, Nov 19, 2012 at 09:12:04AM -0600, Matt Schulte wrote:
> >> Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs.
> >>
> >> Built against tty-next 54d5f88f25c38e5500a17b16240cb3775af00876
> >
> > This patch was line-wrapped, and I had to hand-edit it to get it to
> > apply.  Next time, please fix your email client to not do that.
> >
> 
> Sorry about that, don't know why that last one line-wrapped and the rest didn't.

The others did to, I edited them by hand :)

greg k-h

^ permalink raw reply

* Re: Serial: Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs
From: Matt Schulte @ 2012-11-26  0:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-serial, Alan Cox, Theodore Ts'o
In-Reply-To: <20121121233737.GA8964@kroah.com>

On Wed, Nov 21, 2012 at 5:37 PM, Greg Kroah-Hartman <greg@kroah.com> wrote:
> On Mon, Nov 19, 2012 at 09:12:04AM -0600, Matt Schulte wrote:
>> Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs.
>>
>> Built against tty-next 54d5f88f25c38e5500a17b16240cb3775af00876
>
> This patch was line-wrapped, and I had to hand-edit it to get it to
> apply.  Next time, please fix your email client to not do that.
>

Sorry about that, don't know why that last one line-wrapped and the rest didn't.

Matt Schulte

^ permalink raw reply

* Re: [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct()
From: Yan Hong @ 2012-11-23 15:04 UTC (permalink / raw)
  To: Alan Cox; +Cc: gregkh, linux-serial
In-Reply-To: <20121123145107.22bab04c@pyramind.ukuu.org.uk>

2012/11/23 Alan Cox <alan@lxorguk.ukuu.org.uk>:
> On Fri, 23 Nov 2012 22:41:47 +0800
> Yan Hong <clouds.yan@gmail.com> wrote:
>
>> tty_struct is already zeroed, no need to zero its field again.
>
> True but its asking for impossible to find bugs later if this changes

If it's true, we should have concern for all memset() usage. Is this
case special?

Thanks

^ permalink raw reply

* Re: [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct()
From: Alan Cox @ 2012-11-23 14:51 UTC (permalink / raw)
  To: Yan Hong; +Cc: gregkh, linux-serial
In-Reply-To: <1353681708-5413-1-git-send-email-clouds.yan@gmail.com>

On Fri, 23 Nov 2012 22:41:47 +0800
Yan Hong <clouds.yan@gmail.com> wrote:

> tty_struct is already zeroed, no need to zero its field again.

True but its asking for impossible to find bugs later if this changes

^ permalink raw reply

* [PATCH 2/2] tty: remove useless initialization in tty_open
From: Yan Hong @ 2012-11-23 14:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial
In-Reply-To: <1353681708-5413-1-git-send-email-clouds.yan@gmail.com>

retval must be zero here, no need to set it to zero explicitly.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
 drivers/tty/tty_io.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index e278edf..6d90e9b 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1928,7 +1928,6 @@ retry_open:
 
 	noctty = filp->f_flags & O_NOCTTY;
 	index  = -1;
-	retval = 0;
 
 	mutex_lock(&tty_mutex);
 	/* This is protected by the tty_mutex */
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/2] tty: remove redundant initialization in initialize_tty_struct()
From: Yan Hong @ 2012-11-23 14:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial

tty_struct is already zeroed, no need to zero its field again.

Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
Actually alloc_tty_struct() already zerod tty_struct. Logically speaking
these two functions can be called independently, but they are always called
in pair in current code. Maybe someday we can arrange only one of them
zero the memory and let the other expect a zeroed tty_struct (and document
this assumption).

 drivers/tty/tty_io.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 2ea176b..e278edf 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2935,8 +2935,6 @@ void initialize_tty_struct(struct tty_struct *tty,
 	kref_init(&tty->kref);
 	tty->magic = TTY_MAGIC;
 	tty_ldisc_init(tty);
-	tty->session = NULL;
-	tty->pgrp = NULL;
 	tty->overrun_time = jiffies;
 	tty_buffer_init(tty);
 	mutex_init(&tty->legacy_mutex);
-- 
1.7.9.5


^ permalink raw reply related

* KINGDOM NELSON
From: KINGDOM NELSON @ 2012-11-23  6:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: KINGDOM NELSON.rtf --]
[-- Type: application/msword, Size: 3465 bytes --]

^ permalink raw reply

* Re: [PATCH] serial: ifx6x60: Add modem power off function in the platform reboot process
From: Jun Chen @ 2012-11-23 11:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: Bi Chao, serial, Linux Kernel, russ.gorby
In-Reply-To: <20121122110857.2f7c9804@bob.linux.org.uk>

On Thu, 2012-11-22 at 11:08 +0000, Alan Cox wrote:
> On Thu, 22 Nov 2012 06:19:23 -0500
> Jun Chen <jun.d.chen@intel.com> wrote:
> 
> > 
> > This patch add modem power off function in the reboot process
> > according registering reboot callback to the reboot_notifier_list.
> > Also realizing the spi shutdown function.
> 
> Need to unregister the reboot notifier in the ifx_spi_exit path. If the
> driver module is unloaded you leave the callback present and the kernel
> will call into freed memory.
> 
> Alan
Yes,thanks! I will update this patch again.


^ permalink raw reply

* [PATCH] serial: ifx6x60: Add modem power off function in the platform reboot process
From: Jun Chen @ 2012-11-23 11:07 UTC (permalink / raw)
  To: Alan Cox; +Cc: Jun Chen, Linux Kernel, russ.gorby, serial, Bi Chao


This patch add modem power off function in the reboot process according registering
reboot callback to the reboot_notifier_list. Also realizing the spi shutdown function.

Signed-off-by: Bi Chao <chao.bi@intel.com>
Signed-off-by: Chen Jun <jun.d.chen@intel.com>
---
 drivers/tty/serial/ifx6x60.c |   56 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 5b9bc19..f3c54e9 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -60,6 +60,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/spi/ifx_modem.h>
 #include <linux/delay.h>
+#include <linux/reboot.h>
 
 #include "ifx6x60.h"
 
@@ -72,8 +73,14 @@
 #define IFX_SPI_HEADER_0		(-1)
 #define IFX_SPI_HEADER_F		(-2)
 
+#define PO_POST_DELAY		200
+#define IFX_MDM_RST_PMU	4
+
 /* forward reference */
 static void ifx_spi_handle_srdy(struct ifx_spi_device *ifx_dev);
+static int ifx_modem_reboot_callback(struct notifier_block *nfb,
+				unsigned long event, void *data);
+static int ifx_modem_power_off(struct ifx_spi_device *ifx_dev);
 
 /* local variables */
 static int spi_bpw = 16;		/* 8, 16 or 32 bit word length */
@@ -81,6 +88,29 @@ static struct tty_driver *tty_drv;
 static struct ifx_spi_device *saved_ifx_dev;
 static struct lock_class_key ifx_spi_key;
 
+static struct notifier_block ifx_modem_reboot_notifier_block = {
+	.notifier_call = ifx_modem_reboot_callback,
+};
+
+static int ifx_modem_power_off(struct ifx_spi_device *ifx_dev)
+{
+	gpio_set_value(IFX_MDM_RST_PMU, 1);
+	msleep(PO_POST_DELAY);
+
+	return 0;
+}
+
+static int ifx_modem_reboot_callback(struct notifier_block *nfb,
+				 unsigned long event, void *data)
+{
+	if (saved_ifx_dev)
+		ifx_modem_power_off(saved_ifx_dev);
+	else
+		pr_warn("no ifx modem active;\n");
+
+	return NOTIFY_OK;
+}
+
 /* GPIO/GPE settings */
 
 /**
@@ -1219,6 +1249,9 @@ static int ifx_spi_spi_remove(struct spi_device *spi)
 
 static void ifx_spi_spi_shutdown(struct spi_device *spi)
 {
+	struct ifx_spi_device *ifx_dev = spi_get_drvdata(spi);
+
+	ifx_modem_power_off(ifx_dev);
 }
 
 /*
@@ -1354,7 +1387,9 @@ static void __exit ifx_spi_exit(void)
 {
 	/* unregister */
 	tty_unregister_driver(tty_drv);
+	put_tty_driver(tty_drv);
 	spi_unregister_driver((void *)&ifx_spi_driver);
+	unregister_reboot_notifier(&ifx_modem_reboot_notifier_block);
 }
 
 /**
@@ -1389,16 +1424,31 @@ static int __init ifx_spi_init(void)
 	if (result) {
 		pr_err("%s: tty_register_driver failed(%d)",
 			DRVNAME, result);
-		put_tty_driver(tty_drv);
-		return result;
+		goto err_free_tty;
 	}
 
 	result = spi_register_driver((void *)&ifx_spi_driver);
 	if (result) {
 		pr_err("%s: spi_register_driver failed(%d)",
 			DRVNAME, result);
-		tty_unregister_driver(tty_drv);
+		goto err_unreg_tty;
+	}
+
+	result = register_reboot_notifier(&ifx_modem_reboot_notifier_block);
+	if (result) {
+		pr_err("%s: register ifx modem reboot notifier failed(%d)",
+			DRVNAME, result);
+		goto err_unreg_spi;
 	}
+
+	return 0;
+err_unreg_spi:
+	spi_unregister_driver((void *)&ifx_spi_driver);
+err_unreg_tty:
+	tty_unregister_driver(tty_drv);
+err_free_tty:
+	put_tty_driver(tty_drv);
+
 	return result;
 }
 
-- 
1.7.4.1




^ permalink raw reply related

* [PATCH] serial:ifx6x60:Delete SPI timer when shut down port
From: chao bi @ 2012-11-23  1:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: richardx.r.gorby, jun.d.chen, linux-serial, linux-kernel


When shut down SPI port, it's possible that MRDY has been asserted and a SPI
timer was activated waiting for SRDY assert, in the case, it needs to delete
this timer.

Signed-off-by: Chen Jun <jun.d.chen@intel.com>
Signed-off-by: channing <chao.bi@intel.com>
---
 drivers/tty/serial/ifx6x60.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 5b9bc19..f5e9666 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -552,6 +552,7 @@ static void ifx_port_shutdown(struct tty_port *port)
 		container_of(port, struct ifx_spi_device, tty_port);
 
 	mrdy_set_low(ifx_dev);
+	del_timer(&ifx_dev->spi_timer);
 	clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags);
 	tasklet_kill(&ifx_dev->io_work_tasklet);
 }
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH] serial:ifx6x60:Delete SPI timer when shut down port
From: chao bi @ 2012-11-23  1:25 UTC (permalink / raw)
  To: Alan Cox; +Cc: richardx.r.gorby, jun.d.chen, linux-serial, linux-kernel
In-Reply-To: <20121122110640.3fd5ef9b@bob.linux.org.uk>

On Thu, 2012-11-22 at 11:06 +0000, Alan Cox wrote:
> > --- a/drivers/tty/serial/ifx6x60.c
> > +++ b/drivers/tty/serial/ifx6x60.c
> > @@ -552,7 +552,10 @@ static void ifx_port_shutdown(struct tty_port
> > *port) container_of(port, struct ifx_spi_device, tty_port);
> >  
> >  	mrdy_set_low(ifx_dev);
> > -	clear_bit(IFX_SPI_STATE_TIMER_PENDING, &ifx_dev->flags);
> > +	if (test_and_clear_bit(IFX_SPI_STATE_TIMER_PENDING,
> > +		&ifx_dev->flags)) {
> > +		del_timer(&ifx_dev->spi_timer);
> > +	}
> 
> You don't actually need the test here as far as I can see. Providing a
> timer has been initialised (init_timer) then running del_timer is safe
> even if the timer is not currently queued or has completed.
> 
> Alan

Yes, thanks. I'll update it.

^ permalink raw reply

* Re: [PATCH 1/4] OF: Add helper for matching against linux,stdout-path
From: Grant Likely @ 2012-11-22 21:21 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman,
	devicetree-discuss, Nicolas Ferre, Sascha Hauer, Sascha Hauer,
	linux-arm-kernel@lists.infradead.org, Alan Cox
In-Reply-To: <20121122193521.GA4398@game.jcrosoft.org>

On Thu, Nov 22, 2012 at 7:35 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 15:31 Thu 22 Nov     , Grant Likely wrote:
>> On Thu, 22 Nov 2012 06:41:38 +0100, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
>> > On 18:03 Wed 21 Nov     , Grant Likely wrote:
>> > > On Wed, Nov 21, 2012 at 3:57 PM, Jean-Christophe PLAGNIOL-VILLARD
>> > > <plagnioj@jcrosoft.com> wrote:
>> > > > From: Sascha Hauer <s.hauer@pengutronix.de>
>> > > >
>> > > > devicetrees may have a linux,stdout-path or stdout-path property
>> > > > in the chosen node describing the console device. This adds a helper
>> > > > function to match a device against this property and retrieve the options
>> > > > so a driver can call add_preferred_console for a matching device.
>> > >
>> > > NIce. Looks like the right behaviour, but is a little inefficient.
>> > > Since the stdout property doesn't change this code could be called
>> > > once right after the tree is unflattened and then cache the pointer to
>> > > the node anarguments. Can you add the code to of_alias_scan()?
>> > do we assume that we can have only one stdout-path?
>> >
>> > I think we could have more serial, framebuffer console
>>
>> Nope. stdout-path as currently defined is only one device. Someone would
>> need to propose an extension for multiple stdout's before I'd bother
>> trying to support that.
> ok for this version I do not put it but I need it
>
> I want to have 2 console uart and framebuffer
>
> Personnaly I'd just allow multiple instance of stdout-path

Propose a binding extension.

g.

^ permalink raw reply

* Fund transfer.
From: David @ 2012-11-22 15:06 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 62 bytes --]


Open the attachment file for fund transfer/confidential.


[-- Attachment #2: SOUTH AFRICAN GOVERNMENT PROJECT..doc --]
[-- Type: application/msword, Size: 57856 bytes --]

^ permalink raw reply

* [PATCH] serial: samsung: fix potential soft lockup during uart write
From: Thomas Abraham @ 2012-11-22 12:36 UTC (permalink / raw)
  To: linux-serial
  Cc: gregkh, linux-samsung-soc, kgene.kim, ben-linux, kyungmin.park,
	hk619.kim

Certain tty line discipline implementations such slip and bluetooth hci invoke
the serial core uart_write() api in their write_wakeup callback. This leads to
a soft lockup with samsung serial driver since the uart port lock is taken in
the driver's interrupt handler and uart_write() attempts to take the same lock
again.

Fix this issue by releasing the uart port lock before the call to
uart_write_wakeup() in the tx handler. Also move the spin-lock/unlock sequence
from s3c64xx_serial_handle_irq() function into the tx and rx irq handlers so
that this change is applicable to s3c24xx platforms as well.

Reported-by: Kyungmin Park <kyungmin.park@samsung.com>
Reported-by: Hyeonkook Kim <hk619.kim@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
 drivers/tty/serial/samsung.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 7f04717..97bac4c 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -223,8 +223,11 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id)
 	struct uart_port *port = &ourport->port;
 	struct tty_struct *tty = port->state->port.tty;
 	unsigned int ufcon, ch, flag, ufstat, uerstat;
+	unsigned long flags;
 	int max_count = 64;
 
+	spin_lock_irqsave(&port->lock, flags);
+
 	while (max_count-- > 0) {
 		ufcon = rd_regl(port, S3C2410_UFCON);
 		ufstat = rd_regl(port, S3C2410_UFSTAT);
@@ -299,6 +302,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id)
 	tty_flip_buffer_push(tty);
 
  out:
+	spin_unlock_irqrestore(&port->lock, flags);
 	return IRQ_HANDLED;
 }
 
@@ -307,8 +311,11 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
 	struct s3c24xx_uart_port *ourport = id;
 	struct uart_port *port = &ourport->port;
 	struct circ_buf *xmit = &port->state->xmit;
+	unsigned long flags;
 	int count = 256;
 
+	spin_lock_irqsave(&port->lock, flags);
+
 	if (port->x_char) {
 		wr_regb(port, S3C2410_UTXH, port->x_char);
 		port->icount.tx++;
@@ -336,13 +343,17 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id)
 		port->icount.tx++;
 	}
 
-	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) {
+		spin_unlock(&port->lock);
 		uart_write_wakeup(port);
+		spin_lock(&port->lock);
+	}
 
 	if (uart_circ_empty(xmit))
 		s3c24xx_serial_stop_tx(port);
 
  out:
+	spin_unlock_irqrestore(&port->lock, flags);
 	return IRQ_HANDLED;
 }
 
@@ -352,10 +363,8 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
 	struct s3c24xx_uart_port *ourport = id;
 	struct uart_port *port = &ourport->port;
 	unsigned int pend = rd_regl(port, S3C64XX_UINTP);
-	unsigned long flags;
 	irqreturn_t ret = IRQ_HANDLED;
 
-	spin_lock_irqsave(&port->lock, flags);
 	if (pend & S3C64XX_UINTM_RXD_MSK) {
 		ret = s3c24xx_serial_rx_chars(irq, id);
 		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_RXD_MSK);
@@ -364,7 +373,6 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id)
 		ret = s3c24xx_serial_tx_chars(irq, id);
 		wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
 	}
-	spin_unlock_irqrestore(&port->lock, flags);
 	return ret;
 }
 
-- 
1.6.6.rc2


^ permalink raw reply related

* Re: [PATCH 1/4] OF: Add helper for matching against linux,stdout-path
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-22 19:35 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss,
	Sascha Hauer, linux-serial@vger.kernel.org, Greg Kroah-Hartman,
	Sascha Hauer, Alan Cox, Nicolas Ferre
In-Reply-To: <20121122153152.2B9CB3E129E@localhost>

On 15:31 Thu 22 Nov     , Grant Likely wrote:
> On Thu, 22 Nov 2012 06:41:38 +0100, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> > On 18:03 Wed 21 Nov     , Grant Likely wrote:
> > > On Wed, Nov 21, 2012 at 3:57 PM, Jean-Christophe PLAGNIOL-VILLARD
> > > <plagnioj@jcrosoft.com> wrote:
> > > > From: Sascha Hauer <s.hauer@pengutronix.de>
> > > >
> > > > devicetrees may have a linux,stdout-path or stdout-path property
> > > > in the chosen node describing the console device. This adds a helper
> > > > function to match a device against this property and retrieve the options
> > > > so a driver can call add_preferred_console for a matching device.
> > > 
> > > NIce. Looks like the right behaviour, but is a little inefficient.
> > > Since the stdout property doesn't change this code could be called
> > > once right after the tree is unflattened and then cache the pointer to
> > > the node anarguments. Can you add the code to of_alias_scan()?
> > do we assume that we can have only one stdout-path?
> > 
> > I think we could have more serial, framebuffer console
> 
> Nope. stdout-path as currently defined is only one device. Someone would
> need to propose an extension for multiple stdout's before I'd bother
> trying to support that.
ok for this version I do not put it but I need it

I want to have 2 console uart and framebuffer

Personnaly I'd just allow multiple instance of stdout-path

what do you prefer

Best Regards,
J.

^ permalink raw reply

* Re: Serial: Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs
From: Greg Kroah-Hartman @ 2012-11-21 23:37 UTC (permalink / raw)
  To: Matt Schulte; +Cc: linux-serial, Alan Cox, Theodore Ts'o
In-Reply-To: <CAJp1Oe4vSwBgVe_bOV00ojvYy2fd7YWNfrEfJ+de_JSiyb7AHA@mail.gmail.com>

On Mon, Nov 19, 2012 at 09:12:04AM -0600, Matt Schulte wrote:
> Add support for new devices: Exar's XR17V35x family of multi-port PCIe UARTs.
> 
> Built against tty-next 54d5f88f25c38e5500a17b16240cb3775af00876

This patch was line-wrapped, and I had to hand-edit it to get it to
apply.  Next time, please fix your email client to not do that.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH] tty: Add driver unthrottle in ioctl(...,TCFLSH,..).
From: Alan Cox @ 2012-11-21 21:30 UTC (permalink / raw)
  To: Ilya Zykov
  Cc: Andrew McGregor, Greg Kroah-Hartman, Alan Cox, linux-kernel,
	linux-serial
In-Reply-To: <50AD43DB.4030800@ilyx.ru>

> Function reset_buffer_flags() also invoked during the
> ioctl(...,TCFLSH,..). At the time of request we can have full buffers
> and throttled driver too. If we don't unthrottle driver, we can get
> forever throttled driver, because after request, we will have
> empty buffers and throttled driver and there is no place to unthrottle driver.
> It simple reproduce with "pty" pair then one side sleep on tty->write_wait,
> and other side do ioctl(...,TCFLSH,..). Then there is no place to do writers wake up.


So instead of revertng it why not just fix it ? Just add an argument to
the reset_buffer_flags function to indicate if unthrottling is permitted.

Alan

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox