RE: USB PCI quirk issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I removed the extra call to pci_disable_device in pcie_portdrv_remove.

The 'disabling already-disabled device' messages are gone and the
enable_cnt for bridges
survives bringdown/bringup cycles without going negative.  The only
anomaly I see right now
is that for a few of the bridges the enable_cnt is 2 after boot - before
hot adds or
removes - but this resolves itself after the first hot remove, probably
because
the dev is destroyed.

-----Original Message-----
From: yhlu.kernel@xxxxxxxxx [mailto:yhlu.kernel@xxxxxxxxx] On Behalf Of
Yinghai Lu
Sent: Wednesday, April 24, 2013 1:08 PM
To: Bulkow, David
Cc: Sarah Sharp; Lawrence, Joe; linux-pci@xxxxxxxxxxxxxxx;
linux-usb@xxxxxxxxxxxxxxx; Bjorn Helgaas; Rafael J. Wysocki; Kenji
Kaneshige
Subject: Re: USB PCI quirk issue

[Adding Kenji]

On Wed, Apr 24, 2013 at 6:25 AM, Bulkow, David
<David.Bulkow@xxxxxxxxxxx> wrote:
> By relocating the call to the quirk code, the resource problem is
gone.
> Can we move forward on this change?

ok, will prepare one complete patch for that.

>
> The enable_cnt issue is now only associated with bridges managed by 
> pcieport.
> For each bridge pci_disable_device() is getting called twice during 
> hot-remove.
> This is happening because both pcie_portdrv_remove() and
> pcie_port_device_remove()
> call pci_disable_device().
>
> static void pcie_portdrv_remove(struct pci_dev *dev) {
>         pcie_port_device_remove(dev);
>         pci_disable_device(dev);
> }
>
> and
>
> void pcie_port_device_remove(struct pci_dev *dev) {
>         device_for_each_child(&dev->dev, NULL, remove_iter);
>         cleanup_service_irqs(dev);
>         pci_disable_device(dev);
> }
>
> There are no ill effects from this so far but the warnings are not 
> likely to be received well by customers.

Thanks for digging that out.

that extra pci_disable_device in pcie_port_device_remove() was added by
---
commit dc5351784eb36f1fec4efa88e01581be72c0b711
Author: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>
Date:   Wed Nov 25 21:04:00 2009 +0900

    PCI: portdrv: cleanup service irqs initialization

    This patch cleans up the service irqs initialization as follows:

     - Remove 'irq_mode' field in pcie_port_data and related
definitions,
       which is not needed because we can get the same information from
       'is_msix', 'is_msi' and 'pin' fields in struct pci_dev.

     - Change the name of 'vectors' argument of assign_interrupt_mode()
to
       'irqs' because it holds irq numbers actually. People might
confuse
       it with CPU vector or MSI/MSI-X vector.

     - Change function name assign_interrupt_mode() to
init_service_irqs()
       becasuse we no longer have 'irq_mode' data structure, and new
name
       is more straightforward (IMO).
---

We should remove extra one in pcie_portdrv_remove.

Can you please prepare patch that delete that line in
pcie_portdrv_remove() ?

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux