Greg KH | 1 Feb 23:29 2010

Re: [PATCH 2/2] bcm63xx_uart: allow more than one uart to be registered.

On Sat, Jan 30, 2010 at 07:23:43PM +0100, Wolfram Sang wrote:
> On Sat, Jan 30, 2010 at 06:42:57PM +0100, Maxime Bizon wrote:
> > The bcm6358 CPU has two uarts, make it possible to use the second one.
> > 
> > Signed-off-by: Maxime Bizon <mbizon <at> freebox.fr>
> > ---
> >  drivers/serial/bcm63xx_uart.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/serial/bcm63xx_uart.c b/drivers/serial/bcm63xx_uart.c
> > index f78ede8..6ab959a 100644
> > --- a/drivers/serial/bcm63xx_uart.c
> > +++ b/drivers/serial/bcm63xx_uart.c
> >  <at>  <at>  -35,7 +35,7  <at>  <at> 
> >  #include <bcm63xx_regs.h>
> >  #include <bcm63xx_io.h>
> >  
> > -#define BCM63XX_NR_UARTS	1
> > +#define BCM63XX_NR_UARTS	2
> >  
> >  static struct uart_port ports[BCM63XX_NR_UARTS];
> >  
> >  <at>  <at>  -784,7 +784,7  <at>  <at>  static struct uart_driver bcm_uart_driver = {
> >  	.dev_name	= "ttyS",
> >  	.major		= TTY_MAJOR,
> >  	.minor		= 64,
> > -	.nr		= 1,
> > +	.nr		= 2,
> 
> Err, why not using the #define here?
(Continue reading)

leitao | 2 Feb 02:34 2010
Picon

[PATCH 1/2] jsm: removing the uart structure and filename on error

If jsm fails to load, then remove the uart stuff, otherwise,
the things (as files), will be there forever (even when the module
is unloaded). If you try to reload the module, the following message
appears:

kobject_add_internal failed for ttyn1 with -EEXIST, don't try to
register things with the same name in the same directory.

This patch remove the uart things when the driver fails.

Signed-off-by: Breno Leitao <leitao <at> linux.vnet.ibm.com>
---
 drivers/serial/jsm/jsm_driver.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c
index 108c3e0..12cb5e4 100644
--- a/drivers/serial/jsm/jsm_driver.c
+++ b/drivers/serial/jsm/jsm_driver.c
 <at>  <at>  -179,6 +179,7  <at>  <at>  static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device

 	return 0;
  out_free_irq:
+	jsm_remove_uart_port(brd);
 	free_irq(brd->irq, brd);
  out_iounmap:
 	iounmap(brd->re_map_membase);
--

-- 
1.6.0.2

(Continue reading)

leitao | 2 Feb 02:34 2010
Picon

[PATCH 2/2] jsm: fixing error if the driver fails to load

Currently if the driver fails to register on port, the kernel
crashes with the following stack:

cpu 0x1: Vector: 300 (Data Access) at [c0000000e0303090]
    pc: c00000000039aa74: .__mutex_lock_slowpath+0x44/0x10c
    lr: c00000000039aa58: .__mutex_lock_slowpath+0x28/0x10c
[c0000000e03033c0] c00000000026b074 .uart_remove_one_port+0xbc/0x16c
[c0000000e0303460] d0000000000e0554 .jsm_remove_uart_port+0x8c/0x10c [jsm]
[c0000000e03034f0] d0000000000dc034 .jsm_remove_one+0x34/0x108 [jsm]
[c0000000e0303590] c0000000001f4aa0 .pci_device_remove+0x48/0x74
...

This patch just fixes the code flow to abort the load when an
error is detected.

Signed-off-by: Breno Leitao <leitao <at> linux.vnet.ibm.com>
---
 drivers/serial/jsm/jsm_tty.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
index cd95e21..5673ca9 100644
--- a/drivers/serial/jsm/jsm_tty.c
+++ b/drivers/serial/jsm/jsm_tty.c
 <at>  <at>  -432,7 +432,7  <at>  <at>  int __devinit jsm_tty_init(struct jsm_board *brd)

 int jsm_uart_port_init(struct jsm_board *brd)
 {
-	int i;
+	int i, rc;
(Continue reading)

Wolfram Sang | 2 Feb 19:58 2010
Picon

Re: [PATCH] serial/mpc52xx_uart: Drop outdated comments

On Fri, Jan 08, 2010 at 10:19:29PM +0100, Wolfram Sang wrote:
> Most things mentioned are either obsolete (platform-support) or wrong (device
> numbering, DCD spport) these days. The remaining rest is obvious.
> 
> Signed-off-by: Wolfram Sang <w.sang <at> pengutronix.de>
> Cc: Grant Likely <grant.likely <at> secretlab.ca>

Ping. Anyone interested in this patch?

> ---
>  drivers/serial/mpc52xx_uart.c |   33 ---------------------------------
>  1 files changed, 0 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
> index 7ce9e9f..c7ec1a2 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
>  <at>  <at>  -29,39 +29,6  <at>  <at> 
>   * kind, whether express or implied.
>   */
>  
> -/* Platform device Usage :
> - *
> - * Since PSCs can have multiple function, the correct driver for each one
> - * is selected by calling mpc52xx_match_psc_function(...). The function
> - * handled by this driver is "uart".
> - *
> - * The driver init all necessary registers to place the PSC in uart mode without
> - * DCD. However, the pin multiplexing aren't changed and should be set either
> - * by the bootloader or in the platform init code.
(Continue reading)

Grant Likely | 2 Feb 20:06 2010
Picon

Re: [PATCH] serial/mpc52xx_uart: Drop outdated comments

On Tue, Feb 2, 2010 at 11:58 AM, Wolfram Sang <w.sang <at> pengutronix.de> wrote:
> On Fri, Jan 08, 2010 at 10:19:29PM +0100, Wolfram Sang wrote:
>> Most things mentioned are either obsolete (platform-support) or wrong (device
>> numbering, DCD spport) these days. The remaining rest is obvious.
>>
>> Signed-off-by: Wolfram Sang <w.sang <at> pengutronix.de>
>> Cc: Grant Likely <grant.likely <at> secretlab.ca>
>
> Ping. Anyone interested in this patch?

I haven't forgotten, I just haven't gotten around to looking at it.

g.

--

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Vitaly V. Ch | 5 Feb 10:54 2010
Picon

Review and minor fixes for ftdi_sio.h

Hi all!

I'm find then ftdi_sio.c in 2.4.37.8 kernel have next bug: if I have
three ftdi-232 simultaneously connected to middle-loaded host,
application which use one of them will hung in driver, usually during
few hour.

At now i try to revise that driver and also I review driver in 2.6.32
and do few minor fixes + found out possible buggy place.

****************************************
1) function ftdi_232am_baud_base_to_divisor() in 2.6.32 have next view:

static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
{
    unsigned short int divisor;
    /* divisor shifted 3 bits to the left */
    int divisor3 = base / 2 / baud;
    if ((divisor3 & 0x7) == 7)
        divisor3++; /* round x.7/8 up to x+1 */
    divisor = divisor3 >> 3;
    divisor3 &= 0x7;
    if (divisor3 == 1)
        divisor |= 0xc000; /* 0.125 */
    else if (divisor3 >= 4)
        divisor |= 0x4000; /* 0.5 */
    else if (divisor3 != 0)
        divisor |= 0x8000; /* 0.25 */
    ///  <at> warning possible at this place we have bug
    else if (divisor == 1)
(Continue reading)

Greg KH | 5 Feb 17:38 2010

Re: Review and minor fixes for ftdi_sio.h

On Fri, Feb 05, 2010 at 11:54:56AM +0200, Vitaly V. Ch wrote:
> Hi all!
> 
> I'm find then ftdi_sio.c in 2.4.37.8 kernel have next bug: if I have
> three ftdi-232 simultaneously connected to middle-loaded host,
> application which use one of them will hung in driver, usually during
> few hour.

Can you look at the version in 2.6.33-rc6, and also in the linux-next
tree?  Both of those have changes to this driver already done, and
hopefully this fixes your problem.

> At now i try to revise that driver and also I review driver in 2.6.32
> and do few minor fixes + found out possible buggy place.
> 
> ****************************************
> 1) function ftdi_232am_baud_base_to_divisor() in 2.6.32 have next view:
> 
> static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
> {
>     unsigned short int divisor;
>     /* divisor shifted 3 bits to the left */
>     int divisor3 = base / 2 / baud;
>     if ((divisor3 & 0x7) == 7)
>         divisor3++; /* round x.7/8 up to x+1 */
>     divisor = divisor3 >> 3;
>     divisor3 &= 0x7;
>     if (divisor3 == 1)
>         divisor |= 0xc000; /* 0.125 */
>     else if (divisor3 >= 4)
(Continue reading)

Vitaly V. Ch | 6 Feb 11:18 2010
Picon

Review and minor fixes for ftdi_sio.c

On Fri, Feb 5, 2010 at 6:38 PM, Greg KH <greg@...> wrote:
> On Fri, Feb 05, 2010 at 11:54:56AM +0200, Vitaly V. Ch wrote:
>> Hi all!
>>
>> I'm find then ftdi_sio.c in 2.4.37.8 kernel have next bug: if I have
>> three ftdi-232 simultaneously connected to middle-loaded host,
>> application which use one of them will hung in driver, usually during
>> few hour.
>
> Can you look at the version in 2.6.33-rc6, and also in the linux-next
> tree?  Both of those have changes to this driver already done, and
> hopefully this fixes your problem.

1)
Yes, I will see in that files but I can't use 2.6.xx kernel. I will
backport fixes to 2.4.37.8.

2)
> I don't know, what is the problem you are seeing here?

