* Trying to reset a PCIe device and scratching my head...
@ 2010-09-28 2:05 Jimmie Mayfield
2010-09-28 7:28 ` Clemens Ladisch
0 siblings, 1 reply; 4+ messages in thread
From: Jimmie Mayfield @ 2010-09-28 2:05 UTC (permalink / raw)
To: linux-kernel
Hello. I'm in the process of writing a device driver for a PCIe
device where the bulk of the logic, including the PCIe interface, is
implemented on a couple of large FPGAs. Current target platform is x86
Linux.
Having the PCIe interface implemented inside FPGA 'A' makes upgrading
that particular FPGA rather troublesome. In a perfect world, one would
be able to upgrade the FPGA without having to reboot the machine. The
hardware guys have designed the card to reload that FPGA image upon a
slot reset...either fundamental or hot. (If I could guarantee the
card would always be plugged into a hotplug-capable slot, I suppose I could
forge a hotplug event and toggle power to the slot. But I can't impose
that requirement on customers.)
So I'd like to be able to send either a fundamental or hot reset to the
device but so far I've had no success. Is there a recommended way of doing
this on x86 Linux?
Jimmie
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Trying to reset a PCIe device and scratching my head...
2010-09-28 2:05 Trying to reset a PCIe device and scratching my head Jimmie Mayfield
@ 2010-09-28 7:28 ` Clemens Ladisch
2010-09-28 16:06 ` Jesse Barnes
0 siblings, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2010-09-28 7:28 UTC (permalink / raw)
To: Jimmie Mayfield; +Cc: linux-kernel
Jimmie Mayfield wrote:
> Having the PCIe interface implemented inside FPGA 'A' makes upgrading
> that particular FPGA rather troublesome. In a perfect world, one would
> be able to upgrade the FPGA without having to reboot the machine. The
> hardware guys have designed the card to reload that FPGA image upon a
> slot reset...either fundamental or hot.
>
> So I'd like to be able to send either a fundamental or hot reset to the
> device but so far I've had no success.
The PCIe AER driver (drivers/pci/pcie/aer/) sends a hot reset when
it has received a fatal error. As far as I can tell, it just sets the
PCI_BRIDGE_CTL_BUS_RESET bit of the upstream bridge; everything else
is just infrastructure to handle error reporting and to notify the
device driver about the reset.
Regards,
Clemens
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Trying to reset a PCIe device and scratching my head...
2010-09-28 7:28 ` Clemens Ladisch
@ 2010-09-28 16:06 ` Jesse Barnes
2010-09-28 19:13 ` Jimmie Mayfield
0 siblings, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2010-09-28 16:06 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: Jimmie Mayfield, linux-kernel
On Tue, 28 Sep 2010 09:28:14 +0200
Clemens Ladisch <clemens@ladisch.de> wrote:
> Jimmie Mayfield wrote:
> > Having the PCIe interface implemented inside FPGA 'A' makes upgrading
> > that particular FPGA rather troublesome. In a perfect world, one would
> > be able to upgrade the FPGA without having to reboot the machine. The
> > hardware guys have designed the card to reload that FPGA image upon a
> > slot reset...either fundamental or hot.
> >
> > So I'd like to be able to send either a fundamental or hot reset to the
> > device but so far I've had no success.
>
> The PCIe AER driver (drivers/pci/pcie/aer/) sends a hot reset when
> it has received a fatal error. As far as I can tell, it just sets the
> PCI_BRIDGE_CTL_BUS_RESET bit of the upstream bridge; everything else
> is just infrastructure to handle error reporting and to notify the
> device driver about the reset.
Right, if your system supports this, it may be the easiest way to go.
But devices often have proprietary ways of resetting themselves too;
maybe you could change your device to reset if a specific bit in config
or MMIO space was flipped. You'd likely need some sort of delay before
accessing the device again, but it should be bounded and fairly fixed,
so probably not a big deal for the driver to handle.
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Trying to reset a PCIe device and scratching my head...
2010-09-28 16:06 ` Jesse Barnes
@ 2010-09-28 19:13 ` Jimmie Mayfield
0 siblings, 0 replies; 4+ messages in thread
From: Jimmie Mayfield @ 2010-09-28 19:13 UTC (permalink / raw)
To: Jesse Barnes; +Cc: linux-kernel
On Tue, Sep 28, 2010 at 09:06:55AM -0700, Jesse Barnes wrote:
> Right, if your system supports this, it may be the easiest way to go.
I was under the impression that PCIe requires support for at least
fundamental reset and maybe hot reset (secondary bus reset) though I'd
have to go back to the spec to verify the latter. Are you saying that
not all PCIe chipsets support this? Sorry if this seems like a dumb
question...I'm by no means a PCIe guru.
> But devices often have proprietary ways of resetting themselves too;
> maybe you could change your device to reset if a specific bit in config
> or MMIO space was flipped. You'd likely need some sort of delay before
> accessing the device again, but it should be bounded and fairly fixed,
> so probably not a big deal for the driver to handle.
Indeed, the device does support a proprietary reset via MMIO but
that reset only affects those components that lie behind the card's PCIe
interface. So it's nearly a full device reset but not quite. The FPGA
containing the PCIe interface does not get reloaded. Unfortunately, that
behavior is likely set in stone.
Jimmie
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-28 19:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 2:05 Trying to reset a PCIe device and scratching my head Jimmie Mayfield
2010-09-28 7:28 ` Clemens Ladisch
2010-09-28 16:06 ` Jesse Barnes
2010-09-28 19:13 ` Jimmie Mayfield
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.