From: Yijing Wang <wangyijing@huawei.com>
To: Oliver Neukum <oneukum@suse.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
Hanjun Guo <guohanjun@huawei.com>
Subject: Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily
Date: Mon, 10 Feb 2014 15:59:41 +0800 [thread overview]
Message-ID: <52F886ED.7040603@huawei.com> (raw)
In-Reply-To: <1392015399.21271.9.camel@linux-fkkt.site>
Hi Oliver,
Thanks for your review and comments!
>> +static DEFINE_SPINLOCK(pci_freeze_lock);
>
> The lock is used only here.
Also be used in pci_bus_unfreeze_device();
>
>> +/**
>> + * pci_bus_freeze_device - freeze pci bus to access pci device
>> + * @bus: the pci bus to freeze
>> + *
>> + * Replace pci bus ops by pci_dummy_ops, protect system from
>> + * accessing pci devices.
>> + */
>> +void pci_bus_freeze_device(struct pci_bus *bus)
>> +{
>> + struct pci_ops *ops;
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&pci_freeze_lock, flags);
>> + ops = pci_bus_set_ops(bus, &pci_dummy_ops);
>> + bus->save_ops = ops;
>> + spin_unlock_irqrestore(&pci_freeze_lock, flags);
>
> Against what exactly are you locking here?
I want to use this spin lock to serialize freeze device and unfreeze device.
Thanks!
Yijing.
>
>
>
>
--
Thanks!
Yijing
next prev parent reply other threads:[~2014-02-10 7:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 4:04 [PATCH part1 v5 0/7] Introduce PCIe Device Serial Number capability support Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 1/7] PCI: rework pci_find_next_ext_capability() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 2/7] PCI: introduce pci_bus_find_ext_capability() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 3/7] PCI: Add support for Device Serial Number capability Yijing Wang
2014-02-10 10:21 ` Oliver Neukum
2014-02-11 1:55 ` Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 4/7] PCI: Introduce pci_serial_number_changed() Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily Yijing Wang
2014-02-10 6:56 ` Oliver Neukum
2014-02-10 7:59 ` Yijing Wang [this message]
2014-02-10 10:07 ` Oliver Neukum
2014-02-11 1:49 ` Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 6/7] PCI: Check pci device serial number when scan device Yijing Wang
2014-02-10 4:04 ` [PATCH part1 v5 7/7] PCI: pciehp: Don't enable/disable slot on resume unless status changed Yijing Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52F886ED.7040603@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=guohanjun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=oneukum@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).