Re: [PATCH net-next v4] vsock/test: Add test for null ptr deref when transport changes

2025-07-09 Thread Konstantin Shkolnyy
On 09-Jul-25 10:41, Stefano Garzarella wrote: On Wed, 9 Jul 2025 at 17:26, Stefano Garzarella wrote: On Wed, 9 Jul 2025 at 16:54, Konstantin Shkolnyy wrote: I'm seeing a problem on s390 with the new "SOCK_STREAM transport change null-ptr-deref" test. Here is how it ap

Re: [PATCH net-next v4] vsock/test: Add test for null ptr deref when transport changes

2025-07-09 Thread Konstantin Shkolnyy
On 09-Jul-25 09:57, Luigi Leonardi wrote: Hi Konstantin, On Wed, Jul 09, 2025 at 09:54:03AM -0500, Konstantin Shkolnyy wrote: I'm seeing a problem on s390 with the new "SOCK_STREAM transport change null-ptr-deref" test. Here is how it appears to happen: test_stream_transpor

RE: [PATCH net-next v4] vsock/test: Add test for null ptr deref when transport changes

2025-07-09 Thread Konstantin Shkolnyy
I'm seeing a problem on s390 with the new "SOCK_STREAM transport change null-ptr-deref" test. Here is how it appears to happen: test_stream_transport_change_client() spins for 2s and sends 70K+ CONTROL_CONTINUE messages to the "control" socket. test_stream_transport_change_server() spins call

Re: [PATCH net v2] vsock/test: Fix occasional failure in SOCK_STREAM SHUT_RD test

2025-05-27 Thread Konstantin Shkolnyy
On 26-May-25 08:55, Stefano Garzarella wrote: BTW I think I already fixed the same issue in this series: https://lore.kernel.org/netdev/20250514141927.159456-1-sgarz...@redhat.com/ Can you check it? Yes, it looks like the same issue.

[PATCH net v2] vsock/test: Fix occasional failure in SOCK_STREAM SHUT_RD test

2025-05-26 Thread Konstantin Shkolnyy
nel thread (via vsock->rx_work). Sometimes that thread is delayed more than the test expects. Change the test to keep calling send() until it fails or a timeout occurs. Fixes: b698bd97c5711 ("test/vsock: shutdowned socket test") Signed-off-by: Konstantin Shkolnyy --- Changes in v2:

[PATCH net] vsock/test: Fix occasional failure in SOCK_STREAM SHUT_RD test

2025-05-25 Thread Konstantin Shkolnyy
nel thread (via vsock->rx_work). Sometimes that thread is delayed more than the test expects. Change the test to keep calling send() until it fails or a timeout occurs. Fixes: b698bd97c5711 ("test/vsock: shutdowned socket test") Signed-off-by: Konstantin Shkolnyy --- tools/tes

Re: [PATCH net v2] vsock/test: Fix occasional failure in SIOCOUTQ tests

2025-05-07 Thread Konstantin Shkolnyy
On 07-May-25 10:41, Stefano Garzarella wrote: On Wed, 7 May 2025 at 17:15, Konstantin Shkolnyy wrote: These tests: "SOCK_STREAM ioctl(SIOCOUTQ) 0 unsent bytes" "SOCK_SEQPACKET ioctl(SIOCOUTQ) 0 unsent bytes" output: "Unexpected 'SIOCOUTQ' value,

[PATCH net v2] vsock/test: Fix occasional failure in SIOCOUTQ tests

2025-05-07 Thread Konstantin Shkolnyy
sock_tx_done(), called upon receipt of the data by the other side, doesn't update the counter itself. It delegates that to a kernel thread (via vsock->tx_work). Sometimes that thread is delayed more than the test expects. Change the test to poll SIOCOUTQ until it returns 0 or a timeout occu

[PATCH net] vsock/test: Fix occasional failure in SIOCOUTQ tests

2025-05-07 Thread Konstantin Shkolnyy
sock_tx_done(), called upon receipt of the data by the other side, doesn't update the counter itself. It delegates that to a kernel thread (via vsock->tx_work). Sometimes that thread is delayed more than the test expects. Change the test to try SIOCOUTQ several times with small delays i

