Re: [PATCH] tty: Fallback to use dynamic major number

From: Mark Brown
Date: Thu Jan 16 2014 - 13:15:47 EST


On Thu, Jan 16, 2014 at 09:22:40AM -0800, Greg KH wrote:
> On Thu, Jan 16, 2014 at 05:08:14PM +0000, Mark Brown wrote:

> > No, the issue is happening because the drivers are registering things
> > at module load time and not at device instantiation time.

> That's a driver bug that could easily be fixed, instead of hacking up
> the tty core :)

Looking at the code it really, really looked intentional - in any case
that seems worthwhile, Tushar this looks like a way forwards?

> > While the drivers won't actually be run together things like the
> > multiplatform defconfig and distro configs will build them in since
> > people tend to like to get serial early on.

> Build them into the kernel and not as modules?

Yes. It's the common case for embedded stuff to just build everything
in so people tend to do it.

> > The other solutions I can think of are moving tty_register_driver() to
> > device probe time, allowing tty_register_driver() to accept duplicate
> > majors and the complaining when the devices actually get instantiated
> > or changing major numbers where there is a duplicate which is guaranteed
> > to break at least some userspaces with static devices (which was the
> > original patch you complained about). The first two solutions look a
> > bit fun though perhaps they fall out more easily than I suspect.

> How about fixing the drivers as I mentioned above, to not register with
> the uart or tty core until they know that their hardware is actually
> present in the system? That would keep any tty core "hacks" from being
> needed.

Certainly makes sense to me. I have to confess that looking at the code
it looked totally intentional and I remember dragons from the last time
I had to peer into that stuff.

Attachment: signature.asc
Description: Digital signature