lkml.org 
[lkml]   [2012]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 6/9] perf: Generic pci uncore device support
    On 05/04/2012 05:46 AM, Peter Zijlstra wrote:
    > On Wed, 2012-05-02 at 10:07 +0800, Yan, Zheng wrote:
    >> +static void __devexit uncore_pci_remove(struct pci_dev *pdev)
    >> +{
    >> + struct intel_uncore_box *box = pci_get_drvdata(pdev);
    >> + int phyid = pcibus_to_phyid[pdev->bus->number];
    >> +
    >> + if (WARN_ON_ONCE(phyid != box->phy_id))
    >> + return;
    >> +
    >> + box->pci_dev = NULL;
    >> + if (--box->refcnt == 0) {
    >
    > This appears completely unserialized (as is all the refcnt stuff in
    > patch 4 it seems), now I figure the only way to actually have this pci
    > device go away is by hotplug, which is serialized. Still looks very odd.
    >
    yes, box->refcnt should always be 1 here. will remove the 'if (--box->refcnt == 0)'

    >> + spin_lock(&uncore_pci_lock);
    >> + hlist_del_rcu(&box->hlist);
    >> + spin_unlock(&uncore_pci_lock);
    >> + kfree_rcu(box, rcu_head);
    >> + }
    >> +}



    \
     
     \ /
      Last update: 2012-05-04 08:41    [W:2.880 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site