Re: [PATCH] usb: serial: ch341: add debugfs interface and clean up

Greg KH <[email protected]> Thu, 6 Aug 2026 06:40:26 +0200
Newsgroups org.kernel.vger.linux-usb
Message-ID <2026080638-zoning-trekker-b568@gregkh>
On Wed, Aug 05, 2026 at 08:28:00PM +0500, Vegom Doster wrote:
> On Wed, Aug 5, 2026 at 8:27 PM Vegom Doster <[email protected]> wrote:
> 
> > This patch adds a debugfs interface for the CH341 driver, allowing runtime
> > inspection of chip version, quirks, and line status. It also adds a 'baud'
> > file to test the divisor calculation without hardware.
> >
> > The patch also cleans up magic numbers, removes duplicate code, and fixes
> > several issues:
> > - Replace obsolete usb_control_msg() with usb_control_msg_send/recv
> > - Convert version>0x27 hack to proper CH341_QUIRK_INVERTED_BIT7
> > - Fix baud_rate update in ch341_set_termios (only on success)
> > - Use READ_ONCE/WRITE_ONCE for break_end
> > - Fix error handling in ch341_reset_resume
> > - Add debugfs interface for diagnostics
> >
> > No functional changes are made to the driver's operation.
> >
> > Tested on Arch Linux with Arduino Uno (CH340C, 1a86:7523):
> > - checkpatch: 0 errors, 0 warnings, 0 checks
> > - DTR/RTS (tiocmget/set): PASS
> > - Echo at 9600 and 115200 baud: PASS (byte-per-byte)
> > - Divisor formula for 15 speeds (300..3000000): PASS (error ≤0.16%)
> > - debugfs: tested with custom test script
> >
> > Signed-off-by: nerolocker <[email protected]>

This shouldn't be quoted, and you need a real name for the signed-off-by
line.

> >

> // SPDX-License-Identifier: GPL-2.0

This isn't a diff, but rather the whole file.

Perhaps take a look at the "how to write a kernel patch" tutorial on
kernelnewbies.org first?

Also, obviously, you have to break this up into smaller pieces to even
be able to get it reviewed :)

And finally, why add a debugfs file at all?  What is it going to be used
for and why is it only needed now, after the driver is very stable?

thanks,

greg k-h