From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: gregkh@suse.de
Subject: [PATCH] PCI: Add pci shutdown ability
Date: Wed, 4 May 2005 00:02:18 -0700 [thread overview]
Message-ID: <11151901383259@kroah.com> (raw)
In-Reply-To: <11151901373936@kroah.com>
[PATCH] PCI: Add pci shutdown ability
Now pci drivers can know when the system is going down without having to
add a reboot notifier event.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
commit c8958177224622411b9979eabb5610e30b06034b
tree 09ceb4ce69813c9ac2a3e3c7ea6eff9d5361fe9c
parent 4c0619add8c3a8b28e7fae8b15cc7b62de2f8148
author Greg KH <gregkh@suse.de> 1112939611 +0900
committer Greg KH <gregkh@suse.de> 1115189115 -0700
Index: drivers/pci/pci-driver.c
===================================================================
--- 2e27d1c516480dd6f3686c05caac09b196475951/drivers/pci/pci-driver.c (mode:100644 sha1:37b7961efc44a93fff15ee41c125be1e71c5d9e5)
+++ 09ceb4ce69813c9ac2a3e3c7ea6eff9d5361fe9c/drivers/pci/pci-driver.c (mode:100644 sha1:b42466ccbb309f4961b7a653aa079c3577d7cbb7)
@@ -318,6 +318,14 @@
return 0;
}
+static void pci_device_shutdown(struct device *dev)
+{
+ struct pci_dev *pci_dev = to_pci_dev(dev);
+ struct pci_driver *drv = pci_dev->driver;
+
+ if (drv && drv->shutdown)
+ drv->shutdown(pci_dev);
+}
#define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj)
#define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr)
@@ -385,6 +393,7 @@
drv->driver.bus = &pci_bus_type;
drv->driver.probe = pci_device_probe;
drv->driver.remove = pci_device_remove;
+ drv->driver.shutdown = pci_device_shutdown,
drv->driver.owner = drv->owner;
drv->driver.kobj.ktype = &pci_driver_kobj_type;
pci_init_dynids(&drv->dynids);
Index: include/linux/pci.h
===================================================================
--- 2e27d1c516480dd6f3686c05caac09b196475951/include/linux/pci.h (mode:100644 sha1:3c89148ae28a6e28d4ec21e680a6e383fb885e3d)
+++ 09ceb4ce69813c9ac2a3e3c7ea6eff9d5361fe9c/include/linux/pci.h (mode:100644 sha1:cff5ba3ac8ce816c8261dd588be17f488de89507)
@@ -671,6 +671,7 @@
int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */
int (*resume) (struct pci_dev *dev); /* Device woken up */
int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
+ void (*shutdown) (struct pci_dev *dev);
struct device_driver driver;
struct pci_dynids dynids;
next prev parent reply other threads:[~2005-05-04 7:04 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-04 7:01 [GIT PATCH] PCI bugfixes for 2.6.12-rc3 Greg KH
2005-05-04 7:02 ` [PATCH] PCI: 'is_enabled' flag should be set/cleared when the device is actually enabled/disabled Greg KH
2005-05-04 7:02 ` [PATCH] PCI: fix stale PCI pm docs Greg KH
2005-05-04 7:02 ` [PATCH] PCI: update PCI documentation for pci_get_slot() depreciation Greg KH
2005-05-04 7:02 ` [PATCH] PCI: Clean up a lot of sparse "Should it be static?" warnings Greg KH
2005-05-04 7:02 ` [PATCH] PCI Hotplug ibmphp_pci.c: Fix masking out needed information too early Greg KH
2005-05-04 7:02 ` [PATCH] PCI: fix up word-aligned 16-bit PCI config access through sysfs Greg KH
2005-05-04 7:02 ` Greg KH [this message]
2005-05-04 7:02 ` [PATCH] PCI: Rapid Hance quirk Greg KH
2005-05-04 7:02 ` [PATCH] PCI Hotplug: fix pciehp regression Greg KH
2005-05-04 7:02 ` [PATCH] PCI: Spelling fixes for drivers/pci Greg KH
2005-05-04 7:02 ` [PATCH] PCI: drivers/pci/pci.c: remove pci_dac_set_dma_mask Greg KH
[not found] <Pine.LNX.4.44L0.0504251128070.5751-100000@iolanthe.rowland.org>
[not found] ` <SVLXCHCON1syWVLEFN00000099e@SVLXCHCON1.enterprise.veritas.com>
[not found] ` <20050425182951.GA23209@kroah.com>
[not found] ` <20050425185113.GC23209@kroah.com>
2005-04-25 19:06 ` [PATCH] PCI: Add pci shutdown ability Greg KH
2005-04-25 19:23 ` Jeff Garzik
2005-04-25 20:07 ` Greg KH
2005-04-25 20:11 ` Adam Belay
2005-04-25 19:45 ` Alexander Nyberg
2005-04-25 20:12 ` Greg KH
2005-04-26 3:59 ` Benjamin Herrenschmidt
2005-04-25 20:14 ` Alan Stern
2005-04-25 20:52 ` Alexander Nyberg
2005-04-25 21:12 ` Alan Stern
2005-04-26 15:49 ` Grant Grundler
2005-04-26 16:04 ` Alan Stern
2005-04-26 16:37 ` Grant Grundler
2005-04-26 17:14 ` Alan Stern
2005-04-26 17:41 ` Grant Grundler
2005-05-11 5:33 ` Vivek Goyal
2005-05-11 14:38 ` Alan Stern
2005-04-25 21:58 ` Andrew Morton
2005-04-25 22:13 ` Dave Jones
2005-04-25 23:23 ` Adam Belay
2005-04-26 4:32 ` Benjamin Herrenschmidt
2005-04-26 6:23 ` Adam Belay
2005-04-26 9:16 ` Pavel Machek
2005-04-26 9:41 ` Pavel Machek
2005-04-26 3:52 ` Benjamin Herrenschmidt
2005-04-26 15:14 ` Alan Stern
2005-04-26 9:39 ` Pavel Machek
2005-04-26 17:50 ` Dave Jones
2005-04-26 20:23 ` Pavel Machek
2005-04-26 3:45 ` Benjamin Herrenschmidt
2005-04-26 15:11 ` Alan Stern
2005-04-26 16:01 ` Alexander Nyberg
2005-04-26 15:41 ` Grant Grundler
2005-04-26 16:07 ` Richard B. Johnson
2005-04-26 16:19 ` Grant Grundler
2005-04-26 17:12 ` Alan Stern
2005-04-26 17:19 ` Lee Revell
2005-04-25 20:08 ` Adam Belay
2005-04-25 20:19 ` Greg KH
2005-04-25 20:24 ` Adam Belay
2005-04-25 20:42 ` Pavel Machek
2005-04-25 20:55 ` Adam Belay
2005-04-25 21:06 ` Pavel Machek
2005-04-26 4:30 ` Benjamin Herrenschmidt
2005-04-26 16:12 ` Grant Grundler
2005-04-25 21:00 ` Greg KH
2005-04-25 21:13 ` Pavel Machek
2005-04-26 3:41 ` Benjamin Herrenschmidt
2005-04-26 10:11 ` Pavel Machek
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=11151901383259@kroah.com \
--to=gregkh@suse.de \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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