[PATCH v2] vdpa/mlx5: Fix mlx5_vdpa_get_config() endianness on big-endian machines

2025-02-04 Thread Konstantin Shkolnyy
way. Signed-off-by: Konstantin Shkolnyy --- Changes in V2: Initialize only VIRTIO_F_VERSION_1 in actual_features, rather than all flags. drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vne

[PATCH] vdpa/mlx5: Fix mlx5_vdpa_get_config() endianness on big-endian machines.

2025-01-30 Thread Konstantin Shkolnyy
ore mlx5_vdpa_set_driver_features(), the flag is clear, and the data are returned as big-endian on big-endian machines, while QEMU interprets them as little-endian. Signed-off-by: Konstantin Shkolnyy --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/mlx5/net/mlx5_vne

[PATCH net v8 3/3] vsock/test: verify socket options after setting them

2024-12-03 Thread Konstantin Shkolnyy
Replace setsockopt() calls with calls to functions that follow setsockopt() with getsockopt() and check that the returned value and its size are the same as have been set. (Except in vsock_perf.) Signed-off-by: Konstantin Shkolnyy Reviewed-by: Stefano Garzarella --- tools/testing/vsock

[PATCH net v8 0/3] vsock/test: fix wrong setsockopt() parameters

2024-12-03 Thread Konstantin Shkolnyy
ch series.) Changes for v3: - fix the same problem in vsock_perf and update commit message Changes for v2: - add "Fixes:" lines to the commit message Konstantin Shkolnyy (3): vsock/test: fix failures due to wrong SO_RCVLOWAT parameter vsock/test: fix parameter types in SO_VM_SOCKETS_*

[PATCH net v8 2/3] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-12-03 Thread Konstantin Shkolnyy
ssage bounds test") Fixes: 685a21c314a8 ("test/vsock: add big message test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Signed-off-by: Konstantin Shkolnyy Reviewed-by: Stef

[PATCH net v8 1/3] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-12-03 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf u

[PATCH net v7 2/3] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-12-02 Thread Konstantin Shkolnyy
ssage bounds test") Fixes: 685a21c314a8 ("test/vsock: add big message test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Signed-off-by: Konstantin Shkolnyy Reviewed-by: Stef

[PATCH net v7 1/3] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-12-02 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf u

[PATCH net v7 3/3] vsock/test: verify socket options after setting them

2024-12-02 Thread Konstantin Shkolnyy
Replace setsockopt() calls with calls to functions that follow setsockopt() with getsockopt() and check that the returned value and its size are the same as have been set. (Except in vsock_perf.) Signed-off-by: Konstantin Shkolnyy Reviewed-by: Stefano Garzarella --- tools/testing/vsock

[PATCH net v7 0/3] vsock/test: fix wrong setsockopt() parameters

2024-12-02 Thread Konstantin Shkolnyy
add "Fixes:" lines to the commit message Konstantin Shkolnyy (3): vsock/test: fix failures due to wrong SO_RCVLOWAT parameter vsock/test: fix parameter types in SO_VM_SOCKETS_* calls vsock/test: verify socket options after setting them tools/testing/vsock/control.c |

Re: [PATCH v6 3/3] vsock/test: verify socket options after setting them

2024-11-18 Thread Konstantin Shkolnyy
On 11/14/2024 04:28, Stefano Garzarella wrote: On Wed, Nov 13, 2024 at 08:35:57AM -0600, Konstantin Shkolnyy wrote: [...] diff --git a/tools/testing/vsock/msg_zerocopy_common.c b/tools/ testing/vsock/msg_zerocopy_common.c index 5a4bdf7b5132..8622e5a0f8b7 100644 --- a/tools/testing/vsock

[PATCH v6 3/3] vsock/test: verify socket options after setting them

2024-11-13 Thread Konstantin Shkolnyy
Replace setsockopt() calls with calls to functions that follow setsockopt() with getsockopt() and check that the returned value and its size are the same as have been set. (Except in vsock_perf.) Signed-off-by: Konstantin Shkolnyy --- tools/testing/vsock/control.c | 9 +- tools

[PATCH v6 0/3] vsock/test: fix wrong setsockopt() parameters

