diff mbox

[2/2] tty: serial: msm_serial add info message

Message ID 571BAE11.3020706@gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Frank Rowand April 23, 2016, 5:17 p.m. UTC
From: Frank Rowand <frank.rowand@am.sony.com>

Failure to enable DMA by the msm_serial driver is silent.
Add a message to report the failure.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
 drivers/tty/serial/msm_serial.c |    1 +
 1 file changed, 1 insertion(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Stephen Boyd April 25, 2016, 8:48 p.m. UTC | #1
On 04/23, Frank Rowand wrote:
> From: Frank Rowand <frank.rowand@am.sony.com>
> 
> Failure to enable DMA by the msm_serial driver is silent.
> Add a message to report the failure.
> 
> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> ---
>  drivers/tty/serial/msm_serial.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: b/drivers/tty/serial/msm_serial.c
> ===================================================================
> --- a/drivers/tty/serial/msm_serial.c
> +++ b/drivers/tty/serial/msm_serial.c
> @@ -170,6 +170,7 @@ rel_tx:
>  	dma_release_channel(dma->chan);
>  no_tx:
>  	memset(dma, 0, sizeof(*dma));
> +	dev_info(dev, "msm_serial: DMA not enabled\n");
>  }
>  

Wouldn't this print twice for TX and RX channels? I'd prefer we
not print anything when this driver probes, just because it's a
bunch of log spam that we don't really need.
Frank Rowand April 25, 2016, 9:31 p.m. UTC | #2
On 4/25/2016 1:48 PM, Stephen Boyd wrote:
> On 04/23, Frank Rowand wrote:
>> From: Frank Rowand <frank.rowand@am.sony.com>
>>
>> Failure to enable DMA by the msm_serial driver is silent.
>> Add a message to report the failure.
>>
>> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
>> ---
>>  drivers/tty/serial/msm_serial.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> Index: b/drivers/tty/serial/msm_serial.c
>> ===================================================================
>> --- a/drivers/tty/serial/msm_serial.c
>> +++ b/drivers/tty/serial/msm_serial.c
>> @@ -170,6 +170,7 @@ rel_tx:
>>  	dma_release_channel(dma->chan);
>>  no_tx:
>>  	memset(dma, 0, sizeof(*dma));
>> +	dev_info(dev, "msm_serial: DMA not enabled\n");
>>  }
>>  
> 
> Wouldn't this print twice for TX and RX channels? I'd prefer we
> not print anything when this driver probes, just because it's a
> bunch of log spam that we don't really need.

This is in msm_request_tx_dma().  I should have made the message
"msm_serial: TX DMA not enabled\n" and added a similar message
to msm_request_rx_dma().

Then it could print twice, once for TX and once for RX. :-)
For my board it would print twice because both requests would
fail for the same reason.

Should I add it to msm_request_rx_dma() also, but make both
locations dev_debug() instead of dev_info()?

-Frank




--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Boyd April 25, 2016, 9:35 p.m. UTC | #3
On 04/25, Frank Rowand wrote:
>
> This is in msm_request_tx_dma().  I should have made the message
> "msm_serial: TX DMA not enabled\n" and added a similar message
> to msm_request_rx_dma().
> 
> Then it could print twice, once for TX and once for RX. :-)
> For my board it would print twice because both requests would
> fail for the same reason.

Ah right, the 3 line diff window caught me here.

> 
> Should I add it to msm_request_rx_dma() also, but make both
> locations dev_debug() instead of dev_info()?

Honestly I don't see much point in having this at all. Why does
the user care if DMA is used or not? Don't they just want the
hardware to work? Maybe dev_dbg(), but again, debug junk. I'll
leave it up to you and Greg.
Frank Rowand April 26, 2016, 12:44 a.m. UTC | #4
On 4/25/2016 2:35 PM, Stephen Boyd wrote:
> On 04/25, Frank Rowand wrote:
>>
>> This is in msm_request_tx_dma().  I should have made the message
>> "msm_serial: TX DMA not enabled\n" and added a similar message
>> to msm_request_rx_dma().
>>
>> Then it could print twice, once for TX and once for RX. :-)
>> For my board it would print twice because both requests would
>> fail for the same reason.
> 
> Ah right, the 3 line diff window caught me here.
> 
>>
>> Should I add it to msm_request_rx_dma() also, but make both
>> locations dev_debug() instead of dev_info()?
> 
> Honestly I don't see much point in having this at all. Why does
> the user care if DMA is used or not? Don't they just want the
> hardware to work? Maybe dev_dbg(), but again, debug junk. I'll
> leave it up to you and Greg.

If the user doesn't care if DMA is used then why even bother
implementing it in the driver?  :-)

I don't _need_ the messages, I just need the driver to quit
dropping bytes and writing corrupt bytes.  So patch 1 of 2 is
sufficient for my needs.

-Frank

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH April 28, 2016, 8:51 p.m. UTC | #5
On Sat, Apr 23, 2016 at 10:17:05AM -0700, Frank Rowand wrote:
> From: Frank Rowand <frank.rowand@am.sony.com>
> 
> Failure to enable DMA by the msm_serial driver is silent.
> Add a message to report the failure.
> 
> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> ---
>  drivers/tty/serial/msm_serial.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: b/drivers/tty/serial/msm_serial.c
> ===================================================================
> --- a/drivers/tty/serial/msm_serial.c
> +++ b/drivers/tty/serial/msm_serial.c
> @@ -170,6 +170,7 @@ rel_tx:
>  	dma_release_channel(dma->chan);
>  no_tx:
>  	memset(dma, 0, sizeof(*dma));
> +	dev_info(dev, "msm_serial: DMA not enabled\n");

Don't print out messages that a user can't do something with :(

So I agree, this is not needed, sorry.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Frank Rowand April 28, 2016, 10:15 p.m. UTC | #6
On 4/28/2016 1:51 PM, Greg Kroah-Hartman wrote:
> On Sat, Apr 23, 2016 at 10:17:05AM -0700, Frank Rowand wrote:
>> From: Frank Rowand <frank.rowand@am.sony.com>
>>
>> Failure to enable DMA by the msm_serial driver is silent.
>> Add a message to report the failure.
>>
>> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
>> ---
>>  drivers/tty/serial/msm_serial.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> Index: b/drivers/tty/serial/msm_serial.c
>> ===================================================================
>> --- a/drivers/tty/serial/msm_serial.c
>> +++ b/drivers/tty/serial/msm_serial.c
>> @@ -170,6 +170,7 @@ rel_tx:
>>  	dma_release_channel(dma->chan);
>>  no_tx:
>>  	memset(dma, 0, sizeof(*dma));
>> +	dev_info(dev, "msm_serial: DMA not enabled\n");
> 
> Don't print out messages that a user can't do something with :(
> 
> So I agree, this is not needed, sorry.
> 
> greg k-h
> 

I am ok with dropping patch 2.  No problem.

-Frank
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: b/drivers/tty/serial/msm_serial.c
===================================================================
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -170,6 +170,7 @@  rel_tx:
 	dma_release_channel(dma->chan);
 no_tx:
 	memset(dma, 0, sizeof(*dma));
+	dev_info(dev, "msm_serial: DMA not enabled\n");
 }
 
 static void msm_request_rx_dma(struct msm_port *msm_port, resource_size_t base)