Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756005AbYFXWXq (ORCPT ); Tue, 24 Jun 2008 18:23:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752804AbYFXWXe (ORCPT ); Tue, 24 Jun 2008 18:23:34 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:33034 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbYFXWXd (ORCPT ); Tue, 24 Jun 2008 18:23:33 -0400 Date: Tue, 24 Jun 2008 15:22:53 -0700 From: Andrew Morton To: Guennadi Liakhovetski Cc: vcgandhi1@aol.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Alan Cox Subject: Re: [PATCH] Fix serial_match_port() for dynamic major tty-device numbers Message-Id: <20080624152253.d9bd1da2.akpm@linux-foundation.org> In-Reply-To: References: <8CA6D5E4DEA920C-1128-2973@webmail-nb07.sysops.aol.com> <8CA6D67D9E313CC-1128-35BB@webmail-nb07.sysops.aol.com> <8CA6D6D112DB4D4-1128-38B0@webmail-nb07.sysops.aol.com> <8CA6E48B50204C0-15A8-47D0@webmail-nb06.sysops.aol.com> <8CA6EC102F70775-15A8-8B4A@webmail-nb06.sysops.aol.com> <8CA6EF5BC26E069-12A0-1888@webmail-nc13.sysops.aol.com> <8CA6FF4B03B281A-E10-2E1C@webmail-nf05.sim.aol.com> <8CA73B83C791846-148-41B9@webmail-nb17.sysops.aol.com> <8CA914AC0F6817C-1684-368@webmail-nc03.sysops.aol.com> X-Mailer: Sylpheed version 2.2.4 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1390 Lines: 35 On Sun, 22 Jun 2008 00:45:25 +0200 (CEST) Guennadi Liakhovetski wrote: > As reported by Vipul Gandhi, the current serial_match_port() doesn't work > for tty-devices using dynamic major number allocation. Fix it. > > Signed-off-by: Guennadi Liakhovetski > Tested-by: Vipul Gandhi > > --- > > diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c > index 0f5a179..593ae85 100644 > --- a/drivers/serial/serial_core.c > +++ b/drivers/serial/serial_core.c > @@ -1949,7 +1949,9 @@ struct uart_match { > static int serial_match_port(struct device *dev, void *data) > { > struct uart_match *match = data; > - dev_t devt = MKDEV(match->driver->major, match->driver->minor) + match->port->line; > + struct tty_driver *tty_drv = match->driver->tty_driver; > + dev_t devt = MKDEV(tty_drv->major, tty_drv->minor_start) + > + match->port->line; > > return dev->devt == devt; /* Actually, only one tty per port */ Well that sounds bad. We need to work out whether this fix is needed in 2.6.25 and possibly eariler. What are the consequences of this error? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/