2024-11-13 Thread Konstantin Shkolnyy
s on the first one (hence, it's now a patch series.) Changes for v3: - fix the same problem in vsock_perf and update commit message Changes for v2: - add "Fixes:" lines to the commit message Konstantin Shkolnyy (3): vsock/test: fix failures due to wrong SO_RCVLOWAT parame

[PATCH v6 1/3] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-11-13 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf u

[PATCH v6 2/3] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-11-13 Thread Konstantin Shkolnyy
ssage bounds test") Fixes: 685a21c314a8 ("test/vsock: add big message test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Signed-off-by: Konstantin Shkolnyy Reviewed-by: Stef

Re: [PATCH v5 3/3] vsock/test: verify socket options after setting them

2024-11-12 Thread Konstantin Shkolnyy
On 11/12/2024 02:58, Stefano Garzarella wrote: On Thu, Nov 07, 2024 at 07:17:26PM -0600, Konstantin Shkolnyy wrote: Replace setsockopt() calls with calls to functions that follow setsockopt() with getsockopt() and check that the returned value and its size are the same as have been set. Signed

[PATCH v5 3/3] vsock/test: verify socket options after setting them

2024-11-07 Thread Konstantin Shkolnyy
Replace setsockopt() calls with calls to functions that follow setsockopt() with getsockopt() and check that the returned value and its size are the same as have been set. Signed-off-by: Konstantin Shkolnyy --- tools/testing/vsock/Makefile | 8 +- tools/testing/vsock/control.c

[PATCH v5 2/3] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-11-07 Thread Konstantin Shkolnyy
ssage bounds test") Fixes: 685a21c314a8 ("test/vsock: add big message test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Signed-off-by: Konstantin Shkolnyy --- tools/testing/vso

[PATCH v5 1/3] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-11-07 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf u

[PATCH v5 0/3] vsock/test: fix wrong setsockopt() parameters

2024-11-07 Thread Konstantin Shkolnyy
- add "Reviewed-by:" to the first patch, and add a second patch fixing SO_VM_SOCKETS_* calls, which depends on the first one (hence, it's now a patch series.) Changes for v3: - fix the same problem in vsock_perf and update commit message Changes for v2: - add "Fixes:" lines to

Re: [PATCH v4 2/2] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-10-31 Thread Konstantin Shkolnyy
On 10/31/2024 09:16, Stefano Garzarella wrote: On Tue, Oct 29, 2024 at 09:49:54AM -0500, Konstantin Shkolnyy wrote: Change parameters of SO_VM_SOCKETS_* to uint64_t so that they are always In include/uapi/linux/vm_sockets.h we talk about "unsigned long long", but in the kernel code

[PATCH v4 0/2] vsock/test: fix wrong setsockopt() parameters

2024-10-29 Thread Konstantin Shkolnyy
hanges for v3: - fix the same problem in vsock_perf and update commit message Changes for v2: - add "Fixes:" lines to the commit message Konstantin Shkolnyy (2): vsock/test: fix failures due to wrong SO_RCVLOWAT parameter vsock/test: fix parameter types in SO_VM_SOCKETS_* calls to

[PATCH v4 2/2] vsock/test: fix parameter types in SO_VM_SOCKETS_* calls

2024-10-29 Thread Konstantin Shkolnyy
/vsock: add big message test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf utility") Signed-off-by: Konstantin Shkolnyy --- tools/testing/vsock/vsock_perf.c | 2 +- tools/testing/vsock/vsock_test.c |

[PATCH v4 1/2] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-29 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vsock_perf u

[PATCH v3] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-25 Thread Konstantin Shkolnyy
st failures, while vsock_perf doesn't even notice that it's failed to change it. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Fixes: 8abbffd27ced ("test/vsock: vs

[PATCH v2] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-25 Thread Konstantin Shkolnyy
t failures. Fixes: b1346338fbae ("vsock_test: POLLIN + SO_RCVLOWAT test") Fixes: 542e893fbadc ("vsock/test: two tests to check credit update logic") Signed-off-by: Konstantin Shkolnyy --- Notes: The problem was found on s390 (big endian), while x86-64 didn't show it. Afte

Re: [PATCH] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-25 Thread Konstantin Shkolnyy
On 10/24/2024 03:43, Stefano Garzarella wrote: Other setsockopt() in the tests where we use unsigned long are SO_VM_SOCKETS_* but they are expected to be unsigned, so we should be fine. It's actually not "signed vs unsigned", but a "size + endianess" problem. Also, looking at SO_VM_SOCKETS_* c

[PATCH] vsock/test: fix failures due to wrong SO_RCVLOWAT parameter

2024-10-23 Thread Konstantin Shkolnyy
lures. Signed-off-by: Konstantin Shkolnyy --- Notes: The problem was found on s390 (big endian), while x86-64 didn't show it. After this fix, all tests pass on s390. tools/testing/vsock/vsock_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testi

RE: [EXT] [PATCH v4] r8152: Add support for setting pass through MAC address on RTL8153-AD

2016-06-06 Thread Konstantin Shkolnyy
> -Original Message- > From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- > ow...@vger.kernel.org] On Behalf Of Mario Limonciello > Sent: Monday, June 06, 2016 12:19 > To: hayesw...@realtek.com > Cc: LKML; Netdev; Linux USB; pali.ro...@gmail.com; > anthony.w...@canonical.com; Greg KH;

[PATCH v5 3/3] USB: serial: cp210x: Cleaned up CRTSCTS flag code.

2016-05-04 Thread Konstantin Shkolnyy
The CRTSCTS flag code cleared (and inconsistently) bits unrelated to CRTSCTS functionality. It was also harder than necessary to read. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions

[PATCH v5 0/3] USB: serial: cp210x: Bugfixes and cleanup in CRTSCTS flag code

2016-05-04 Thread Konstantin Shkolnyy
. v2 Improved CRTSCTS fix by feedback. Dropped get_termios error handling fix. Konstantin Shkolnyy (3): USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag. USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code. USB: serial: cp210x: Cleaned up CRTSCTS flag code

[PATCH v5 2/3] USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code.

2016-05-04 Thread Konstantin Shkolnyy
Replaced magic numbers used in the CRTSCTS flag code with symbolic names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 109 ++-- 1 file changed, 84 insertions(+), 25 deletions(-) diff --git a/drivers

[PATCH v5 1/3] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-05-04 Thread Konstantin Shkolnyy
" This only happened after first having enabled CRTSCTS. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index dd47823..fef7a51 100644 --- a/drivers/u

RE: [EXT] Re: [PATCH v4 2/3] USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code.

2016-05-04 Thread Konstantin Shkolnyy
> -Original Message- > From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- > ow...@vger.kernel.org] On Behalf Of Johan Hovold > Sent: Wednesday, May 04, 2016 02:29 > To: Konstantin Shkolnyy > Cc: jo...@kernel.org; linux-...@vger.kernel.org; linux- > ker...@vger

RE: [EXT] Re: [PATCH v4 2/3] USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code.

2016-05-04 Thread Konstantin Shkolnyy
> -Original Message- > From: Johan Hovold [mailto:jhov...@gmail.com] On Behalf Of Johan Hovold > Sent: Wednesday, May 04, 2016 07:55 > To: Konstantin Shkolnyy > Cc: Johan Hovold; Konstantin Shkolnyy; linux-...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject:

[PATCH v4 2/3] USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code.

2016-05-03 Thread Konstantin Shkolnyy
Replaced magic numbers used in the CRTSCTS flag code with symbolic names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- v4: Same series of patches, fixed names and defines by feedback. v3: Regenerated the patches correctly against the latest usb-next branch. v2 Improved

[PATCH v4 3/3] USB: serial: cp210x: Cleaned up CRTSCTS flag code.

2016-05-03 Thread Konstantin Shkolnyy
The CRTSCTS flag code cleared (and inconsistently) bits unrelated to CRTSCTS functionality. It was also harder than necessary to read. Signed-off-by: Konstantin Shkolnyy --- v4: Same series of patches, fixed names and defines by feedback. v3: Regenerated the patches correctly against the latest

[PATCH v4 1/3] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-05-03 Thread Konstantin Shkolnyy
" This only happened after first having enabled CRTSCTS. Signed-off-by: Konstantin Shkolnyy --- v4: Same series of patches, fixed names and defines by feedback. v3: Regenerated the patches correctly against the latest usb-next branch. v2 Improved CRTSCTS fix by feedback. Dropped get_termios error ha

RE: [EXT] RE: [PATCH v2 2/3] USB: serial: cp210x: Added comments to CRTSCTS flag code.

2016-05-03 Thread Konstantin Shkolnyy
> -Original Message- > From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- > ow...@vger.kernel.org] On Behalf Of David Laight > Sent: Tuesday, May 03, 2016 04:44 > To: 'Konstantin Shkolnyy'; jo...@kernel.org > Cc: linux-...@vger.kernel.org; linux-kernel@vge

[PATCH v3 3/3] USB: serial: cp210x: Cleaned up CRTSCTS flag code.

2016-04-30 Thread Konstantin Shkolnyy
The CRTSCTS flag code cleared (and inconsistently) bits unrelated to CRTSCTS functionality. It was also harder than necessary to read. Signed-off-by: Konstantin Shkolnyy --- v3: Regenerated the patches correctly against the latest usb-next branch. v2 Improved CRTSCTS fix by feedback. Dropped

[PATCH v3 1/3] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-04-30 Thread Konstantin Shkolnyy
" This only happened after first having enabled CRTSCTS. Signed-off-by: Konstantin Shkolnyy --- v3: Regenerated the patches correctly against the latest usb-next branch. v2 Improved CRTSCTS fix by feedback. Dropped get_termios error handling fix. drivers/usb/serial/cp210x.c | 3 +-- 1 file c

[PATCH v3 2/3] USB: serial: cp210x: Got rid of magic numbers in CRTSCTS flag code.

2016-04-30 Thread Konstantin Shkolnyy
Replaced magic numbers used in the CRTSCTS flag code with symbolic names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- v3: Regenerated the patches correctly against the latest usb-next branch. v2 Improved CRTSCTS fix by feedback. Dropped get_termios error handling fix

[PATCH v2 1/3] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-04-29 Thread Konstantin Shkolnyy
" This only happened after first having enabled CRTSCTS. Signed-off-by: Konstantin Shkolnyy --- Changes in v2: Improved CRTSCTS fix based on feedback. Dropped get_termios error handling. drivers/usb/serial/cp210x.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drive

