2019-01-31 17:08:03

by James Prestwood

[permalink] [raw]
Subject: BCM43602 system freeze with PCI passthrough

Hi,

I posted about a month ago about an Ath9k card that was causing my host
machine to freeze/lock up when doing PCI passthrough into a VM. This
was resolved by adding:

DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034,
quirk_no_bus_reset);

to drivers/pci/quirks.c and rebuilding the host kernel.

Original thread:
https://marc.info/?l=linux-wireless&m=154689580213002&w=2

I am now trying to get this BCM43602 card working under the same
conditions but again I am seeing the host machine freeze when starting
the VM. I did try adding a similar line for this card, which actually
prevented the machine from freezing, but I am seeing this when starting
the VM:

qemu-system-x86_64: vfio: Cannot reset device 0000:0a:00.0, no
available reset mechanism.

And once inside the VM the device is UNCLAIMED and not usable:

$ lshw -C network

*-network:2 UNCLAIMED
description: Network controller
product: BCM43602 802.11ac Wireless LAN SoC
vendor: Broadcom Limited
physical id: 6
bus info: pci@0000:00:06.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: memory:fe890000-fe897fff memory:fe400000-fe7fffff

This change was really a shot in the dark as I only have a vague
understanding of what its actually doing. I see other entries in
quirks.c for the Broadcom vendor ID but would rather not go poking
around here without any direction.

Thanks,
James



2019-01-31 17:17:31

by Steve deRosier

[permalink] [raw]
Subject: Re: BCM43602 system freeze with PCI passthrough

Hi James,

On Thu, Jan 31, 2019 at 9:08 AM James Prestwood
<[email protected]> wrote:
>
> Hi,
>
> I posted about a month ago about an Ath9k card that was causing my host
> machine to freeze/lock up when doing PCI passthrough into a VM. This
> was resolved by adding:
>
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034,
> quirk_no_bus_reset);
>
> to drivers/pci/quirks.c and rebuilding the host kernel.
>
> Original thread:
> https://marc.info/?l=linux-wireless&m=154689580213002&w=2
>
> I am now trying to get this BCM43602 card working under the same
> conditions but again I am seeing the host machine freeze when starting
> the VM. I did try adding a similar line for this card, which actually
> prevented the machine from freezing, but I am seeing this when starting
> the VM:
>

Since you've had the same issue with two totally unrelated cards, I'm
going to suggest that perhaps the issue is not a Linux wireless one.
You see, the only thing in common with those two cards, with different
manufacturers, different drivers, different firmware, is the PCI bus
and how you're using it (PCI passthrough on QEMU). Perhaps it's either
a QEMU or a PCI bus driver issue. Have you brought up the question
with either of those teams?

- Steve

2019-01-31 17:27:32

by James Prestwood

[permalink] [raw]
Subject: Re: BCM43602 system freeze with PCI passthrough

On Thu, 2019-01-31 at 09:16 -0800, Steve deRosier wrote:
> Hi James,
>
> On Thu, Jan 31, 2019 at 9:08 AM James Prestwood
> <[email protected]> wrote:
> >
> > Hi,
> >
> > I posted about a month ago about an Ath9k card that was causing my
> > host
> > machine to freeze/lock up when doing PCI passthrough into a VM.
> > This
> > was resolved by adding:
> >
> > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0034,
> > quirk_no_bus_reset);
> >
> > to drivers/pci/quirks.c and rebuilding the host kernel.
> >
> > Original thread:
> > https://marc.info/?l=linux-wireless&m=154689580213002&w=2
> >
> > I am now trying to get this BCM43602 card working under the same
> > conditions but again I am seeing the host machine freeze when
> > starting
> > the VM. I did try adding a similar line for this card, which
> > actually
> > prevented the machine from freezing, but I am seeing this when
> > starting
> > the VM:
> >
>
> Since you've had the same issue with two totally unrelated cards, I'm
> going to suggest that perhaps the issue is not a Linux wireless one.
> You see, the only thing in common with those two cards, with
> different
> manufacturers, different drivers, different firmware, is the PCI bus
> and how you're using it (PCI passthrough on QEMU). Perhaps it's
> either
> a QEMU or a PCI bus driver issue. Have you brought up the question
> with either of those teams?

I followed up originally on the PCI mailing list for the Ath card with
a patch, no idea if they took it. The Ath card having this problem was
not as surprising as there are other Ath cards with the same fix in
quirks.c.

This setup has worked fine on another broadcom card (b43 driver), as
well as two Intel cards (iwlwifi driver). I will definitely ask those
teams.

Thanks,
James

>
> - Steve