自己调试的系统偶有死机,跟同事们一起琢磨的结果如下:在evdev.c文件中存在一个隐患的BUG。
static int evdev_open(struct inode *inode, struct file *file)
{
struct evdev *evdev;
struct evdev_client *client;
int i = iminor(inode) - EVDEV_MINOR_BASE;
int error;
if (i >= EVDEV_MINORS)
return -ENODEV;
error = mutex_lock_interruptible(&evdev_table_mutex);
if (error)
return error;
evdev = evdev_table[i];
if (evdev)
get_device(&evdev->dev);
mutex_unlock(&evdev_table_mutex);
if (!evdev)
return -ENODEV;
error = evdev_open_device(evdev);
if (error)
goto err_put_evdev;
client = kzalloc(sizeof(struct evdev_client), GFP_KERNEL);
if (!client) {
error = -ENOMEM;
goto err_put_evdev;
}
spin_lock_init(&client->buffer_lock);
wake_lock_init(&client->wake_lock, WAKE_LOCK_SUSPEND, evdev->name);
client->evdev = evdev;
evdev_attach_client(evdev, client);
error = evdev_open_device(evdev);
if (error)
goto err_put_evdev;
file->private_data = client;
return 0;
err_free_client:
evdev_detach_client(evdev, client);
kfree(client);
err_put_evdev:
put_device(&evdev->dev);
return error;
}
可能的问题在于:在wake_lock_init(&client->wake_lock, WAKE_LOCK_SUSPEND, evdev->name);中会把wake_lock插入到唤醒锁的链表中,如果在这个语句后面蓝色处还有导致err_free_client的发生,其里面有kfree(client)会把刚插入的那个wake_lock空间也释放,造成链表断裂,引起系统不稳定。所以要将可能导致goto err_put_evdev的evdev_open_device放在插入wake_lock之前,即红色处。
mark:以后测试机器有用
分享到:
相关推荐
python库。资源全名:evdev-0.3.3.tar.gz
资源分类:Python库 所属语言:Python 资源全名:evdev_prepared-0.2.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,亲测可用
官方离线安装包,亲测可用
The Xorg Evdev Driver package contains Generic Linux input driver for the Xorg X server. It handles keyboard, mouse, touchpads and wacom devices, though for touchpad and wacom advanced handling, ...
lua-evdev:Lua模块,用于从devinputeventXX节点读取Linux输入事件
官方离线安装包,亲测可用
资源来自pypi官网。 资源全名:evdev_prepared-0.2.2.tar.gz
Vigilem::Evdev::Stat 确定evdev是否在这个系统上的状态安装 $ gem install vigilem-evdev-stat用法 require 'vigilem/evdev/stat' Vigilem :: Evdev :: Stat . default . available?
evdev 该软件包提供了对Linux中通用输入事件接口的绑定。 evdev接口用于将内核中生成的事件通过通常位于/dev/input/字符设备直接传递到用户空间。 该软件包还带有对uspace的绑定, uinput是用户空间输入子系统。 ...
活动,从 evdev 输入设备读取事件并发布到路线。 版权所有 (C) 2015 Google Inc. 版权所有 (C) 2015 End Point Corporation 根据 Apache 许可,版本 2.0(“许可”)获得许可; 除非遵守许可,否则您不得使用此文件...
戈朗·埃夫杰夫该软件包将Go语言绑定提供给Linux中的通用输入事件接口。 evdev接口用于将内核中生成的事件通过通常位于/ dev / input /中的字符设备直接传递到用户空间。 说明文件: 发展:
Liquid Galaxy Interactive Spaces 活动,可创建虚拟 evdev 输入设备并从路线合成输入事件。 版权所有 (C) 2015 Google Inc. 版权所有 (C) 2015 End Point Corporation 根据 Apache 许可,版本 2.0(“许可”)...
Linux输入子系统的流程结构图,给你一个对于Linux下的输入子系统一个清晰地认识。
Java包:com.endpoint.lg.evdev.demuxer Liquid Galaxy Interactive Spaces 活动,用于分离和聚合不同类型的输入事件。 版权所有 (C) 2015 Google Inc. 版权所有 (C) 2015 End Point Corporation 根据 Apache ...
EvDev:功能齐全的Dockerized开发环境
聊天板驱动程序 用纯 Python 编写的 Xbox 360 Chatpad 驱动程序,支持 USB-UART。 需要 python-evdev,目前只有 Py2。 包含一个键码-编码映射创建实用程序。
这些步骤假设您正在交叉编译模块,并且您的PATH包含一个以armv6j-hardfloat-linux-gnueabi-为前缀的工具链。 也可以在 Pi 本身上构建模块,但您需要调整 Makefile。 为您在 Pi 上运行的 Linux 版本克隆 Raspberry ...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装