Re: tty serial 8250 rs485 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 17, 2018 at 08:12:31AM +0000, Francisco Pastor Gomis wrote:
> Hello.
> 
> I have modified some kernel sources to add support for the rs485 API in the 8250 serial driver. I copy the patch at the end of this message.

Take a look at Documentation/SubmittingPatches for how to send a kernel
patch so that we can apply it.  Your patch needs a bit of work to get it
to be acceptable, can you do that?

> This modification affect only to the modules 8250_core.cc and 8250_port.cc. Basically this programs a timer after the last byte written to the UART to delaying the RTS change for two bytes, one is the previous byte that starts going out and the second for this last byte. Also it adds an additional  tick for avoid the error due to the rounding in ticks number. In the sources the changes are commented with the mark FPG (my initials).
> 
> The patch is applied to the version 4.14.53, but it is also valid for the 4.14.63 because the affected modules have not changed.

4.14 is almost a year old now, we can't go back in time, you need to
work on the latest kernel tree for new patches.  Take a look at the
development process documentation in the kernel tree for a bit of
information on how this all works.


> 
> I am new sending kernel patches, so please say me if this mail is enough to report the change or I have to send the patch to another place.
> 
> Regards.
> 
> Francisco Pastor
> fpastor.etraid@xxxxxxxxxxxxx
> 
> -------------- patch -------------------
> 
> diff -Naur '--exclude=Makefile' linux-4.14.53/drivers/tty/serial/8250/8250_core.c drivers/4.14.53/CUBE-CYME/8250/8250_core.c
> --- linux-4.14.53/drivers/tty/serial/8250/8250_core.c	2018-07-03 11:25:05.000000000 +0200
> +++ drivers/4.14.53/CUBE-CYME/8250/8250_core.c	2018-07-10 14:25:25.747564455 +0200
> @@ -954,6 +954,30 @@
>  }
>  
>  /**
> + * FPG: Function to set the 485 configuration

Nit, no need to put your initials anywhere.  We have 4000+ contributors
every year, the tree would be a mess of initials if we all did that :)

> + */
> +static int serial8250_rs485_config(struct uart_port *port,
> +			      struct serial_rs485 *rs485)
> +{
> +	int ret = 0;
> +	struct uart_8250_port *up = up_to_u8250p(port);
> +
> +	if (rs485->flags & SER_RS485_ENABLED)
> +	{

Run your patch through scripts/checkpatch.pl to fix up the obvious
formatting issues as well.

Care to do that and resend?

thanks,

greg k-h



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux