> + for ( ; sec_bus <= sub_bus; sec_bus++ )
> + pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];
OK. You are collapsing the bridge of the subordinate buses to be the same
upstream bridge of the pdev we are removing. Looks good. Ack!
Allen
-----Original Message-----
From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
Sent: Friday, October 07, 2011 12:08 AM
To: Kay, Allen M
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [PATCH] passthrough: update bus2bridge mapping as PCI devices get
added/removed
>>> On 07.10.11 at 04:00, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
> Hi Jan,
>
> I'm not able to spot the difference between this patch and the earlier one
> you had second thoughts about in attached email. Was there a change I
> missed?
It addresses the comment I made in the mail you had attached, i.e. ...
> Allen
>
> -----Original Message-----
>...
> -static void free_pdev(struct pci_dev *pdev)
> +static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
> {
> + /* update bus2bridge */
> + switch ( pdev_type(pseg->nr, pdev->bus, pdev->devfn) )
> + {
> + u8 dev, func, sec_bus, sub_bus;
> +
> + case DEV_TYPE_PCIe2PCI_BRIDGE:
> + case DEV_TYPE_LEGACY_PCI_BRIDGE:
> + dev = PCI_SLOT(pdev->devfn);
> + func = PCI_FUNC(pdev->devfn);
> + sec_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> + PCI_SECONDARY_BUS);
> + sub_bus = pci_conf_read8(pseg->nr, pdev->bus, dev, func,
> + PCI_SUBORDINATE_BUS);
> +
> + spin_lock(&pseg->bus2bridge_lock);
> + for ( ; sec_bus <= sub_bus; sec_bus++ )
> + pseg->bus2bridge[sec_bus] = pseg->bus2bridge[pdev->bus];
... the right side of this was 0 on the first posting.
Jan
> + spin_unlock(&pseg->bus2bridge_lock);
> + break;
> + }
> +
> list_del(&pdev->alldevs_list);
> xfree(pdev);
> }
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|