Hello, I understand how the computer running Linux would wake up from USB based ethernet from S3 (suspend) state. But, I am missing some piece of information for WOL on USB ethernet from S5 (shutdown). My driver is not working on the S5 state. Can someone help with pointers on the web or point me out a book or explain? Thanks. Abu Rasheda
any pointers? On Fri, Jul 26, 2019 at 4:56 PM Abu Rasheda <rcpilot2010@gmail.com> wrote:
Hello,
I understand how the computer running Linux would wake up from USB based ethernet from S3 (suspend) state. But, I am missing some piece of information for WOL on USB ethernet from S5 (shutdown).
My driver is not working on the S5 state.
Can someone help with pointers on the web or point me out a book or explain?
Thanks.
Abu Rasheda
Hi, I would like to understand mfd_add_devices call and platform_data section. All the drivers I read the platform_data is static, but mfd_add_devices will call platform_device_add_data which duplicates that memory and frees the first pointer given. But the first pointer is static and kfrees says: "Don't free memory not originally allocated by kmalloc() or you will run into trouble." So, my questions is : Should my driver kmalloc platform_data first and then call mfd_add_devices ? Or it's fine to give static memory to it ? Example driver: drivers/mfd/vexpress-sysreg.c: static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = { .label = "sys_id", }; static struct mfd_cell vexpress_sysreg_cells[] = { { .name = "syscon", .num_resources = 1, .resources = (struct resource []) { DEFINE_RES_MEM(SYS_ID, 0x4), }, .platform_data = &vexpress_sysreg_sys_id_pdata, .pdata_size = sizeof(vexpress_sysreg_sys_id_pdata), }, For this case mfd_add_devices will free vexpress_sysreg_sys_id_pdata, but it's static. Thanks Lucas
participants (2)
-
Abu Rasheda -
Lucas Tanure