Re: [PATCH v3 4/7] xen/pciback: Implement PCI reset slot or bus with 'do_flr' SysFS attribute
From: Konrad Rzeszutek Wilk
Date: Tue Jul 08 2014 - 15:29:13 EST
On Tue, Jul 08, 2014 at 02:46:26PM -0400, Konrad Rzeszutek Wilk wrote:
> On Tue, Jul 08, 2014 at 07:02:51PM +0100, David Vrabel wrote:
> > On 08/07/14 19:58, konrad@xxxxxxxxxx wrote:
> > > --- a/Documentation/ABI/testing/sysfs-driver-pciback
> > > +++ b/Documentation/ABI/testing/sysfs-driver-pciback
> > > @@ -82,3 +82,14 @@ Description:
> > > device is shared, enabled, or on a level interrupt line.
> > > Writing a string of DDDD:BB:DD.F will toggle the state.
> > > This is Domain:Bus:Device.Function where domain is optional.
> > > +
> > > +What: /sys/bus/pci/drivers/pciback/do_flr
> > > +Date: July 2014
> > > +KernelVersion: 3.16
> > > +Contact: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > > +Description:
> > > + An option to slot or bus reset an PCI device owned by
> > > + Xen PCI backend. Writing a string of DDDD:BB:DD.F will cause
> > > + the driver to perform an slot or bus reset if the device
> > > + supports. It also checks to make sure that all of the devices
> > > + under the bridge are owned by Xen PCI backend.
> >
> > Not sure I like this new interface. I solved this by adding a new reset
> > file that looked like the regular one the pci would have if it supported
> > FLR. I'm fairly sure I posted a series for this. Was there a reason
> > you didn't do this?
>
> It did not work.
>
> During bootup kobject would complain about a secondary 'reset' SysFS
> on the PCI device.
Here is what I saw:
20.441332] Key type dns_resolver registered
[ 20.446548] registered taskstats version 1
[ 20.452843] ------------[ cut here ]------------
[ 20.457731] WARNING: CPU: 0 PID: 1 at /home/konrad/ssd/konrad/linux/fs/sysfs/dir.c:31 sysfs_warn_dup+0x6a/0x80()
[ 20.468594] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/0000:03:01.0/0000:04:00.0/reset'
[ 20.481207] Modules linked in:
[ 20.484508] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 3.16.0-rc2-00027-g777b409 #1
[ 20.493701] Hardware name: /DQ67SW, BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
[ 20.503561] 000000000000001f ffff8801192abcc8 ffffffff816e5bc2 000000000000001f
[ 20.511479] ffff8801192abd18 ffff8801192abd08 ffffffff810a0187 0000000000000000
[ 20.519396] ffff88010e8ff000 ffffffff819b632b ffff880118e421e8 ffff880118e410a8
[ 20.527337] Call Trace:
[ 20.530022] [<ffffffff816e5bc2>] dump_stack+0x51/0x6b
[ 20.535541] [<ffffffff810a0187>] warn_slowpath_common+0x87/0xb0
[ 20.541986] [<ffffffff810a0251>] warn_slowpath_fmt+0x41/0x50
[ 20.548155] [<ffffffff81245243>] ? kernfs_path+0x53/0x70
[ 20.553966] [<ffffffff812473fa>] sysfs_warn_dup+0x6a/0x80
[ 20.559855] [<ffffffff81246e56>] sysfs_add_file_mode_ns+0x126/0x160
[ 20.566668] [<ffffffff81246eb5>] sysfs_create_file_ns+0x25/0x30
[ 20.573110] [<ffffffff81476343>] device_create_file+0x43/0xb0
[ 20.579361] [<ffffffff81369d13>] pci_create_sysfs_dev_files+0x2c3/0x3e0
[ 20.586546] [<ffffffff81d1ffa5>] pci_sysfs_init+0x1f/0x51
[ 20.592429] [<ffffffff81d1ff86>] ? pci_driver_init+0x12/0x12
[ 20.598592] [<ffffffff81d1ff86>] ? pci_driver_init+0x12/0x12
[ 20.604748] [<ffffffff81002089>] do_one_initcall+0x89/0x1b0
[ 20.610833] [<ffffffff81ce4b30>] kernel_init_freeable+0x167/0x1fd
[ 20.617487] [<ffffffff81ce4bc6>] ? kernel_init_freeable+0x1fd/0x1fd
[ 20.624296] [<ffffffff816dd7c0>] ? rest_init+0x90/0x90
[ 20.629910] [<ffffffff816dd7c9>] kernel_init+0x9/0xf0
[ 20.635433] [<ffffffff816eb27c>] ret_from_fork+0x7c/0xb0
[ 20.641219] [<ffffffff816dd7c0>] ? rest_init+0x90/0x90
[ 20.646846] ---[ end trace 956618df162d6136 ]---
[ 20.661457] Magic number: 6:892:343
with this patch and command line:
debug console=hvc0 xen-blkback.log_stats=1 kgdboc=hvc0 xen-pciback.hide=(04:00.0)(07:00.0)(00:16.*)(03:01.0)(03:02.0)