linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] serial: 8250: fix regression in 8250 uart driver
@ 2016-06-13 20:13 Dinh Nguyen
  2016-06-13 21:57 ` Peter Hurley
  0 siblings, 1 reply; 2+ messages in thread
From: Dinh Nguyen @ 2016-06-13 20:13 UTC (permalink / raw)
  To: andriy.shevchenko
  Cc: peter, heikki.krogerus, Greg KH, linux-kernel, linux-serial

Hi Andy,

I saw that you have discovered that commit ec5a11a91eec ("serial: 8250:
Validate dmaengine rx chan meets requirements") introduced a regression
in the 8250 uart driver. For SoCFPGA platform, I am seeing this error:

[    5.541751] ttyS0 - failed to request DMA

Reverting the commit ec5a11a91eec removes the error.

I saw that you started the discussion, but I didn't see that a patch was
included[1].

The following patch seems to fix the error, but I'm not sure if it's the
same fix that you had in mind.

Thanks,
Dinh

[1] http://marc.info/?l=linux-serial&m=146254187602862&w=2

---------------8<------------
diff --git a/drivers/tty/serial/8250/8250_dma.c
b/drivers/tty/serial/8250/8250_dma.c
index 7f33d1c..847a203 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -176,7 +176,7 @@ int serial8250_request_dma(struct uart_8250_port *p)
        ret = dma_get_slave_caps(dma->rxchan, &caps);
        if (ret)
                goto release_rx;
-       if (!caps.cmd_pause || !caps.cmd_terminate ||
+       if ((!caps.cmd_pause || !caps.cmd_terminate) &&
            caps.residue_granularity ==
DMA_RESIDUE_GRANULARITY_DESCRIPTOR) {
                ret = -EINVAL;
                goto release_rx;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] serial: 8250: fix regression in 8250 uart driver
  2016-06-13 20:13 [RFC] serial: 8250: fix regression in 8250 uart driver Dinh Nguyen
@ 2016-06-13 21:57 ` Peter Hurley
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Hurley @ 2016-06-13 21:57 UTC (permalink / raw)
  To: Dinh Nguyen
  Cc: andriy.shevchenko, heikki.krogerus, Greg KH, linux-kernel, linux-serial

On 06/13/2016 01:13 PM, Dinh Nguyen wrote:
> Hi Andy,
> 
> I saw that you have discovered that commit ec5a11a91eec ("serial: 8250:
> Validate dmaengine rx chan meets requirements") introduced a regression
> in the 8250 uart driver. For SoCFPGA platform, I am seeing this error:
> 
> [    5.541751] ttyS0 - failed to request DMA
> 
> Reverting the commit ec5a11a91eec removes the error.

The error is that your dmaengine driver doesn't support the functionality
required by the 8250 driver.

Regards,
Peter Hurley

> I saw that you started the discussion, but I didn't see that a patch was
> included[1].
> 
> The following patch seems to fix the error, but I'm not sure if it's the
> same fix that you had in mind.
> 
> Thanks,
> Dinh
> 
> [1] http://marc.info/?l=linux-serial&m=146254187602862&w=2
> 
> ---------------8<------------
> diff --git a/drivers/tty/serial/8250/8250_dma.c
> b/drivers/tty/serial/8250/8250_dma.c
> index 7f33d1c..847a203 100644
> --- a/drivers/tty/serial/8250/8250_dma.c
> +++ b/drivers/tty/serial/8250/8250_dma.c
> @@ -176,7 +176,7 @@ int serial8250_request_dma(struct uart_8250_port *p)
>         ret = dma_get_slave_caps(dma->rxchan, &caps);
>         if (ret)
>                 goto release_rx;
> -       if (!caps.cmd_pause || !caps.cmd_terminate ||
> +       if ((!caps.cmd_pause || !caps.cmd_terminate) &&
>             caps.residue_granularity ==
> DMA_RESIDUE_GRANULARITY_DESCRIPTOR) {
>                 ret = -EINVAL;
>                 goto release_rx;
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 20:13 [RFC] serial: 8250: fix regression in 8250 uart driver Dinh Nguyen
2016-06-13 21:57 ` Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).