驱动-ConfigFS-释放资源篇

了解了ConfigFS 关联的基本知识,创建子系统、group、item。 这里补充一个知识点,回收资源相关的。


前言

这里对ConfigFS 体系资源回收知识点做一个了解、熟悉。 主要涉及到两个 函数:drop_item 、release 。 这里就是具体去了解 这两个api 关联的知识点。

参考资料

重温一下前面的知识点,其中创建Item 篇有release api 的调用,可以看一下针对性知识点模块知识
Linux驱动-设备树插件语法
设备树插件基础必备
设备树插件注册子系统
驱动-设备树插件-注册group
RK3568驱动指南|第八篇 设备树插件-第78章 用户空间创建item实验
驱动-设备数插件-创建Item
设备树插件-第79章 完善drop和release函数实验

一、实际案例

源码程序

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/configfs.h>

// 定义一个名为"mygroup"的config_group结构体
static struct config_group mygroup;

// 自定义的配置项结构体
struct myitem
{
    struct config_item item;
};

// 配置项释放函数
void myitem_release(struct config_item *item)
{
    struct myitem *myitem = container_of(item, struct myitem, item);
    kfree(myitem);
    printk("%s\n", __func__);
}

// 配置项操作结构体
struct configfs_item_operations myitem_ops = {
    .release = myitem_release,
};

// 配置项类型结构体
static struct config_item_type mygroup_item_type = {
    .ct_owner = THIS_MODULE,
    .ct_item_ops = &myitem_ops,
};

// 创建配置项函数
struct config_item *mygroup_make_item(struct config_group *group, const char *name)
{
    struct myitem *myconfig_item;
    printk("%s\n", __func__);
    myconfig_item = kzalloc(sizeof(*myconfig_item), GFP_KERNEL);
    config_item_init_type_name(&myconfig_item->item, name, &mygroup_item_type);
    return &myconfig_item->item;
}

// 删除配置项函数
void mygroup_delete_item(struct config_group *group, struct config_item *item)
{
    struct myitem *myitem = container_of(item, struct myitem, item);
    
    config_item_put(&myitem->item);
    printk("%s\n", __func__);
}

// 配置组操作结构体
struct configfs_group_operations mygroup_ops = {
    .make_item = mygroup_make_item,
    .drop_item = mygroup_delete_item,
};

// 定义名为"mygroup_config_item_type"的config_item_type结构体,用于描述配置项类型。
static const struct config_item_type mygroup_config_item_type = {
    .ct_owner = THIS_MODULE,
    .ct_group_ops = &mygroup_ops,
};

// 定义名为"myconfig_item_type"的配置项类型结构体
static const struct config_item_type myconfig_item_type = {
    .ct_owner = THIS_MODULE,
    .ct_group_ops = NULL,
};

// 定义一个configfs_subsystem结构体实例"myconfigfs_subsystem"
static struct configfs_subsystem myconfigfs_subsystem = {
    .su_group = {
        .cg_item = {
            .ci_namebuf = "myconfigfs",
            .ci_type = &myconfig_item_type,
        },
    },
};

// 模块的初始化函数
static int myconfig_group_init(void)
{
    // 初始化配置组
    config_group_init(&myconfigfs_subsystem.su_group);
    // 注册子系统
    configfs_register_subsystem(&myconfigfs_subsystem);

    // 初始化配置组"mygroup"
    config_group_init_type_name(&mygroup, "mygroup", &mygroup_config_item_type);
    // 在子系统中注册配置组"mygroup"
    configfs_register_group(&myconfigfs_subsystem.su_group, &mygroup);
    return 0;
}

// 模块退出函数
static void myconfig_group_exit(void)
{
    // 注销子系统
    configfs_unregister_subsystem(&myconfigfs_subsystem);
}

module_init(myconfig_group_init); // 指定模块的初始化函数
module_exit(myconfig_group_exit); // 指定模块的退出函数

MODULE_LICENSE("GPL");   // 模块使用的许可证
MODULE_AUTHOR("fangchen"); // 模块的作者

源码分析

这个源码程序完全基于上一篇 驱动-设备数插件-创建Item 基础上来修改了几行代码。
在这里插入图片描述

回顾 config_item_type-configfs_group_operations-configfs_item_operations

releasedrop_item 和这几个结构体关联,这里还是从结构体的角度再次重温一下这几个结构体知识点,前面的文章知识点其实已经介绍了,这里简单回顾 才能更好理解 drop_itemrelease 函数
驱动-设备数插件-创建Item设备树插件基础必备 篇中有相关介绍了 可以看看以前知识点,做了详细分析:
在这里插入图片描述
在这里插入图片描述

问题点分析

上面的结构体知识是基本的知识点,特别重要。 现在的问题是:
configfs_item_operations 结构体配置了在这里插入代码片函数 和 configfs_group_operations 结构体配置了drop_item,一个是项的操作,一个是组的操作。 比如如下代码这样写:

// 配置项释放函数
void myitem_release(struct config_item *item)
{
    struct myitem *myitem = container_of(item, struct myitem, item);
    kfree(myitem);
    printk("%s\n", __func__);
}

// 配置项操作结构体
struct configfs_item_operations myitem_ops = {
    .release = myitem_release,
};
// 配置项类型结构体
static struct config_item_type mygroup_item_type = {
    .ct_owner = THIS_MODULE,
    .ct_item_ops = &myitem_ops,
};
// 创建配置项函数
struct config_item *mygroup_make_item(struct config_group *group, const char *name)
{
    struct myitem *myconfig_item;
    printk("%s\n", __func__);
    myconfig_item = kzalloc(sizeof(*myconfig_item), GFP_KERNEL);
    config_item_init_type_name(&myconfig_item->item, name, &mygroup_item_type);
    return &myconfig_item->item;
}
// 删除配置项函数
void mygroup_delete_item(struct config_group *group, struct config_item *item)
{
    struct myitem *myitem = container_of(item, struct myitem, item);
    
  //  config_item_put(&myitem->item);
    printk("%s\n", __func__);
}
// 配置组操作结构体
struct configfs_group_operations mygroup_ops = {
    .make_item = mygroup_make_item,
    .drop_item = mygroup_delete_item,
};

// 定义名为"mygroup_config_item_type"的config_item_type结构体,用于描述配置项类型。
static const struct config_item_type mygroup_config_item_type = {
    .ct_owner = THIS_MODULE,
    .ct_group_ops = &mygroup_ops,
};

也就是在 configfs_group_operations 结构体的组操作中的配置了drop_item 函数结构体,在实现里面 不去执行 config_item_put(&myitem->item); api 函数。 结果是什么呢?

在 ConfigFS 体系里面执行了 rmdir+内核模块名,configfs_group_operations 结构体配置的drop_item 结构体函数会执行,但是 configfs_item_operations 中的release 方法就不会执行了。 这就会导致内存资源无法释放出去。

所以要想实现 configfs_item_operations 中的结构体 release 方法回调,就在configfs_group_operations 结构体配置的drop_item 结构体函数中去执行 config_item_put(&myitem->item); 函数。

知识点扩充-release -drop_item

在 Linux 内核的 configfs 子系统中,configfs_item_operations 中的 release 函数和 configfs_group_operations 中的 drop_item API 都与 configfs 对象的生命周期管理相关,但它们的职责和调用时机有所不同。以下是它们的区别和联系:

函数解析

release 函数 (configfs_item_operations)

作用:
release 是一个内存释放回调,当 configfs 对象(config_item)的引用计数降至零时被调用。它的主要职责是释放该对象占用的内存和资源。

调用时机:
当内核不再需要该 config_item(例如,用户空间删除 configfs 属性文件或卸载模块时),kobject 的引用机制会触发 release

典型实现:

void my_item_release(struct config_item *item) {
    struct my_struct *p = to_my_struct(item);
    kfree(p);
}

关键点:

  • 纯粹的内存管理角色,不涉及逻辑操作(如清理其他资源)。
  • kobject 的引用计数机制自动触发,开发者无需直接调用。

drop_item 函数 (configfs_group_operations)

作用:
drop_item 是一个逻辑回调,当用户空间通过 rmdir 删除 configfs 目录(表示一个子对象)时被调用。它负责断开父对象与子对象的关系,并可能触发引用计数递减。

调用时机:
用户显式删除 configfs 目录(如 rmdir /config/parent/child)时,由 VFS 层调用。

典型实现:

void my_group_drop_item(struct config_group *group, struct config_item *item) {
    struct my_parent *parent = to_my_parent(group);
    struct my_child *child = to_my_child(item);

    // 1. 解除父子关系
    list_del(&child->sibling_list);
    // 2. 递减引用计数(最终可能触发 release)
    config_item_put(item);
}

关键点:

  • 处理对象间的逻辑关系(如从父对象的链表中移除子项)。
  • 必须手动调用 config_item_put 来递减引用计数,否则 release 不会被触发。
  • 可以包含额外的清理逻辑(如通知其他模块)。

联系与协作

调用顺序:
用户删除一个 configfs 目录时,内核会先调用 drop_item 解除父子关系,然后在引用计数降至零后调用 release 释放内存。
依赖关系:
drop_item 通常需要显式调用 config_item_put 来触发 release;如果忘记调用,会导致内存泄漏。
分工明确:

  • drop_item:处理逻辑关系(如断开父子链接、通知其他模块)。
  • release:处理物理资源(如释放内存、销毁私有数据结构)。

图示流程

用户执行 `rmdir /config/parent/child`
    ↓
VFS 调用 configfs 的 `drop_item`
    ↓
drop_item 逻辑:  
    1. 从父组中移除子项  
    2. 调用 config_item_put(item)  
        ↓  
        如果引用计数为零 → 触发 `release`  
            ↓  
            release 释放 item 的内存

区别与联系

特性release 函数drop_item API
目的释放 config_item 的资源处理从父组中移除子项的逻辑
调用者内核(通过 config_item_put)内核(在用户 rmdir 时触发)
是否直接释放资源否(需调用 config_item_put 间接触发)
返回值无(void)返回被移除的 config_item
典型操作释放内存、关闭文件等解除父子关系、检查引用计数

联系:
drop_item 通常会在返回 config_item 后,由内核调用 config_item_put,从而可能触发 release 函数(如果引用计数归零)。

即:rmdir → drop_item → config_item_put → release(若引用为 0)。

总结

  • 这里其实就是讲了一个知识点:ConfigFS 里面资源释放机制,针对性的对drop_item和release 方法结构体的了解和被调用的结构体的知识点回顾
