Message ID | 1415825647-6024-2-git-send-email-cernekee@gmail.com |
---|---|
State | New |
Headers | show |
On Tue, 25 Nov 2014 15:37:16 -0800 , Kevin Cernekee <cernekee@gmail.com> wrote: > On Tue, Nov 25, 2014 at 12:34 PM, Greg KH <gregkh@linuxfoundation.org> wrote: > > On Wed, Nov 12, 2014 at 12:53:58PM -0800, Kevin Cernekee wrote: > >> From: Tushar Behera <tushar.behera@linaro.org> > > > > This email bounces, so I'm going to have to reject this patch. I can't > > accept a patch from a "fake" person, let alone something that touches > > core code like this. > > > > Sorry, I can't accept anything in this series then. > > Oops, guess I probably should have updated his address after the V1 > emails bounced... > > Before I send a new version, what do you think about the overall > approach? Should we try to make serial8250 coexist with the other > "ttyS / major 4 / minor 64" drivers (possibly at the expense of > compatibility) or is it better to start with a simpler, cleaner driver > like serial/pxa? Co-existing really needs to be fixed. The way to handle this might be to blacklist the creation of the first 4 8250 devices on certain platforms. It's going to be painful unfortunately. g. -- 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
On Wed, Nov 26, 2014 at 2:34 PM, Peter Hurley <peter@hurleysoftware.com> wrote: > On 11/26/2014 08:33 AM, Grant Likely wrote: >> On Tue, 25 Nov 2014 15:37:16 -0800 >> , Kevin Cernekee <cernekee@gmail.com> >> wrote: >>> On Tue, Nov 25, 2014 at 12:34 PM, Greg KH <gregkh@linuxfoundation.org> wrote: >>>> On Wed, Nov 12, 2014 at 12:53:58PM -0800, Kevin Cernekee wrote: >>>>> From: Tushar Behera <tushar.behera@linaro.org> >>>> >>>> This email bounces, so I'm going to have to reject this patch. I can't >>>> accept a patch from a "fake" person, let alone something that touches >>>> core code like this. >>>> >>>> Sorry, I can't accept anything in this series then. >>> >>> Oops, guess I probably should have updated his address after the V1 >>> emails bounced... >>> >>> Before I send a new version, what do you think about the overall >>> approach? Should we try to make serial8250 coexist with the other >>> "ttyS / major 4 / minor 64" drivers (possibly at the expense of >>> compatibility) or is it better to start with a simpler, cleaner driver >>> like serial/pxa? >> >> Co-existing really needs to be fixed. > > What are the requirements for co-existence? > Is it sufficient to provide 1st come-1st served minor allocation? Should be sufficient. Basically, if the hardware doesn't exist, the driver shouldn't be trying to grab the minor numbers. Also, on hardware where both exists, there should be some sane fallback so that all UARTs get assigned numbers. On DT systems we can also use /aliases to ensure consistent assignment of numbers. g. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 0508a1d..a6d4d9a 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -3365,6 +3365,22 @@ int tty_register_driver(struct tty_driver *driver) dev_t dev; struct device *d; + if (driver->major) { + dev = MKDEV(driver->major, driver->minor_start); + error = register_chrdev_region(dev, driver->num, driver->name); + /* In case of error, fall back to dynamic allocation */ + if (error < 0) { + pr_warn("Default device node (%d:%d) for %s is busy, using dynamic major number\n", + driver->major, driver->minor_start, + driver->name); + driver->major = 0; + } + } + + /* + * Don't replace the following check with an else to above if statement, + * as it may also be called as a fallback. + */ if (!driver->major) { error = alloc_chrdev_region(&dev, driver->minor_start, driver->num, driver->name); @@ -3372,9 +3388,6 @@ int tty_register_driver(struct tty_driver *driver) driver->major = MAJOR(dev); driver->minor_start = MINOR(dev); } - } else { - dev = MKDEV(driver->major, driver->minor_start); - error = register_chrdev_region(dev, driver->num, driver->name); } if (error < 0) goto err;