All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] More Driver Core patches for 2.6.15
@ 2006-01-13 19:46 Greg KH
  2006-01-13 19:50 ` [PATCH] Add bus_type probe, remove, shutdown methods Greg KH
  0 siblings, 1 reply; 48+ messages in thread
From: Greg KH @ 2006-01-13 19:46 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

Here are some more driver core patches for 2.6.15.  They have all been
in the last -mm with no problems.  They contain the following
things:
	- input MODALIAS addition (it was accentially dropped from the
	  last patch series).
	- suspend bugfix
	- Russell's bus and driver callback rework (touches a lot of
	  different files.)
	- comment typo fixed.

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

The full patch set will be sent to the linux-kernel mailing list, if
anyone wants to see them.

thanks,

greg k-h

 arch/arm/common/locomo.c            |    4 +-
 arch/arm/common/sa1111.c            |    4 +-
 arch/arm/kernel/ecard.c             |   14 +++++----
 arch/arm/mach-integrator/lm.c       |   36 +++++++++++------------
 arch/ia64/sn/kernel/tiocx.c         |   16 +++++-----
 arch/parisc/kernel/drivers.c        |    4 +-
 arch/powerpc/kernel/of_device.c     |    4 +-
 arch/powerpc/kernel/vio.c           |    8 ++---
 arch/ppc/syslib/ocp.c               |    4 +-
 arch/sh/kernel/cpu/bus.c            |   34 +++++++++++-----------
 drivers/base/dd.c                   |   12 ++++++-
 drivers/base/driver.c               |    5 +++
 drivers/base/platform.c             |    2 -
 drivers/base/power/shutdown.c       |    9 +++--
 drivers/dio/dio-driver.c            |    4 +-
 drivers/i2c/i2c-core.c              |   20 +++++--------
 drivers/ide/ide-cd.c                |   14 +++------
 drivers/ide/ide-disk.c              |   22 +++++---------
 drivers/ide/ide-floppy.c            |   14 +++------
 drivers/ide/ide-tape.c              |   18 ++++-------
 drivers/ide/ide.c                   |   31 ++++++++++++++++++++
 drivers/input/gameport/gameport.c   |   12 ++++---
 drivers/input/input.c               |   55 ++++++++++++++++++++++++------------
 drivers/input/serio/serio.c         |   12 ++++---
 drivers/macintosh/macio_asic.c      |    6 +--
 drivers/media/dvb/bt8xx/dvb-bt8xx.c |   23 +++++++--------
 drivers/media/video/bttv-gpio.c     |   24 ++++++++++++++-
 drivers/media/video/bttv.h          |    2 +
 drivers/mfd/mcp-core.c              |    4 +-
 drivers/mmc/mmc_sysfs.c             |   26 +++++++----------
 drivers/pci/pci-driver.c            |    4 +-
 drivers/pcmcia/ds.c                 |    4 +-
 drivers/pnp/driver.c                |    4 +-
 drivers/rapidio/rio-driver.c        |    6 +--
 drivers/s390/cio/ccwgroup.c         |   16 +++++-----
 drivers/s390/cio/css.c              |   36 ++++++++++++++++++++++-
 drivers/s390/cio/css.h              |    4 ++
 drivers/s390/cio/device.c           |   50 +++++++++++++++-----------------
 drivers/scsi/scsi_debug.c           |    4 +-
 drivers/sh/superhyway/superhyway.c  |    4 +-
 drivers/usb/gadget/ether.c          |    3 -
 drivers/usb/gadget/inode.c          |    3 -
 drivers/usb/gadget/serial.c         |    3 -
 drivers/usb/gadget/zero.c           |    3 -
 drivers/usb/serial/bus.c            |   15 ++++-----
 drivers/zorro/zorro-driver.c        |    4 +-
 include/linux/device.h              |    3 +
 include/linux/ide.h                 |    5 +++
 48 files changed, 358 insertions(+), 256 deletions(-)


Cornelia Huck:
      Add {css,ccw}_bus_type probe, remove, shutdown methods.

Jean Delvare:
      platform-device-del typo fix

Kay Sievers:
      INPUT: add MODALIAS to the event environment

Michael Richardson:
      device_shutdown can loop if the driver frees itself

Russell King:
      Add bus_type probe, remove, shutdown methods.
      Add pci_bus_type probe and remove methods
      Add SA1111 bus_type probe/remove methods
      Add locomo bus_type probe/remove methods
      Add logic module bus_type probe/remove methods
      Add tiocx bus_type probe/remove methods
      Add ecard_bus_type probe/remove/shutdown methods
      Add of_platform_bus_type probe and remove methods
      Add ocp_bus_type probe and remove methods
      Add parisc_bus_type probe and remove methods
      Add sh_bus_type probe and remove methods
      Add gameport bus_type probe and remove methods
      Add vio_bus_type probe and remove methods
      Add serio bus_type probe and remove methods
      Add dio_bus_type probe and remove methods
      Add i2c_bus_type probe and remove methods
      Add pcmcia_bus_type probe and remove methods
      Add MCP bus_type probe and remove methods
      Add macio_bus_type probe and remove methods
      Add mmc_bus_type probe and remove methods
      Add pnp_bus_type probe and remove methods
      Add usb_serial_bus_type probe and remove methods
      Add ccwgroup_bus_type probe and remove methods
      Add superhyway_bus_type probe and remove methods
      Add ide_bus_type probe and remove methods
      Add zorro_bus_type probe and remove methods
      Add Pseudo LLD bus_type probe and remove methods
      Add rio_bus_type probe and remove methods
      Add bttv sub bus_type probe and remove methods
      Remove usb gadget generic driver methods


^ permalink raw reply	[flat|nested] 48+ messages in thread
* [PATCH] device_shutdown can loop if the driver frees itself
@ 2006-01-04 20:31 Michael Richardson
  0 siblings, 0 replies; 48+ messages in thread
From: Michael Richardson @ 2006-01-04 20:31 UTC (permalink / raw)
  To: mochel; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2443 bytes --]


This patch changes device_shutdown() to use a newly introduce safe
reverse list traversal.  We experienced loops on system reboot if we had
removed and re-inserted our device from the device list. 

We noticed this problem on PPC405. Our PCI IDE device comes and goes a lot.

Our hypothesis was that there was a loop caused by the driver->shutdown
freeing memory.  It is possible that we do something wrong as well, but
being unable to reboot is kind of nasty.

Signed-off-by: Michael Richardson <mcr@marajade.sandelman.ca>

---

 drivers/base/power/shutdown.c |    4 ++--
 include/linux/list.h          |   13 +++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

applies-to: 96a0b5842e24d6736c698cdbd820a3ad9d8d9f10
49291875d63ec697510fc4cc9a1766b7400ee2d3
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index f50a08b..3a417c8 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -35,10 +35,10 @@ extern int sysdev_shutdown(void);
  */
 void device_shutdown(void)
 {
-	struct device * dev;
+	struct device * dev, *devn;
 
 	down_write(&devices_subsys.rwsem);
-	list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
+	list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list,
 				kobj.entry) {
 		if (dev->driver && dev->driver->shutdown) {
 			dev_dbg(dev, "shutdown\n");
diff --git a/include/linux/list.h b/include/linux/list.h
index 8e33882..b31ec32 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -436,6 +436,19 @@ static inline void list_splice_init(stru
 	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
 
 /**
+ * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against removal of list entry
+ * @pos:	the type * to use as a loop counter.
+ * @n:          another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
+		     n = list_entry(pos->member.next, typeof(*pos), member); \
+	     &pos->member != (head); 	\
+	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+
+/**
  * list_for_each_rcu	-	iterate over an rcu-protected list
  * @pos:	the &struct list_head to use as a loop counter.
  * @head:	the head for your list.
---
0.99.9.GIT







[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]

^ permalink raw reply related	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2006-01-23  8:39 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 19:46 [GIT PATCH] More Driver Core patches for 2.6.15 Greg KH
2006-01-13 19:50 ` [PATCH] Add bus_type probe, remove, shutdown methods Greg KH
2006-01-13 19:50   ` [PATCH] Add pci_bus_type probe and remove methods Greg KH
2006-01-13 19:50     ` [PATCH] INPUT: add MODALIAS to the event environment Greg KH
2006-01-13 19:50       ` [PATCH] Add SA1111 bus_type probe/remove methods Greg KH
2006-01-13 19:50         ` [PATCH] Add locomo " Greg KH
2006-01-13 19:50           ` [PATCH] Add logic module " Greg KH
2006-01-13 19:50             ` [PATCH] Add tiocx " Greg KH
2006-01-13 19:50               ` [PATCH] Add ecard_bus_type probe/remove/shutdown methods Greg KH
2006-01-13 19:50                 ` [PATCH] Add of_platform_bus_type probe and remove methods Greg KH
2006-01-13 19:50                   ` [PATCH] Add ocp_bus_type " Greg KH
2006-01-13 19:50                     ` [PATCH] Add parisc_bus_type " Greg KH
2006-01-13 19:50                       ` [PATCH] Add sh_bus_type " Greg KH
2006-01-13 19:50                         ` [PATCH] Add gameport bus_type " Greg KH
2006-01-13 19:50                           ` [PATCH] Add vio_bus_type " Greg KH
2006-01-13 19:50                             ` [PATCH] Add serio bus_type " Greg KH
2006-01-13 19:50                               ` [PATCH] Add dio_bus_type " Greg KH
2006-01-13 19:50                                 ` [PATCH] Add i2c_bus_type " Greg KH
2006-01-13 19:50                                   ` [PATCH] Add pcmcia_bus_type " Greg KH
2006-01-13 19:50                                     ` [PATCH] Add MCP bus_type " Greg KH
2006-01-13 19:50                                       ` [PATCH] Add macio_bus_type " Greg KH
2006-01-13 19:50                                         ` [PATCH] Add mmc_bus_type " Greg KH
2006-01-13 19:50                                           ` [PATCH] Add pnp_bus_type " Greg KH
2006-01-13 19:50                                             ` [PATCH] Add usb_serial_bus_type " Greg KH
2006-01-13 19:50                                               ` [PATCH] Add ccwgroup_bus_type " Greg KH
2006-01-13 19:50                                                 ` [PATCH] Add superhyway_bus_type " Greg KH
2006-01-13 19:50                                                   ` [PATCH] Add ide_bus_type " Greg KH
2006-01-13 19:50                                                     ` [PATCH] Add zorro_bus_type " Greg KH
2006-01-13 19:50                                                       ` [PATCH] Add Pseudo LLD bus_type " Greg KH
2006-01-13 19:50                                                         ` [PATCH] Add rio_bus_type " Greg KH
2006-01-13 19:50                                                           ` [PATCH] platform-device-del typo fix Greg KH
2006-01-13 19:50                                                             ` [PATCH] Add bttv sub bus_type probe and remove methods Greg KH
2006-01-13 19:50                                                               ` [PATCH] Add {css,ccw}_bus_type probe, remove, shutdown methods Greg KH
2006-01-13 19:50                                                                 ` [PATCH] Remove usb gadget generic driver methods Greg KH
2006-01-13 19:50                                                                   ` [PATCH] device_shutdown can loop if the driver frees itself Greg KH
2006-01-13 20:06                                                     ` [PATCH] Add ide_bus_type probe and remove methods Bartlomiej Zolnierkiewicz
2006-01-14 19:57                                                       ` Russell King
2006-01-14 20:32                                                         ` Bartlomiej Zolnierkiewicz
2006-01-23  8:39                                                         ` Bartlomiej Zolnierkiewicz
2006-01-14  5:14       ` [PATCH] INPUT: add MODALIAS to the event environment Alexander E. Patrakov
2006-01-14 11:04         ` Kay Sievers
2006-01-14 13:15           ` Alexander E. Patrakov
2006-01-14 13:21             ` Kay Sievers
2006-01-14 13:42               ` Alexander E. Patrakov
2006-01-14 14:11                 ` Kay Sievers
2006-01-14 14:50                   ` Alexander E. Patrakov
2006-01-23  6:00             ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2006-01-04 20:31 [PATCH] device_shutdown can loop if the driver frees itself Michael Richardson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.