* [PATCH] serial: 8250_dw: Fix assignment error of data in dw8250_probe()
@ 2023-08-04 12:16 Xia Fukun
2023-08-04 12:24 ` Ilpo Järvinen
0 siblings, 1 reply; 3+ messages in thread
From: Xia Fukun @ 2023-08-04 12:16 UTC (permalink / raw)
To: ilpo.jarvinen, andy.shevchenko, gregkh, heikki.krogerus
Cc: xiafukun, linux-kernel
When the "ri-override" property is present in the device,
data->msr_mask_on and UART_MSR_RI should be used for
OR-assignment. Fix the errors in it.
Fixes: 1bd8edba10e6 ("serial: 8250_dw: adapt to unified device property interface")
Signed-off-by: Xia Fukun <xiafukun@huawei.com>
---
drivers/tty/serial/8250/8250_dw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 7db51781289e..921b5f07828f 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -587,7 +587,7 @@ static int dw8250_probe(struct platform_device *pdev)
if (device_property_read_bool(dev, "ri-override")) {
/* Always report Ring indicator as inactive */
- data->msr_mask_off |= UART_MSR_RI;
+ data->msr_mask_on |= UART_MSR_RI;
data->msr_mask_off |= UART_MSR_TERI;
}
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250_dw: Fix assignment error of data in dw8250_probe()
2023-08-04 12:16 [PATCH] serial: 8250_dw: Fix assignment error of data in dw8250_probe() Xia Fukun
@ 2023-08-04 12:24 ` Ilpo Järvinen
2023-08-04 12:41 ` Xia Fukun
0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2023-08-04 12:24 UTC (permalink / raw)
To: Xia Fukun
Cc: andy.shevchenko, Greg Kroah-Hartman, heikki.krogerus, LKML, linux-serial
On Fri, 4 Aug 2023, Xia Fukun wrote:
> When the "ri-override" property is present in the device,
> data->msr_mask_on and UART_MSR_RI should be used for
> OR-assignment. Fix the errors in it.
>
> Fixes: 1bd8edba10e6 ("serial: 8250_dw: adapt to unified device property interface")
> Signed-off-by: Xia Fukun <xiafukun@huawei.com>
> ---
> drivers/tty/serial/8250/8250_dw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 7db51781289e..921b5f07828f 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -587,7 +587,7 @@ static int dw8250_probe(struct platform_device *pdev)
>
> if (device_property_read_bool(dev, "ri-override")) {
> /* Always report Ring indicator as inactive */
> - data->msr_mask_off |= UART_MSR_RI;
> + data->msr_mask_on |= UART_MSR_RI;
> data->msr_mask_off |= UART_MSR_TERI;
The comment and also documentation says RI signal is always kept inactive
when ri-override is present.
In Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml:
ri-override:
description: Override the RI modem status signal. This signal will always
be reported as inactive instead of being obtained from the modem status
register. Define this if your serial port does not use this pin.
...So why you think this patch is correct? (Please explain it in the v2
changelog clearly if you think your patch is still correct thing to do,
thank you).
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250_dw: Fix assignment error of data in dw8250_probe()
2023-08-04 12:24 ` Ilpo Järvinen
@ 2023-08-04 12:41 ` Xia Fukun
0 siblings, 0 replies; 3+ messages in thread
From: Xia Fukun @ 2023-08-04 12:41 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: andy.shevchenko, Greg Kroah-Hartman, heikki.krogerus, LKML, linux-serial
On 2023/8/4 20:24, Ilpo Järvinen wrote:
> On Fri, 4 Aug 2023, Xia Fukun wrote:
>
>> When the "ri-override" property is present in the device,
>> data->msr_mask_on and UART_MSR_RI should be used for
>> OR-assignment. Fix the errors in it.
>>
>> if (device_property_read_bool(dev, "ri-override")) {
>> /* Always report Ring indicator as inactive */
>> - data->msr_mask_off |= UART_MSR_RI;
>> + data->msr_mask_on |= UART_MSR_RI;
>> data->msr_mask_off |= UART_MSR_TERI;
>
> The comment and also documentation says RI signal is always kept inactive
> when ri-override is present.
>
> In Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml:
>
> ri-override:
> description: Override the RI modem status signal. This signal will always
> be reported as inactive instead of being obtained from the modem status
> register. Define this if your serial port does not use this pin.
>
> ...So why you think this patch is correct? (Please explain it in the v2
> changelog clearly if you think your patch is still correct thing to do,
> thank you).
>
Thank you very much for your reply. My understanding of this property is
indeed flawed. That is to say, in the "ri-override" property,
data->msr_mask_on will not be used, there will be no signal transmission?
In that case, you are right. My patch may be redundant.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-04 12:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 12:16 [PATCH] serial: 8250_dw: Fix assignment error of data in dw8250_probe() Xia Fukun
2023-08-04 12:24 ` Ilpo Järvinen
2023-08-04 12:41 ` Xia Fukun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®