Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
* WOL from S5 (shutdown)
@ 2019-07-26 23:56 Abu Rasheda
  2019-07-31 19:32 ` Abu Rasheda
  0 siblings, 1 reply; 3+ messages in thread
From: Abu Rasheda @ 2019-07-26 23:56 UTC (permalink / raw)
  To: Linux Kernel List

[-- Attachment #1.1: Type: text/plain, Size: 346 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 488 bytes --]

<div dir="ltr">Hello,<div><br></div><div>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).</div><div><br></div><div>My driver is not working on the S5 state.</div><div><br></div><div>Can someone help with pointers on the web or point me out a book or explain?</div><div><br></div><div>Thanks.</div><div><br></div><div>Abu Rasheda</div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: WOL from S5 (shutdown)
  2019-07-26 23:56 WOL from S5 (shutdown) Abu Rasheda
@ 2019-07-31 19:32 ` Abu Rasheda
  2019-08-01 16:05   ` Questions about mfd_add_devices and platform_data Lucas Tanure
  0 siblings, 1 reply; 3+ messages in thread
From: Abu Rasheda @ 2019-07-31 19:32 UTC (permalink / raw)
  To: Linux Kernel List

[-- Attachment #1.1: Type: text/plain, Size: 462 bytes --]

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
>

[-- Attachment #1.2: Type: text/html, Size: 871 bytes --]

<div dir="ltr"><div>any pointers?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 26, 2019 at 4:56 PM Abu Rasheda &lt;<a href="mailto:rcpilot2010@gmail.com">rcpilot2010@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>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).</div><div><br></div><div>My driver is not working on the S5 state.</div><div><br></div><div>Can someone help with pointers on the web or point me out a book or explain?</div><div><br></div><div>Thanks.</div><div><br></div><div>Abu Rasheda</div></div>
</blockquote></div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Questions about mfd_add_devices and platform_data
  2019-07-31 19:32 ` Abu Rasheda
@ 2019-08-01 16:05   ` Lucas Tanure
  0 siblings, 0 replies; 3+ messages in thread
From: Lucas Tanure @ 2019-08-01 16:05 UTC (permalink / raw)
  To: Linux Kernel List

[-- Attachment #1.1: Type: text/plain, Size: 1038 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1224 bytes --]

<div dir="ltr">Hi,<br><br>I would like to understand mfd_add_devices call and platform_data section. <br><br>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.<br>But the first pointer is static and kfrees says:<br><br>&quot;Don&#39;t free memory not originally allocated by kmalloc() or you will run into trouble.&quot;<br><br>So, my questions is : Should my driver kmalloc platform_data first and then call mfd_add_devices ? Or it&#39;s fine to give static memory to it ?<br><br>Example driver:<br><br>drivers/mfd/vexpress-sysreg.c:<br><br>static struct syscon_platform_data vexpress_sysreg_sys_id_pdata = {<br>	.label = &quot;sys_id&quot;,<br>};<br><br>static struct mfd_cell vexpress_sysreg_cells[] = {<br>	{<br>		.name = &quot;syscon&quot;,<br>		.num_resources = 1,<br>		.resources = (struct resource []) {<br>			DEFINE_RES_MEM(SYS_ID, 0x4),<br>		},<br>		.platform_data = &amp;vexpress_sysreg_sys_id_pdata,<br>		.pdata_size = sizeof(vexpress_sysreg_sys_id_pdata),<br>	},<br><br>For this case mfd_add_devices will free vexpress_sysreg_sys_id_pdata, but it&#39;s static.<br><br>Thanks<br>Lucas</div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 23:56 WOL from S5 (shutdown) Abu Rasheda
2019-07-31 19:32 ` Abu Rasheda
2019-08-01 16:05   ` Questions about mfd_add_devices and platform_data Lucas Tanure

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox