linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-04-23  4:34 Stephen Rothwell
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-23  4:34 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, Oliver Neukum, Greg KH

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

Hi Alan,

Today's linux-next merge of the ttydev tree got a conflict in
drivers/usb/serial/option.c between commit
3355625b2b58b213e481b071aa01d15240f0d8dd ("USB: removal of
tty->low_latency hack dating back to the old serial code") from the
usb.current tree and commit 1156df675ae541b21dc343912413f201f87a3909
("tty-usb-use-port") from the ttydev tree.

Just context changes.  I fixed it up and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 19:21               ` Oliver Neukum
@ 2009-07-28 19:24                 ` Alan Cox
  0 siblings, 0 replies; 27+ messages in thread
From: Alan Cox @ 2009-07-28 19:24 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: Greg KH, Stephen Rothwell, linux-next, linux-kernel

On Tue, 28 Jul 2009 21:21:32 +0200
Oliver Neukum <oliver@neukum.org> wrote:

> Am Dienstag, 28. Juli 2009 18:34:20 schrieb Greg KH:
> > > > Oliver: I'll send you an alternative patch later today/tomorrow that
> > > > uses the ASYNC flags.
> > >
> > > Should I just drop Oliver's existing patch from my tree for now then?
> >
> > Ok, in order to get a good merge for today, I've dropped it now.
> >
> > Oliver, care to work with Alan to get something that is agreeable to
> > everyone?
> 
> Sure. Alan, is there a driver you can recommend for looking at to learn how
> to correctly use the tty layer?

I'm no longer tty maintainer, please take it up with Linus.

Alan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 16:34             ` Greg KH
@ 2009-07-28 19:21               ` Oliver Neukum
  2009-07-28 19:24                 ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Oliver Neukum @ 2009-07-28 19:21 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Cox, Stephen Rothwell, linux-next, linux-kernel

Am Dienstag, 28. Juli 2009 18:34:20 schrieb Greg KH:
> > > Oliver: I'll send you an alternative patch later today/tomorrow that
> > > uses the ASYNC flags.
> >
> > Should I just drop Oliver's existing patch from my tree for now then?
>
> Ok, in order to get a good merge for today, I've dropped it now.
>
> Oliver, care to work with Alan to get something that is agreeable to
> everyone?

Sure. Alan, is there a driver you can recommend for looking at to learn how
to correctly use the tty layer?

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 16:32           ` Greg KH
@ 2009-07-28 16:34             ` Greg KH
  2009-07-28 19:21               ` Oliver Neukum
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2009-07-28 16:34 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, Oliver Neukum, linux-next, linux-kernel

On Tue, Jul 28, 2009 at 09:32:22AM -0700, Greg KH wrote:
> On Tue, Jul 28, 2009 at 02:17:40PM +0100, Alan Cox wrote:
> > On Tue, 28 Jul 2009 22:35:04 +1000
> > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > > Hi Alan,
> > > 
> > > On Tue, 28 Jul 2009 13:29:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > > >
> > > > I need to look at the actual diff, but the combination looks completely
> > > > bogus unless I'm misreading the fixup which is possible.
> > > 
> > > Below is the actual patch from the usb.current tree.
> > 
> > Thanks - ok that is probably safe. The change I was worried about (the
> > error paths not adjusting port->count are ok as it gets zeroed within the
> > mutex)
> > 
> > Not sure its safe versus hangup but neither was the old code 8)
> > 
> > Oliver: I'll send you an alternative patch later today/tomorrow that uses
> > the ASYNC flags.
> 
> Should I just drop Oliver's existing patch from my tree for now then?

Ok, in order to get a good merge for today, I've dropped it now.

Oliver, care to work with Alan to get something that is agreeable to
everyone?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 13:17         ` Alan Cox
@ 2009-07-28 16:32           ` Greg KH
  2009-07-28 16:34             ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2009-07-28 16:32 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, Oliver Neukum, linux-next, linux-kernel

On Tue, Jul 28, 2009 at 02:17:40PM +0100, Alan Cox wrote:
> On Tue, 28 Jul 2009 22:35:04 +1000
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> > Hi Alan,
> > 
> > On Tue, 28 Jul 2009 13:29:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > >
> > > I need to look at the actual diff, but the combination looks completely
> > > bogus unless I'm misreading the fixup which is possible.
> > 
> > Below is the actual patch from the usb.current tree.
> 
> Thanks - ok that is probably safe. The change I was worried about (the
> error paths not adjusting port->count are ok as it gets zeroed within the
> mutex)
> 
> Not sure its safe versus hangup but neither was the old code 8)
> 
> Oliver: I'll send you an alternative patch later today/tomorrow that uses
> the ASYNC flags.

Should I just drop Oliver's existing patch from my tree for now then?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 12:35       ` Stephen Rothwell
@ 2009-07-28 13:17         ` Alan Cox
  2009-07-28 16:32           ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2009-07-28 13:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Oliver Neukum, linux-next, linux-kernel, Greg KH

On Tue, 28 Jul 2009 22:35:04 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Alan,
> 
> On Tue, 28 Jul 2009 13:29:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> >
> > I need to look at the actual diff, but the combination looks completely
> > bogus unless I'm misreading the fixup which is possible.
> 
> Below is the actual patch from the usb.current tree.

Thanks - ok that is probably safe. The change I was worried about (the
error paths not adjusting port->count are ok as it gets zeroed within the
mutex)

Not sure its safe versus hangup but neither was the old code 8)

Oliver: I'll send you an alternative patch later today/tomorrow that uses
the ASYNC flags.

Alan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 12:29     ` Alan Cox
@ 2009-07-28 12:35       ` Stephen Rothwell
  2009-07-28 13:17         ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-07-28 12:35 UTC (permalink / raw)
  To: Alan Cox; +Cc: Oliver Neukum, linux-next, linux-kernel, Greg KH

Hi Alan,

On Tue, 28 Jul 2009 13:29:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
> I need to look at the actual diff, but the combination looks completely
> bogus unless I'm misreading the fixup which is possible.

Below is the actual patch from the usb.current tree.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

>From oliver@neukum.org  Sat Jul 18 15:45:44 2009
From: Oliver Neukum <oliver@neukum.org>
Date: Sat, 18 Jul 2009 15:47:17 +0200
Subject: USB: fix usage count in usb serial generic open regarding autoresume
To: Matthew Garrett <mjg59@srcf.ucam.org>, Greg KH <greg@kroah.com>, Alan Stern <stern@rowland.harvard.edu>, linux-usb@vger.kernel.org
Message-ID: <200907181547.17813.oliver@neukum.org>
Content-Disposition: inline


The resume handler has to resubmit the reading URBs if the device is
resumed while opened. But the open() method bumps the counter before
it resumes a device. The fix is to increment the counter only after
the resumption or if no resumption is attempted.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Tested-by: Matthew Garrett <mjg@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/usb/serial/usb-serial.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -214,15 +214,13 @@ static int serial_open (struct tty_struc
 		goto bailout_port_put;
 	}
 
-	++port->port.count;
-
 	/* set up our port structure making the tty driver
 	 * remember our port object, and us it */
 	tty->driver_data = port;
 	tty_port_tty_set(&port->port, tty);
 
 	/* If the console is attached, the device is already open */
-	if (port->port.count == 1 && !port->console) {
+	if (!port->port.count && !port->console) {
 
 		/* lock this module before we call it
 		 * this may fail, which means we must bail out,
@@ -240,12 +238,16 @@ static int serial_open (struct tty_struc
 		if (retval)
 			goto bailout_module_put;
 
+		++port->port.count;
+
 		/* only call the device specific open if this
 		 * is the first time the port is opened */
 		retval = serial->type->open(tty, port, filp);
 		if (retval)
 			goto bailout_interface_put;
 		mutex_unlock(&serial->disc_mutex);
+	} else {
+		++port->port.count;
 	}
 	mutex_unlock(&port->mutex);
 	/* Now do the correct tty layer semantics */

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 12:10   ` Oliver Neukum
@ 2009-07-28 12:29     ` Alan Cox
  2009-07-28 12:35       ` Stephen Rothwell
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2009-07-28 12:29 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: Stephen Rothwell, linux-next, linux-kernel, Greg KH

> As serial_open() takes the lock, resume() must not do so.
> If however, remote wakeup is used a lock must be taken
> to look at port->count reliably. As this is impossible, the patch
> implementing use of remote wakeup for the option driver
> implements a private flag for opened ports.

I need to look at the actual diff, but the combination looks completely
bogus unless I'm misreading the fixup which is possible.

The way the core serial code and most other drivers do this is to keep
track of the port ASYNC_INITIALIZED flag, which indicates (in the non USB
cases but trivially fixable for the USB cases) that the port hardware is
initialized. We now set it on an open but we don't clear it on
serial_do_down() finishing.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28 10:26 ` Alan Cox
@ 2009-07-28 12:10   ` Oliver Neukum
  2009-07-28 12:29     ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Oliver Neukum @ 2009-07-28 12:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: Stephen Rothwell, linux-next, linux-kernel, Greg KH

Am Dienstag, 28. Juli 2009 12:26:08 schrieb Alan Cox:
> On Tue, 28 Jul 2009 14:01:10 +1000
>
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi Alan,
> >
> > Today's linux-next merge of the ttydev tree got a conflict in
> > drivers/usb/serial/usb-serial.c between commit
> > a00b8d98aca97bfb6fa983f41dae25b424058592 ("USB: fix usage count in usb
> > serial generic open regarding autoresume") from the usb.current tree	
>
> That looks wrong. The extra fiddling with port.count looks both unsafe
> and incorrect. I've never seen the "autoresume" patch referred to so I've
> no idea what it is trying to do

The problem is subdrivers looking at port->count to determine
whether URBs have to be resubmitted. That must happen once.
Therefore if serial_open() needs to do it itself it must make sure
resume() runs without port->count already incremented.

As serial_open() takes the lock, resume() must not do so.
If however, remote wakeup is used a lock must be taken
to look at port->count reliably. As this is impossible, the patch
implementing use of remote wakeup for the option driver
implements a private flag for opened ports.

This code from option_resume():

for (i = 0; i < serial->num_ports; i++) {
		/* walk all ports */
		port = serial->port[i];
		portdata = usb_get_serial_port_data(port);
		mutex_lock(&port->mutex);

		/* skip closed ports */
		if (!port->port.count) {
			mutex_unlock(&port->mutex);
			continue;
		}

		for (j = 0; j < N_IN_URB; j++) {
			urb = portdata->in_urbs[j];
			err = usb_submit_urb(urb, GFP_NOIO);
			if (err < 0) {
				mutex_unlock(&port->mutex);
				err("%s: Error %d for bulk URB %d",
					 __func__, err, i);
				return err;
			}
		}
		mutex_unlock(&port->mutex);

must not take the port->mutex.

Unfortunately I have no access to my trees today and yesterday.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-28  4:01 Stephen Rothwell
@ 2009-07-28 10:26 ` Alan Cox
  2009-07-28 12:10   ` Oliver Neukum
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2009-07-28 10:26 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Oliver Neukum, Greg KH

On Tue, 28 Jul 2009 14:01:10 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi Alan,
> 
> Today's linux-next merge of the ttydev tree got a conflict in
> drivers/usb/serial/usb-serial.c between commit
> a00b8d98aca97bfb6fa983f41dae25b424058592 ("USB: fix usage count in usb
> serial generic open regarding autoresume") from the usb.current tree

That looks wrong. The extra fiddling with port.count looks both unsafe
and incorrect. I've never seen the "autoresume" patch referred to so I've
no idea what it is trying to do

Greg ?

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-07-28  4:01 Stephen Rothwell
  2009-07-28 10:26 ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-07-28  4:01 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, linux-kernel, Oliver Neukum, Greg KH

Hi Alan,

Today's linux-next merge of the ttydev tree got a conflict in
drivers/usb/serial/usb-serial.c between commit
a00b8d98aca97bfb6fa983f41dae25b424058592 ("USB: fix usage count in usb
serial generic open regarding autoresume") from the usb.current tree and
commit 73fed8403623653560cc2f35c9b62891adaf6b4b
("tty-usb-error-unlock-fix") from the ttydev tree.

Just context changes.  I have fixed it up (see below) and can carry the
fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/usb/serial/usb-serial.c
index 06579a8,99188c9..0000000
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@@ -220,8 -224,8 +222,8 @@@ static int serial_open (struct tty_stru
  	tty_port_tty_set(&port->port, tty);
  
  	/* If the console is attached, the device is already open */
 -	if (port->port.count == 1 && !port->console) {
 +	if (!port->port.count && !port->console) {
- 
+ 		first = 1;
  		/* lock this module before we call it
  		 * this may fail, which means we must bail out,
  		 * safe because we are called with BKL held */
@@@ -246,8 -248,7 +248,9 @@@
  		if (retval)
  			goto bailout_interface_put;
  		mutex_unlock(&serial->disc_mutex);
+ 		set_bit(ASYNCB_INITIALIZED, &port->port.flags);
 +	} else {
 +		++port->port.count;
  	}
  	mutex_unlock(&port->mutex);
  	/* Now do the correct tty layer semantics */

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-10  0:06   ` Stephen Rothwell
@ 2009-07-10  0:13     ` Greg KH
  0 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2009-07-10  0:13 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Alan Cox, linux-next, linux-kernel, Jason Wessel

On Fri, Jul 10, 2009 at 10:06:25AM +1000, Stephen Rothwell wrote:
> Hi Greg,
> 
> On Thu, 9 Jul 2009 16:19:56 -0700 Greg KH <greg@kroah.com> wrote:
> >
> > On Thu, Jul 09, 2009 at 01:04:30PM +1000, Stephen Rothwell wrote:
> > > 
> > > Today's linux-next merge of the ttydev tree got conflicts in
> > > drivers/usb/serial/generic.c and include/linux/usb/serial.h between commit
> > > d8298d029cdd5d944c3d8369d2862de94d12ae4b ("USB: serial: regression fix to
> > > move sysrq from hot path") from the usb.current tree and commit
> > > cf8456fe1aaed1776bf4c26c18adef76e472b9fa ("tty-usb-fix-perf-regression")
> > > from the ttydev tree.  Also between commit
> > > a2170a444ef9a89a7ec9acc72d79e5db433effc4 ("USB: serial: optimize sysrq
> > > function calls") from the usb.current tree and commit
> > > bfce6b042a47c9cdd55c7cd231e58710ec1fa4e1 ("tty-usb-fix-kref-leak") from
> > > the ttydev tree.
> > > 
> > > The first two commits above seem to be trying to do the same thing (or
> > > similar) so I have used the ttydev version for now.
> > > 
> > > I fixed them up (see below) and can carry the fixes as necessary.
> > 
> > Thanks for the fix, I don't know what happened in the tty tree, I've not
> > touched the USB tree for a week or so now...
> 
> In case you missed it, Alan has submitted the above two ttydev patches to
> Linus.

Ah, thanks, I'll handle the merge when they hit Linus's tree.

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-09 23:19 ` Greg KH
@ 2009-07-10  0:06   ` Stephen Rothwell
  2009-07-10  0:13     ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-07-10  0:06 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Cox, linux-next, linux-kernel, Jason Wessel

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

Hi Greg,

On Thu, 9 Jul 2009 16:19:56 -0700 Greg KH <greg@kroah.com> wrote:
>
> On Thu, Jul 09, 2009 at 01:04:30PM +1000, Stephen Rothwell wrote:
> > 
> > Today's linux-next merge of the ttydev tree got conflicts in
> > drivers/usb/serial/generic.c and include/linux/usb/serial.h between commit
> > d8298d029cdd5d944c3d8369d2862de94d12ae4b ("USB: serial: regression fix to
> > move sysrq from hot path") from the usb.current tree and commit
> > cf8456fe1aaed1776bf4c26c18adef76e472b9fa ("tty-usb-fix-perf-regression")
> > from the ttydev tree.  Also between commit
> > a2170a444ef9a89a7ec9acc72d79e5db433effc4 ("USB: serial: optimize sysrq
> > function calls") from the usb.current tree and commit
> > bfce6b042a47c9cdd55c7cd231e58710ec1fa4e1 ("tty-usb-fix-kref-leak") from
> > the ttydev tree.
> > 
> > The first two commits above seem to be trying to do the same thing (or
> > similar) so I have used the ttydev version for now.
> > 
> > I fixed them up (see below) and can carry the fixes as necessary.
> 
> Thanks for the fix, I don't know what happened in the tty tree, I've not
> touched the USB tree for a week or so now...

In case you missed it, Alan has submitted the above two ttydev patches to
Linus.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-07-09  3:04 Stephen Rothwell
@ 2009-07-09 23:19 ` Greg KH
  2009-07-10  0:06   ` Stephen Rothwell
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2009-07-09 23:19 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Alan Cox, linux-next, linux-kernel, Jason Wessel

On Thu, Jul 09, 2009 at 01:04:30PM +1000, Stephen Rothwell wrote:
> Hi Alan,
> 
> Today's linux-next merge of the ttydev tree got conflicts in
> drivers/usb/serial/generic.c and include/linux/usb/serial.h between commit
> d8298d029cdd5d944c3d8369d2862de94d12ae4b ("USB: serial: regression fix to
> move sysrq from hot path") from the usb.current tree and commit
> cf8456fe1aaed1776bf4c26c18adef76e472b9fa ("tty-usb-fix-perf-regression")
> from the ttydev tree.  Also between commit
> a2170a444ef9a89a7ec9acc72d79e5db433effc4 ("USB: serial: optimize sysrq
> function calls") from the usb.current tree and commit
> bfce6b042a47c9cdd55c7cd231e58710ec1fa4e1 ("tty-usb-fix-kref-leak") from
> the ttydev tree.
> 
> The first two commits above seem to be trying to do the same thing (or
> similar) so I have used the ttydev version for now.
> 
> I fixed them up (see below) and can carry the fixes as necessary.

Thanks for the fix, I don't know what happened in the tty tree, I've not
touched the USB tree for a week or so now...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-07-09  3:04 Stephen Rothwell
  2009-07-09 23:19 ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-07-09  3:04 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, linux-kernel, Jason Wessel, Greg KH

Hi Alan,

Today's linux-next merge of the ttydev tree got conflicts in
drivers/usb/serial/generic.c and include/linux/usb/serial.h between commit
d8298d029cdd5d944c3d8369d2862de94d12ae4b ("USB: serial: regression fix to
move sysrq from hot path") from the usb.current tree and commit
cf8456fe1aaed1776bf4c26c18adef76e472b9fa ("tty-usb-fix-perf-regression")
from the ttydev tree.  Also between commit
a2170a444ef9a89a7ec9acc72d79e5db433effc4 ("USB: serial: optimize sysrq
function calls") from the usb.current tree and commit
bfce6b042a47c9cdd55c7cd231e58710ec1fa4e1 ("tty-usb-fix-kref-leak") from
the ttydev tree.

The first two commits above seem to be trying to do the same thing (or
similar) so I have used the ttydev version for now.

I fixed them up (see below) and can carry the fixes as necessary.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/usb/serial/generic.c
index 48f6743,21dd6e7..0000000
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
diff --cc include/linux/usb/serial.h
index 4601e0d,0ec50ba..0000000
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@@ -325,34 -330,6 +325,35 @@@ extern struct usb_serial_driver usb_ser
  extern struct bus_type usb_serial_bus_type;
  extern struct tty_driver *usb_serial_tty_driver;
  
- static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port,
++static inline int usb_serial_handle_sysrq_char(struct tty_struct *tty,
++					       struct usb_serial_port *port,
 +					       unsigned int ch)
 +{
 +#ifdef CONFIG_MAGIC_SYSRQ
 +	if (port->sysrq && port->console) {
 +		if (ch && time_before(jiffies, port->sysrq)) {
- 			handle_sysrq(ch, tty_port_tty_get(&port->port));
++			handle_sysrq(ch, tty);
 +			port->sysrq = 0;
 +			return 1;
 +		}
 +		port->sysrq = 0;
 +	}
 +#endif /* CONFIG_MAGIC_SYSRQ */
 +	return 0;
 +}
 +
 +static inline int usb_serial_handle_break(struct usb_serial_port *port)
 +{
 +#ifdef CONFIG_MAGIC_SYSRQ
 +	if (!port->sysrq) {
 +		port->sysrq = jiffies + HZ*5;
 +		return 1;
 +	}
 +	port->sysrq = 0;
 +#endif /* CONFIG_MAGIC_SYSRQ */
 +	return 0;
 +}
 +
  static inline void usb_serial_debug_data(int debug,
  					 struct device *dev,
  					 const char *function, int size,

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-28  4:58         ` Greg KH
@ 2009-04-28  6:45           ` Stephen Rothwell
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-28  6:45 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Cox, Alan Stern, linux-next

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

Hi Greg,

On Mon, 27 Apr 2009 21:58:28 -0700 Greg KH <greg@kroah.com> wrote:
>
> It's all in Linus's tree, and has been for a few days now.  Are you
> still getting merge errors?

Oops, wrong target :-)

Yes, I am still getting merge conflicts, but they are obviously Alan's
problem, now.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-28  4:42       ` Stephen Rothwell
@ 2009-04-28  4:58         ` Greg KH
  2009-04-28  6:45           ` Stephen Rothwell
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2009-04-28  4:58 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Alan Cox, Alan Stern, linux-next

On Tue, Apr 28, 2009 at 02:42:56PM +1000, Stephen Rothwell wrote:
> Hi Greg,
> 
> On Wed, 22 Apr 2009 09:38:57 -0700 Greg KH <greg@kroah.com> wrote:
> >
> > On Wed, Apr 22, 2009 at 05:30:09PM +0100, Alan Cox wrote:
> > > > I'll be happy to help, although no doubt Alan Cox is quite capable of 
> > > > resolving the conflicts on his own.
> > > 
> > > Greg - can you send me the diff you applied in the end, then we can move
> > > the patch from the USB tree into the tty tree otherwise its not going to
> > > be possible to keep the two trees based on Linus base otherwise. Better
> > > yet forcefeed it to Linus instead as its quite a icky bug and wants fixing
> > > ASAP IMHO.
> > 
> > Ok, I'll send it to Linus today, and we can handle the merge after that.
> 
> Any ETA?

It's all in Linus's tree, and has been for a few days now.  Are you
still getting merge errors?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-22 16:38     ` Greg KH
@ 2009-04-28  4:42       ` Stephen Rothwell
  2009-04-28  4:58         ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-28  4:42 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Cox, Alan Stern, linux-next

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

Hi Greg,

On Wed, 22 Apr 2009 09:38:57 -0700 Greg KH <greg@kroah.com> wrote:
>
> On Wed, Apr 22, 2009 at 05:30:09PM +0100, Alan Cox wrote:
> > > I'll be happy to help, although no doubt Alan Cox is quite capable of 
> > > resolving the conflicts on his own.
> > 
> > Greg - can you send me the diff you applied in the end, then we can move
> > the patch from the USB tree into the tty tree otherwise its not going to
> > be possible to keep the two trees based on Linus base otherwise. Better
> > yet forcefeed it to Linus instead as its quite a icky bug and wants fixing
> > ASAP IMHO.
> 
> Ok, I'll send it to Linus today, and we can handle the merge after that.

Any ETA?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-04-23  4:49 Stephen Rothwell
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-23  4:49 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, Elina Pasheva, Greg KH

Hi Alan,

Today's linux-next merge of the ttydev tree got a conflict in
drivers/usb/serial/sierra.c between commit
72c9d57967ab2b6a32a215c6063c2943f0e48ab4 ("USB: serial: sierra driver bug
fix for composite interface") from the usb.current tree and commit
1156df675ae541b21dc343912413f201f87a3909 ("tty-usb-use-port") from the
ttydev tree.

Overlapping changes.  I fixed it up, I think (see below) and can carry
the fix as necessary.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/usb/serial/sierra.c
index 913225c,2617ea8..0000000
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@@ -251,46 -251,28 +251,43 @@@ static int sierra_send_setup(struct usb
  
  	portdata = usb_get_serial_port_data(port);
  
- 	if (tty) {
- 		int val = 0;
- 		if (portdata->dtr_state)
- 			val |= 0x01;
- 		if (portdata->rts_state)
- 			val |= 0x02;
- 
- 		/* If composite device then properly report interface */
- 		if (serial->num_ports == 1) {
- 			interface = sierra_calc_interface(serial);
- 
- 			/* Control message is sent only to interfaces with
- 			 * interrupt_in endpoints
- 			 */
- 			if (port->interrupt_in_urb) {
- 				/* send control message */
- 				return usb_control_msg(serial->dev,
- 					usb_rcvctrlpipe(serial->dev, 0),
- 					0x22, 0x21, val, interface,
- 					NULL, 0, USB_CTRL_SET_TIMEOUT);
- 			}
- 		}
+ 	if (portdata->dtr_state)
+ 		val |= 0x01;
+ 	if (portdata->rts_state)
+ 		val |= 0x02;
  
- 		/* Otherwise the need to do non-composite mapping */
- 		else {
- 			if (port->bulk_out_endpointAddress == 2)
- 				interface = 0;
- 			else if (port->bulk_out_endpointAddress == 4)
- 				interface = 1;
- 			else if (port->bulk_out_endpointAddress == 5)
- 				interface = 2;
+ 	/* If composite device then properly report interface */
 -	if (serial->num_ports == 1)
++	if (serial->num_ports == 1) {
+ 		interface = sierra_calc_interface(serial);
  
++		/* Control message is sent only to interfaces with
++		 * interrupt_in endpoints
++		 */
++		if (port->interrupt_in_urb) {
++			/* send control message */
 +			return usb_control_msg(serial->dev,
 +				usb_rcvctrlpipe(serial->dev, 0),
 +				0x22, 0x21, val, interface,
 +				NULL, 0, USB_CTRL_SET_TIMEOUT);
- 
 +		}
 +	}
 +
+ 	/* Otherwise the need to do non-composite mapping */
+ 	else {
+ 		if (port->bulk_out_endpointAddress == 2)
+ 			interface = 0;
+ 		else if (port->bulk_out_endpointAddress == 4)
+ 			interface = 1;
+ 		else if (port->bulk_out_endpointAddress == 5)
+ 			interface = 2;
 -	}
 -	return usb_control_msg(serial->dev,
++
++		return usb_control_msg(serial->dev,
+ 			usb_rcvctrlpipe(serial->dev, 0),
+ 			0x22, 0x21, val, interface,
+ 			NULL, 0, USB_CTRL_SET_TIMEOUT);
++
++	}
++
  	return 0;
  }
  

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-04-23  4:30 Stephen Rothwell
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-23  4:30 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, Oliver Neukum, Greg KH

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

Hi Alan,

Today's linux-next merge of the ttydev tree got a conflict in
drivers/usb/serial/cypress_m8.c between commit
3355625b2b58b213e481b071aa01d15240f0d8dd ("USB: removal of
tty->low_latency hack dating back to the old serial code") from the
usb.current tree and commit 1156df675ae541b21dc343912413f201f87a3909
("tty-usb-use-port") from the ttydev tree.

Each patch just removes code next to the code removed by the other.  I
fixed it up and can carry the fix. as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-22 16:30   ` Alan Cox
@ 2009-04-22 16:38     ` Greg KH
  2009-04-28  4:42       ` Stephen Rothwell
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2009-04-22 16:38 UTC (permalink / raw)
  To: Alan Cox; +Cc: Alan Stern, Stephen Rothwell, linux-next

On Wed, Apr 22, 2009 at 05:30:09PM +0100, Alan Cox wrote:
> > I'll be happy to help, although no doubt Alan Cox is quite capable of 
> > resolving the conflicts on his own.
> 
> Greg - can you send me the diff you applied in the end, then we can move
> the patch from the USB tree into the tty tree otherwise its not going to
> be possible to keep the two trees based on Linus base otherwise. Better
> yet forcefeed it to Linus instead as its quite a icky bug and wants fixing
> ASAP IMHO.

Ok, I'll send it to Linus today, and we can handle the merge after that.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-22 15:50 ` Alan Stern
@ 2009-04-22 16:30   ` Alan Cox
  2009-04-22 16:38     ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2009-04-22 16:30 UTC (permalink / raw)
  To: Alan Stern; +Cc: Stephen Rothwell, linux-next, Greg KH

> I'll be happy to help, although no doubt Alan Cox is quite capable of 
> resolving the conflicts on his own.

Greg - can you send me the diff you applied in the end, then we can move
the patch from the USB tree into the tty tree otherwise its not going to
be possible to keep the two trees based on Linus base otherwise. Better
yet forcefeed it to Linus instead as its quite a icky bug and wants fixing
ASAP IMHO.

Alan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-04-22  3:38 Stephen Rothwell
@ 2009-04-22 15:50 ` Alan Stern
  2009-04-22 16:30   ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Stern @ 2009-04-22 15:50 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Alan Cox, linux-next, Greg KH

On Wed, 22 Apr 2009, Stephen Rothwell wrote:

> Hi Alan,
> 
> Today's linux-next merge of the ttydev tree got a conflict in
> drivers/usb/serial/usb-serial.c between commit
> 098aa19445c918bb8430f9b5cb840b546de570f2 ("USB: serial: fix lifetime and
> locking problems") from the usb.current tree and commit
> 1156df675ae541b21dc343912413f201f87a3909 ("tty-usb-use-port") from the
> ttydev tree.
> 
> OK, I can't figure this out easily, so I have used the ttydev version of
> the file - effectively reverting the usb.current change.
> 
> Alan (Cox), when the usb.current change goes into Linus' tree (it is
> destined for 2.6.30), you will have to fix the conflict.  You could do
> this now by adding that patch to your series and fixing the mess ... Alan
> (Stern) you may want to help with this.  I can cope with having the same
> patch on both sides of the merge (I won't even complain :-)).

I'll be happy to help, although no doubt Alan Cox is quite capable of 
resolving the conflicts on his own.

Alan Stern

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-04-22  3:38 Stephen Rothwell
  2009-04-22 15:50 ` Alan Stern
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-04-22  3:38 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-next, Alan Stern, Greg KH

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

Hi Alan,

Today's linux-next merge of the ttydev tree got a conflict in
drivers/usb/serial/usb-serial.c between commit
098aa19445c918bb8430f9b5cb840b546de570f2 ("USB: serial: fix lifetime and
locking problems") from the usb.current tree and commit
1156df675ae541b21dc343912413f201f87a3909 ("tty-usb-use-port") from the
ttydev tree.

OK, I can't figure this out easily, so I have used the ttydev version of
the file - effectively reverting the usb.current change.

Alan (Cox), when the usb.current change goes into Linus' tree (it is
destined for 2.6.30), you will have to fix the conflict.  You could do
this now by adding that patch to your series and fixing the mess ... Alan
(Stern) you may want to help with this.  I can cope with having the same
patch on both sides of the merge (I won't even complain :-)).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-03-12  9:44 ` Alan Cox
@ 2009-03-12 11:02   ` Stephen Rothwell
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Rothwell @ 2009-03-12 11:02 UTC (permalink / raw)
  To: Alan Cox; +Cc: Greg KH, linux-next, Axel Wachtler, Michael Hennerich

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

Hi Alan,

On Thu, 12 Mar 2009 09:44:34 +0000 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
> > Today's linux-next merge of the ttydev tree got conflicts in
> > drivers/usb/serial/ftdi_sio.c and drivers/usb/serial/ftdi_sio.h.  It
> > looks like the same two patches have been applied to the ttydev
> > (tty-ftdi-gnice, tty-ftdi-dresdenelec) and the usb.current (USB: serial:
> 
> These are USB identifier updates to a USB driver that's also a tty
> driver. I'll drop them in favour of GregKH's tree carring them.

OK, thanks.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: linux-next: manual merge of the ttydev tree with the usb.current tree
  2009-03-12  4:04 Stephen Rothwell
@ 2009-03-12  9:44 ` Alan Cox
  2009-03-12 11:02   ` Stephen Rothwell
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2009-03-12  9:44 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Greg KH, linux-next, Axel Wachtler, Michael Hennerich

> Today's linux-next merge of the ttydev tree got conflicts in
> drivers/usb/serial/ftdi_sio.c and drivers/usb/serial/ftdi_sio.h.  It
> looks like the same two patches have been applied to the ttydev
> (tty-ftdi-gnice, tty-ftdi-dresdenelec) and the usb.current (USB: serial:

These are USB identifier updates to a USB driver that's also a tty
driver. I'll drop them in favour of GregKH's tree carring them.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* linux-next: manual merge of the ttydev tree with the usb.current tree
@ 2009-03-12  4:04 Stephen Rothwell
  2009-03-12  9:44 ` Alan Cox
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Rothwell @ 2009-03-12  4:04 UTC (permalink / raw)
  To: Alan Cox, Greg KH; +Cc: linux-next, Axel Wachtler, Michael Hennerich

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

Hi Alan, Greg,

Today's linux-next merge of the ttydev tree got conflicts in
drivers/usb/serial/ftdi_sio.c and drivers/usb/serial/ftdi_sio.h.  It
looks like the same two patches have been applied to the ttydev
(tty-ftdi-gnice, tty-ftdi-dresdenelec) and the usb.current (USB: serial:
add FTDI USB/Serial converter devices, USB: serial: ftdi: enable UART
detection on gnICE JTAG adaptors blacklist interface0) trees but in a
different order.

I fixed it up (by using the usb.current tree's versions).  I suspect one
of you will get these patches into Linus's tree and hopefully the other
will drop them.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-07-28 19:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23  4:34 linux-next: manual merge of the ttydev tree with the usb.current tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2009-07-28  4:01 Stephen Rothwell
2009-07-28 10:26 ` Alan Cox
2009-07-28 12:10   ` Oliver Neukum
2009-07-28 12:29     ` Alan Cox
2009-07-28 12:35       ` Stephen Rothwell
2009-07-28 13:17         ` Alan Cox
2009-07-28 16:32           ` Greg KH
2009-07-28 16:34             ` Greg KH
2009-07-28 19:21               ` Oliver Neukum
2009-07-28 19:24                 ` Alan Cox
2009-07-09  3:04 Stephen Rothwell
2009-07-09 23:19 ` Greg KH
2009-07-10  0:06   ` Stephen Rothwell
2009-07-10  0:13     ` Greg KH
2009-04-23  4:49 Stephen Rothwell
2009-04-23  4:30 Stephen Rothwell
2009-04-22  3:38 Stephen Rothwell
2009-04-22 15:50 ` Alan Stern
2009-04-22 16:30   ` Alan Cox
2009-04-22 16:38     ` Greg KH
2009-04-28  4:42       ` Stephen Rothwell
2009-04-28  4:58         ` Greg KH
2009-04-28  6:45           ` Stephen Rothwell
2009-03-12  4:04 Stephen Rothwell
2009-03-12  9:44 ` Alan Cox
2009-03-12 11:02   ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).