[PATCH v2 3/3] USB: serial: cp210x: Cleaned up CRTSCTS flag code.

2016-04-29 Thread Konstantin Shkolnyy
The CRTSCTS flag code cleared (and inconsistently) bits unrelated to CRTSCTS functionality. It was also harder than necessary to read. Signed-off-by: Konstantin Shkolnyy --- Changes in v2: Improved CRTSCTS fix based on feedback. Dropped get_termios error handling. drivers/usb/serial/cp210x.c

[PATCH v2 2/3] USB: serial: cp210x: Added comments to CRTSCTS flag code.

2016-04-29 Thread Konstantin Shkolnyy
Replaced magic numbers used in the CRTSCTS flag code with symbolic names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- Changes in v2: Improved CRTSCTS fix based on feedback. Dropped get_termios error handling. drivers/usb/serial/cp210x.c | 93

RE: [EXT] Re: [PATCH RESEND 3/5] USB: serial: cp210x: Added comments to CRTSCT flag code.

2016-04-27 Thread Konstantin Shkolnyy
> -Original Message- > From: Johan Hovold [mailto:jhov...@gmail.com] On Behalf Of Johan Hovold > Sent: Tuesday, April 26, 2016 02:26 > To: Konstantin Shkolnyy > Cc: Johan Hovold; Konstantin Shkolnyy; linux-...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject:

RE: [EXT] Re: [PATCH RESEND 3/5] USB: serial: cp210x: Added comments to CRTSCT flag code.

2016-04-25 Thread Konstantin Shkolnyy
; __le32 ulXoffLimit; } __packed; > -Original Message- > From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- > ow...@vger.kernel.org] On Behalf Of Johan Hovold > Sent: Monday, April 25, 2016 05:17 > To: Konstantin Shkolnyy > Cc: jo...@kernel.org; linux-...@vger.kernel

[PATCH RESEND 5/5] USB: serial: cp210x: Added more error handling to open()

2016-04-24 Thread Konstantin Shkolnyy
Added error handling to register accesses made by open(), so it doesn't succeed if anything goes wrong. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/driver

[PATCH RESEND 1/5] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-04-24 Thread Konstantin Shkolnyy
A bug in the CRTSCT handling caused RTS to alternate between CRTSCTS=0 => "RTS transmits active signal" and CRTSCTS=1 => "RTS receives flow control" instead of CRTSCTS=0 => "RTS is statically active" and CRTSCTS=1 => "RTS receives flow control"

[PATCH RESEND 4/5] USB: serial: cp210x: Prepared get_termios() for adding error handling

2016-04-24 Thread Konstantin Shkolnyy
Replaced several register write calls with one, to simplify adding error handling. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index

[PATCH RESEND 3/5] USB: serial: cp210x: Added comments to CRTSCT flag code.

2016-04-24 Thread Konstantin Shkolnyy
Documented "magic numbers" used in the CRTSCT flag code in terms of register bit names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 38 ++ 1 file changed, 34 insertions(+), 4 deletions(-) di

[PATCH RESEND 2/5] USB: serial: cp210x: Made sure SERIAL_XOFF_CONTINUE flag is clear.

2016-04-24 Thread Konstantin Shkolnyy
The CRTCTS flag code intended to clear the SERIAL_XOFF_CONTINUE flag, but did it inconsistently. This change is non-functional for existing chips because the driver never set the flag and it's clear by default. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 2 +- 1

[PATCH 4/5] USB: serial: cp210x: Prepared get_termios() for adding error handling

2016-03-21 Thread Konstantin Shkolnyy
Replaced several register write calls with one, to simplify adding error handling. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index

[PATCH 5/5] USB: serial: cp210x: Added more error handling to open()

2016-03-21 Thread Konstantin Shkolnyy
Added error handling to register accesses made by open(), so it doesn't succeed if anything goes wrong. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/driver

[PATCH 3/5] USB: serial: cp210x: Added comments to CRTSCT flag code.

2016-03-21 Thread Konstantin Shkolnyy
Documented "magic numbers" used in the CRTSCT flag code in terms of register bit names from the chip specification. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 38 ++ 1 file changed, 34 insertions(+), 4 deletions(-) di

[PATCH 1/5] USB: serial: cp210x: Fixed RTS mode setting by the CRTSCTS flag.

2016-03-21 Thread Konstantin Shkolnyy
A bug in the CRTSCT handling caused RTS to alternate between CRTSCTS=0 => "RTS transmits active signal" and CRTSCTS=1 => "RTS receives flow control" instead of CRTSCTS=0 => "RTS is statically active" and CRTSCTS=1 => "RTS receives flow control"

[PATCH 2/5] USB: serial: cp210x: Made sure SERIAL_XOFF_CONTINUE flag is clear.

2016-03-21 Thread Konstantin Shkolnyy
The CRTCTS flag code intended to clear the SERIAL_XOFF_CONTINUE flag, but did it inconsistently. This change is non-functional for existing chips because the driver never set the flag and it's clear by default. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 2 +- 1

[PATCH v5 3/3] USB: serial: cp210x: New access functions for large registers

2016-02-28 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change switches large register access to use new block functions. The old functions are removed because now they become unused. Signed-off-by: Konstantin Shkolnyy --- change in v5: Same patch, regenerated against current usb

[PATCH v5 2/3] USB: serial: cp210x: New 8-bit and 32-bit register access functions.

2016-02-28 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 8 and 32-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v5: Same patch, regenerated against current usb-next branch. change in v4

[PATCH v5 1/3] USB: serial: cp210x: New 16-bit register access functions.

2016-02-28 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 16-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v5: Same patch, regenerated against current usb-next branch. change in v4

[PATCH v4 3/3 RESEND] USB: serial: cp210x: New access functions for large registers

2016-02-27 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change switches large register access to use new block functions. The old functions are removed because now they become unused. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one

[PATCH v4 2/3 RESEND] USB: serial: cp210x: New 8-bit and 32-bit register access functions.

2016-02-27 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 8 and 32-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one separate patch, added them

[PATCH v4 1/3 RESEND] USB: serial: cp210x: New 16-bit register access functions.

2016-02-27 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 16-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one separate patch, added them with

[PATCH v4 2/3] USB: serial: cp210x: New 8-bit and 32-bit register access functions.

2016-02-07 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 8 and 32-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one separate patch, added them

[PATCH v4 3/3] USB: serial: cp210x: New access functions for large registers

2016-02-07 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change switches large register access to use new block functions. The old functions are removed because now they become unused. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one

[PATCH v4 1/3] USB: serial: cp210x: New 16-bit register access functions.

2016-02-07 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 16-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- change in v4: Instead of adding all new functions a one separate patch, added them with

[PATCH v3 1/4] USB: serial: cp210x: New register access functions.

2016-01-01 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions to replace them. New functions are not yet called - the switch is done gradually in following changes. Signed-off-by: Konstantin Shkolnyy --- change in v3: Presented new function

[PATCH v3 4/4] USB: serial: cp210x: Switch to new register access functions for large registers

2016-01-01 Thread Konstantin Shkolnyy
Change to use new large register access functions instead of cp210x_get_config and cp210x_set_config and remove the old functions since they are now unused. Signed-off-by: Konstantin Shkolnyy --- change in v3: Presented new function addition as a separate patch #1, to simplify code review

[PATCH v3 2/4] USB: serial: cp210x: Switch to new 16-bit register access functions.

2016-01-01 Thread Konstantin Shkolnyy
Change to use new 16-bit register access functions instead of cp210x_get_config and cp210x_set_config. Signed-off-by: Konstantin Shkolnyy --- change in v3: Presented new function addition as a separate patch #1, to simplify code review. drivers/usb/serial/cp210x.c | 80

[PATCH v3 3/4] USB: serial: cp210x: Switch to new 8-bit and 32-bit register access functions.

2016-01-01 Thread Konstantin Shkolnyy
Change to use new 8-bit and 32-bit register access functions instead of cp210x_get_config and cp210x_set_config. Signed-off-by: Konstantin Shkolnyy --- change in v3: Presented new function addition as a separate patch #1, to simplify code review. drivers/usb/serial/cp210x.c | 11 +-- 1

[PATCH v2 1/3 RESEND] USB: serial: cp210x: New 16-bit register access functions.

2015-12-22 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 16-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 155 +++- 1 file

[PATCH v2 2/3 RESEND] USB: serial: cp210x: New 8-bit and 32-bit register access functions.

2015-12-22 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 8 and 32-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 92 ++--- 1

[PATCH v2 3/3 RESEND] USB: serial: cp210x: New register access functions for large registers

2015-12-22 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change switches large register access to use new block functions. The old functions are removed because now they become unused. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 137

[PATCH v2 3/3] USB: serial: cp210x: New register access functions for large registers

2015-12-13 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change switches large register access to use new block functions. The old functions are removed because now they become unused. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 137

[PATCH v2 2/3] USB: serial: cp210x: New 8-bit and 32-bit register access functions.

2015-12-13 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 8 and 32-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 92 ++--- 1

[PATCH v2 1/3] USB: serial: cp210x: New 16-bit register access functions.

2015-12-13 Thread Konstantin Shkolnyy
cp210x_get_config and cp210x_set_config are cumbersome to use. This change introduces new register access functions for 16-bit values, instead of the above functions. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 155 +++- 1 file

[PATCH] USB: serial: cp210x: Cleaned up USB access functions.

2015-11-30 Thread Konstantin Shkolnyy
introduces separate register accessor functions for single 8, 16 and 32-bit values, with endian conversion, as well as "block" access functions without conversion. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 314 ++-- 1 fi

Re: [PATCH v2] USB: serial: cp210x: Add tx_empty()

2015-11-26 Thread Konstantin Shkolnyy
On Wed, Nov 25, 2015 at 2:26 PM, Andy Shevchenko wrote: > On Wed, Nov 25, 2015 at 12:28 AM, Konstantin Shkolnyy > wrote: >> +static bool cp210x_tx_empty(struct usb_serial_port *port) >> +{ >> + int err; >> + u32 count; >> + >> +

[PATCH v2] USB: serial: cp210x: Add tx_empty()

2015-11-24 Thread Konstantin Shkolnyy
-empty the close can be delayed until all data are sent. Signed-off-by: Konstantin Shkolnyy --- Code style corrections and using sizeof instead of a defined constant. drivers/usb/serial/cp210x.c | 58 + 1 file changed, 58 insertions(+) diff --git a/d

[PATCH RESEND] USB: serial: cp210x: Add tx_empty()

2015-11-11 Thread Konstantin Shkolnyy
Without this function, when the port is closed the data in the chip's transmit FIFO are lost. If the actual byte count is reported the close can be delayed until all data are sent. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c

[PATCH] USB: serial: cp210x: Remove CP2110 ID from compatibility list

2015-11-10 Thread Konstantin Shkolnyy
CP2110 ID (0x10c4, 0xea80) doesn't belong here because it's a HID and completely different from CP210x devices. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp21

[PATCH] USB: serial: cp210x: Add tx_empty()

2015-11-04 Thread Konstantin Shkolnyy
Without this function, when the port is closed the data in the chip's transmit FIFO are lost. If the actual byte count is reported the close can be delayed until all data are sent. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c

Re: [PATCH v4 3/3] USB: serial: cp210x: Workaround cp2108 GET_LINE_CTL bug

2015-11-03 Thread Konstantin Shkolnyy
[...] Hi Johan, I'd like to add tx_empty() and replace cp210x_get/set_config with simpler functions, as we discussed before. While the tx_empty patch could be made against the current kernel, the latter would have to be made against my previous patch set. How should this be done? Thanks, Konstan

Re: [PATCH v4 3/3] USB: serial: cp210x: Workaround cp2108 GET_LINE_CTL bug

2015-10-31 Thread Konstantin Shkolnyy
On Sat, Oct 31, 2015 at 7:16 AM, Johan Hovold wrote: > [ Please avoid top-posting. ] > > On Thu, Oct 29, 2015 at 08:39:04AM -0500, Konstantin Shkolnyy wrote: >> I tested it on cp2102, cp2105 and cp2108. >> I'm a little worried about that extra PURGE command, so I did

Re: [PATCH v4 3/3] USB: serial: cp210x: Workaround cp2108 GET_LINE_CTL bug

2015-10-29 Thread Konstantin Shkolnyy
27, 2015 at 04:53:34PM -0500, Konstantin Shkolnyy wrote: >> > cp2108 GET_LINE_CTL returns the 16-bit value with the 2 bytes swapped. >> > However, SET_LINE_CTL functions properly. When the driver tries to modify >> > the register, it reads it, modifies some bits and writ

[PATCH v5 1/3] USB: serial: cp210x: Workaround cp2108 Tx queue bug

2015-10-28 Thread Konstantin Shkolnyy
close() callback. This change is applied to all cp210x devices. Clearing internal queues on close is generally good. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb

[PATCH v5 3/3] USB: serial: cp210x: Workaround cp2108 GET_LINE_CTL bug

2015-10-28 Thread Konstantin Shkolnyy
. In turn, this causes cp2108 respond with a stall. The stall sometimes doesn't clear properly and cp2108 starts responding to following valid commands also with stalls, effectively failing. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c

[PATCH v5 2/3] USB: serial: cp210x: Relocated private data from USB interface to port

2015-10-28 Thread Konstantin Shkolnyy
trivial. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 43 +++ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 8ba1005..352fe63 100644 --- a/drivers/usb

[PATCH v4 3/3] USB: serial: cp210x: Workaround cp2108 GET_LINE_CTL bug

2015-10-27 Thread Konstantin Shkolnyy
. In turn, this causes cp2108 respond with a stall. The stall sometimes doesn't clear properly and cp2108 starts responding to following valid commands also with stalls, effectively failing. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c

[PATCH v4 2/3] USB: serial: cp210x: Relocated private data from USB interface to port

2015-10-27 Thread Konstantin Shkolnyy
trivial. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 43 +++ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 8ba1005..352fe63 100644 --- a/drivers/usb

[PATCH v4 1/3] USB: serial: cp210x: Workaround cp2108 Tx queue bug

2015-10-27 Thread Konstantin Shkolnyy
close() callback. This change is applied to all cp210x devices. Clearing internal queues on close is generally good. Signed-off-by: Konstantin Shkolnyy --- drivers/usb/serial/cp210x.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb

  1   2   >