In kernel sources we have:

    else if (divisor == 1)
        divisor = 0;    /* special case for maximum baud rate */

But there are reason to wait at this place:

     if (divisor == 1)
         divisor = 0;    /* special case for maximum baud rate */

(Continue reading)

Greg KH | 6 Feb 11:40 2010

Re: Review and minor fixes for ftdi_sio.c

On Sat, Feb 06, 2010 at 12:18:04PM +0200, Vitaly V. Ch wrote:
> On Fri, Feb 5, 2010 at 6:38 PM, Greg KH <greg <at> kroah.com> wrote:
> > On Fri, Feb 05, 2010 at 11:54:56AM +0200, Vitaly V. Ch wrote:
> >> Hi all!
> >>
> >> I'm find then ftdi_sio.c in 2.4.37.8 kernel have next bug: if I have
> >> three ftdi-232 simultaneously connected to middle-loaded host,
> >> application which use one of them will hung in driver, usually during
> >> few hour.
> >
> > Can you look at the version in 2.6.33-rc6, and also in the linux-next
> > tree? ?Both of those have changes to this driver already done, and
> > hopefully this fixes your problem.
> 
> 1)
> Yes, I will see in that files but I can't use 2.6.xx kernel. I will
> backport fixes to 2.4.37.8.

Ah, my fault, I missed the "2.4" portion of your email above, sorry
about that.

And if you are stuck with 2.4, sorry, but you really are on your own.

good luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Vitaly V. Ch | 6 Feb 12:26 2010
Picon

Is there sens for patch which replace space-based indentation by tab-based indentation in files ftdi_sio.c and ftdi_sio.h

There are some qty of old code which is space indented. Patch for
replace it by tab-based indentation will be acceptable for kernel
sources?

\\wbr Vitaly Chernookiy
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane