Removal of deprecated serial functions - please update your drivers NOW
As per the feature-removal.txt file, I will be removing the following functions shortly:
* register_serial
* unregister_serial
* uart_register_port
* uart_unregister_port
However, there are still some drivers which use these functions:
drivers/char/mwave/mwavedd.c: return register_serial(&serial); drivers/char/mwave/mwavedd.c: unregister_serial(pDrvData->sLine); drivers/misc/ibmasm/uart.c: sp->serial_line = register_serial(&serial); drivers/misc/ibmasm/uart.c: unregister_serial(sp->serial_line); drivers/net/ioc3-eth.c: register_serial(&req); drivers/net/ioc3-eth.c: register_serial(&req); drivers/serial/serial_txx9.c: line = uart_register_port(&serial_txx9_reg, &port); drivers/serial/serial_txx9.c: uart_unregister_port(&serial_txx9_reg, line);
These drivers really really really need fixing in the next few days if they aren't going to break. I hereby ask that the maintainers of the above drivers show some willingness to update their drivers.
Unfortunately, it appears that some of these drivers do not contain email addresses for their maintainers, neither are they listed in the MAINTAINERS file. (mwavedd and serial_txx9).
Please note that this is the last warning folk will have before the functions are removed.
In addition, the following drivers declare functions of the same name. The maintainers of these need to look to see why, and eliminate them where possible.
drivers/serial/crisv10.c:register_serial(struct serial_struct *req) drivers/serial/crisv10.c:void unregister_serial(int line)
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 3 lines · Russell King
Unfortunately, it appears that some of these drivers do not contain email addresses for their maintainers, neither are they listed in the
MAINTAINERSfile. (mwavedd andserial_txx9).
I'll have a quick look at mwave. If I remember rightly it just needs to tell someone that an "ISA" 16450 serial port materialised by magic at the addresses it selected.
The mwave firmware is loaded into a DSP and until its loaded there isn't a serial port.
Quoted 8 lines · Alan Cox
Quoted 3 lines · Russell King
Unfortunately, it appears that some of these drivers do not contain email addresses for their maintainers, neither are they listed in the
MAINTAINERSfile. (mwavedd andserial_txx9).I'll have a quick look at mwave. If I remember rightly it just needs to tell someone that an "ISA" 16450 serial port materialised by magic at the addresses it selected.
Thanks Alan.
I think that it shouldn't be too big a problem - maybe just using serial8250_register_port() and serial8250_unregister_port() instead of register_serial()/unregister_serial(), and changing the structure.
The key thing is that port.dev should be set appropriately and the relevant calls to serial8250_suspend_port/serial8250_resume_port be made (or port.dev should be NULL if no power management is expected - in which case it may be managed as a generic platform port.)
Also, port.uartclk must be set, and since this is an add-in card, it should not be using BASE_BAUD but the clock rate for the UART on the card itself. (BASE_BAUD being an architecture defined constant has no business being used in connection with add-in cards with on-board UART clock generators.)
I hope the above is useful, thanks.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 5 lines · Russell King
The key thing is that port.dev should be set appropriately and the relevant calls to serial8250_suspend_port/serial8250_resume_port be made (or port.dev should be NULL if no power management is expected - in which case it may be managed as a generic platform port.)
Thanks. Thats all I needed to know to whack that into shape once I've put a legacy 32bit build environment back together for this and for something akpm wants me to fix in another diff.
Power management is umm special. The port will die on suspend/resume via Linux (via APM seems to be ok) and need a userspace firmware reload to come back.
I think this is all that is needed for Mwave.
char/mwave/mwavedd.c renamed from linux.vanilla-2.6.13-rc6-mm2/drivers/char/mwave/mwavedd.c +12 -9
@@ -57,6 +57,7 @@#include <linux/sched.h> #include <linux/spinlock.h> #include <linux/delay.h> +#include <linux/serial_8250.h> #include "smapi.h" #include "mwavedd.h" #include "3780i.h"
@@ -410,8 +411,8 @@static int register_serial_portandirq (unsigned int port,int irq) { -struct serial_struct serial; - +struct uart_port uart; +switch ( port ) {case 0x3f8 :case 0x2f8 :
@@ -442,12 +443,14 @@ }/* switch */ /* irq is okay */ -memset (&serial,0 ,sizeof (serial)); - serial.port = port; - serial.irq = irq; - serial.flags =ASYNC_SHARE_IRQ ; - -return register_serial (&serial); +memset (&uart,0 ,sizeof (struct uart_port )); + + uart.uartclk =1843200 ; + uart.iobase = port; + uart.irq = irq; + uart.iotype =UPIO_PORT ; + uart.flags =UPF_SHARE_IRQ ; +return serial8250_register_port (&uart); }
@@ -523,7 +526,7 @@#endif if ( pDrvData->sLine >=0 ) { -unregister_serial (pDrvData->sLine); +serial8250_unregister_port (pDrvData->sLine); }if (pDrvData->bMwaveDevRegistered) {misc_deregister (&mwave_misc_dev);
PATCH 1/1 drivers/serial/crisv10.c: remove {,un}register_serial dummies
In reply to Russell KingQuoted 7 lines · Russell King
...
In addition, the following drivers declare functions of the same name. The maintainers of these need to look to see why, and eliminate them where possible.drivers/serial/crisv10.c:register_serial(struct
serial_struct*req) drivers/serial/crisv10.c:voidunregister_serial(int line)
It seems we can simply kill these dummies with this patch.
drivers/serial/crisv10.c renamed from drivers/serial/crisv10.c.old +0 -14
@@ -5038,17 +5038,3 @@/* this makes sure that rs_init is called during kernel boot */ module_init (rs_init); - -/* -* register_serial and unregister_serial allows for serial ports to be -* configured at run-time, to support PCMCIA modems. -*/ -int -register_serial (struct serial_struct *req) -{ -return -1 ; -} - -void unregister_serial (int line) -{ -}
Russell King
AppliedRe: [2.6 patch] drivers/serial/crisv10.c: remove {,un}register_serial dummies
Quoted 10 lines · Adrian Bunk
Quoted 7 lines · Russell King
...
In addition, the following drivers declare functions of the same name. The maintainers of these need to look to see why, and eliminate them where possible.drivers/serial/crisv10.c:register_serial(struct
serial_struct*req) drivers/serial/crisv10.c:voidunregister_serial(int line)It seems we can simply kill these dummies with this patch.
Thanks, applied.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 19 lines · Russell King
As per the feature-removal.txt file, I will be removing the following functions shortly:
*
register_serial
*unregister_serial
*uart_register_port
*uart_unregister_portHowever, there are still some drivers which use these functions:
drivers/char/mwave/mwavedd.c: return register_serial(&serial); drivers/char/mwave/mwavedd.c: unregister_serial(pDrvData->sLine); drivers/misc/ibmasm/uart.c: sp->serial_line = register_serial(&serial); drivers/misc/ibmasm/uart.c: unregister_serial(sp->serial_line); drivers/net/ioc3-eth.c: register_serial(&req); drivers/net/ioc3-eth.c: register_serial(&req); drivers/serial/serial_txx9.c: line = uart_register_port(&serial_txx9_reg, &port); drivers/serial/serial_txx9.c: uart_unregister_port(&serial_txx9_reg, line);
Quoted 4 lines
These drivers really really really need fixing in the next few days if they aren't going to break. I hereby ask that the maintainers of the above drivers show some willingness to update their drivers.
Here is a patch for the ibmasm driver. Let me know it I missed something.
thanks,
max
drivers/misc/Kconfig +1 -1
@@ -6,7 +6,7 @@ menu "Misc devices" config IBM_ASM tristate "Device driver for IBM RSA service processor" - depends on X86 && PCI && EXPERIMENTAL && BROKEN + depends on X86 && PCI && EXPERIMENTAL ---help--- This option enables device driver support for in-band access to the IBM RSA (Condor) service processor in eServer xSeries systems.
drivers/misc/ibmasm/uart.c +10 -9
@@ -27,13 +27,14 @@#include <linux/serial_core.h> #include <linux/serial.h> #include <linux/serial_reg.h> +#include <linux/serial_8250.h> #include "ibmasm.h" #include "lowlevel.h" void ibmasm_register_uart (struct service_processor *sp) { -struct serial_struct serial; +struct uart_port uport;void __iomem *iomem_base; iomem_base = sp->base_address +SCOUT_COM_B_BASE ;
@@ -47,14 +48,14 @@ void ibmasm_register_uart(struct servicereturn ; } -memset (&serial,0 ,sizeof (serial)); - serial.irq = sp->irq; - serial.baud_base =3686400 /16 ; - serial.flags =UPF_AUTOPROBE |UPF_SHARE_IRQ ; - serial.io_type =UPIO_MEM ; - serial.iomem_base = iomem_base; +memset (&uport,0 ,sizeof (struct uart_port )); + uport.irq = sp->irq; + uport.uartclk =3686400 ; + uport.flags =UPF_AUTOPROBE |UPF_SHARE_IRQ ; + uport.iotype =UPIO_MEM ; + uport.membase = iomem_base; - sp->serial_line =register_serial (&serial); + sp->serial_line =serial8250_register_port (&uport);if (sp->serial_line <0 ) {dev_err (sp->dev,"Failed to register serial port\n" );return ;
@@ -68,5 +69,5 @@ void ibmasm_unregister_uart(struct servireturn ;disable_uart_interrupts (sp->base_address); -unregister_serial (sp->serial_line); +serial8250_unregister_port (sp->serial_line); }
Quoted 2 lines · Max Asbock
Here is a patch for the ibmasm driver. Let me know it I missed something.
Thanks. Does it still need to include serial.h?
Also, can I have a signed-off-by line as per the DCO v1.1 please (see Documentation/SubmittingPatches) ?
Thanks again.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 10 lines · Russell King
Quoted 2 lines · Max Asbock
Here is a patch for the ibmasm driver. Let me know it I missed something.
Thanks. Does it still need to include
serial.h?Also, can I have a signed-off-by line as per the DCO v1.1 please (see
Documentation/SubmittingPatches) ?Thanks again.
It doesn't need serial.h included. So here it is again.
max
drivers/misc/Kconfig +1 -1
@@ -6,7 +6,7 @@ menu "Misc devices" config IBM_ASM tristate "Device driver for IBM RSA service processor" - depends on X86 && PCI && EXPERIMENTAL && BROKEN + depends on X86 && PCI && EXPERIMENTAL ---help--- This option enables device driver support for in-band access to the IBM RSA (Condor) service processor in eServer xSeries systems.
drivers/misc/ibmasm/uart.c +10 -10
@@ -25,15 +25,15 @@#include <linux/termios.h> #include <linux/tty.h> #include <linux/serial_core.h> -#include <linux/serial.h> #include <linux/serial_reg.h> +#include <linux/serial_8250.h> #include "ibmasm.h" #include "lowlevel.h" void ibmasm_register_uart (struct service_processor *sp) { -struct serial_struct serial; +struct uart_port uport;void __iomem *iomem_base; iomem_base = sp->base_address +SCOUT_COM_B_BASE ;
@@ -47,14 +47,14 @@ void ibmasm_register_uart(struct servicereturn ; } -memset (&serial,0 ,sizeof (serial)); - serial.irq = sp->irq; - serial.baud_base =3686400 /16 ; - serial.flags =UPF_AUTOPROBE |UPF_SHARE_IRQ ; - serial.io_type =UPIO_MEM ; - serial.iomem_base = iomem_base; +memset (&uport,0 ,sizeof (struct uart_port )); + uport.irq = sp->irq; + uport.uartclk =3686400 ; + uport.flags =UPF_AUTOPROBE |UPF_SHARE_IRQ ; + uport.iotype =UPIO_MEM ; + uport.membase = iomem_base; - sp->serial_line =register_serial (&serial); + sp->serial_line =serial8250_register_port (&uport);if (sp->serial_line <0 ) {dev_err (sp->dev,"Failed to register serial port\n" );return ;
@@ -68,5 +68,5 @@ void ibmasm_unregister_uart(struct servireturn ;disable_uart_interrupts (sp->base_address); -unregister_serial (sp->serial_line); +serial8250_unregister_port (sp->serial_line); }