From: Arnd Bergmann <arnd@arndb.de>
To: Grant Likely <grant.likely@linaro.org>
Cc: Peter Hurley <peter@hurleysoftware.com>,
Kevin Cernekee <cernekee@gmail.com>,
Greg KH <gregkh@linuxfoundation.org>, Jiri Slaby <jslaby@suse.cz>,
Rob Herring <robh@kernel.org>, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Florian Fainelli <f.fainelli@gmail.com>,
Maxime Bizon <mbizon@freebox.fr>, Jonas Gorski <jogo@openwrt.org>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
tushar.b@samsung.com
Subject: Re: [PATCH V2 01/10] tty: Fallback to use dynamic major number
Date: Thu, 27 Nov 2014 15:33:58 +0100 [thread overview]
Message-ID: <4316435.J1BtEYnd6C@wuerfel> (raw)
In-Reply-To: <CACxGe6uLWZav=AfaK2w17PW6vtxF8S0=OUvCMB-uFSvhs2cLtw@mail.gmail.com>
On Thursday 27 November 2014 13:50:01 Grant Likely wrote:
>
> 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.
>From what I can see, this is really the ISA compatibility code
in the 8250 driver, and we should be able to make that optional
or even move it into a separate glue driver.
Basically the serial8250_init function tries to do a lot of things
at once (skipping error handling):
serial8250_isa_init_ports();
ret = sunserial_register_minors(&serial8250_reg, UART_NR);
serial8250_reg.nr = UART_NR;
ret = uart_register_driver(&serial8250_reg);
ret = serial8250_pnp_init();
serial8250_isa_devs = platform_device_alloc("serial8250",
PLAT8250_DEV_LEGACY);
ret = platform_device_add(serial8250_isa_devs);
serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev);
ret = platform_driver_register(&serial8250_isa_driver);
The only thing we want from this is the uart_register_driver() call,
everything else is only needed together with the ISA support. The way
that uart_register_driver() works unfortunately implies that you know
the maximum number of ports at driver init time, which would need
to be changed if you want to share the numbers.
One idea I had a few years ago when we discussed this was to treat
the major 4 allocation differently so you could share it between all
sorts of drivers as an opt-in, but could have all unmodified continue
using their own device names and numbers.
Arnd
next prev parent reply other threads:[~2014-11-27 14:33 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 20:53 [PATCH V2 00/10] UART driver support for BMIPS multiplatform kernels Kevin Cernekee
2014-11-12 20:53 ` [PATCH V2 01/10] tty: Fallback to use dynamic major number Kevin Cernekee
2014-11-25 20:34 ` Greg KH
2014-11-25 23:37 ` Kevin Cernekee
2014-11-25 23:49 ` Greg KH
2014-11-26 13:33 ` Grant Likely
2014-11-26 14:34 ` Peter Hurley
2014-11-27 11:10 ` Geert Uytterhoeven
2014-11-27 13:50 ` Grant Likely
2014-11-27 14:33 ` Arnd Bergmann [this message]
2014-11-12 20:53 ` [PATCH V2 02/10] serial: core: Add big-endian iotype Kevin Cernekee
2014-11-12 20:54 ` [PATCH V2 03/10] of: Fix of_device_is_compatible() comment Kevin Cernekee
2014-11-18 17:32 ` Grant Likely
2014-11-12 20:54 ` [PATCH V2 04/10] of: Change of_device_is_available() to return bool Kevin Cernekee
2014-11-18 17:33 ` Grant Likely
2014-11-12 20:54 ` [PATCH V2 05/10] of: Add helper function to check MMIO register endianness Kevin Cernekee
2014-11-18 21:47 ` Grant Likely
2014-11-12 20:54 ` [PATCH V2 06/10] serial: pxa: Add fifo-size and {big,native}-endian properties Kevin Cernekee
2014-11-19 14:49 ` Grant Likely
2014-11-19 16:23 ` Kevin Cernekee
2014-11-12 20:54 ` [PATCH V2 07/10] serial: pxa: Make the driver buildable for BCM7xxx set-top platforms Kevin Cernekee
2014-11-12 20:54 ` [PATCH V2 08/10] serial: pxa: Update DT binding documentation Kevin Cernekee
2014-11-12 20:54 ` [PATCH V2 09/10] serial: earlycon: Set UPIO_MEM32BE based on DT properties Kevin Cernekee
2014-11-18 21:50 ` Grant Likely
2014-11-19 3:16 ` Rob Herring
2014-11-19 14:43 ` Grant Likely
2014-11-12 20:54 ` [PATCH V2 10/10] serial: pxa: Add OF_EARLYCON support Kevin Cernekee
[not found] ` <1415825647-6024-1-git-send-email-cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-13 7:36 ` [PATCH V2 00/10] UART driver support for BMIPS multiplatform kernels Robert Jarzmik
2014-11-13 16:39 ` Kevin Cernekee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4316435.J1BtEYnd6C@wuerfel \
--to=arnd@arndb.de \
--cc=cernekee@gmail.com \
--cc=daniel@zonque.org \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=haojian.zhuang@gmail.com \
--cc=jogo@openwrt.org \
--cc=jslaby@suse.cz \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@vger.kernel.org \
--cc=mbizon@freebox.fr \
--cc=peter@hurleysoftware.com \
--cc=robert.jarzmik@free.fr \
--cc=robh@kernel.org \
--cc=tushar.b@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox