serial: 16550: properly initialize fcr field of ns16550_platdata
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
Default fcr value is initialized in ns16550_serial_ofdata_to_platdata but this function is only called if OF_CONTROL option is enabled while the field is used whenever DM_SERIAL is set. So for configs that do not have OF_CONTROL default fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.
As a fix initialize fcr field in probe method
--- drivers/serial/ns16550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/ns16550.c +1 -1
@@ -352,6 +352,7 @@ int ns16550_serial_probe(struct udevice *dev)struct NS16550 *const com_port =dev_get_priv (dev); com_port->plat =dev_get_platdata (dev); + com_port->plat->fcr =UART_FCR_DEFVAL ;NS16550_init (com_port,-1 );return 0 ;
@@ -437,7 +438,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)return -EINVAL ; } - plat->fcr =UART_FCR_DEFVAL ;if (port_type ==PORT_JZ4780 ) plat->fcr |=UART_FCR_UME ;
Signature · 1 line
2.9.2
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
Quoted 7 lines · Oleksandr Tymoshenko
Default fcr value is initialized in
ns16550_serial_ofdata_to_platdatabut this function is only called ifOF_CONTROLoption is enabled while the field is used wheneverDM_SERIALis set. So for configs that do not haveOF_CONTROLdefault fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.
Quoted 6 lines
As a fix initialize fcr field in probe method
Signed-off-by Oleksandr Tymoshenko <[email protected]>Cc Marek Vasut <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>
This looks like the correct fix for the FCR flub instead of patching each and every board/cpu file.
Quoted 25 lines
--- drivers/serial/ns16550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/serial/ns16550.c +1
-1@@ -352,6 +352,7 @@ int ns16550_serial_probe(struct udevice *dev)struct NS16550 *const com_port =dev_get_priv (dev); com_port->plat =dev_get_platdata (dev); + com_port->plat->fcr =UART_FCR_DEFVAL ;NS16550_init (com_port,-1 );return 0 ;@@ -437,7 +438,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)return -EINVAL ; } - plat->fcr =UART_FCR_DEFVAL ;if (port_type ==PORT_JZ4780 ) plat->fcr |=UART_FCR_UME ;
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
In reply to Oleksandr TymoshenkoQuoted 7 lines · Oleksandr Tymoshenko
Default fcr value is initialized in
ns16550_serial_ofdata_to_platdatabut this function is only called ifOF_CONTROLoption is enabled while the field is used wheneverDM_SERIALis set. So for configs that do not haveOF_CONTROLdefault fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.
Quoted 6 lines
As a fix initialize fcr field in probe method
Signed-off-by Oleksandr Tymoshenko <[email protected]>Cc Marek Vasut <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>
Are you still seeing this with v2017.03-rc1? Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170201/9612247f/attachment.sig>
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
Quoted 9 lines · Tom Rini (trini at konsulko.com)
Quoted 7 lines · Oleksandr Tymoshenko
Default fcr value is initialized in
ns16550_serial_ofdata_to_platdatabut this function is only called ifOF_CONTROLoption is enabled while the field is used wheneverDM_SERIALis set. So for configs that do not haveOF_CONTROLdefault fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.
Quoted 8 lines
Quoted 6 lines
As a fix initialize fcr field in probe method
Signed-off-by Oleksandr Tymoshenko <[email protected]>Cc Marek Vasut <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>Are you still seeing this with v2017.03-rc1? Thanks!
No, this bug is not reproducible on v2017.03-rc1, I believe 17fa032671 fixed it. Not sure how I missed that patch I am pretty sure I tested my BBB with master branch.
Thanks
Signature · 1 line
gonzo
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
Hello Oleksandr,
Am 01.02.2017 um 19:52 schrieb Oleksandr Tymoshenko:
Quoted 17 lines
Quoted 16 lines · Tom Rini (trini at konsulko.com)
Quoted 13 lines · Oleksandr Tymoshenko
Default fcr value is initialized in
ns16550_serial_ofdata_to_platdatabut this function is only called ifOF_CONTROLoption is enabled while the field is used wheneverDM_SERIALis set. So for configs that do not haveOF_CONTROLdefault fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.As a fix initialize fcr field in probe method
Signed-off-by Oleksandr Tymoshenko <[email protected]>Cc Marek Vasut <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>
Quoted 5 lines
Quoted 1 line
Are you still seeing this with v2017.03-rc1? Thanks!
No, this bug is not reproducible on v2017.03-rc1, I believe
17fa032671fixed it. Not sure how I missed that patch I am pretty sure I tested my BBB with master branch.
Yes commit 17fa032671 fixed this issue. How do you test? You must type very fast, or copy&paste a long command ...
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 1/1 serial: 16550: properly initialize fcr field of ns16550_platdata
Quoted 20 lines · Heiko Schocher (hs at denx.de)
Hello Oleksandr,
Am 01.02.2017 um 19:52 schrieb Oleksandr Tymoshenko:
Quoted 17 lines
Quoted 16 lines · Tom Rini (trini at konsulko.com)
Quoted 13 lines · Oleksandr Tymoshenko
Default fcr value is initialized in
ns16550_serial_ofdata_to_platdatabut this function is only called ifOF_CONTROLoption is enabled while the field is used wheneverDM_SERIALis set. So for configs that do not haveOF_CONTROLdefault fcr value is set to zero which leads to loosing characters when serial port input is faster than reading routine i.e. when copy-pasting long line to U-Boot prompt.As a fix initialize fcr field in probe method
Signed-off-by Oleksandr Tymoshenko <[email protected]>Cc Marek Vasut <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Are you still seeing this with v2017.03-rc1? Thanks!
No, this bug is not reproducible on v2017.03-rc1, I believe
17fa032671fixed it. Not sure how I missed that patch I am pretty sure I tested my BBB with master branch.Yes commit
17fa032671fixed this issue. How do you test? You must type very fast, or copy&paste a long command ...
Hi Heiko,
I copy-pasted long lines for my test. I think I used 2017.01 for my test, not master. That's why I didn't realise that the bug is fixed in the latest version.
Signature · 1 line
gonzo