tty open failed
来源:互联网 发布:linux socket 库 编辑:程序博客网 时间:2024/05/16 09:44
tty_open
-> if (tty) { retval = tty_reopen(tty);}
->
static int tty_reopen(struct tty_struct *tty)
{
struct tty_driver *driver = tty->driver;
if (test_bit(TTY_CLOSING, &tty->flags) ||
test_bit(TTY_HUPPING, &tty->flags) ||
test_bit(TTY_LDISC_CHANGING, &tty->flags))
return -EIO;
if (driver->type == TTY_DRIVER_TYPE_PTY &&
driver->subtype == PTY_TYPE_MASTER) {
/*
* special case for PTY masters: only one open permitted,
* and the slave side open count is incremented as well.
*/
if (tty->count)
return -EIO;
tty->link->count++;
}
tty->count++;
mutex_lock(&tty->ldisc_mutex);
WARN_ON(!test_bit(TTY_LDISC, &tty->flags));
mutex_unlock(&tty->ldisc_mutex);
return 0;
}
/*---------------------------------------------------------------------------*/
static void smd_ch_irq_tasklet_handler(unsigned long data)
{
unsigned char *ptr;
int avail;
struct tty_struct *tty;
int index=data;
unsigned long flags;
struct smd_tty_info *tty_info = &driver_info->smd_tty[index];
dbg("enter %s\n",__func__);
spin_lock_irqsave(&driver_info->lock, flags);
tty = tty_port_tty_get(&tty_info->port);
if (!tty){
spin_unlock_irqrestore(&driver_info->lock, flags);
return;
}
avail = smd_stream_read_avail(tty_info->ch);
if (!avail){
spin_unlock_irqrestore(&driver_info->lock, flags);
return;
}
avail = tty_prepare_flip_string(tty, &ptr, avail);
if(!avail){
spin_unlock_irqrestore(&driver_info->lock, flags);
pr_err("smd_ch_irq_tasklet_handler: cannot get space from tty_buffer!\n");
return;
}
smd_stream_read(tty_info->ch,ptr,avail);
smd_send_intr(tty_info->a2b_int_rx);
tty_flip_buffer_push(tty);
tty_kref_put(tty);
spin_unlock_irqrestore(&driver_info->lock, flags);
}
更改为:
/*---------------------------------------------------------------------------*/
static void smd_ch_irq_tasklet_handler(unsigned long data)
{
unsigned char *ptr;
int avail;
struct tty_struct *tty;
int index=data;
unsigned long flags;
struct smd_tty_info *tty_info = &driver_info->smd_tty[index];
dbg("enter %s\n",__func__);
spin_lock_irqsave(&driver_info->lock, flags);
tty = tty_port_tty_get(&tty_info->port);
if (!tty){
spin_unlock_irqrestore(&driver_info->lock, flags);
return;
}
avail = smd_stream_read_avail(tty_info->ch);
if (!avail){
tty_kref_put(tty);
spin_unlock_irqrestore(&driver_info->lock, flags);
return;
}
avail = tty_prepare_flip_string(tty, &ptr, avail);
if(!avail){
tty_kref_put(tty);
spin_unlock_irqrestore(&driver_info->lock, flags);
pr_err("smd_ch_irq_tasklet_handler: cannot get space from tty_buffer!\n");
return;
}
smd_stream_read(tty_info->ch,ptr,avail);
smd_send_intr(tty_info->a2b_int_rx);
tty_flip_buffer_push(tty);
tty_kref_put(tty);
spin_unlock_irqrestore(&driver_info->lock, flags);
}
就是说tty_port_tty_get和tty_kref_put没有成对出现
具体的原因,有时间在填上。
- tty open failed
- tty open call stack
- 3516cv300的ttyAMA1打开失败的问题吗? open tty /dev/ttyAMA1 failed
- tty系统open流程分析
- rpmdb open failed
- Open HAX device failed!!
- rpmdb open failed解决方案
- TTY
- tty
- tty
- tty
- TTY
- tty
- tty
- TTY
- TTY
- tty驱动程序之线路规程open函数调用路径
- Linux tty驱动学习 - UART驱动的open操作
- SVN客户端--TortoiseSVN使用说明
- UVa:10229 Modular Fibonacci
- UTF-8、BOM、<feff>的问题
- eclipse Android 工程在Libs导入第三方jar / Android工程作为library为其他工程提供引用
- java中的IO详解(上)
- tty open failed
- java中的IO详解(下)
- cocos2d-x ios 输入框打开时点击其他部分依然有效
- 虚拟机安装黑苹果 VM9.0+MacOS10.8.5+XCode5
- How to Validate Network and Name Resolution Setup for the Clusterware and RAC (Doc ID 1054902.1)
- @RequestMapping拦截多个请求
- Android Emulator Failed To Allocate memory 8
- VM安装CentOS6.5 minimal 过程(均来源于网络,按照自己的安装过程整理下,方便以后查找)
- Android Studio下做打包apk加代码混淆