From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gavin Shan Date: Fri, 23 May 2014 07:37:21 +0000 Subject: Re: [PATCH v6 2/3] drivers/vfio: EEH support for VFIO PCI device Message-Id: <20140523073720.GA5929@shangw> List-Id: References: <1400747034-15045-1-git-send-email-gwshan@linux.vnet.ibm.com> <1400747034-15045-3-git-send-email-gwshan@linux.vnet.ibm.com> <1400814653.3289.428.camel@ul30vt.home> <20140523043722.GA11572@shangw> <76F750C7-EAA1-455F-A64F-BAB826F66281@suse.de> In-Reply-To: <76F750C7-EAA1-455F-A64F-BAB826F66281@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alexander Graf Cc: "aik@ozlabs.ru" , Gavin Shan , "kvm-ppc@vger.kernel.org" , Alex Williamson , "qiudayu@linux.vnet.ibm.com" , "linuxppc-dev@lists.ozlabs.org" On Fri, May 23, 2014 at 08:55:15AM +0200, Alexander Graf wrote: >> Am 23.05.2014 um 06:37 schrieb Gavin Shan : >>> On Thu, May 22, 2014 at 09:10:53PM -0600, Alex Williamson wrote: >>>> On Thu, 2014-05-22 at 18:23 +1000, Gavin Shan wrote: >>>> The patch adds new IOCTL commands for VFIO PCI device to support >>>> EEH functionality for PCI devices, which have been passed through >>>> from host to somebody else via VFIO. .../... >>>> + >>>> +/* >>>> + * Reset is the major step to recover problematic PE. The following >>>> + * command helps on that. >>>> + */ >>>> +struct vfio_eeh_pe_reset { >>>> + __u32 argsz; >>>> + __u32 option; >>>> +}; >>>> + >>>> +#define VFIO_EEH_PE_RESET _IO(VFIO_TYPE, VFIO_BASE + 24) >>>> + >>>> +/* >>>> + * One of the steps for recovery after PE reset is to configure the >>>> + * PCI bridges affected by the PE reset. >>>> + */ >>>> +#define VFIO_EEH_PE_CONFIGURE _IO(VFIO_TYPE, VFIO_BASE + 25) >>> >>> What can the user do differently by making these separate ioctls? >> >> hrm, I didn't understood as well. Alex.G could have the explaination. > >Alex raised the same concern as me: why separate reset and configure? When we want to recover a device, we need a reset call anyway, right? > Ok. With current ioctl commands, "reset+configure" is required to do error recovery. Before the recovery, we also need call "configure" in order to retrieve error log correctly. Also, they corresponds to 2 separate RTAS services: "ibm,set-slot-reset" and "ibm,configure-pe". Thanks, Gavin