5,139 questions
-1
votes
0
answers
51
views
Why does deferred probe succeed on one device but fails intermittently on identical hardware in the same board [closed]
I am working on a Qualcomm-based embedded Linux platform using a platform driver for a peripheral (UART/I2C/WiFi).
The driver uses a device tree match table and implements a probe() and remove(). The ...
2
votes
0
answers
82
views
+100
In-Order Delivery of UIO Interrupts for Userspace Driver
I have multiple UIO interrupts defined. I am using Linux 6.12 without the realtime config (so, using the default scheduler, CFS).
My userspace driver is using poll in a loop to watch these interrupts ...
Advice
0
votes
3
replies
72
views
Enforce probe order for device tree overlay fragments
I am building a dto for a display using an Ilitek 9806e controller and a Goodix Gt911 touch controller.
These two components share a single reset line, so this reset line should only be asserted once ...
-4
votes
0
answers
120
views
Custom board based on i.MX soc: custom driver module crashes after Linux update
Introduction: I'm using a custom board based on an i.MX6q SoC that communicates with an FPGA on the EIM bus: this communication is managed via custom driver module. The DTACK signal and memory WDOG ...
1
vote
2
answers
141
views
How to enable I2C GPIO fault Injector in Linux kernel
I am attempting to introduce bus errors on the I²C bus using the i2c-gpio fault injector already available under drivers/i2c/busses/. For my target platform (AST2600), I’ve enabled the following ...
2
votes
0
answers
52
views
What is the use of startct blk_mq_tag_set.reserved_tags inthe linux nvme driver?
I am customizing the Linux nvme driver ioctl(NVME_IOCTL_SUBMIT_IO) to take QID from user and submit the IO command to that particular QID. I am using ubuntu 22(Kernel 6.5).
I modified ...
0
votes
0
answers
74
views
How to select particular queue for sending IO from Userspace in linux nvme driver
I am customizing the linux nvme driver to take QID and submit the IO command to that particular QID in the ioctl command NVME_IOCTL_SUBMIT_IO. I am using Kernel6.5(ubuntu 22).
The call is like this:
...
-2
votes
1
answer
208
views
Lack of alias in kernel module .ko file built with Yocto [closed]
I am trying to build a driver for my IP in an FPGA. I have:
static const struct of_device_id myip_of_match[] = {
{ .compatible = "xlnx,myip-controller-1.022", },
{},
};
...
0
votes
0
answers
40
views
gpio phandle remains unresolved when device overlay is applied
Objective:
To run ltr390 industrial device driver on raspberrypi
Hardware Setup:
Raspberrypi 4B
ltr390 sensor breakout board.
Following are the connections done.
rpi
ltr390
PIN7
INT
PIN1
3.3V
PIN3
...
1
vote
0
answers
143
views
Add timestamp support to PCF85363 RTC
I'm working with a custom board that integrates the NXP PCF85263 RTC. This RTC supports timestamp functionalities (e.g., tamper detection and battery switch-over events), but unfortunately, the RTC ...
0
votes
0
answers
75
views
does ioremap work on ARM? Unhandled fault: imprecise external abort (0x1406)
When testing linux kernel 5.10 on Zynq-7010 FPGA with multiple sequential interrupts I get Unhandled fault: imprecise external abort (0x1406) from the interrupt handler an example of the failure (from ...
0
votes
0
answers
191
views
Get GPIO active high/low setting in Linux kernel v6.6
My DT describes GPIO as following:
my-gpio = <&gpio4 20 0>;
In Linux kernel v5.10 I use
gpionum = of_get_named_gpio(np, "my-gpio", 0);
of_get_named_gpio_flags(np, "my-gpio&...
0
votes
1
answer
146
views
Where does exactly eeprom file get created in Linux at24 driver
I have the following overlay inserted to Kernel:
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&i2c_arm>;
__overlay__ {
mem@50 {
compatible = ...
2
votes
0
answers
94
views
Invalid write at 0xFEE01004 region ‘null’ [duplicate]
When I call msix_notify, I get this error
"Invalid write at 0xFEE01004 region ‘null’"
in the log. I am using msix_initx_exclusive.bar initialization, and in qemu monitor, I can also see ...
1
vote
0
answers
145
views
kzalloc(32, GFP_KERNEL) failed, but kzalloc(64, GFP_KERNEL) success,
I'm new to Linux kernel development and need help understanding a memory allocation issue. I defined a structure in my driver like this:
typedef struct MyStruct {
int a;
int b;
int c;
...
0
votes
0
answers
132
views
mcp23008 i2c GPIO expander interrupts vs libgpiod v2.1
I have an application running on an NVIDIA Jetson Xavier NX (so, arm64) with a need to interface with a GPIO located on an i2c-connected expander (an MCP23008). I'm also using libgpiod v2.1, for what ...
0
votes
0
answers
132
views
Can't open mmc as block device when driver is on built-in
I have a module who open mmc blockdevice, inspired of block2mtd.c driver on linux 5.1.
It works successfully when my driver is as module and "modprobe" after kernel started.
But it fail when ...
0
votes
0
answers
40
views
Proper data race protection between ndo_start_xmit and NAPI tx
Assuming I run TX completions (i.e. release transmitted skbs) for a given TX queue in a NAPI context, what would be a correct way to ensure there's absolutely no data race between the ndo_start_xmit ...
0
votes
1
answer
62
views
Proper usage of %pad specifier in Linux kernel function printk?
I am working on a DMA driver. I found in documentation that there is special printk specifier for dma_addr_t:
%pad 0x01234567 or 0x0123456789abcdef
For printing a dma_addr_t type which can vary ...
0
votes
1
answer
101
views
kobject_uevent_env() doesn't show in udevadm
I am learning kobjects and kobject_uevent_env() functions.
Not sure why my code doesn't print "CUSTOM_VAR"s in udevadm monitor.
KOBJ_ADD, KOBJ_REMOVE appear to be doing nothing in this code.
...
1
vote
0
answers
68
views
How to send sk_buff to Linux Network stack as package received from TAP
I'm trying to send sk_buff from one driver to RX queue of other (TAP, drivers/net/tun.c in Linux sources), using code like this:
#if RECV_SKB
#define NETIF_RX netif_receive_skb
#else
#define NETIF_RX ...
0
votes
0
answers
76
views
What may be causing a deadlock in my block device module?
I have what looks like a deadlock (to me) in my linux block device module.
The block device is created and exists and is backed by a file. When I go to mount the file system via: mount -o ro /dev/...
0
votes
1
answer
311
views
Diference between pgprot_noncached() and set_memory_uc()
I want to allocate a memory region who's pages can selectively have their cache disabled. For example, allocate 1 MB (256x4K pages) where, as the execution goes on, specific pages get set to ...
0
votes
1
answer
91
views
For some reason, when allocating memory from user space linux, I have a problem with the write response in AXE Memory Mapped to PCI Express module
I have a PC as a root complex and Xilinx fpga device as an end point that writes via PCI Express to root complex RAM using DMA and a linux driver to it. I have a problem that I can't solve in any way. ...
0
votes
0
answers
65
views
Replacing / updating a kernel module
I need the latest version of the tsc2007 driver that is available in master but not in my distros repo rpi-6.12.y. I downloaded the source from both master and my distros repo and compared the files. ...
2
votes
1
answer
235
views
dma_alloc_coherent() memory remap to userspace via mmap
I'm working on a Linux kernel driver that allocates memory with dma_alloc_coherent() and maps it to userspace using mmap.
This works perfectly on kernel 4.18 (tested on 4.18.0-553.47.1.el8_10.x86_64), ...
1
vote
1
answer
130
views
Is it possible to mock out a character device file in userspace?
I have a user space application that opens a Linux device file handle (e.g., /dev/foobar) and then sends ioctls to it.
I need to replicate a specific series of answers from the device delivered back ...
0
votes
2
answers
98
views
platform_device_register() causing kobject error
I am a noob in learning Linux, and I am learning platform device and driver functionality, and I am testing a simple Linux device code here.
#include "platform.h"
struct platform_device *...
2
votes
1
answer
109
views
Is task->state deprecated after 5.6 Linux kernel versions?
Consider:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/sched/signal.h>
#include <linux/jiffies.h>
MODULE_LICENSE("GPL&...
1
vote
0
answers
102
views
Logic behind using per cpu variable
I'm going through some linux kernel documentation on per cpu variables. I understand that having separate variable for each CPU help prevent cache line invalidation and make things faster.
But in ...
2
votes
0
answers
73
views
Kernel Module - Character Device and Sysfs Permissions Issue
I am developing a kernel module that, during initialization, creates a character device and multiple sysfs entries. I need to allow user-space access (non-root, non-sudo) to both. I want to be able to ...
0
votes
0
answers
119
views
USB host vs, gadget linux device driver
I'm trying to learn USB linux device drivers to implement a project idea I have:
Primary device is a Rasp Pi with USB port
Secondary device is a custom USB stick that I'm going to design with some ...
1
vote
0
answers
70
views
Changes in usb_deregister_device_driver() are not reflected
I changed the code in kernel-source/drivers/usb/core/driver.c to:
void usb_deregister_device_driver(struct usb_device_driver *udriver)
{
pr_info("%s: deregistering device driver %s\n",
...
1
vote
0
answers
46
views
x86 LDTR on 64-bit OSes: is it safe to assume that it is always zero?
I am working on a kernel virtualization driver for x86 CPUs. The driver uses Intel VT-x for virtualization of some guest code.
I stumbled upon a piece of driver code that saves and restores VMM's ...
1
vote
1
answer
342
views
How do i get IRQ for sc16is741 UART on DLN-2 compatible USB adapter working on Linux
I have a Linux/ACPI problem on kernel 6.16 (Debian). I have a Pico USB I/O Board (USB to SPI and GPIO adapter) used with the DLN-2 driver that is initialized thru a (for my laptop adapted) ACPI SSDT ...
0
votes
1
answer
123
views
Is it safe to retrieve userspace PID using current->pid in Linux Driver?
I would like to retrieve caller process' PID (Userspace) in Linux Driver.
At first, I could find pid attribute so easy from the struct task_struct in Linux Source Code (include/linux/sched.h) I used ...
0
votes
2
answers
112
views
Warnings in DTS Linux
While I compile DTS for my device, it gives me warnings, that don't really make sense to me.
There are two spi-chips on my device, their description is DTS is the following:
spi-gpio {
compatible =...
0
votes
0
answers
119
views
How does Linux handle a driver for a device which lives on a bus requiring another driver?
I have been doing work embedded Linux work for the past few years without any real formal training on it. I'd like to better understand how device drivers handle nested devices/buses.
For example, a ...
0
votes
0
answers
88
views
What is the proper way to add a node in device tree?
I'm trying to write a simple Kernel module which uses snvs module of imx8mm processor.
I also found there is similar module in Kernel which is rtc-snvs.c.
So, I am trying to write my driver in very ...
0
votes
0
answers
32
views
Makefile for kernel module with multiple sources [duplicate]
I am trying to build a kernel module through yocto.
I have this simple Makefile that builds the module from a single source file and then everything is fine:
obj-m := my_nand_controller.o
KERNEL_SRC :...
0
votes
0
answers
55
views
How to identify the signature of pci_reset_bus()
I'm facing a compilation issue with the pci_reset_bus() function.
In kernels v4.19-rc1 and later, the function signature is:
int pci_reset_bus(struct pci_dev *dev);
In kernels prior to v4.19-rc1, the ...
0
votes
1
answer
69
views
Kernel logs not getting updated [duplicate]
I am learning kernel programming (I am a beginner).
There are two kernel modules hello.ko and hello2.ko, I am following these steps and the I get these outputs:
inserting module hello.ko -> not ...
0
votes
0
answers
46
views
SPI CLK is not changed by initializing the SPI Setup
I now access a peripheral device using the SPI interface on the Linux environment.
Access to this device is okay.
I want to change the SPI CLK, but it is not changed by the clk setting value.
The ...
1
vote
1
answer
409
views
Error: MODPOST i2c_slave_register undefined
I am trying to follow the linux i2c slave documentation https://docs.kernel.org/i2c/slave-interface.html
when I attempt to compile the kernel module using make I get this error:
ERROR: modpost: "...
1
vote
0
answers
146
views
Linux DT-Overlay for MCP2515 with interrupt PIN
it's time to ask a human :). I'm trying to write a DT-Overlay for my own MCP2515 driver (just for learning purposes) and have troubles with the Interrupt-PIN configuration.
I'm using raspberry pi 4b ...
0
votes
0
answers
79
views
Schedule NAPI on a specific CPU
Is there any way to schedule NAPI on a specific CPU, e.g. similar to what schedule_work_on() workqueue context API does but in a NAPI context?
Asking this because I'm writing a Linux network driver ...
1
vote
1
answer
329
views
Trying to run EINJ but not able to find <debugfs mount point>/apei/einj
I'm running CentOS Stream 10 on a system, and I'm trying to run EINJ on it. According to documentation, I'm supposed to find a file named available_error_type over there, but it isn't.
This is the ...
0
votes
0
answers
62
views
RS485 on Pocket Beagle
I am using pocket beagle with debian 10.3th vserion. I just want to know is there is any dtbo file there to start rs485 in pocket beagle?
Like; BBB have “BB-UART4-RS485-00A0.dtbo”, dtbo for pocket ...
1
vote
1
answer
70
views
ndo_start_xmit() not called when using cansend command
A little background, I want to receive CAN frames to Linux SOM, which does not have CAN peripheral, so I use stm32 which acts just like a bridge that sends CAN frames over UART to SoM. That part is ...
1
vote
1
answer
145
views
Virtual UART device in linux
I'm trying to implement a virtual UART using socat command for send and receive a string that is encrypted using XOR cipher on sending and decrypted while receiving using C program.
#include <stdio....