All of lore.kernel.org
 help / color / mirror / Atom feed
* [ofa-general] MTHCA driver for Linux
@ 2008-01-18 17:01 Lukas Hejtmanek
  2008-01-18 20:36 ` Roland Dreier
  0 siblings, 1 reply; 5+ messages in thread
From: Lukas Hejtmanek @ 2008-01-18 17:01 UTC (permalink / raw)
  To: Roland Dreier; +Cc: xen-devel, general

Hello,

I have a minor problem with ib_mthca driver in linux with Xen in DomU.

If I keep ib_mthca driver in kernel while shutting down the DomU, the next
start of the DomU resets the machine.

Trivial fix is possible: either to rmmod ib_mthca before shutting down the
DomU or set .shutdown section to the same value as the .remove section in
pci_driver structure.

Are you willing apply a patch that sets .shutdown in the mainline of IB driver
in Linux? Or is it something that should be fixed by Xen guys?

-- 
Lukáš Hejtmánek

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

* Re: [ofa-general] MTHCA driver for Linux
  2008-01-18 17:01 [ofa-general] MTHCA driver for Linux Lukas Hejtmanek
@ 2008-01-18 20:36 ` Roland Dreier
  2008-01-18 20:48   ` Lukas Hejtmanek
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2008-01-18 20:36 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: xen-devel, general

 > If I keep ib_mthca driver in kernel while shutting down the DomU, the next
 > start of the DomU resets the machine.
 > 
 > Trivial fix is possible: either to rmmod ib_mthca before shutting down the
 > DomU or set .shutdown section to the same value as the .remove section in
 > pci_driver structure.
 > 
 > Are you willing apply a patch that sets .shutdown in the mainline of IB driver
 > in Linux? Or is it something that should be fixed by Xen guys?

I would like to understand the underlying problem before blindly
setting the .shutdown method of the ib_mthca PCI driver section.  The
mthca driver should be able to handle the hardware being in an
arbitrary state when it is reloaded -- that is why it resets the
adapter very early during initialization.  Do you have any idea what
is going wrong in the case where the machine resets?

Very few other PCI drivers have a .shutdown method, and I don't know
of any that just duplicate the .remove method.  So rather than just
having a bandaid for mthca that probably leaves the same problem for
every other driver, I would prefer to understand the problem first,
and if it is indeed something specific to mthca, then fix the
underlying issue in mthca with a simpler shutdown method.

I guess one way to debug this would be to delete operations from
mthca_remove_one() one by one (starting from the end of the function),
and each time try restarting your domU after doing rmmod ib_mthca.
When you reach the really necessary thing, then you'll see the reset.

 - R.

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

* Re: [ofa-general] MTHCA driver for Linux
  2008-01-18 20:36 ` Roland Dreier
@ 2008-01-18 20:48   ` Lukas Hejtmanek
  2008-01-18 21:38     ` Roland Dreier
  0 siblings, 1 reply; 5+ messages in thread
From: Lukas Hejtmanek @ 2008-01-18 20:48 UTC (permalink / raw)
  To: Roland Dreier; +Cc: xen-devel, general

On Fri, Jan 18, 2008 at 12:36:00PM -0800, Roland Dreier wrote:
> I would like to understand the underlying problem before blindly
> setting the .shutdown method of the ib_mthca PCI driver section.  The
> mthca driver should be able to handle the hardware being in an
> arbitrary state when it is reloaded -- that is why it resets the
> adapter very early during initialization.  Do you have any idea what
> is going wrong in the case where the machine resets?

The pcifront-end of xen is wrong. It touches somehow the device when the DomU
is starting. At that point, it resets the box hardly, if DomU has been started
already with IB driver since the box start up.

If the IB device is properly shut down (rmmod ib_mthca), pcifront-end driver 
does not reset the box at DomU start up.

-- 
Lukáš Hejtmánek

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

* Re: [ofa-general] MTHCA driver for Linux
  2008-01-18 20:48   ` Lukas Hejtmanek
@ 2008-01-18 21:38     ` Roland Dreier
  2008-01-18 22:50       ` Lukas Hejtmanek
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2008-01-18 21:38 UTC (permalink / raw)
  To: Lukas Hejtmanek; +Cc: xen-devel, general

 > The pcifront-end of xen is wrong. It touches somehow the device when the DomU
 > is starting. At that point, it resets the box hardly, if DomU has been started
 > already with IB driver since the box start up.

I'm not sure I'm understanding what you're saying.  Do you mean that
you've found a bug in the Xen pci front-end, or do you still think we
should fix this by changing the mthca driver?

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

* Re: [ofa-general] MTHCA driver for Linux
  2008-01-18 21:38     ` Roland Dreier
@ 2008-01-18 22:50       ` Lukas Hejtmanek
  0 siblings, 0 replies; 5+ messages in thread
From: Lukas Hejtmanek @ 2008-01-18 22:50 UTC (permalink / raw)
  To: Roland Dreier; +Cc: xen-devel, general

On Fri, Jan 18, 2008 at 01:38:47PM -0800, Roland Dreier wrote:
> I'm not sure I'm understanding what you're saying.  Do you mean that
> you've found a bug in the Xen pci front-end, or do you still think we
> should fix this by changing the mthca driver?

I'm not sure where exactly the bug is.

The bug is triggered by Xen PCI front-end driver in DomU.

The workaround is to either rmmod mthca driver or merge .shutdown and .remove
sections of the mthca driver (in the module that runs in DomU kernel).

I'm not sure where the bug is as the driver should leave the device in correct
state. The current Linux kernel does not do that for most devices.

Similar problem was with e1000 driver. If the driver was not removed before
reboot, the system froze in BIOS code. This one was fixed in the BIOS of
motherboard. But I believe, the drivers should not leave the device as is.

Maybe people from Xen could write their opinion  what should be done here.

-- 
Lukáš Hejtmánek

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

end of thread, other threads:[~2008-01-18 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-18 17:01 [ofa-general] MTHCA driver for Linux Lukas Hejtmanek
2008-01-18 20:36 ` Roland Dreier
2008-01-18 20:48   ` Lukas Hejtmanek
2008-01-18 21:38     ` Roland Dreier
2008-01-18 22:50       ` Lukas Hejtmanek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.