public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MFD: core assumes that all children are platform devices
@ 2011-11-28 16:23 Jean-François Dagenais
  2011-11-28 19:01 ` [PATCH] mfd: core - make sure children are cells during mfd_remove_devices Jean-François Dagenais
  2011-11-29 18:57 ` MFD: core assumes that all children are platform devices Guenter Roeck
  0 siblings, 2 replies; 7+ messages in thread
From: Jean-François Dagenais @ 2011-11-28 16:23 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: open list

Hi,

I have a pci driver that registers with UIO for it's operations. As a consequence, the pci device
instance has a child device of class uio.

My driver also declares a ds1wm instance that has it's register interface at an offset in BAR0
of the pci device, as an MFD cell.

When I call mfd_remove_devices, MFD proceeds to enumerate ALL the parent device's chilren
and assumes that they are MFD cells, and thus platform_device, which is not true in my case.
(...uio is a child of the parent pci device)

I had (luckily or unluckily) not seen signs of this broken assumption on certain setups I have
used, but in my current setup, this page-faults every time now.

This is a major thing and I have not found the assumption documented anywhere.

I could first declare a new child device on my pci device and then declare it as the parent to
the mfd cells...

Or, is there a way for the mfd-core, as it's doing the "for each child device", to recognize
non-MFD-cell children and skip them?

/jfd

^ permalink raw reply	[flat|nested] 7+ messages in thread
* MFD: core assumes that all children are platform devices
@ 2011-11-28 16:31 Jean-Francois Dagenais
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Francois Dagenais @ 2011-11-28 16:31 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: open list

Hi,

I have a pci driver that registers with UIO for it's operations. As a consequence, the pci device
instance has a child device of class uio.

My driver also declares a ds1wm instance that has it's register interface at an offset in BAR0
of the pci device, as an MFD cell.

When I call mfd_remove_devices, MFD proceeds to enumerate ALL the parent device's chilren
and assumes that they are MFD cells, and thus platform_device, which is not true in my case.
(...uio is a child of the parent pci device)

I had (luckily or unluckily) not seen signs of this broken assumption on certain setups I have
used, but in my current setup, this page-faults every time now.

This is a major thing and I have not found the assumption documented anywhere.

I could first declare a new child device on my pci device and then declare it as the parent to
the mfd cells...

Or, is there a way for the mfd-core, as it's doing the "for each child device", to recognize
non-MFD-cell children and skip them?

/jfd

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

end of thread, other threads:[~2011-11-30 14:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28 16:23 MFD: core assumes that all children are platform devices Jean-François Dagenais
2011-11-28 19:01 ` [PATCH] mfd: core - make sure children are cells during mfd_remove_devices Jean-François Dagenais
2011-11-29 18:57 ` MFD: core assumes that all children are platform devices Guenter Roeck
2011-11-29 21:40   ` Jean-François Dagenais
2011-11-29 23:02     ` Guenter Roeck
2011-11-30 14:21       ` Jean-Francois Dagenais
  -- strict thread matches above, loose matches on Subject: below --
2011-11-28 16:31 Jean-Francois Dagenais

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox