Questions tagged [linux-device-driver]

Device drivers take on a special role in the Linux kernel. They are distinct programmatically abstracted “black boxes” that make a particular piece of hardware respond to a well-defined internal programming interface; they hide completely the details of how the device works.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
17 views

My headphone on my Ubuntu 22.04 lts is not working Asus gl503ge [closed]

thank you in advance for any help. I've just installed Ubuntu 22.04 LTS for work purposes. I installed it on a HDD disk that came with the computer, and everything works wonderfully. However, I've ...
DIEGO's user avatar
  • 1
0 votes
0 answers
15 views

Failed to find device node for boot cpu missing boot CPU MPIDR, not enabling secondaries

we are trying to boot Arm64/Aarch64 Linux kernel(5.9) using device tree. In device tree we add the below nodes: 1.CPUs 2.Memory 3.Serial 4.Interrupt-controller (GIC) 5.Timer Our implementation : ...
Jayaprakash's user avatar
1 vote
1 answer
76 views

dma_set_mask_and_coherent() with 24-bit DMA mask for PCIe on arm64

I am writing a PCIe driver and have trouble with setting the DMA mask. The host is a zcu102 with a Quadcore ARM-Cortex A53. The PCIe device is a custom Device. The kernel is v5.15.0-1023-xilinx-zynqmp ...
GuentherMeyer's user avatar
0 votes
0 answers
14 views

Linux FTRACE function_graph process context

I've a question related to the use of ftrace on Linux kernel 4.15. ftrace is configured as follows: mount -t debugfs nodev /sys/kernel/debug echo funcgraph-proc > /sys/kernel/debug/tracing/...
Carlo C's user avatar
  • 81
1 vote
0 answers
45 views

Is it possible to apply get_user_pages() over a mmap address? [closed]

as the title says: Is it possible to apply get_user_pages to a virtual address obtained by a mmap? My system is an embedded System composed by a SoC running a Linux distribution ( kernel version 4.6) ...
Gionata Benelli's user avatar
0 votes
0 answers
9 views

How to correct correctly sk_buff structure to "manualy" process VLAN Taget packet?

Follows frame and sk_buff's fields at transmitter side: Nov 29 14:17:56 nxp2 kernel: [TID: 0x000000 bh2_start_xmit:665] ---------------------------------------------------------------------------------...
Ruslan R. Laishev's user avatar
0 votes
0 answers
17 views

Is the `bv_len` field of `struct bio_vec` necessarily a multiple of the device's sector size?

Assuming we are reading data from the device, if the bio_vec contains a contiguous segment in memory where to data can be written by the driver, is the bvec->len field a multiple of our device's ...
Diogo Landau's user avatar
0 votes
1 answer
39 views

Read PCI config address for PCI device iteration

I want to find all PCI devices with as little Linux use as possible because of exercise. I find in scattered docs to read address 0xCF8 or maybe there is some protocol where I write to that address in ...
user2183336's user avatar
0 votes
1 answer
54 views

missing braces around initializer in kernel module

I am trying to write below driver for a use case in my kernel driver. For simplicity I have hardcoded few values here and reduced my array for 1 element, the driver code is as below, #include <...
mrigendra's user avatar
  • 1,502
0 votes
0 answers
18 views

Why does Linux need both "char_device_struct" and "cdev" structures to represent character devices?

I'm reading the code of Linux driver model. I know that when I want to register a range of character devices, I have to first use functions like register_chrdev_region() to register some ...
muqu's user avatar
  • 1
0 votes
0 answers
46 views

Could not insert the kernel module even with sudo

I am studying the Linux kernel device driver. I compiled the char device driver with kernel but while inserting with insmod, I am getting error as following, $ sudo insmod sample-module.ko [sudo] ...
dev_eng's user avatar
  • 126
1 vote
0 answers
46 views

Can port cause Linux kernel crash?

I wrote a C program like below to test my can port send speed: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <net/if.h> #include ...
Arvin's user avatar
  • 11
0 votes
0 answers
47 views

Linux GPIO driver only handles 2 IRQs instead of 4 that were requested

I am learning to write Linux drivers with the book 'Linux-Device-Drivers 3rd Edition', and I wanted to implement a simple driver for a RaspberryPi Model 4 B to control some LEDs and buttons on a ...
CoolSteve's user avatar
0 votes
0 answers
28 views

What is the difference between `module_param_cb()` and `device_param_cb()`?

Can someone explain the differences between module_param_cb() and device_param_cb() in linux/moduleparam.h—specifically about the use cases for these two functions? I was unable to find any ...
rkshthrmsh's user avatar
0 votes
0 answers
36 views

How echo command use to interact with device files?

I've seen this command: echo 0x1> /dev/uio0 It is used to clear the interrupt in a device. uio0 is the device file created for hardware device. It is created by adding generic-uio platform to the ...
Jonathan's user avatar
0 votes
0 answers
37 views

How to create a sysfs attribute_group under an existing sysfs directory?

So I have sysfs structure /sys/class/drm/device/foo/moo. moo is a subdirectory that has been created using an attribute_group. Now I want to add a subdirectory under moo - /sys/class/drm/device/foo/...
Suja S's user avatar
  • 1
0 votes
0 answers
22 views

when loading the module ,i face a problem as it not being probe invoked succefully

when i loaded my module it is loaded and it is showing in lsmod but my probe function not invoking. I checked my dts file .compatible that matches correctly with my driver (.compatible) even though my ...
Mahendra Jammigumppula's user avatar
0 votes
0 answers
29 views

Kprobe handler is not triggered for some kernel symbols

I am registering my probe to skx_register_mci symbol. Output of this symbol from /proc/kallsyms : ffffffffc1696a90 t skx_register_mci [skx_edac] So, this function seems to be local text (code). ...
xdxdxd's user avatar
  • 106
0 votes
0 answers
38 views

How to make camera driver supporting multiple MIPI CSI-2 virtual channels?

I'm in the process of writing driver for a device streaming video over MIPI CSI-2 (later called pseudo-camera). Hardware wise it acts as some form of muxer which produces multiple streams over virtual ...
Michał Fita's user avatar
  • 1,224
0 votes
0 answers
45 views

Linux NIC packet processing inside kernel space

From this question I understood that it is in charge of Linux NIC's driver code (loaded in kernel space) to allocate at its initialization both RX/TX ring descriptors plus data buffers as well. NIC's ...
Carlo C's user avatar
  • 81
0 votes
1 answer
63 views

Linux GPIO driver probe fails

I am trying to write a small kernel module that can control some LEDs connected to the GPIO pins on my RaspberryPi 4 Model B. My Pi is running Raspbian GNU/Linux 11 (bullseye) and Linux kernel v6.1.21-...
CoolSteve's user avatar
0 votes
0 answers
81 views

error: target file "./scripts/target.json" does not exist

I'm compile the Linux kernel module but I get the follow error error: target file "./scripts/target.json" does not exist make[3]: *** [scripts/Makefile.build:292: /home/guilherme/...
Guilherme Giácomo Simoes's user avatar
0 votes
0 answers
74 views

negative refcount after running cudaHostRegister-cudaHostUnregister on mmap'ed DMA zone (result: memory leak)

Description A custom device allocates memory using dma_alloc_coherent() and returns it to userland using remap_pfn_range() on .mmap routine. User mmap() the device and pinned the memory using ...
Pan's user avatar
  • 9
0 votes
0 answers
64 views

Getting SOC temp linux-mainline on sun8i

Here is my environment: Mainline linux kernel 5.15.35 OrangePi Plus 2E Yocto-based linux distro What I would expect to see here is something in /sys/class/thermal/thermal_zoneX, however the contents ...
smthingshwere's user avatar
0 votes
0 answers
34 views

Serial port telegrams timestamping on ARM embedded Linux

I want to build an ethernet based distributed measurement system with embedded NXP i.MX 6 ULL boards (measurment nodes). Measurment data is taken from a serial ineterface with a baudrate of 9600. For ...
DrNick's user avatar
  • 1
2 votes
1 answer
43 views

How do I persist data to storage from a block driver in the Linux kernel?

I am trying to implement a block device driver in the Linux kernel (version 6.2). This is a university project, and I need to implement a redundancy scheme which will be added to another tool for use. ...
sile's user avatar
  • 31
0 votes
0 answers
57 views

Increasing size for Linux kernel module kfifo_alloc() which fails for 128MB

We have an embedded product with quad Cortex-A53 cores, 4 GB RAM and runs Linux Kernel v5.4 aarch64. Whole Linux currently consumes only 200MB to work, therefore I have plenty of RAM available to use. ...
Mehmet Fide's user avatar
  • 1,655
0 votes
0 answers
69 views

How to solve the problem so that the driver port (uart4) works adequately?

UART4 serial port driver (dw-apb-uart) has only two lines - Rx and Tx. Linux kernel v6.5.8 is used. Allwinner A40i processor. This is exactly RS485, the UART is connected to the RS485 transceiver ...
Rarebeast's user avatar
0 votes
0 answers
34 views

Linux netlink socket behaviours while pushing data from kernel to user space

I have 20MB/sec data received in kernel streamed from an external device via PCIe/DMA with chunks of 1MB and I need to push this data in kernel to an application. (Linux Kernel v5.4, 64 bit) According ...
Mehmet Fide's user avatar
  • 1,655
1 vote
0 answers
21 views

How does the CPU share data with devices through HMM mechanism in Linux?

HMM stands for Heterogeneous Memory Management in Linux kernel. It provide infrastructure and helpers to integrate non-conventional memory (device memory like GPU on board memory) into regular kernel ...
Frontier_Setter's user avatar
0 votes
1 answer
56 views

linux char device create failed

I wrote a demo device driver like this: #include <linux/fs.h> #include <linux/cdev.h> #include <linux/module.h> #include <linux/init.h> #include <linux/errno.h> #include &...
Arvin's user avatar
  • 11
0 votes
0 answers
83 views

Best practice for device tree mixing GPIO and SPI in Linux Kernel device driver

As a personal challenge I'm developing a LKM for a SPI protocol device driver. SPI slave device is implemented on MCU. There are 2 signal lines READY (slave has data to send) and BUSY (master is busy)....
NielsProsch's user avatar
0 votes
0 answers
76 views

What features does OpenSBI provide that a DTS does not in an emulated environment?

I have been experimenting with RISC-V emulators, QEMU and mini-rv32ima mainly, and have come across OpenSBI. The project defines itself as: The RISC-V Supervisor Binary Interface (SBI) is the ...
Liam Kelly's user avatar
  • 3,472
0 votes
0 answers
47 views

I²C bus over PCI

I am trying to write an ARM driver for a FPGA device connected over PCI. The FPGA device has some I²C devices and DMA for which I want to write DMA engine driver. The FPGA design is not mine and ...
ozimki's user avatar
  • 75
2 votes
1 answer
94 views

Mapping non-contiguous physical memory to userspace

I had recently been reading Linux Device Drivers 3rd edition, and had reached chapter 15: Memory Mapping and DMA. I had also come across linux-kernel-labs, specifically their exercises in the Memory ...
jon doe's user avatar
  • 492
0 votes
0 answers
60 views

How should I integrate my SPI driver into kernel?

First, let me explain what I would like to achieve. I'm using the NXP LS1028a CPU, which will be used as a base for our SoM. This CPU features two types of SPI controllers: 1 FlexSPI (cabable of ...
bielu000's user avatar
  • 1,866
-2 votes
0 answers
34 views

How to download the HID.dll (USB) for Raspberry Pi 4 (64) for C# Dot Net Core application

I am new to Raspberry Pi. I am migrating an existing C# .NET Framework 5.4 based console application to C# .Net Core /7.0 (cross platform for Raspberry Pi 4, Raspbian OS). This application ...
skt's user avatar
  • 555
1 vote
0 answers
42 views

C# USB communication (HID) SetupDiGetClassDevs() return long value insted of IntPtr in .Net7.0 but retutn correct in .net Framework4.5

I am facing the issue while getting the data from Device using USB communication (HID) in .Net Core or .Net7.0. Actually, I have a legacy code in C# .Net Framework4.5. I wanted to convert the whole ...
skt's user avatar
  • 555
0 votes
0 answers
46 views

copy_from_user fails with write error : bad address

I am writing a test kernel module to simulate locks/unlocks. Below is the code : #define MODULE_NAME "lock_injection" #define COMMAND_BUF_SIZE 128 static DEFINE_MUTEX(my_mutex); static ...
Naveen's user avatar
  • 7,994
1 vote
0 answers
48 views

FROM_DEVICE DMA Request hangs Linux on multi CPU server motherboard

I am developing FPGA based PCI Express (PCIe) device that should work under Linux OS, so I am writing the Linux kernel driver also. One of the features of the device is that it can write data to Linux ...
ya_urock's user avatar
0 votes
0 answers
60 views

How can I add a ch341 driver to a custom linux for Toradex Colibri IMX7d?

We are running a java program on a Toradex Colibri IMX7d and we need to communicate through the USB port using a cable that needs the ch341 serial driver. I attempted to customise a linux kernel bu ...
Ariel H.'s user avatar
  • 782
1 vote
0 answers
56 views

I have encountered a strange problem when i want to compile a linux driver

make -C /home/doney/100ask_imx6ull_mini-sdk/Linux-4.9.88 M=`pwd` modules make[1]: Entering directory '/home/doney/100ask_imx6ull_mini-sdk/Linux-4.9.88' Building modules, stage 2. MODPOST 1 ...
Doney's user avatar
  • 11
0 votes
1 answer
42 views

Read and write device-register in Linux device driver?

First of all, this is my first attempt to do a driver for a Linux kernel, so if I'm totally wrong here, bare with me. In my current project, we have added a new device on the board (FPGA), and I have ...
EmbeddedNoob's user avatar
0 votes
0 answers
71 views

USB wakeup from suspended state on Android 13.x IMX8MQ evk

I am unable to use USB wake-up feature of Android on IMX8MQ evk. I am using the following setup: -Imx8mq EVK -Android 13 -Kernel 5.15.71-dirty -GSM modem is attached via USB I have set the following ...
Muhammad Awais's user avatar
0 votes
0 answers
28 views

About null safty in Flutter 3.7.12 Linux Platform

https://github.com/flutter/flutter/issues/136791 Steps to reproduce 1、Install and configure Flutter 3.7.12 on Linux 2、run flutte build linux --release --no-sound-null-safety or flutter run -d ...
zzy's user avatar
  • 31
0 votes
0 answers
90 views

Setting the direction of PCA953X I2C GPIO expander pins in the device tree

I've into an interesting problem that I'm hoping someone can help we with. I'm trying to bring up a board which utilises a PCA9537 I2C GPIO Expander chip to control the reset pins of various ICs on ...
rje's user avatar
  • 1
1 vote
0 answers
58 views

Why DMA driver memcpy is not working in some cases

I have written somewhat working driver for mem2mem for buffer copy without device tree using only kernel dma api as below (without error handling), Tested on beaglebone black rev C # uname -r 5.4.242 ...
mrigendra's user avatar
  • 1,502
0 votes
0 answers
147 views

Can I allocate huge pages In Kernel driver?

I want to allocate huge pages in kernel driver of size 2Mb. I have read that I can allocate huge page using kmalloc in this answer Allocating huge pages in kernel modules. Something like this. kmalloc(...
tensm's user avatar
  • 11
0 votes
0 answers
44 views

How this DMA driver is not working in beaglebone black

I am trying to learn how DMA works in Linux kernel, and for that I have taken reference from this driver, dma_test.c I have inserted device tree entry for this inside am33xx-l4.dtsi as below, ...
mrigendra's user avatar
  • 1,502
0 votes
0 answers
28 views

If a Linux application calls a driver module and the driver module acquires a lock, what happens to the lock if the driver module crashes

"If a Linux application calls a driver module and the driver module acquires a lock, what happens to the lock if the driver module crashes unexpectedly (e.g., segmentation fault) or if the ...
ycj's user avatar
  • 1

1
2 3 4 5
101