virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* PCI device not properly reset after VFIO
@ 2012-10-18  6:47 Hannes Reinecke
  2012-10-18 14:40 ` Alex Williamson
       [not found] ` <1350571230.2112.344.camel@bling.home>
  0 siblings, 2 replies; 4+ messages in thread
From: Hannes Reinecke @ 2012-10-18  6:47 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm-devel, Linux Virtualization

Hi Alex,

I've been playing around with VFIO and megasas (of course).
What I did now was switching between VFIO and 'normal' operation, ie 
emulated access.

megasas is happily running under VFIO, but when I do an emergency 
stop like killing the Qemu session the PCI device is not properly reset.
IE when I load 'megaraid_sas' after unbinding the vfio_pci module
the driver cannot initialize the card and waits forever for the 
firmware state to change.

I need to do a proper pci reset via
echo 1 > /sys/bus/pci/device/XXXX/reset
to get it into a working state again.

Looking at vfio_pci_disable() pci reset is called before the config 
state and BARs are restored.
Seeing that vfio_pci_enable() calls pci reset right at the start, 
too, before modifying anything I do wonder whether the pci reset is 
at the correct location for disable.

I would have expected to call pci reset in vfio_pci_disable() 
_after_ we have restored the configuration, to ensure a sane state 
after reset.
And, as experience show, we do need to call it there.

So what is the rationale for the pci reset?
Can we move it to the end of vfio_pci_disable() or do we need to 
call pci reset twice?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

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

end of thread, other threads:[~2012-10-18 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-18  6:47 PCI device not properly reset after VFIO Hannes Reinecke
2012-10-18 14:40 ` Alex Williamson
     [not found] ` <1350571230.2112.344.camel@bling.home>
2012-10-18 15:06   ` Hannes Reinecke
     [not found]   ` <50801AF8.7040305@suse.de>
2012-10-18 20:40     ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).