From munisekharrms at gmail.com Tue Dec 3 06:17:31 2024 From: munisekharrms at gmail.com (Muni Sekhar) Date: Tue, 3 Dec 2024 16:47:31 +0530 Subject: Query Regarding UART Controller Device Driver in Linux Kernel Message-ID: Dear Linux Kernel Community, I hope this email finds you well. I need to work on the high speed UART controller driver in the Linux kernel, and I have a few questions that I would appreciate your guidance on: I understand that the Linux kernel tree contains multiple source code files related to UART controller device drivers. Could you please point me to the relevant source code paths for these drivers? What is the maximum supported UART baud rate in the current kernel driver's supports? For example, if the hardware supports high-speed baud rates (e.g., 12 Mbps), are there any specific design strategies or modifications needed in the driver to support such high speeds? Are there any user-space utilities available for testing UART interfaces in Linux? If so, could you kindly share details on these utilities or provide any resources that would be useful for testing? Thank you for your time and support. I look forward to your response. -- Thanks, Sekhar From greg at kroah.com Tue Dec 3 08:56:17 2024 From: greg at kroah.com (Greg KH) Date: Tue, 3 Dec 2024 14:56:17 +0100 Subject: Query Regarding UART Controller Device Driver in Linux Kernel In-Reply-To: References: Message-ID: <2024120338-atrocious-policy-1ce0@gregkh> On Tue, Dec 03, 2024 at 04:47:31PM +0530, Muni Sekhar wrote: > Dear Linux Kernel Community, > > I hope this email finds you well. I need to work on the high speed > UART controller driver in the Linux kernel, and I have a few questions > that I would appreciate your guidance on: > > I understand that the Linux kernel tree contains multiple source code > files related to UART controller device drivers. Could you please > point me to the relevant source code paths for these drivers? Where have you looked that you did not find them? (hint, drivers/tty/serial is where they are located...) > What is the maximum supported UART baud rate in the current kernel > driver's supports? For example, if the hardware supports high-speed > baud rates (e.g., 12 Mbps), are there any specific design strategies > or modifications needed in the driver to support such high speeds? Many different uarts support different high-speed rates, it depends on the hardware. And yes, there are different ways of going that fast, but again, it depends on the hardware. What exact hardware type are you working with? Does it not already work properly with Linux? > Are there any user-space utilities available for testing UART > interfaces in Linux? If so, could you kindly share details on these > utilities or provide any resources that would be useful for testing? There are loads of them, but it depends on what you want to test. What exactly are you wishing to test/validate? thanks, greg k-h From munisekharrms at gmail.com Tue Dec 3 12:08:30 2024 From: munisekharrms at gmail.com (Muni Sekhar) Date: Tue, 3 Dec 2024 22:38:30 +0530 Subject: Query Regarding UART Controller Device Driver in Linux Kernel In-Reply-To: <2024120338-atrocious-policy-1ce0@gregkh> References: <2024120338-atrocious-policy-1ce0@gregkh> Message-ID: On Tue, Dec 3, 2024 at 7:26?PM Greg KH wrote: > > On Tue, Dec 03, 2024 at 04:47:31PM +0530, Muni Sekhar wrote: > > Dear Linux Kernel Community, > > > > I hope this email finds you well. I need to work on the high speed > > UART controller driver in the Linux kernel, and I have a few questions > > that I would appreciate your guidance on: > > > > I understand that the Linux kernel tree contains multiple source code > > files related to UART controller device drivers. Could you please > > point me to the relevant source code paths for these drivers? > > Where have you looked that you did not find them? (hint, > drivers/tty/serial is where they are located...) > > > What is the maximum supported UART baud rate in the current kernel > > driver's supports? For example, if the hardware supports high-speed > > baud rates (e.g., 12 Mbps), are there any specific design strategies > > or modifications needed in the driver to support such high speeds? > > Many different uarts support different high-speed rates, it depends on > the hardware. And yes, there are different ways of going that fast, but > again, it depends on the hardware. > > What exact hardware type are you working with? Does it not already work > properly with Linux? The hardware I am working with is Xilinx based UART controller with DMA capability. Can you provide examples of hardware platforms or available UART controller drivers that support speeds up to 12 Mbps or higher? What specific modifications or configurations are required in the driver to enable such high baud rates? > > > Are there any user-space utilities available for testing UART > > interfaces in Linux? If so, could you kindly share details on these > > utilities or provide any resources that would be useful for testing? > > There are loads of them, but it depends on what you want to test. What > exactly are you wishing to test/validate? I am looking for test utilities to stress-test high-speed data transfers between two systems over UART, checking for correct reception of a large data payload. It includes, transferring data at a high baud rate, and verifying its integrity at the receiving end. Could you clarify which utilities are commonly used for testing UART interfaces at different levels (e.g., performance, stability, data integrity, error checking)? Are there any specific utilities or resources you would recommend for testing high-speed UARTs? > > thanks, > > greg k-h -- Thanks, Sekhar From greg at kroah.com Tue Dec 3 12:26:00 2024 From: greg at kroah.com (Greg KH) Date: Tue, 3 Dec 2024 18:26:00 +0100 Subject: Query Regarding UART Controller Device Driver in Linux Kernel In-Reply-To: References: <2024120338-atrocious-policy-1ce0@gregkh> Message-ID: <2024120311-omit-camcorder-e8c0@gregkh> On Tue, Dec 03, 2024 at 10:38:30PM +0530, Muni Sekhar wrote: > On Tue, Dec 3, 2024 at 7:26?PM Greg KH wrote: > > > > On Tue, Dec 03, 2024 at 04:47:31PM +0530, Muni Sekhar wrote: > > > Dear Linux Kernel Community, > > > > > > I hope this email finds you well. I need to work on the high speed > > > UART controller driver in the Linux kernel, and I have a few questions > > > that I would appreciate your guidance on: > > > > > > I understand that the Linux kernel tree contains multiple source code > > > files related to UART controller device drivers. Could you please > > > point me to the relevant source code paths for these drivers? > > > > Where have you looked that you did not find them? (hint, > > drivers/tty/serial is where they are located...) > > > > > What is the maximum supported UART baud rate in the current kernel > > > driver's supports? For example, if the hardware supports high-speed > > > baud rates (e.g., 12 Mbps), are there any specific design strategies > > > or modifications needed in the driver to support such high speeds? > > > > Many different uarts support different high-speed rates, it depends on > > the hardware. And yes, there are different ways of going that fast, but > > again, it depends on the hardware. > > > > What exact hardware type are you working with? Does it not already work > > properly with Linux? > The hardware I am working with is Xilinx based UART controller with > DMA capability. > Can you provide examples of hardware platforms or available UART > controller drivers that support speeds up to 12 Mbps or higher? What > specific modifications or configurations are required in the driver to > enable such high baud rates? I would suggest reading some UART datasheets for this type of information. Start with the one that you have now, that's the best way to test things. > > > Are there any user-space utilities available for testing UART > > > interfaces in Linux? If so, could you kindly share details on these > > > utilities or provide any resources that would be useful for testing? > > > > There are loads of them, but it depends on what you want to test. What > > exactly are you wishing to test/validate? > I am looking for test utilities to stress-test high-speed data > transfers between two systems over UART, checking for correct > reception of a large data payload. It includes, transferring data at > a high baud rate, and verifying its integrity at the receiving end. > Could you clarify which utilities are commonly used for testing UART > interfaces at different levels (e.g., performance, stability, data > integrity, error checking)? Are there any specific utilities or > resources you would recommend for testing high-speed UARTs? You can search as well as I can, but here's something that came up pretty easily: https://github.com/cbrake/linux-serial-test There are many many many other serial port programs, ideally you would test the hardware with what you expect to use that hardware for, so why not just use that software instead of something else? good luck! greg k-h From michelemartone at users.sourceforge.net Tue Dec 17 16:02:59 2024 From: michelemartone at users.sourceforge.net (Michele Martone) Date: Tue, 17 Dec 2024 21:02:59 +0000 Subject: Training: Semantic Patching of C and C++ Code with Coccinelle Message-ID: Dear Linux Kernel Hackers, this pretty unusual on-site training at LRZ in Munich, Germany may be of interest to some you, despite the HPC context that motivated it. __________________________________________________________________________________ What: Introduction to Semantic Patching of C and C++ Programs with Coccinelle, or A language to update large swathes of C/C++ code with non-trivial changes (with emphasis on HPC-specific restructurings). Why: Code maintenance and porting to new CPUs/GPUs is difficult. This can help. When: Wednesday, January 22, 2025, 09:30 - 17:30 Where: Leibniz Supercomputing Centre, Garching near Munich, Germany (ON-SITE) Who: Dr. Michele Martone https://github.com/michelemartone Prerequisites: Good C/C++ knowledge; HPC experience recommended. __________________________________________________________________________________ Registration URL: ===> ---> https://tiny.badw.de/gsRkBW <--- <=== __________________________________________________________________________________ The maintenance of a large software project can be very demanding. External factors like evolving third-party software library APIs, or constantly changing hardware platforms might require significant code adaptions for the code to run efficiently, or to run at all. Failure in coping with this can lead to obsolescence, loss of performance, incompatibility, vendor lock-in, bugs. Have you ever wondered how to detect and manipulate specified C/C++ code constructs, be it for code analysis, or better, to restructure an arbitrarily large codebase according to a specified, non-trivial `pattern', without writing a source-to-source translator yourself, but using an existing programmable one? In this training we introduce you to a tool to do exactly this: match and restructure code in a programmatic, formal way. After this training, you shall be able to write your own code transformations, be it for a refactoring, performance improvement, paving the way to an experimental fork, or for debug/analysis reasons. The training will also show how to analyse code looking for interesting patterns (e.g. bugs), integrate your Python scripts to achieve the custom transformations you need, and leverage Coccinelle's increasing C++ support. Special mention will go to performance-oriented transformations, of interest of HPC practitioners. __________________________________________________________________________________ -- Dr. Michele Martone https://michelemartone.org Leibniz Supercomputing Centre (LRZ) High Performance Systems Division Boltzmannstrasse 1 D-85748 Garching bei Muenchen Germany () ASCII ribbon campaign - against HTML e-mail /\ - against proprietary attachments -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 195 bytes Desc: not available URL: From jim.cromie at gmail.com Thu Dec 19 14:28:22 2024 From: jim.cromie at gmail.com (jim.cromie at gmail.com) Date: Thu, 19 Dec 2024 14:28:22 -0500 Subject: Abandoned patch In-Reply-To: References: Message-ID: you could keep his patch as-is for 1st commit, then alter it afterwards to address issues. And cc: author in the msgs then review might suggest you squash them in, or not.. On Fri, Oct 25, 2024 at 3:44?PM Patryk wrote: > > Hi, > I've got a question - what can I do with a patch that was submitted > some time ago (about a year ago) but after the review was abandoned by > the author for no obvious reason? Perhaps, the author did not have > time to finalize upstream and started working on something else. Can I > take such a patch, clean up according to the comments and send it > again? If so, how can I provide / retain the information about the > original patch author? This patch still seems to be useful as it adds > the support for a device that is still in production. Moreover, I will > probably need this patch in my project. Will be grateful for some > advice. > > Best regards > Patryk > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies From jim.cromie at gmail.com Thu Dec 19 14:33:31 2024 From: jim.cromie at gmail.com (jim.cromie at gmail.com) Date: Thu, 19 Dec 2024 14:33:31 -0500 Subject: Help Needed: Debugging Memory Corruption results GPF In-Reply-To: References: Message-ID: Can you run this in a KVM ? My go-to is virtme-ng, where I can run my hacks on my laptop, in its own VM - on a copy of my whole system. with the tools I'm familiar with. then you can attach gdb to the VM. then Id try a watchpoint on the memory. On Fri, Nov 15, 2024 at 11:19?AM Muni Sekhar wrote: > > Hi all, > > I am encountering a memory corruption issue in the function > msm_set_laddr() from the Slimbus MSM Controller driver source code. > https://android.googlesource.com/kernel/msm/+/refs/heads/android-msm-sunfish-4.14-android12/drivers/slimbus/slim-msm-ctrl.c > > In msm_set_laddr(), one of the arguments is ea (enumeration address), > which is a pointer to constant data. While testing, I observed strange > behavior: > > The contents of the ea buffer get corrupted during a timeout scenario > in the call to: > > timeout = wait_for_completion_timeout(&done, HZ); > > Specifically, the ea buffer's contents differ before and after the > wait_for_completion_timeout() call, even though it's declared as a > pointer to constant data (const u8 *ea). > To debug this issue, I enabled KASAN, but it didn't reveal any memory > corruption. After the buffer corruption, random memory allocations in > other parts of the kernel occasionally result in a GPF crash. > > Here is the relevant part of the code: > > static int msm_set_laddr(struct slim_controller *ctrl, const u8 *ea, > u8 elen, u8 laddr) > { > struct msm_slim_ctrl *dev = slim_get_ctrldata(ctrl); > struct completion done; > int timeout, ret, retries = 0; > u32 *buf; > retry_laddr: > init_completion(&done); > mutex_lock(&dev->tx_lock); > buf = msm_get_msg_buf(dev, 9, &done); > if (buf == NULL) > return -ENOMEM; > buf[0] = SLIM_MSG_ASM_FIRST_WORD(9, SLIM_MSG_MT_CORE, > SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS, > SLIM_MSG_DEST_LOGICALADDR, > ea[5] | ea[4] << 8); > buf[1] = ea[3] | (ea[2] << 8) | (ea[1] << 16) | (ea[0] << 24); > buf[2] = laddr; > ret = msm_send_msg_buf(dev, buf, 9, MGR_TX_MSG); > timeout = wait_for_completion_timeout(&done, HZ); > if (!timeout) > dev->err = -ETIMEDOUT; > if (dev->err) { > ret = dev->err; > dev->err = 0; > } > mutex_unlock(&dev->tx_lock); > if (ret) { > pr_err("set LADDR:0x%x failed:ret:%d, retrying", laddr, ret); > if (retries < INIT_MX_RETRIES) { > msm_slim_wait_retry(dev); > retries++; > goto retry_laddr; > } else { > pr_err("set LADDR failed after retrying:ret:%d", ret); > } > } > return ret; > } > > What I've Tried: > KASAN: Enabled it but couldn't identify the source of the corruption. > Debugging Logs: Added logs to print the ea contents before and after > the wait_for_completion_timeout() call. The logs show a mismatch in > the data. > > Question: > How can I efficiently trace the source of the memory corruption in > this scenario? > Could wait_for_completion_timeout() or a related function cause > unintended side effects? > Are there additional tools or techniques (e.g., dynamic debugging or > specific kernel config options) that can help identify this > corruption? > Any insights or suggestions would be greatly appreciated! > > > > -- > Thanks, > Sekhar > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies From s-sandro at gmx.de Fri Dec 20 10:25:28 2024 From: s-sandro at gmx.de (sandro) Date: Fri, 20 Dec 2024 16:25:28 +0100 Subject: userland process PID/TGID in the RPC layer Message-ID: <0D49914A-DB7D-458D-95C3-26D3185E412A@gmx.de> Hello everyone, I am currently working on my bachelor thesis and I have a question regarding PIDs/TGIDs in the sunrpc layer of the kernel. I was wondering if I can obtain the PID/TGID of the userland process that originally caused a RPC request to be transmitted, from within the RPC request itself. Here is what I did: With a BPF program I collect the following metrics from a tracepoint inside ?xprt_request_transmit()? function defined in /net/sunrpc/xprt.c: 1. current task name 2. current PID/TGID as a return value of bpf_get_current_pid_tgid() 3. The TGID assigned in the tk_owner field of struct rpc_task. (Using: BPF_CORE_READ(rpc_rqst, rq_task, tk_owner)) From the sources I have learned that TGID from 3. is assigned in ?rpc_init_task() function? defined in /net/sunrpc/sched.c: task->tk_owner = current->tgid; In the output of the BPF program I see records with the following entries for the above metrics: 1. "kworker/u389:3? 2. "PID": 455045, "TGID": 455045 3. "rpc_tk_owner_tgid": 3989219 Here, evidently, the thread that executes the "xprt_request_transmit()? differs from the one that assigned the rpc_tk_owner_tgid in ?rpc_init_task()?. The latter was executed by the userland process. But there are also records like this: 1. "kworker/u128:4" 2. "PID": 1457360, "TGID": 1457360 3. "rpc_tk_owner_tgid": 1457360 Here, the kworker did both the jobs. Now to my questions: 1. What determines which thread executes rpc_init_task()? 2. How can I, with certainty, obtain the userland process? PID/TGID from inside rpc_init_task() ? Thank you for your answers. Best regards, Sandro -------------- next part -------------- An HTML attachment was scrubbed... URL: