5,136 questions
-4
votes
0
answers
79
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 ...
2
votes
0
answers
51
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 ...
-2
votes
1
answer
201
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", },
{},
};
...
1
vote
0
answers
141
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
177
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&...
2
votes
0
answers
93
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 ...
0
votes
0
answers
125
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
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
90
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.
...
0
votes
0
answers
75
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
89
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. ...
2
votes
1
answer
233
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), ...
0
votes
2
answers
90
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 *...
1
vote
0
answers
96
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 ...
0
votes
0
answers
114
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
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 ...
0
votes
1
answer
116
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
0
answers
115
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
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
1
answer
68
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 ...
1
vote
1
answer
392
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: "...
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 ...
0
votes
0
answers
61
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
142
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....
0
votes
1
answer
209
views
Best current practice device tree layout and API usage to implement a Linux kernel device driver for a device consisting of multiple SPI devices
I have a custom device that can be connected to various SoCs using two SPIs and a couple of GPIO wires (one of them functioning as an interrupt request wire). It would be acceptable to expect both ...