01-01 13:59:06.678967 1 1 I [ 3106.874830]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:06.685984 1 1 I [ 3106.881847]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 2ms and failed: symlink() failed: File exists 01-01 13:59:06.688757 1 1 W [ 3106.884620]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:06.689161 1 1 I [ 3106.885024]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 2ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:07.023596 13602 13602 E [ 3107.219459][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:07.063182 13602 13602 E [ 3107.259045][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:07.084823 13602 13602 E [ 3107.280686][ERROR]: OPLUS_CHG[MMS_GAUGE]([oplus_mms_gauge_update_cc][3883]): get battery cc error, rc=0 01-01 13:59:07.101110 13602 13602 E [ 3107.296973][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:07.116107 13680 13680 I [ 3107.311970]: [INFO]: OPLUS_CHG[CHG_COMM]([oplus_comm_smooth_to_soc][3142]): soc[0 3 100 100 100 100] avg[0 1 0 0 0] fifo[100 100 100 100] 01-01 13:59:07.116188 13680 13680 E [ 3107.312051][ERROR]: OPLUS_CHG[CHG_COMM]([oplus_comm_battery_notify_tbat_check][4799]): bat_temp(585) > 53'C 01-01 13:59:07.128010 516 516 I [ 3107.323873]: ///PD dbg info 122d 01-01 13:59:07.128029 516 516 I [ 3107.323892]< 3107.323>TCPC-TCPC: bat_update_work_func battery update soc = 100 01-01 13:59:07.128029 516 516 I [ 3107.323892]< 3107.323>TCPC-TCPC: bat_update_work_func Battery Idle 01-01 13:59:07.131843 12695 12695 I [ 3107.327706]: [INFO]: OPLUS_CHG[sc6607]:sc6607_reset_watchdog_timer: enter 01-01 13:59:07.159981 13913 13913 I [ 3107.355844]: [INFO]: OPLUS_CHG[sc6607]:sc6607_set_input_volt_limit: volt = 4700, val=0x7 01-01 13:59:07.166027 1434 1434 W [ 3107.361890]healthd: battery l=100 v=4416 t=58.5 h=3 st=5 c=0 fc=7000000 cc=0 chg=u 01-01 13:59:07.179969 13680 13680 I [ 3107.375832]OPLUS_CHG[oplus_charge_info]: BATTERY[585 585 4416 4416 0 100 100 100 7368 7000 1 0x0], CHARGE[4470 0 1 0], WIRED[1 185 5107 500 3 0x0 0 0 0 2 0], WIRELESS[0 0 0 0 0 0x0 0 0 0], VOOC[0 0 0 0 0x0], UFCS[0 0 0 0x0], COMMON[8 0 5 0x100088 0 0 1 7000 100 0] 01-01 13:59:07.274454 13600 13600 I [ 3107.470317](virq: irq_count)- GICv3:arch_timer(11):1971560 GICv3:IPI(1):1737505 GICv3:IPI(2):897238 GICv3:IPI(6):333489 GICv3:glink-native-rpm-glink(33):161472 pmic_arb:pm-adc5(172):108727 GICv3:i2c_geni(180):107227 GICv3:i2c_geni(179):84340 GICv3:arch_mem_timer(13):81225 GICv3:mmc0(36):80879 01-01 13:59:07.274603 13600 13600 I [ 3107.470466](cpu: irq_count)- 0:1271515 1:1016677 2:1010488 3:1213493 4:298566 5:282403 6:268443 7:276907 01-01 13:59:07.274705 13600 13600 I [ 3107.470568](ipi: irq_count)- 0:1737505 1:897238 2:0 3:0 4:1957 5:333489 6:0 01-01 13:59:07.726521 1871 1871 I [ 3107.922384]: read descriptors 01-01 13:59:07.726669 1871 1871 I [ 3107.922532]: read strings 01-01 13:59:07.735964 1 1 I [ 3107.931827]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:07.751653 1 1 W [ 3107.947516]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:08.779235 1871 1871 I [ 3108.975098]: read descriptors 01-01 13:59:08.779393 1871 1871 I [ 3108.975256]: read strings 01-01 13:59:08.804696 1 1 W [ 3109.000559]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:09.833425 1871 1871 I [ 3110.029288]: read descriptors 01-01 13:59:09.834559 1871 1871 I [ 3110.030422]: read strings 01-01 13:59:09.843181 1 1 I [ 3110.039044]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:09.846371 1 1 I [ 3110.042234]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 1ms and failed: symlink() failed: File exists 01-01 13:59:09.847584 1 1 W [ 3110.043447]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:09.847773 1 1 I [ 3110.043636]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 0ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:10.865193 817 817 E [ 3111.061056][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:10.902853 1871 1871 I [ 3111.098716]: read descriptors 01-01 13:59:10.903019 1871 1871 I [ 3111.098882]: read strings 01-01 13:59:10.911364 1 1 I [ 3111.107227]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:10.919875 1 1 I [ 3111.115738]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 2ms and failed: symlink() failed: File exists 01-01 13:59:10.923961 1 1 W [ 3111.119824]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:10.924498 1 1 I [ 3111.120361]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 3ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:11.125117 8 8 E [ 3111.320980][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:11.151486 8 8 E [ 3111.347349][ERROR]: OPLUS_CHG[CW2217]([cw_update_data][525]): vol = 4415 current = 0 cap = 100 temp = 585 01-01 13:59:11.959919 1871 1871 I [ 3112.155782]: read descriptors 01-01 13:59:11.960022 1871 1871 I [ 3112.155885]: read strings 01-01 13:59:11.966123 1 1 I [ 3112.161986]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:11.973102 1 1 I [ 3112.168965]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 1ms and failed: symlink() failed: File exists 01-01 13:59:11.976702 1 1 W [ 3112.172565]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:11.977120 1 1 I [ 3112.172983]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 2ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:12.143321 13242 13242 E [ 3112.339184][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.181296 13242 13242 E [ 3112.377159][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.200908 13242 13242 E [ 3112.396771][ERROR]: OPLUS_CHG[MMS_GAUGE]([oplus_mms_gauge_update_cc][3883]): get battery cc error, rc=0 01-01 13:59:12.219789 13242 13242 E [ 3112.415652][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.235356 12809 12809 I [ 3112.431219]: [INFO]: OPLUS_CHG[CHG_COMM]([oplus_comm_smooth_to_soc][3142]): soc[0 3 100 100 100 100] avg[1 1 0 0 0] fifo[100 100 100 100] 01-01 13:59:12.235477 12809 12809 E [ 3112.431340][ERROR]: OPLUS_CHG[CHG_COMM]([oplus_comm_battery_notify_tbat_check][4799]): bat_temp(585) > 53'C 01-01 13:59:12.248278 516 516 I [ 3112.444141]: ///PD dbg info 122d 01-01 13:59:12.248311 516 516 I [ 3112.444174]< 3112.443>TCPC-TCPC: bat_update_work_func battery update soc = 100 01-01 13:59:12.248311 516 516 I [ 3112.444174]< 3112.444>TCPC-TCPC: bat_update_work_func Battery Idle 01-01 13:59:12.255329 11611 11611 I [ 3112.451192]: [INFO]: OPLUS_CHG[sc6607]:sc6607_reset_watchdog_timer: enter 01-01 13:59:12.279157 830 830 I [ 3112.475020]: [INFO]: OPLUS_CHG[sc6607]:sc6607_set_input_volt_limit: volt = 4700, val=0x7 01-01 13:59:12.286759 12809 12809 I [ 3112.482622]OPLUS_CHG[oplus_charge_info]: BATTERY[585 585 4415 4415 0 100 100 100 7368 7000 1 0x0], CHARGE[4470 0 1 0], WIRED[1 87 5096 500 3 0x0 0 0 0 2 0], WIRELESS[0 0 0 0 0 0x0 0 0 0], VOOC[0 0 0 0 0x0], UFCS[0 0 0 0x0], COMMON[8 0 5 0x100088 0 0 1 7000 100 0] 01-01 13:59:12.292084 1434 1434 W [ 3112.487947]healthd: battery l=100 v=4415 t=58.5 h=3 st=5 c=0 fc=7000000 cc=0 chg=u 01-01 13:59:13.013451 1871 1871 I [ 3113.209314]: read descriptors 01-01 13:59:13.014448 1871 1871 I [ 3113.210311]: read strings 01-01 13:59:13.023199 1 1 I [ 3113.219062]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:13.035059 1 1 W [ 3113.230922]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:14.070376 1871 1871 I [ 3114.266239]: read descriptors 01-01 13:59:14.070535 1871 1871 I [ 3114.266398]: read strings 01-01 13:59:14.096620 1 1 W [ 3114.292483]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:15.119153 1871 1871 I [ 3115.315016]: read descriptors 01-01 13:59:15.119311 1871 1871 I [ 3115.315174]: read strings 01-01 13:59:15.127714 1 1 I [ 3115.323577]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:15.134920 1 1 I [ 3115.330783]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 2ms and failed: symlink() failed: File exists 01-01 13:59:15.137969 1 1 W [ 3115.333832]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:15.138384 1 1 I [ 3115.334247]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 2ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:15.577289 1434 1434 W [ 3115.773152]healthd: battery l=100 v=4415 t=58.5 h=3 st=5 c=0 fc=7000000 cc=0 chg=u 01-01 13:59:15.984789 817 817 E [ 3116.180652][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:16.173296 1871 1871 I [ 3116.369159]: read descriptors 01-01 13:59:16.173411 1871 1871 I [ 3116.369274]: read strings 01-01 13:59:16.183227 1 1 I [ 3116.379090]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:16.190469 1 1 I [ 3116.386332]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 3ms and failed: symlink() failed: File exists 01-01 13:59:16.193461 1 1 W [ 3116.389324]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:16.194308 1 1 I [ 3116.390171]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 2ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:16.250226 13529 13529 E [ 3116.446089][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:16.276676 13529 13529 E [ 3116.472539][ERROR]: OPLUS_CHG[CW2217]([cw_update_data][525]): vol = 4415 current = 0 cap = 100 temp = 585 01-01 13:59:16.747593 169 169 I [ 3116.943456]: [wdog_util]cpu avail mask: 0xff; ping mask: 0xe; irqs since last: 11439 01-01 13:59:16.747798 169 169 W [ 3116.943661][OPLUS_WD] oplus_show_utc_time: !@WatchDog: 2025-01-01 05:59:16.570463516 UTC 01-01 13:59:16.748428 13529 13529 I [ 3116.944291](virq: irq_count)- GICv3:arch_timer(11):1976165 GICv3:IPI(1):1741681 GICv3:IPI(2):897712 GICv3:IPI(6):334096 GICv3:glink-native-rpm-glink(33):161884 pmic_arb:pm-adc5(172):109062 GICv3:i2c_geni(180):107497 GICv3:i2c_geni(179):84498 GICv3:arch_mem_timer(13):81509 GICv3:mmc0(36):80900 01-01 13:59:16.748752 13529 13529 I [ 3116.944615](cpu: irq_count)- 0:1274609 1:1018977 2:1012910 3:1216613 4:298643 5:282439 6:268626 7:277111 01-01 13:59:16.748978 13529 13529 I [ 3116.944841](ipi: irq_count)- 0:1741681 1:897712 2:0 3:0 4:1962 5:334096 6:0 01-01 13:59:17.228087 1871 1871 I [ 3117.423950]: read descriptors 01-01 13:59:17.228190 1871 1871 I [ 3117.424053]: read strings
07-11
01-01 13:59:09.833425 1871 1871 I [ 3110.029288]: read descriptors 01-01 13:59:09.834559 1871 1871 I [ 3110.030422]: read strings 01-01 13:59:09.843181 1 1 I [ 3110.039044]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:09.846371 1 1 I [ 3110.042234]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 1ms and failed: symlink() failed: File exists 01-01 13:59:09.847584 1 1 W [ 3110.043447]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:09.847773 1 1 I [ 3110.043636]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 0ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:10.865193 817 817 E [ 3111.061056][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:10.902853 1871 1871 I [ 3111.098716]: read descriptors 01-01 13:59:10.903019 1871 1871 I [ 3111.098882]: read strings 01-01 13:59:10.911364 1 1 I [ 3111.107227]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:10.919875 1 1 I [ 3111.115738]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 2ms and failed: symlink() failed: File exists 01-01 13:59:10.923961 1 1 W [ 3111.119824]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:10.924498 1 1 I [ 3111.120361]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 3ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:11.125117 8 8 E [ 3111.320980][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:11.151486 8 8 E [ 3111.347349][ERROR]: OPLUS_CHG[CW2217]([cw_update_data][525]): vol = 4415 current = 0 cap = 100 temp = 585 01-01 13:59:11.959919 1871 1871 I [ 3112.155782]: read descriptors 01-01 13:59:11.960022 1871 1871 I [ 3112.155885]: read strings 01-01 13:59:11.966123 1 1 I [ 3112.161986]init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/system/etc/init/hw/init.usb.configfs.rc:24) 01-01 13:59:11.973102 1 1 I [ 3112.168965]init: Command 'symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:26) took 1ms and failed: symlink() failed: File exists 01-01 13:59:11.976702 1 1 W [ 3112.172565]UDC core: couldn't find an available UDC or it's busy: -19 01-01 13:59:11.977120 1 1 I [ 3112.172983]init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/system/etc/init/hw/init.usb.configfs.rc:27) took 2ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device 01-01 13:59:12.143321 13242 13242 E [ 3112.339184][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.181296 13242 13242 E [ 3112.377159][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.200908 13242 13242 E [ 3112.396771][ERROR]: OPLUS_CHG[MMS_GAUGE]([oplus_mms_gauge_update_cc][3883]): get battery cc error, rc=0 01-01 13:59:12.219789 13242 13242 E [ 3112.415652][ERROR]: OPLUS_CHG[CW2217]([cw_get_capacity][352]): CW2015[352]: UI_SOC = 103 larger 100!!!! 01-01 13:59:12.235356 12809 12809 I [ 3112.431219]: [INFO]: OPLUS_CHG[CHG_COMM]([oplus_comm_smooth_to_soc][3142]): soc[0 3 100 100 100 100] avg[1 1 0 0 0] fifo[100 100 100 100] 01-01 13:59:12.235477 12809 12809 E [ 3112.431340][ERROR]: OPLUS_CHG[CHG_COMM]([oplus_comm_battery_notify_tbat_check][4799]): bat_temp(585) > 53'C 01-01 13:59:12.248278 516 516 I [ 3112.444141]: ///PD dbg info 122d 01-01 13:59:12.248311 516 516 I [ 3112.444174]< 3112.443>TCPC-TCPC: bat_update_work_func battery update soc = 100 01-01 13:59:12.248311 516 516 I [ 3112.444174]< 3112.444>TCPC-TCPC: bat_update_work_func Battery Idle 01-01 13:59:12.255329 11611 11611 I [ 3112.451192]: [INFO]: OPLUS_CHG[sc6607]:sc6607_reset_watchdog_timer: enter 01-01 13:59:12.279157 830 830 I [ 3112.475020]: [INFO]: OPLUS_CHG[sc6607]:sc6607_set_input_volt_limit: volt = 4700, val=0x7 01-01 13:59:12.286759 12809 12809 I [ 3112.482622]OPLUS_CHG[oplus_charge_info]: BATTERY[585 585 4415 4415 0 100 100 100 7368 7000 1 0x0], CHARGE[4470 0 1 0], WIRED[1 87 5096 500 3 0x0 0 0 0 2 0], WIRELESS[0 0 0 0 0 0x0 0 0 0], VOOC[0 0 0 0 0x0], UFCS[0 0 0 0x0], COMMON[8 0 5 0x100088 0 0 1 7000 100 0] 01-01 13:59:12.292084 1434 1434 W [ 3112.487947]healthd: battery l=100 v=4415 t=58.5 h=3 st=5 c=0 fc=7000000 cc=0 chg=u adb为什么断连
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

野火少年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值