rpms/kernel/devel kernel.spec, 1.576, 1.577 linux-2.6-firewire-git-pending.patch, 1.23, 1.24 linux-2.6-firewire-git-update.patch, 1.11, 1.12

Jarod Wilson (jwilson) fedora-extras-commits at redhat.com
Wed Apr 2 14:50:19 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28467

Modified Files:
	kernel.spec linux-2.6-firewire-git-pending.patch 
	linux-2.6-firewire-git-update.patch 
Log Message:
* Wed Apr 02 2008 Jarod Wilson <jwilson at redhat.com>
- Resync FireWire patches with current linux1394 git tree



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.576
retrieving revision 1.577
diff -u -r1.576 -r1.577
--- kernel.spec	2 Apr 2008 11:23:59 -0000	1.576
+++ kernel.spec	2 Apr 2008 14:49:30 -0000	1.577
@@ -1752,6 +1752,9 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Wed Apr 02 2008 Jarod Wilson <jwilson at redhat.com>
+- Resync FireWire patches with current linux1394 git tree
+
 * Wed Apr  2 2008 Mark McLoughlin <markmc at redhat.com>
 - Sync some spec file changes from kernel-xen
 

linux-2.6-firewire-git-pending.patch:

Index: linux-2.6-firewire-git-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-firewire-git-pending.patch,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- linux-2.6-firewire-git-pending.patch	25 Mar 2008 20:42:18 -0000	1.23
+++ linux-2.6-firewire-git-pending.patch	2 Apr 2008 14:49:30 -0000	1.24
@@ -54,792 +54,3 @@
  	init_completion(&orb->done);
 
 
-
-Adds a goofy routine to dump the configuration ROM as far as it could be
-read, if fw-core failed to get it all.
-
-Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
----
-
-We may want to reduce it to printing
-  - any encountered Extended ROM keys,
-  - the number of quadlets that were successfully read
-    (in the last attempt, or in the most successfull attempt?),
-  - the return code of the last attempt
-before submitting to mainline.
-
- drivers/firewire/fw-device.c |  126 ++++++++++++++++++++++-------------
- drivers/firewire/fw-device.h |    1 
- 2 files changed, 82 insertions(+), 45 deletions(-)
-
-Index: linux/drivers/firewire/fw-device.c
-===================================================================
---- linux.orig/drivers/firewire/fw-device.c
-+++ linux/drivers/firewire/fw-device.c
-@@ -18,6 +18,7 @@
-  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#include <linux/bitops.h>
- #include <linux/module.h>
- #include <linux/wait.h>
- #include <linux/errno.h>
-@@ -422,8 +423,12 @@ read_rom(struct fw_device *device, int g
- 	return callback_data.rcode;
- }
- 
--#define READ_BIB_ROM_SIZE	256
--#define READ_BIB_STACK_SIZE	16
-+#define MAX_CONFIG_ROM_SIZE ((CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) / 4)
-+
-+struct config_rom_image {
-+	u32 rom[MAX_CONFIG_ROM_SIZE];
-+	DECLARE_BITMAP(read, MAX_CONFIG_ROM_SIZE);
-+};
- 
- /*
-  * Read the bus info block, perform a speed probe, and read all of the rest of
-@@ -432,35 +437,36 @@ read_rom(struct fw_device *device, int g
-  * It's better to start all over in this case because the node from which we
-  * are reading the ROM may have changed the ROM during the reset.
-  */
--static int read_bus_info_block(struct fw_device *device, int generation)
-+static int read_bus_info_block(struct fw_device *device, int generation,
-+			       struct config_rom_image *rom_img)
- {
--	u32 *rom, *stack, *old_rom, *new_rom;
-+	u32 *rom, *old_rom, *new_rom;
-+	u32 stack[16];
- 	u32 sp, key;
--	int i, end, length, ret = -1;
-+	int i, end, length, ret;
- 
--	rom = kmalloc(sizeof(*rom) * READ_BIB_ROM_SIZE +
--		      sizeof(*stack) * READ_BIB_STACK_SIZE, GFP_KERNEL);
--	if (rom == NULL)
-+	if (rom_img == NULL)
- 		return -ENOMEM;
--
--	stack = &rom[READ_BIB_ROM_SIZE];
-+	rom = rom_img->rom;
- 
- 	device->max_speed = SCODE_100;
- 
- 	/* First read the bus info block. */
- 	for (i = 0; i < 5; i++) {
--		if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
--			goto out;
-+		ret = read_rom(device, generation, i, &rom[i]);
-+		if (ret != RCODE_COMPLETE)
-+			return ret;
-+		__set_bit(i, rom_img->read);
- 		/*
- 		 * As per IEEE1212 7.2, during power-up, devices can
- 		 * reply with a 0 for the first quadlet of the config
--		 * rom to indicate that they are booting (for example,
-+		 * ROM to indicate that they are booting (for example,
- 		 * if the firmware is on the disk of a external
- 		 * harddisk).  In that case we just fail, and the
- 		 * retry mechanism will try again later.
- 		 */
- 		if (i == 0 && rom[i] == 0)
--			goto out;
-+			return -EAGAIN;
- 	}
- 
- 	device->max_speed = device->node->max_speed;
-@@ -484,15 +490,17 @@ static int read_bus_info_block(struct fw
- 			device->max_speed = device->card->link_speed;
- 
- 		while (device->max_speed > SCODE_100) {
--			if (read_rom(device, generation, 0, &dummy) ==
--			    RCODE_COMPLETE)
-+			ret = read_rom(device, generation, 0, &dummy);
-+			if (ret == RCODE_COMPLETE)
- 				break;
-+			if (ret == RCODE_GENERATION)
-+				return ret;
- 			device->max_speed--;
- 		}
- 	}
- 
- 	/*
--	 * Now parse the config rom.  The config rom is a recursive
-+	 * Now parse the config ROM.  The config ROM is a recursive
- 	 * directory structure so we parse it using a stack of
- 	 * references to the blocks that make up the structure.  We
- 	 * push a reference to the root directory on the stack to
-@@ -504,44 +512,49 @@ static int read_bus_info_block(struct fw
- 	while (sp > 0) {
- 		/*
- 		 * Pop the next block reference of the stack.  The
--		 * lower 24 bits is the offset into the config rom,
-+		 * lower 24 bits is the offset into the config ROM,
- 		 * the upper 8 bits are the type of the reference the
- 		 * block.
- 		 */
- 		key = stack[--sp];
- 		i = key & 0xffffff;
--		if (i >= READ_BIB_ROM_SIZE)
-+		if (i >= MAX_CONFIG_ROM_SIZE) {
- 			/*
- 			 * The reference points outside the standard
--			 * config rom area, something's fishy.
-+			 * config ROM area.
- 			 */
--			goto out;
--
-+			if (key >> 24 == (CSR_EXTENDED_ROM | CSR_LEAF))
-+				fw_error("Extended ROM not supported\n");
-+			return -EINVAL;
-+		}
- 		/* Read header quadlet for the block to get the length. */
--		if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
--			goto out;
-+		ret = read_rom(device, generation, i, &rom[i]);
-+		if (ret != RCODE_COMPLETE)
-+			return ret;
-+		__set_bit(i, rom_img->read);
- 		end = i + (rom[i] >> 16) + 1;
- 		i++;
--		if (end > READ_BIB_ROM_SIZE)
-+		if (end > MAX_CONFIG_ROM_SIZE) {
- 			/*
- 			 * This block extends outside standard config
- 			 * area (and the array we're reading it
- 			 * into).  That's broken, so ignore this
- 			 * device.
- 			 */
--			goto out;
--
-+			return -EINVAL;
-+		}
- 		/*
- 		 * Now read in the block.  If this is a directory
- 		 * block, check the entries as we read them to see if
- 		 * it references another block, and push it in that case.
- 		 */
- 		while (i < end) {
--			if (read_rom(device, generation, i, &rom[i]) !=
--			    RCODE_COMPLETE)
--				goto out;
-+			ret = read_rom(device, generation, i, &rom[i]);
-+			if (ret != RCODE_COMPLETE)
-+				return ret;
-+			__set_bit(i, rom_img->read);
- 			if ((key >> 30) == 3 && (rom[i] >> 30) > 1 &&
--			    sp < READ_BIB_STACK_SIZE)
-+			    sp < ARRAY_SIZE(stack))
- 				stack[sp++] = i + rom[i];
- 			i++;
- 		}
-@@ -552,7 +565,7 @@ static int read_bus_info_block(struct fw
- 	old_rom = device->config_rom;
- 	new_rom = kmemdup(rom, length * 4, GFP_KERNEL);
- 	if (new_rom == NULL)
--		goto out;
-+		return -ENOMEM;
- 
- 	down_write(&fw_device_rwsem);
- 	device->config_rom = new_rom;
-@@ -560,14 +573,25 @@ static int read_bus_info_block(struct fw
- 	up_write(&fw_device_rwsem);
- 
- 	kfree(old_rom);
--	ret = 0;
- 	device->cmc = rom[2] & 1 << 30;
-- out:
--	kfree(rom);
- 
--	return ret;
-+	return 0;
-+}
-+
-+static void dump_config_rom(struct config_rom_image *rom_img)
-+{
-+	int i;
-+
-+	if (rom_img == NULL || !test_bit(0, rom_img->read))
-+		return;
-+
-+	fw_notify("config ROM read so far:\n");
-+	for_each_bit(i, rom_img->read, MAX_CONFIG_ROM_SIZE)
-+		printk(KERN_NOTICE "%x: %08x\n",
-+		       CSR_CONFIG_ROM + i * 4, rom_img->rom[i]);
- }
- 
-+
- static void fw_unit_release(struct device *dev)
- {
- 	struct fw_unit *unit = fw_unit(dev);
-@@ -697,27 +721,32 @@ static void fw_device_init(struct work_s
- {
- 	struct fw_device *device =
- 		container_of(work, struct fw_device, work.work);
-+	struct config_rom_image *rom_img;
- 	int minor, err;
- 
-+	rom_img = kzalloc(sizeof(*rom_img), GFP_KERNEL);
-+
- 	/*
- 	 * All failure paths here set node->data to NULL, so that we
- 	 * don't try to do device_for_each_child() on a kfree()'d
- 	 * device.
- 	 */
- 
--	if (read_bus_info_block(device, device->generation) < 0) {
-+	err = read_bus_info_block(device, device->generation, rom_img);
-+	if (err) {
- 		if (device->config_rom_retries < MAX_RETRIES &&
- 		    atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
- 			device->config_rom_retries++;
- 			schedule_delayed_work(&device->work, RETRY_DELAY);
- 		} else {
--			fw_notify("giving up on config rom for node id %x\n",
--				  device->node_id);
-+			fw_notify("giving up on config ROM for node id %x "
-+				  "(returned %d)\n", device->node_id, err);
-+			dump_config_rom(rom_img);
- 			if (device->node == device->card->root_node)
- 				schedule_delayed_work(&device->card->work, 0);
- 			fw_device_release(&device->device);
- 		}
--		return;
-+		goto out;
- 	}
- 
- 	err = -ENOMEM;
-@@ -786,7 +815,7 @@ static void fw_device_init(struct work_s
- 	if (device->node == device->card->root_node)
- 		schedule_delayed_work(&device->card->work, 0);
- 
--	return;
-+	goto out;
- 
-  error_with_cdev:
- 	down_write(&fw_device_rwsem);
-@@ -796,6 +825,8 @@ static void fw_device_init(struct work_s
- 	fw_device_put(device);		/* fw_device_idr's reference */
- 
- 	put_device(&device->device);	/* our reference */
-+ out:
-+	kfree(rom_img);
- }
- 
- static int update_unit(struct device *dev, void *data)
-@@ -854,6 +885,7 @@ static void fw_device_refresh(struct wor
- 		container_of(work, struct fw_device, work.work);
- 	struct fw_card *card = device->card;
- 	int node_id = device->node_id;
-+	struct config_rom_image *rom_img = NULL;
- 
- 	switch (reread_bus_info_block(device, device->generation)) {
- 	case REREAD_BIB_ERROR:
-@@ -890,13 +922,15 @@ static void fw_device_refresh(struct wor
- 	 */
- 	device_for_each_child(&device->device, NULL, shutdown_unit);
- 
--	if (read_bus_info_block(device, device->generation) < 0) {
-+	rom_img = kzalloc(sizeof(*rom_img), GFP_KERNEL);
-+
-+	if (read_bus_info_block(device, device->generation, rom_img) != 0) {
- 		if (device->config_rom_retries < MAX_RETRIES &&
- 		    atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
- 			device->config_rom_retries++;
- 			schedule_delayed_work(&device->work, RETRY_DELAY);
- 
--			return;
-+			goto out;
- 		}
- 		goto give_up;
- 	}
-@@ -910,16 +944,18 @@ static void fw_device_refresh(struct wor
- 
- 	fw_notify("refreshed device %s\n", device->device.bus_id);
- 	device->config_rom_retries = 0;
--	goto out;
-+	goto out_bm;
- 
-  give_up:
- 	fw_notify("giving up on refresh of device %s\n", device->device.bus_id);
-  gone:
- 	atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
- 	fw_device_shutdown(work);
-- out:
-+ out_bm:
- 	if (node_id == card->root_node->node_id)
- 		schedule_delayed_work(&card->work, 0);
-+ out:
-+	kfree(rom_img);
- }
- 
- void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
-Index: linux/drivers/firewire/fw-device.h
-===================================================================
---- linux.orig/drivers/firewire/fw-device.h
-+++ linux/drivers/firewire/fw-device.h
-@@ -142,6 +142,7 @@ static inline void fw_unit_put(struct fw
- #define CSR_DEPENDENT_INFO	0x14
- #define CSR_MODEL		0x17
- #define CSR_INSTANCE		0x18
-+#define CSR_EXTENDED_ROM	0x1b
- #define CSR_DIRECTORY_ID	0x20
- 
- struct fw_csr_iterator {
-
--- 
-Stefan Richter
--=====-==--- --== -=---
-http://arcgraph.de/sr/
-
-
-
-Date: Thu, 20 Mar 2008 22:04:36 +0100 (CET)
-From: Stefan Richter <stefanr at s5r6.in-berlin.de>
-Subject: [PATCH] firewire: debug interrupt events
-To: linux1394-devel at lists.sourceforge.net
-cc: linux-kernel at vger.kernel.org,
- Jarod Wilson <jwilson at redhat.com>
-
-This adds debug printks for asynchronous transmission and reception and
-for self ID reception.  They can be enabled at module load time, and at
-runtime via /sys/module/firewire_ohci/parameters/debug.
-
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
-
-Also added:  Logging of interrupt event codes and of cancelled AT
-packets.
-
-The code now depends on a Kconfig variable.  This makes it easier to
-build firewire-ohci without the feature or to make it an option in the
-future.  The variable is currently hidden and always on.
-
-This feature inflates firewire-ohci.ko by 7 kB = 27% on x86-64 and by
-4 kB = 23% on i686.
-
-Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
----
- drivers/firewire/Kconfig   |    5 +
- drivers/firewire/fw-ohci.c |  182 +++++++++++++++++++++++++++++++++++++
- 2 files changed, 187 insertions(+)
-
-Index: linux/drivers/firewire/Kconfig
-===================================================================
---- linux.orig/drivers/firewire/Kconfig
-+++ linux/drivers/firewire/Kconfig
-@@ -54,6 +54,11 @@ config FIREWIRE_OHCI
- 	  directive, use "install modulename /bin/true" for the modules to be
- 	  blacklisted.
- 
-+config FIREWIRE_OHCI_DEBUG
-+	bool
-+	depends on FIREWIRE_OHCI
-+	default y
-+
- config FIREWIRE_SBP2
- 	tristate "Support for storage devices (SBP-2 protocol driver)"
- 	depends on FIREWIRE && SCSI
-Index: linux/drivers/firewire/fw-ohci.c
-===================================================================
---- linux.orig/drivers/firewire/fw-ohci.c
-+++ linux/drivers/firewire/fw-ohci.c
-@@ -27,6 +27,7 @@
- #include <linux/kernel.h>
- #include <linux/mm.h>
- #include <linux/module.h>
-+#include <linux/moduleparam.h>
- #include <linux/pci.h>
- #include <linux/spinlock.h>
- 
-@@ -237,6 +238,179 @@ static inline struct fw_ohci *fw_ohci(st
- 
- static char ohci_driver_name[] = KBUILD_MODNAME;
- 
-+#ifdef CONFIG_FIREWIRE_OHCI_DEBUG
-+
-+#define OHCI_PARAM_DEBUG_IRQS		1
-+#define OHCI_PARAM_DEBUG_SELFIDS	2
-+#define OHCI_PARAM_DEBUG_AT_AR		4
-+
-+static int param_debug;
-+module_param_named(debug, param_debug, int, 0644);
-+MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
-+	", IRQs = "		__stringify(OHCI_PARAM_DEBUG_IRQS)
-+	", self-IDs = "		__stringify(OHCI_PARAM_DEBUG_SELFIDS)
-+	", AT/AR events = "	__stringify(OHCI_PARAM_DEBUG_AT_AR)
-+	", or a combination, or all = -1)");
-+
-+static void log_irqs(u32 evt)
-+{
-+	if (likely(!(param_debug & OHCI_PARAM_DEBUG_IRQS)))
-+		return;
-+
-+	printk(KERN_DEBUG KBUILD_MODNAME ": IRQ %08x%s%s%s%s%s%s%s%s%s%s%s\n",
-+	       evt,
-+	       evt & OHCI1394_selfIDComplete	? " selfID"		: "",
-+	       evt & OHCI1394_RQPkt		? " AR_req"		: "",
-+	       evt & OHCI1394_RSPkt		? " AR_resp"		: "",
-+	       evt & OHCI1394_reqTxComplete	? " AT_req"		: "",
-+	       evt & OHCI1394_respTxComplete	? " AT_resp"		: "",
-+	       evt & OHCI1394_isochRx		? " IR"			: "",
-+	       evt & OHCI1394_isochTx		? " IT"			: "",
-+	       evt & OHCI1394_postedWriteErr	? " postedWriteErr"	: "",
-+	       evt & OHCI1394_cycleTooLong	? " cycleTooLong"	: "",
-+	       evt & OHCI1394_cycle64Seconds	? " cycle64Seconds"	: "",
-+	       evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt |
-+		       OHCI1394_RSPkt | OHCI1394_reqTxComplete |
-+		       OHCI1394_respTxComplete | OHCI1394_isochRx |
-+		       OHCI1394_isochTx | OHCI1394_postedWriteErr |
-+		       OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds)
-+						? " ?"			: "");
-+}
-+
-+static const char *speed[] = {
-+	[0] = "S100", [1] = "S200", [2] = "S400",    [3] = "beta",
-+};
-+static const char *power[] = {
-+	[0] = "+0W",  [1] = "+15W", [2] = "+30W",    [3] = "+45W",
-+	[4] = "-3W",  [5] = " ?W",  [6] = "-3..-6W", [7] = "-3..-10W",
-+};
-+static const char port[] = { '.', '-', 'p', 'c', };
-+
-+static char _p(u32 *s, int shift)
-+{
-+	return port[*s >> shift & 3];
-+}
-+
-+static void log_selfids(int generation, int self_id_count, u32 *s)
-+{
-+	if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS)))
-+		return;
-+
-+	printk(KERN_DEBUG KBUILD_MODNAME ": %d selfIDs, generation %d\n",
-+	       self_id_count, generation);
-+
-+	for (; self_id_count--; ++s)
-+		if ((*s & 1 << 23) == 0)
-+			printk(KERN_DEBUG "selfID 0: %08x, phy %d [%c%c%c] "
-+			       "%s gc=%d %s %s%s%s\n",
-+			       *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2),
-+			       speed[*s >> 14 & 3], *s >> 16 & 63,
-+			       power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "",
-+			       *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : "");
-+		else
-+			printk(KERN_DEBUG "selfID n: %08x, phy %d "
-+			       "[%c%c%c%c%c%c%c%c]\n",
-+			       *s, *s >> 24 & 63,
-+			       _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10),
-+			       _p(s,  8), _p(s,  6), _p(s,  4), _p(s,  2));
-+}
-+
-+static const char *evts[] = {
-+	[0x00] = "evt_no_status",	[0x01] = "-reserved-",
-+	[0x02] = "evt_long_packet",	[0x03] = "evt_missing_ack",
-+	[0x04] = "evt_underrun",	[0x05] = "evt_overrun",
-+	[0x06] = "evt_descriptor_read",	[0x07] = "evt_data_read",
-+	[0x08] = "evt_data_write",	[0x09] = "evt_bus_reset",
-+	[0x0a] = "evt_timeout",		[0x0b] = "evt_tcode_err",
-+	[0x0c] = "-reserved-",		[0x0d] = "-reserved-",
-+	[0x0e] = "evt_unknown",		[0x0f] = "evt_flushed",
-+	[0x10] = "-reserved-",		[0x11] = "ack_complete",
-+	[0x12] = "ack_pending ",	[0x13] = "-reserved-",
-+	[0x14] = "ack_busy_X",		[0x15] = "ack_busy_A",
-+	[0x16] = "ack_busy_B",		[0x17] = "-reserved-",
-+	[0x18] = "-reserved-",		[0x19] = "-reserved-",
-+	[0x1a] = "-reserved-",		[0x1b] = "ack_tardy",
-+	[0x1c] = "-reserved-",		[0x1d] = "ack_data_error",
-+	[0x1e] = "ack_type_error",	[0x1f] = "-reserved-",
-+	[0x20] = "pending/cancelled",
-+};
-+static const char *tcodes[] = {
-+	[0x0] = "QW req",		[0x1] = "BW req",
-+	[0x2] = "W resp",		[0x3] = "-reserved-",
-+	[0x4] = "QR req",		[0x5] = "BR req",
-+	[0x6] = "QR resp",		[0x7] = "BR resp",
-+	[0x8] = "cycle start",		[0x9] = "Lk req",
-+	[0xa] = "async stream packet",	[0xb] = "Lk resp",
-+	[0xc] = "-reserved-",		[0xd] = "-reserved-",
-+	[0xe] = "link internal",	[0xf] = "-reserved-",
-+};
-+static const char *phys[] = {
-+	[0x0] = "phy config packet",	[0x1] = "link-on packet",
-+	[0x2] = "self-id packet",	[0x3] = "-reserved-",
-+};
-+
-+static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
-+{
-+	int tcode = header[0] >> 4 & 0xf;
-+	char specific[12];
-+
-+	if (likely(!(param_debug & OHCI_PARAM_DEBUG_AT_AR)))
-+		return;
-+
-+	if (unlikely(evt >= ARRAY_SIZE(evts)))
-+			evt = 0x1f;
-+
-+	if (header[0] == ~header[1]) {
-+		printk(KERN_DEBUG "A%c %s, %s, %08x\n",
-+		       dir, evts[evt], phys[header[0] >> 30 & 0x3],
-+		       header[0]);
-+		return;
-+	}
-+
-+	switch (tcode) {
-+	case 0x0: case 0x6: case 0x8:
-+		snprintf(specific, sizeof(specific), " = %08x",
-+			 be32_to_cpu((__force __be32)header[3]));
-+		break;
-+	case 0x1: case 0x5: case 0x7: case 0x9: case 0xb:
-+		snprintf(specific, sizeof(specific), " %x,%x",
-+			 header[3] >> 16, header[3] & 0xffff);
-+		break;
-+	default:
-+		specific[0] = '\0';
-+	}
-+
-+	switch (tcode) {
-+	case 0xe: case 0xa:
-+		printk(KERN_DEBUG "A%c %s, %s\n",
-+		       dir, evts[evt], tcodes[tcode]);
-+		break;
-+	case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
-+		printk(KERN_DEBUG "A%c spd %x tl %02x, "
-+		       "%04x -> %04x, %s, "
-+		       "%s, %04x%08x%s\n",
-+		       dir, speed, header[0] >> 10 & 0x3f,
-+		       header[1] >> 16, header[0] >> 16, evts[evt],
-+		       tcodes[tcode], header[1] & 0xffff, header[2], specific);
-+		break;
-+	default:
-+		printk(KERN_DEBUG "A%c spd %x tl %02x, "
-+		       "%04x -> %04x, %s, "
-+		       "%s%s\n",
-+		       dir, speed, header[0] >> 10 & 0x3f,
-+		       header[1] >> 16, header[0] >> 16, evts[evt],
-+		       tcodes[tcode], specific);
-+	}
-+}
-+
-+#else
-+
-+#define log_irqs(evt)
-+#define log_selfids(generation, self_id_count, sid)
-+#define log_ar_at_event(dir, speed, header, evt)
-+
-+#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */
-+
- static inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
- {
- 	writel(data, ohci->registers + offset);
-@@ -368,6 +542,8 @@ static __le32 *handle_ar_packet(struct a
- 	p.timestamp  = status & 0xffff;
- 	p.generation = ohci->request_generation;
- 
-+	log_ar_at_event('R', p.speed, p.header, status >> 16 & 0x1f);
-+
- 	/*
- 	 * The OHCI bus reset handler synthesizes a phy packet with
- 	 * the new generation number when a bus reset happens (see
-@@ -816,6 +992,8 @@ static int handle_at_packet(struct conte
- 	evt = le16_to_cpu(last->transfer_status) & 0x1f;
- 	packet->timestamp = le16_to_cpu(last->res_count);
- 
-+	log_ar_at_event('T', packet->speed, packet->header, evt);
-+
- 	switch (evt) {
- 	case OHCI1394_evt_timeout:
- 		/* Async response transmit timed out. */
-@@ -1117,6 +1295,8 @@ static void bus_reset_tasklet(unsigned l
- 		dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
- 				  free_rom, free_rom_bus);
- 
-+	log_selfids(generation, self_id_count, ohci->self_id_buffer);
-+
- 	fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
- 				 self_id_count, ohci->self_id_buffer);
- }
-@@ -1133,6 +1313,7 @@ static irqreturn_t irq_handler(int irq, 
- 		return IRQ_NONE;
- 
- 	reg_write(ohci, OHCI1394_IntEventClear, event);
-+	log_irqs(event);
- 
- 	if (event & OHCI1394_selfIDComplete)
- 		tasklet_schedule(&ohci->bus_reset_tasklet);
-@@ -1435,6 +1616,7 @@ static int ohci_cancel_packet(struct fw_
- 	if (packet->ack != 0)
- 		goto out;
- 
-+	log_ar_at_event('T', packet->speed, packet->header, 0x20);
- 	driver_data->packet = NULL;
- 	packet->ack = RCODE_CANCELLED;
- 	packet->callback(packet, &ohci->card, packet->ack);
-
--- 
-Stefan Richter
--=====-==--- --== =-=--
-http://arcgraph.de/sr/
-
-
-Date: Thu, 20 Mar 2008 23:48:23 +0100 (CET)
-From: Stefan Richter <stefanr at s5r6.in-berlin.de>
-Subject: [PATCH] firewire: wait until PHY configuration packet was transmitted
-To: linux1394-devel at lists.sourceforge.net
-cc: linux-kernel at vger.kernel.org,
- Jarod Wilson <jwilson at redhat.com>
-
-We now exit fw_send_phy_config /after/ the PHY config packet has been
-transmitted, instead of before.  A subsequent fw_core_initiate_bus_reset
-will therefore not overlap with the transmission.  This is meant to make
-the send PHY config packet + reset bus routine more deterministic.
-
-Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
----
- drivers/firewire/fw-transaction.c |   49 ++++++++++++++----------------
- 1 file changed, 24 insertions(+), 25 deletions(-)
-
-Index: linux/drivers/firewire/fw-transaction.c
-===================================================================
---- linux.orig/drivers/firewire/fw-transaction.c
-+++ linux/drivers/firewire/fw-transaction.c
-@@ -18,6 +18,7 @@
-  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  */
- 
-+#include <linux/completion.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -294,42 +295,40 @@ fw_send_request(struct fw_card *card, st
- }
- EXPORT_SYMBOL(fw_send_request);
- 
-+struct fw_phy_packet {
-+	struct fw_packet packet;
-+	struct completion done;
-+};
-+
- static void
- transmit_phy_packet_callback(struct fw_packet *packet,
- 			     struct fw_card *card, int status)
- {
--	kfree(packet);
--}
--
--static void send_phy_packet(struct fw_card *card, u32 data, int generation)
--{
--	struct fw_packet *packet;
-+	struct fw_phy_packet *p =
-+			container_of(packet, struct fw_phy_packet, packet);
- 
--	packet = kzalloc(sizeof(*packet), GFP_ATOMIC);
--	if (packet == NULL)
--		return;
--
--	packet->header[0] = data;
--	packet->header[1] = ~data;
--	packet->header_length = 8;
--	packet->payload_length = 0;
--	packet->speed = SCODE_100;
--	packet->generation = generation;
--	packet->callback = transmit_phy_packet_callback;
--
--	card->driver->send_request(card, packet);
-+	complete(&p->done);
- }
- 
- void fw_send_phy_config(struct fw_card *card,
- 			int node_id, int generation, int gap_count)
- {
--	u32 q;
--
--	q = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
--		PHY_CONFIG_ROOT_ID(node_id) |
--		PHY_CONFIG_GAP_COUNT(gap_count);
-+	struct fw_phy_packet p;
-+	u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
-+		   PHY_CONFIG_ROOT_ID(node_id) |
-+		   PHY_CONFIG_GAP_COUNT(gap_count);
-+
-+	p.packet.header[0] = data;
-+	p.packet.header[1] = ~data;
-+	p.packet.header_length = 8;
-+	p.packet.payload_length = 0;
-+	p.packet.speed = SCODE_100;
-+	p.packet.generation = generation;
-+	p.packet.callback = transmit_phy_packet_callback;
-+	init_completion(&p.done);
- 
--	send_phy_packet(card, q, generation);
-+	card->driver->send_request(card, &p.packet);
-+	wait_for_completion(&p.done);
- }
- 
- void fw_flush_transactions(struct fw_card *card)
-
--- 
-Stefan Richter
--=====-==--- --== =-=--
-http://arcgraph.de/sr/
-
-
-There's a minor memory leak in firewire-ohci's ar_context_tasklet(), in that
-we're not freeing up some of the memory we use for each ar_buffer, due to a
-moving pointer. The problem has been there for a while, but didn't start
-to be noticed until we were doing a coherent allocation for the ar_buffer --
-meaning we have a smaller pool of memory to work with now, so the problem
-crops up sooner. The manifestation of this comes after doing a bunch of I/O to
-a firewire disk, which eventually stalls, and this starts spewing to the
-console:
-
-PCI-DMA: Out of IOMMU space for 53248 bytes at device 0000:04:09.0
-
-The device there is one of my FireWire controllers trying to do I/O. The host
-is a fairly new rev. opteron.
-
-Just need to make sure we're freeing the correct memory range is pass through
-ar_context_tasklet to fix it. Probably something we ought to sneak into 2.6.25
-if its still doable...
-
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
----
-
- drivers/firewire/fw-ohci.c |    9 +++++----
- 1 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
-index 8ff9059..e1d50f7 100644
---- a/drivers/firewire/fw-ohci.c
-+++ b/drivers/firewire/fw-ohci.c
-@@ -579,7 +579,8 @@ static void ar_context_tasklet(unsigned long data)
- 
- 	if (d->res_count == 0) {
- 		size_t size, rest, offset;
--		dma_addr_t buffer_bus;
-+		dma_addr_t start_bus;
-+		void *start;
- 
- 		/*
- 		 * This descriptor is finished and we may have a
-@@ -588,9 +589,9 @@ static void ar_context_tasklet(unsigned long data)
- 		 */
- 
- 		offset = offsetof(struct ar_buffer, data);
--		buffer_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
-+		start = buffer = ab;
-+		start_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
- 
--		buffer = ab;
- 		ab = ab->next;
- 		d = &ab->descriptor;
- 		size = buffer + PAGE_SIZE - ctx->pointer;
-@@ -605,7 +606,7 @@ static void ar_context_tasklet(unsigned long data)
- 			buffer = handle_ar_packet(ctx, buffer);
- 
- 		dma_free_coherent(ohci->card.device, PAGE_SIZE,
--				  buffer, buffer_bus);
-+				  start, start_bus);
- 		ar_context_add_page(ctx);
- 	} else {
- 		buffer = ctx->pointer;

linux-2.6-firewire-git-update.patch:

Index: linux-2.6-firewire-git-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-firewire-git-update.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- linux-2.6-firewire-git-update.patch	17 Mar 2008 13:37:48 -0000	1.11
+++ linux-2.6-firewire-git-update.patch	2 Apr 2008 14:49:30 -0000	1.12
@@ -1,28 +1,31 @@
-git diff in linux1394-2.6.git vs. v2.6.25-rc6, March 17, 2008.
+git diff in linux1394-2.6.git vs. v2.6.25-rc8, April 02, 2008
 
  Documentation/debugging-via-ohci1394.txt |   13 +-
- drivers/firewire/fw-card.c               |   40 +-----
+ drivers/firewire/Kconfig                 |    5 +
+ drivers/firewire/fw-card.c               |   52 +----
  drivers/firewire/fw-cdev.c               |   13 +-
- drivers/firewire/fw-device.c             |  263 ++++++++++++++++++++++++------
+ drivers/firewire/fw-device.c             |  263 +++++++++++++++++++-----
  drivers/firewire/fw-device.h             |   38 +++-
- drivers/firewire/fw-ohci.c               |  114 +++++++-------
- drivers/firewire/fw-sbp2.c               |  150 ++++++++---------
- drivers/firewire/fw-topology.c           |    3 +
+ drivers/firewire/fw-iso.c                |    5 -
+ drivers/firewire/fw-ohci.c               |  338 ++++++++++++++++++++++++------
+ drivers/firewire/fw-ohci.h               |    1 +
+ drivers/firewire/fw-sbp2.c               |  150 ++++++-------
+ drivers/firewire/fw-topology.c           |   22 ++-
  drivers/firewire/fw-topology.h           |   11 +-
- drivers/firewire/fw-transaction.c        |   11 +-
- drivers/firewire/fw-transaction.h        |    6 -
+ drivers/firewire/fw-transaction.c        |   75 ++++----
+ drivers/firewire/fw-transaction.h        |   17 +-
  drivers/ieee1394/csr.c                   |    6 +-
- drivers/ieee1394/dv1394.c                |    3 +-
+ drivers/ieee1394/dv1394.c                |    4 +-
  drivers/ieee1394/highlevel.c             |    6 +-
  drivers/ieee1394/ieee1394_core.c         |    2 +-
  drivers/ieee1394/nodemgr.c               |    6 +-
- drivers/ieee1394/ohci1394.c              |  111 ++++++-------
- drivers/ieee1394/pcilynx.c               |   12 +-
- drivers/ieee1394/raw1394.c               |    1 -
+ drivers/ieee1394/ohci1394.c              |  229 ++++++++++----------
+ drivers/ieee1394/pcilynx.c               |   15 +-
+ drivers/ieee1394/raw1394.c               |    2 -
  drivers/ieee1394/sbp2.c                  |   11 +-
- drivers/ieee1394/video1394.c             |    3 +-
+ drivers/ieee1394/video1394.c             |    4 +-
  lib/Kconfig.debug                        |   10 +
- 22 files changed, 487 insertions(+), 346 deletions(-)
+ 25 files changed, 835 insertions(+), 463 deletions(-)
 
 diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
 index c360d4e..371ba27 100644
@@ -48,11 +51,61 @@
  
  To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
  Provide code for enabling DMA over FireWire early on boot) and pass the
+diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
+index 25bdc2d..fb4d391 100644
+--- a/drivers/firewire/Kconfig
++++ b/drivers/firewire/Kconfig
+@@ -54,6 +54,11 @@ config FIREWIRE_OHCI
+ 	  directive, use "install modulename /bin/true" for the modules to be
+ 	  blacklisted.
+ 
++config FIREWIRE_OHCI_DEBUG
++	bool
++	depends on FIREWIRE_OHCI
++	default y
++
+ config FIREWIRE_SBP2
+ 	tristate "Support for storage devices (SBP-2 protocol driver)"
+ 	depends on FIREWIRE && SCSI
 diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
-index a034627..7e4012d 100644
+index a034627..102e809 100644
 --- a/drivers/firewire/fw-card.c
 +++ b/drivers/firewire/fw-card.c
-@@ -331,7 +331,7 @@ fw_card_bm_work(struct work_struct *work)
+@@ -167,7 +167,6 @@ fw_core_add_descriptor(struct fw_descriptor *desc)
+ 
+ 	return 0;
+ }
+-EXPORT_SYMBOL(fw_core_add_descriptor);
+ 
+ void
+ fw_core_remove_descriptor(struct fw_descriptor *desc)
+@@ -182,7 +181,6 @@ fw_core_remove_descriptor(struct fw_descriptor *desc)
+ 
+ 	mutex_unlock(&card_mutex);
+ }
+-EXPORT_SYMBOL(fw_core_remove_descriptor);
+ 
+ static const char gap_count_table[] = {
+ 	63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
+@@ -220,7 +218,7 @@ fw_card_bm_work(struct work_struct *work)
+ 	struct bm_data bmd;
+ 	unsigned long flags;
+ 	int root_id, new_root_id, irm_id, gap_count, generation, grace;
+-	int do_reset = 0;
++	bool do_reset = false;
+ 
+ 	spin_lock_irqsave(&card->lock, flags);
+ 	local_node = card->local_node;
+@@ -240,7 +238,7 @@ fw_card_bm_work(struct work_struct *work)
+ 	root_id = root_node->node_id;
+ 	grace = time_after(jiffies, card->reset_jiffies + DIV_ROUND_UP(HZ, 10));
+ 
+-	if (card->bm_generation + 1 == generation ||
++	if (is_next_generation(generation, card->bm_generation) ||
+ 	    (card->bm_generation != generation && grace)) {
+ 		/*
+ 		 * This first step is to figure out who is IRM and
+@@ -331,7 +329,7 @@ fw_card_bm_work(struct work_struct *work)
  		 */
  		spin_unlock_irqrestore(&card->lock, flags);
  		goto out;
@@ -61,7 +114,25 @@
  		/*
  		 * FIXME: I suppose we should set the cmstr bit in the
  		 * STATE_CLEAR register of this node, as described in
-@@ -398,7 +398,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
+@@ -360,14 +358,14 @@ fw_card_bm_work(struct work_struct *work)
+ 		gap_count = 63;
+ 
+ 	/*
+-	 * Finally, figure out if we should do a reset or not.  If we've
+-	 * done less that 5 resets with the same physical topology and we
++	 * Finally, figure out if we should do a reset or not.  If we have
++	 * done less than 5 resets with the same physical topology and we
+ 	 * have either a new root or a new gap count setting, let's do it.
+ 	 */
+ 
+ 	if (card->bm_retries++ < 5 &&
+ 	    (card->gap_count != gap_count || new_root_id != root_id))
+-		do_reset = 1;
++		do_reset = true;
+ 
+ 	spin_unlock_irqrestore(&card->lock, flags);
+ 
+@@ -398,7 +396,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
  {
  	static atomic_t index = ATOMIC_INIT(-1);
  
@@ -69,7 +140,7 @@
  	atomic_set(&card->device_count, 0);
  	card->index = atomic_inc_return(&index);
  	card->driver = driver;
-@@ -429,12 +428,6 @@ fw_card_add(struct fw_card *card,
+@@ -429,12 +426,6 @@ fw_card_add(struct fw_card *card,
  	card->link_speed = link_speed;
  	card->guid = guid;
  
@@ -82,7 +153,7 @@
  	mutex_lock(&card_mutex);
  	config_rom = generate_config_rom(card, &length);
  	list_add_tail(&card->link, &card_list);
-@@ -540,40 +533,9 @@ fw_core_remove_card(struct fw_card *card)
+@@ -540,40 +531,9 @@ fw_core_remove_card(struct fw_card *card)
  	cancel_delayed_work_sync(&card->work);
  	fw_flush_transactions(card);
  	del_timer_sync(&card->flush_timer);
@@ -160,7 +231,7 @@
  	if (get_info->bus_reset != 0) {
  		void __user *uptr = u64_to_uptr(get_info->bus_reset);
 diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
-index 870125a..f559c63 100644
+index 870125a..2d01bc1 100644
 --- a/drivers/firewire/fw-device.c
 +++ b/drivers/firewire/fw-device.c
 @@ -25,7 +25,7 @@
@@ -513,7 +584,7 @@
   error:
  	fw_device_put(device);		/* fw_device_idr's reference */
  
-@@ -771,6 +821,107 @@ static void fw_device_update(struct work_struct *work)
+@@ -771,6 +821,106 @@ static void fw_device_update(struct work_struct *work)
  	device_for_each_child(&device->device, NULL, update_unit);
  }
  
@@ -573,8 +644,7 @@
 +
 +		fw_device_update(work);
 +		device->config_rom_retries = 0;
-+
-+		return;
++		goto out;
 +
 +	case REREAD_BIB_CHANGED:
 +		break;
@@ -621,7 +691,7 @@
  void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
  {
  	struct fw_device *device;
-@@ -780,7 +931,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+@@ -780,7 +930,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
  	case FW_NODE_LINK_ON:
  		if (!node->link_on)
  			break;
@@ -630,7 +700,7 @@
  		device = kzalloc(sizeof(*device), GFP_ATOMIC);
  		if (device == NULL)
  			break;
-@@ -819,6 +970,22 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+@@ -819,6 +969,23 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
  		schedule_delayed_work(&device->work, INITIAL_DELAY);
  		break;
  
@@ -646,7 +716,8 @@
 +			    FW_DEVICE_RUNNING,
 +			    FW_DEVICE_INITIALIZING) == FW_DEVICE_RUNNING) {
 +			PREPARE_DELAYED_WORK(&device->work, fw_device_refresh);
-+			schedule_delayed_work(&device->work, INITIAL_DELAY);
++			schedule_delayed_work(&device->work,
++				node == card->local_node ? 0 : INITIAL_DELAY);
 +		}
 +		break;
 +
@@ -756,11 +827,58 @@
  #define CSR_OFFSET	0x40
  #define CSR_LEAF	0x80
  #define CSR_DIRECTORY	0xc0
+diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
+index 2b640e9..bcbe794 100644
+--- a/drivers/firewire/fw-iso.c
++++ b/drivers/firewire/fw-iso.c
+@@ -126,7 +126,6 @@ fw_iso_context_create(struct fw_card *card, int type,
+ 
+ 	return ctx;
+ }
+-EXPORT_SYMBOL(fw_iso_context_create);
+ 
+ void fw_iso_context_destroy(struct fw_iso_context *ctx)
+ {
+@@ -134,14 +133,12 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
+ 
+ 	card->driver->free_iso_context(ctx);
+ }
+-EXPORT_SYMBOL(fw_iso_context_destroy);
+ 
+ int
+ fw_iso_context_start(struct fw_iso_context *ctx, int cycle, int sync, int tags)
+ {
+ 	return ctx->card->driver->start_iso(ctx, cycle, sync, tags);
+ }
+-EXPORT_SYMBOL(fw_iso_context_start);
+ 
+ int
+ fw_iso_context_queue(struct fw_iso_context *ctx,
+@@ -153,11 +150,9 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
+ 
+ 	return card->driver->queue_iso(ctx, packet, buffer, payload);
+ }
+-EXPORT_SYMBOL(fw_iso_context_queue);
+ 
+ int
+ fw_iso_context_stop(struct fw_iso_context *ctx)
+ {
+ 	return ctx->card->driver->stop_iso(ctx);
+ }
+-EXPORT_SYMBOL(fw_iso_context_stop);
 diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
-index 996d61f..0f02b8d 100644
+index ca6d51e..3d4ef3f 100644
 --- a/drivers/firewire/fw-ohci.c
 +++ b/drivers/firewire/fw-ohci.c
-@@ -177,7 +177,7 @@ struct fw_ohci {
+@@ -27,6 +27,7 @@
+ #include <linux/kernel.h>
+ #include <linux/mm.h>
+ #include <linux/module.h>
++#include <linux/moduleparam.h>
+ #include <linux/pci.h>
+ #include <linux/spinlock.h>
+ 
+@@ -177,7 +178,7 @@ struct fw_ohci {
  	struct tasklet_struct bus_reset_tasklet;
  	int node_id;
  	int generation;
@@ -769,7 +887,265 @@
  	u32 bus_seconds;
  	bool old_uninorth;
  
-@@ -1096,6 +1096,11 @@ static void bus_reset_tasklet(unsigned long data)
+@@ -237,6 +238,179 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
+ 
+ static char ohci_driver_name[] = KBUILD_MODNAME;
+ 
++#ifdef CONFIG_FIREWIRE_OHCI_DEBUG
++
++#define OHCI_PARAM_DEBUG_IRQS		1
++#define OHCI_PARAM_DEBUG_SELFIDS	2
++#define OHCI_PARAM_DEBUG_AT_AR		4
++
++static int param_debug;
++module_param_named(debug, param_debug, int, 0644);
++MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
++	", IRQs = "		__stringify(OHCI_PARAM_DEBUG_IRQS)
++	", self-IDs = "		__stringify(OHCI_PARAM_DEBUG_SELFIDS)
++	", AT/AR events = "	__stringify(OHCI_PARAM_DEBUG_AT_AR)
++	", or a combination, or all = -1)");
++
++static void log_irqs(u32 evt)
++{
++	if (likely(!(param_debug & OHCI_PARAM_DEBUG_IRQS)))
++		return;
++
++	printk(KERN_DEBUG KBUILD_MODNAME ": IRQ %08x%s%s%s%s%s%s%s%s%s%s%s\n",
++	       evt,
++	       evt & OHCI1394_selfIDComplete	? " selfID"		: "",
++	       evt & OHCI1394_RQPkt		? " AR_req"		: "",
++	       evt & OHCI1394_RSPkt		? " AR_resp"		: "",
++	       evt & OHCI1394_reqTxComplete	? " AT_req"		: "",
++	       evt & OHCI1394_respTxComplete	? " AT_resp"		: "",
++	       evt & OHCI1394_isochRx		? " IR"			: "",
++	       evt & OHCI1394_isochTx		? " IT"			: "",
++	       evt & OHCI1394_postedWriteErr	? " postedWriteErr"	: "",
++	       evt & OHCI1394_cycleTooLong	? " cycleTooLong"	: "",
++	       evt & OHCI1394_cycle64Seconds	? " cycle64Seconds"	: "",
++	       evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt |
++		       OHCI1394_RSPkt | OHCI1394_reqTxComplete |
++		       OHCI1394_respTxComplete | OHCI1394_isochRx |
++		       OHCI1394_isochTx | OHCI1394_postedWriteErr |
++		       OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds)
++						? " ?"			: "");
++}
++
++static const char *speed[] = {
++	[0] = "S100", [1] = "S200", [2] = "S400",    [3] = "beta",
++};
++static const char *power[] = {
++	[0] = "+0W",  [1] = "+15W", [2] = "+30W",    [3] = "+45W",
++	[4] = "-3W",  [5] = " ?W",  [6] = "-3..-6W", [7] = "-3..-10W",
++};
++static const char port[] = { '.', '-', 'p', 'c', };
++
++static char _p(u32 *s, int shift)
++{
++	return port[*s >> shift & 3];
++}
++
++static void log_selfids(int generation, int self_id_count, u32 *s)
++{
++	if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS)))
++		return;
++
++	printk(KERN_DEBUG KBUILD_MODNAME ": %d selfIDs, generation %d\n",
++	       self_id_count, generation);
++
++	for (; self_id_count--; ++s)
++		if ((*s & 1 << 23) == 0)
++			printk(KERN_DEBUG "selfID 0: %08x, phy %d [%c%c%c] "
++			       "%s gc=%d %s %s%s%s\n",
++			       *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2),
++			       speed[*s >> 14 & 3], *s >> 16 & 63,
++			       power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "",
++			       *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : "");
++		else
++			printk(KERN_DEBUG "selfID n: %08x, phy %d "
++			       "[%c%c%c%c%c%c%c%c]\n",
++			       *s, *s >> 24 & 63,
++			       _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10),
++			       _p(s,  8), _p(s,  6), _p(s,  4), _p(s,  2));
++}
++
++static const char *evts[] = {
++	[0x00] = "evt_no_status",	[0x01] = "-reserved-",
++	[0x02] = "evt_long_packet",	[0x03] = "evt_missing_ack",
++	[0x04] = "evt_underrun",	[0x05] = "evt_overrun",
++	[0x06] = "evt_descriptor_read",	[0x07] = "evt_data_read",
++	[0x08] = "evt_data_write",	[0x09] = "evt_bus_reset",
++	[0x0a] = "evt_timeout",		[0x0b] = "evt_tcode_err",
++	[0x0c] = "-reserved-",		[0x0d] = "-reserved-",
++	[0x0e] = "evt_unknown",		[0x0f] = "evt_flushed",
++	[0x10] = "-reserved-",		[0x11] = "ack_complete",
++	[0x12] = "ack_pending ",	[0x13] = "-reserved-",
++	[0x14] = "ack_busy_X",		[0x15] = "ack_busy_A",
++	[0x16] = "ack_busy_B",		[0x17] = "-reserved-",
++	[0x18] = "-reserved-",		[0x19] = "-reserved-",
++	[0x1a] = "-reserved-",		[0x1b] = "ack_tardy",
++	[0x1c] = "-reserved-",		[0x1d] = "ack_data_error",
++	[0x1e] = "ack_type_error",	[0x1f] = "-reserved-",
++	[0x20] = "pending/cancelled",
++};
++static const char *tcodes[] = {
++	[0x0] = "QW req",		[0x1] = "BW req",
++	[0x2] = "W resp",		[0x3] = "-reserved-",
++	[0x4] = "QR req",		[0x5] = "BR req",
++	[0x6] = "QR resp",		[0x7] = "BR resp",
++	[0x8] = "cycle start",		[0x9] = "Lk req",
++	[0xa] = "async stream packet",	[0xb] = "Lk resp",
++	[0xc] = "-reserved-",		[0xd] = "-reserved-",
++	[0xe] = "link internal",	[0xf] = "-reserved-",
++};
++static const char *phys[] = {
++	[0x0] = "phy config packet",	[0x1] = "link-on packet",
++	[0x2] = "self-id packet",	[0x3] = "-reserved-",
++};
++
++static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
++{
++	int tcode = header[0] >> 4 & 0xf;
++	char specific[12];
++
++	if (likely(!(param_debug & OHCI_PARAM_DEBUG_AT_AR)))
++		return;
++
++	if (unlikely(evt >= ARRAY_SIZE(evts)))
++			evt = 0x1f;
++
++	if (header[0] == ~header[1]) {
++		printk(KERN_DEBUG "A%c %s, %s, %08x\n",
++		       dir, evts[evt], phys[header[0] >> 30 & 0x3],
++		       header[0]);
++		return;
++	}
++
++	switch (tcode) {
++	case 0x0: case 0x6: case 0x8:
++		snprintf(specific, sizeof(specific), " = %08x",
++			 be32_to_cpu((__force __be32)header[3]));
++		break;
++	case 0x1: case 0x5: case 0x7: case 0x9: case 0xb:
++		snprintf(specific, sizeof(specific), " %x,%x",
++			 header[3] >> 16, header[3] & 0xffff);
++		break;
++	default:
++		specific[0] = '\0';
++	}
++
++	switch (tcode) {
++	case 0xe: case 0xa:
++		printk(KERN_DEBUG "A%c %s, %s\n",
++		       dir, evts[evt], tcodes[tcode]);
++		break;
++	case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
++		printk(KERN_DEBUG "A%c spd %x tl %02x, "
++		       "%04x -> %04x, %s, "
++		       "%s, %04x%08x%s\n",
++		       dir, speed, header[0] >> 10 & 0x3f,
++		       header[1] >> 16, header[0] >> 16, evts[evt],
++		       tcodes[tcode], header[1] & 0xffff, header[2], specific);
++		break;
++	default:
++		printk(KERN_DEBUG "A%c spd %x tl %02x, "
++		       "%04x -> %04x, %s, "
++		       "%s%s\n",
++		       dir, speed, header[0] >> 10 & 0x3f,
++		       header[1] >> 16, header[0] >> 16, evts[evt],
++		       tcodes[tcode], specific);
++	}
++}
++
++#else
++
++#define log_irqs(evt)
++#define log_selfids(generation, self_id_count, sid)
++#define log_ar_at_event(dir, speed, header, evt)
++
++#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */
++
+ static inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
+ {
+ 	writel(data, ohci->registers + offset);
+@@ -320,6 +494,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
+ 	struct fw_ohci *ohci = ctx->ohci;
+ 	struct fw_packet p;
+ 	u32 status, length, tcode;
++	int evt;
+ 
+ 	p.header[0] = cond_le32_to_cpu(buffer[0]);
+ 	p.header[1] = cond_le32_to_cpu(buffer[1]);
+@@ -362,12 +537,15 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
+ 	/* FIXME: What to do about evt_* errors? */
+ 	length = (p.header_length + p.payload_length + 3) / 4;
+ 	status = cond_le32_to_cpu(buffer[length]);
++	evt    = (status >> 16) & 0x1f;
+ 
+-	p.ack        = ((status >> 16) & 0x1f) - 16;
++	p.ack        = evt - 16;
+ 	p.speed      = (status >> 21) & 0x7;
+ 	p.timestamp  = status & 0xffff;
+ 	p.generation = ohci->request_generation;
+ 
++	log_ar_at_event('R', p.speed, p.header, evt);
++
+ 	/*
+ 	 * The OHCI bus reset handler synthesizes a phy packet with
+ 	 * the new generation number when a bus reset happens (see
+@@ -378,7 +556,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
+ 	 * request.
+ 	 */
+ 
+-	if (p.ack + 16 == 0x09)
++	if (evt == OHCI1394_evt_bus_reset)
+ 		ohci->request_generation = (p.header[2] >> 16) & 0xff;
+ 	else if (ctx == &ohci->ar_request_ctx)
+ 		fw_core_handle_request(&ohci->card, &p);
+@@ -817,6 +995,8 @@ static int handle_at_packet(struct context *context,
+ 	evt = le16_to_cpu(last->transfer_status) & 0x1f;
+ 	packet->timestamp = le16_to_cpu(last->res_count);
+ 
++	log_ar_at_event('T', packet->speed, packet->header, evt);
++
+ 	switch (evt) {
+ 	case OHCI1394_evt_timeout:
+ 		/* Async response transmit timed out. */
+@@ -1019,20 +1199,30 @@ static void bus_reset_tasklet(unsigned long data)
+ 	ohci->node_id = reg & (OHCI1394_NodeID_busNumber |
+ 			       OHCI1394_NodeID_nodeNumber);
+ 
++	reg = reg_read(ohci, OHCI1394_SelfIDCount);
++	if (reg & OHCI1394_SelfIDCount_selfIDError) {
++		fw_notify("inconsistent self IDs\n");
++		return;
++	}
+ 	/*
+ 	 * The count in the SelfIDCount register is the number of
+ 	 * bytes in the self ID receive buffer.  Since we also receive
+ 	 * the inverted quadlets and a header quadlet, we shift one
+ 	 * bit extra to get the actual number of self IDs.
+ 	 */
+-
+-	self_id_count = (reg_read(ohci, OHCI1394_SelfIDCount) >> 3) & 0x3ff;
++	self_id_count = (reg >> 3) & 0x3ff;
++	if (self_id_count == 0) {
++		fw_notify("inconsistent self IDs\n");
++		return;
++	}
+ 	generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
+ 	rmb();
+ 
+ 	for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
+-		if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1])
+-			fw_error("inconsistent self IDs\n");
++		if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1]) {
++			fw_notify("inconsistent self IDs\n");
++			return;
++		}
+ 		ohci->self_id_buffer[j] =
+ 				cond_le32_to_cpu(ohci->self_id_cpu[i]);
+ 	}
+@@ -1097,12 +1287,19 @@ static void bus_reset_tasklet(unsigned long data)
  		reg_write(ohci, OHCI1394_ConfigROMhdr, ohci->next_header);
  	}
  
@@ -781,7 +1157,67 @@
  	spin_unlock_irqrestore(&ohci->lock, flags);
  
  	if (free_rom)
-@@ -1434,6 +1439,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+ 		dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
+ 				  free_rom, free_rom_bus);
+ 
++	log_selfids(generation, self_id_count, ohci->self_id_buffer);
++
+ 	fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
+ 				 self_id_count, ohci->self_id_buffer);
+ }
+@@ -1119,6 +1316,7 @@ static irqreturn_t irq_handler(int irq, void *data)
+ 		return IRQ_NONE;
+ 
+ 	reg_write(ohci, OHCI1394_IntEventClear, event);
++	log_irqs(event);
+ 
+ 	if (event & OHCI1394_selfIDComplete)
+ 		tasklet_schedule(&ohci->bus_reset_tasklet);
+@@ -1192,6 +1390,8 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
+ {
+ 	struct fw_ohci *ohci = fw_ohci(card);
+ 	struct pci_dev *dev = to_pci_dev(card->device);
++	u32 lps;
++	int i;
+ 
+ 	if (software_reset(ohci)) {
+ 		fw_error("Failed to reset ohci card.\n");
+@@ -1203,13 +1403,24 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
+ 	 * most of the registers.  In fact, on some cards (ALI M5251),
+ 	 * accessing registers in the SClk domain without LPS enabled
+ 	 * will lock up the machine.  Wait 50msec to make sure we have
+-	 * full link enabled.
++	 * full link enabled.  However, with some cards (well, at least
++	 * a JMicron PCIe card), we have to try again sometimes.
+ 	 */
+ 	reg_write(ohci, OHCI1394_HCControlSet,
+ 		  OHCI1394_HCControl_LPS |
+ 		  OHCI1394_HCControl_postedWriteEnable);
+ 	flush_writes(ohci);
+-	msleep(50);
++
++	for (lps = 0, i = 0; !lps && i < 3; i++) {
++		msleep(50);
++		lps = reg_read(ohci, OHCI1394_HCControlSet) &
++		      OHCI1394_HCControl_LPS;
++	}
++
++	if (!lps) {
++		fw_error("Failed to set Link Power Status\n");
++		return -EIO;
++	}
+ 
+ 	reg_write(ohci, OHCI1394_HCControlClear,
+ 		  OHCI1394_HCControl_noByteSwapData);
+@@ -1421,6 +1632,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+ 	if (packet->ack != 0)
+ 		goto out;
+ 
++	log_ar_at_event('T', packet->speed, packet->header, 0x20);
+ 	driver_data->packet = NULL;
+ 	packet->ack = RCODE_CANCELLED;
+ 	packet->callback(packet, &ohci->card, packet->ack);
+@@ -1435,6 +1647,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
  static int
  ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
  {
@@ -791,7 +1227,7 @@
  	struct fw_ohci *ohci = fw_ohci(card);
  	unsigned long flags;
  	int n, retval = 0;
-@@ -1465,6 +1473,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
+@@ -1466,6 +1681,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
   out:
  	spin_unlock_irqrestore(&ohci->lock, flags);
  	return retval;
@@ -799,7 +1235,7 @@
  }
  
  static u64
-@@ -2044,17 +2053,9 @@ static const struct fw_card_driver ohci_driver = {
+@@ -2045,17 +2261,9 @@ static const struct fw_card_driver ohci_driver = {
  	.stop_iso		= ohci_stop_iso,
  };
  
@@ -819,7 +1255,7 @@
  	if (machine_is(powermac)) {
  		struct device_node *ofn = pci_device_to_OF_node(dev);
  
-@@ -2063,8 +2064,35 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2064,8 +2272,33 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
  			pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
  		}
  	}
@@ -850,12 +1286,15 @@
 +	int err;
 +	size_t size;
 +
-+	ohci_pmac_on(dev);
-+
  	ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
  	if (ohci == NULL) {
  		fw_error("Could not malloc fw_ohci data.\n");
-@@ -2076,7 +2104,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2074,10 +2307,12 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+ 
+ 	fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev);
+ 
++	ohci_pmac_on(dev);
++
  	err = pci_enable_device(dev);
  	if (err) {
  		fw_error("Failed to enable OHCI hardware.\n");
@@ -864,7 +1303,7 @@
  	}
  
  	pci_set_master(dev);
-@@ -2172,8 +2200,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2173,8 +2408,9 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
  	pci_release_region(dev, 0);
   fail_disable:
  	pci_disable_device(dev);
@@ -872,10 +1311,11 @@
 -	fw_card_put(&ohci->card);
 + fail_free:
 +	kfree(&ohci->card);
++	ohci_pmac_off(dev);
  
  	return err;
  }
-@@ -2201,72 +2229,42 @@ static void pci_remove(struct pci_dev *dev)
+@@ -2202,72 +2438,42 @@ static void pci_remove(struct pci_dev *dev)
  	pci_iounmap(dev, ohci->registers);
  	pci_release_region(dev, 0);
  	pci_disable_device(dev);
@@ -962,6 +1402,18 @@
  	if (err) {
  		fw_error("pci_enable_device failed\n");
  		return err;
+diff --git a/drivers/firewire/fw-ohci.h b/drivers/firewire/fw-ohci.h
+index dec4f04..5754c6e 100644
+--- a/drivers/firewire/fw-ohci.h
++++ b/drivers/firewire/fw-ohci.h
+@@ -30,6 +30,7 @@
+ #define  OHCI1394_HCControl_softReset		0x00010000
+ #define OHCI1394_SelfIDBuffer                 0x064
+ #define OHCI1394_SelfIDCount                  0x068
++#define  OHCI1394_SelfIDCount_selfIDError	0x80000000
+ #define OHCI1394_IRMultiChanMaskHiSet         0x070
+ #define OHCI1394_IRMultiChanMaskHiClear       0x074
+ #define OHCI1394_IRMultiChanMaskLoSet         0x078
 diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
 index 62b4e47..2a99937 100644
 --- a/drivers/firewire/fw-sbp2.c
@@ -1336,7 +1788,7 @@
  }
  
 diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
-index d2c7a3d..ebdec4c 100644
+index d2c7a3d..ffbf7d1 100644
 --- a/drivers/firewire/fw-topology.c
 +++ b/drivers/firewire/fw-topology.c
 @@ -108,6 +108,7 @@ static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
@@ -1347,7 +1799,23 @@
  	node->port_count = port_count;
  
  	atomic_set(&node->ref_count, 1);
-@@ -431,6 +432,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
+@@ -289,12 +290,11 @@ static struct fw_node *build_tree(struct fw_card *card,
+ 			beta_repeaters_present = true;
+ 
+ 		/*
+-		 * If all PHYs does not report the same gap count
+-		 * setting, we fall back to 63 which will force a gap
+-		 * count reconfiguration and a reset.
++		 * If PHYs report different gap counts, set an invalid count
++		 * which will force a gap count reconfiguration and a reset.
+ 		 */
+ 		if (SELF_ID_GAP_COUNT(q) != gap_count)
+-			gap_count = 63;
++			gap_count = 0;
+ 
+ 		update_hop_count(node);
+ 
+@@ -431,6 +431,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
  			event = FW_NODE_LINK_OFF;
  		else if (!node0->link_on && node1->link_on)
  			event = FW_NODE_LINK_ON;
@@ -1356,6 +1824,25 @@
  		else
  			event = FW_NODE_UPDATED;
  
+@@ -510,6 +512,18 @@ fw_core_handle_bus_reset(struct fw_card *card,
+ 
+ 	fw_flush_transactions(card);
+ 
++	/*
++	 * If the selfID buffer is not the immediate successor of the
++	 * previously processed one, we cannot reliably compare the
++	 * old and new topologies.
++	 */
++	if (!is_next_generation(generation, card->generation) &&
++	    card->local_node != NULL) {
++		fw_notify("skipped bus generations, destroying all nodes\n");
++		fw_destroy_nodes(card);
++		card->bm_retries = 0;
++	}
++
+ 	spin_lock_irqsave(&card->lock, flags);
+ 
+ 	/*
 diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
 index cedc1ec..addb9f8 100644
 --- a/drivers/firewire/fw-topology.h
@@ -1379,10 +1866,97 @@
  
  struct fw_node {
 diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
-index 99529e5..e550535 100644
+index e6f1bda..3a59e9b 100644
 --- a/drivers/firewire/fw-transaction.c
 +++ b/drivers/firewire/fw-transaction.c
-@@ -396,7 +396,8 @@ const struct fw_address_region fw_high_memory_region =
+@@ -18,6 +18,7 @@
+  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#include <linux/completion.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+@@ -294,42 +295,40 @@ fw_send_request(struct fw_card *card, struct fw_transaction *t,
+ }
+ EXPORT_SYMBOL(fw_send_request);
+ 
++struct fw_phy_packet {
++	struct fw_packet packet;
++	struct completion done;
++};
++
+ static void
+ transmit_phy_packet_callback(struct fw_packet *packet,
+ 			     struct fw_card *card, int status)
+ {
+-	kfree(packet);
+-}
+-
+-static void send_phy_packet(struct fw_card *card, u32 data, int generation)
+-{
+-	struct fw_packet *packet;
+-
+-	packet = kzalloc(sizeof(*packet), GFP_ATOMIC);
+-	if (packet == NULL)
+-		return;
+-
+-	packet->header[0] = data;
+-	packet->header[1] = ~data;
+-	packet->header_length = 8;
+-	packet->payload_length = 0;
+-	packet->speed = SCODE_100;
+-	packet->generation = generation;
+-	packet->callback = transmit_phy_packet_callback;
++	struct fw_phy_packet *p =
++			container_of(packet, struct fw_phy_packet, packet);
+ 
+-	card->driver->send_request(card, packet);
++	complete(&p->done);
+ }
+ 
+ void fw_send_phy_config(struct fw_card *card,
+ 			int node_id, int generation, int gap_count)
+ {
+-	u32 q;
+-
+-	q = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
+-		PHY_CONFIG_ROOT_ID(node_id) |
+-		PHY_CONFIG_GAP_COUNT(gap_count);
+-
+-	send_phy_packet(card, q, generation);
++	struct fw_phy_packet p;
++	u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
++		   PHY_CONFIG_ROOT_ID(node_id) |
++		   PHY_CONFIG_GAP_COUNT(gap_count);
++
++	p.packet.header[0] = data;
++	p.packet.header[1] = ~data;
++	p.packet.header_length = 8;
++	p.packet.payload_length = 0;
++	p.packet.speed = SCODE_100;
++	p.packet.generation = generation;
++	p.packet.callback = transmit_phy_packet_callback;
++	init_completion(&p.done);
++
++	card->driver->send_request(card, &p.packet);
++	wait_for_completion(&p.done);
+ }
+ 
+ void fw_flush_transactions(struct fw_card *card)
+@@ -389,21 +388,21 @@ lookup_enclosing_address_handler(struct list_head *list,
+ static DEFINE_SPINLOCK(address_handler_lock);
+ static LIST_HEAD(address_handler_list);
+ 
+-const struct fw_address_region fw_low_memory_region =
+-	{ .start = 0x000000000000ULL, .end = 0x000100000000ULL,  };
+ const struct fw_address_region fw_high_memory_region =
+ 	{ .start = 0x000100000000ULL, .end = 0xffffe0000000ULL,  };
++EXPORT_SYMBOL(fw_high_memory_region);
++
++#if 0
++const struct fw_address_region fw_low_memory_region =
++	{ .start = 0x000000000000ULL, .end = 0x000100000000ULL,  };
  const struct fw_address_region fw_private_region =
  	{ .start = 0xffffe0000000ULL, .end = 0xfffff0000000ULL,  };
  const struct fw_address_region fw_csr_region =
@@ -1391,8 +1965,16 @@
 +	  .end   = CSR_REGISTER_BASE | CSR_CONFIG_ROM_END,  };
  const struct fw_address_region fw_unit_space_region =
  	{ .start = 0xfffff0000900ULL, .end = 0x1000000000000ULL, };
- EXPORT_SYMBOL(fw_low_memory_region);
-@@ -741,7 +742,8 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
+-EXPORT_SYMBOL(fw_low_memory_region);
+-EXPORT_SYMBOL(fw_high_memory_region);
+-EXPORT_SYMBOL(fw_private_region);
+-EXPORT_SYMBOL(fw_csr_region);
+-EXPORT_SYMBOL(fw_unit_space_region);
++#endif  /*  0  */
+ 
+ /**
+  * Allocate a range of addresses in the node space of the OHCI
+@@ -747,7 +746,8 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
  EXPORT_SYMBOL(fw_core_handle_response);
  
  static const struct fw_address_region topology_map_region =
@@ -1402,7 +1984,7 @@
  
  static void
  handle_topology_map(struct fw_card *card, struct fw_request *request,
-@@ -779,7 +781,8 @@ static struct fw_address_handler topology_map = {
+@@ -785,7 +785,8 @@ static struct fw_address_handler topology_map = {
  };
  
  static const struct fw_address_region registers_region =
@@ -1412,7 +1994,7 @@
  
  static void
  handle_registers(struct fw_card *card, struct fw_request *request,
-@@ -788,7 +791,7 @@ handle_registers(struct fw_card *card, struct fw_request *request,
+@@ -794,7 +795,7 @@ handle_registers(struct fw_card *card, struct fw_request *request,
  		 unsigned long long offset,
  		 void *payload, size_t length, void *callback_data)
  {
@@ -1422,10 +2004,22 @@
  	__be32 *data = payload;
  
 diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
-index a43bb22..8d1987f 100644
+index a43bb22..eb01e5c 100644
 --- a/drivers/firewire/fw-transaction.h
 +++ b/drivers/firewire/fw-transaction.h
-@@ -221,12 +221,9 @@ struct fw_card {
+@@ -201,11 +201,7 @@ struct fw_address_region {
+ 	u64 end;
+ };
+ 
+-extern const struct fw_address_region fw_low_memory_region;
+ extern const struct fw_address_region fw_high_memory_region;
+-extern const struct fw_address_region fw_private_region;
+-extern const struct fw_address_region fw_csr_region;
+-extern const struct fw_address_region fw_unit_space_region;
+ 
+ int fw_core_add_address_handler(struct fw_address_handler *handler,
+ 				const struct fw_address_region *region);
+@@ -221,12 +217,9 @@ struct fw_card {
  	const struct fw_card_driver *driver;
  	struct device *device;
  	atomic_t device_count;
@@ -1438,16 +2032,23 @@
  	int current_tlabel, tlabel_mask;
  	struct list_head transaction_list;
  	struct timer_list flush_timer;
-@@ -263,9 +260,6 @@ struct fw_card {
+@@ -263,8 +256,14 @@ struct fw_card {
  	int bm_generation;
  };
  
 -struct fw_card *fw_card_get(struct fw_card *card);
 -void fw_card_put(struct fw_card *card);
--
++/*
++ * Check whether new_generation is the immediate successor of old_generation.
++ * Take counter roll-over at 255 (as per to OHCI) into account.
++ */
++static inline bool is_next_generation(int new_generation, int old_generation)
++{
++	return (new_generation & 0xff) == ((old_generation + 1) & 0xff);
++}
+ 
  /*
   * The iso packet format allows for an immediate header/payload part
-  * stored in 'header' immediately after the packet info plus an
 diff --git a/drivers/ieee1394/csr.c b/drivers/ieee1394/csr.c
 index 52ac83e..c90be40 100644
 --- a/drivers/ieee1394/csr.c
@@ -1473,7 +2074,7 @@
                                               | csr_crc16(host->csr.speed_map+1,
                                                           0x3f1));
 diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
-index 6572211..8c72f36 100644
+index 6572211..6228fad 100644
 --- a/drivers/ieee1394/dv1394.c
 +++ b/drivers/ieee1394/dv1394.c
 @@ -2179,8 +2179,7 @@ static struct ieee1394_device_id dv1394_id_table[] = {
@@ -1486,6 +2087,14 @@
  };
  
  
+@@ -2568,7 +2567,6 @@ static int __init dv1394_init_module(void)
+ 
+ 	cdev_init(&dv1394_cdev, &dv1394_fops);
+ 	dv1394_cdev.owner = THIS_MODULE;
+-	kobject_set_name(&dv1394_cdev.kobj, "dv1394");
+ 	ret = cdev_add(&dv1394_cdev, IEEE1394_DV1394_DEV, 16);
+ 	if (ret) {
+ 		printk(KERN_ERR "dv1394: unable to register character device\n");
 diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
 index b642546..fa2bfec 100644
 --- a/drivers/ieee1394/highlevel.c
@@ -1548,9 +2157,18 @@
  		    id->vendor_id != ud->vendor_id)
  			continue;
 diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
-index 969de2a..0808bae 100644
+index 969de2a..0690469 100644
 --- a/drivers/ieee1394/ohci1394.c
 +++ b/drivers/ieee1394/ohci1394.c
+@@ -149,7 +149,7 @@ printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id ,
+ /* Module Parameters */
+ static int phys_dma = 1;
+ module_param(phys_dma, int, 0444);
+-MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1).");
++MODULE_PARM_DESC(phys_dma, "Enable physical DMA (default = 1).");
+ 
+ static void dma_trm_tasklet(unsigned long data);
+ static void dma_trm_reset(struct dma_trm_ctx *d);
 @@ -708,7 +708,7 @@ static void insert_packet(struct ti_ohci *ohci,
                                  /* FIXME: do something about it */
                                  PRINT(KERN_ERR,
@@ -1560,10 +2178,93 @@
                                        packet->data, packet->data_size);
                          }
  #endif
-@@ -2993,15 +2993,9 @@ do {						\
- 	return err;				\
- } while (0)
+@@ -2089,10 +2089,8 @@ static void dma_trm_reset(struct dma_trm_ctx *d)
+ 
+ 	spin_lock_irqsave(&d->lock, flags);
  
+-	list_splice(&d->fifo_list, &packet_list);
+-	list_splice(&d->pending_list, &packet_list);
+-	INIT_LIST_HEAD(&d->fifo_list);
+-	INIT_LIST_HEAD(&d->pending_list);
++	list_splice_init(&d->fifo_list, &packet_list);
++	list_splice_init(&d->pending_list, &packet_list);
+ 
+ 	d->branchAddrPtr = NULL;
+ 	d->sent_ind = d->prg_ind;
+@@ -2787,7 +2785,7 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
+ 	d->buf_bus = kzalloc(d->num_desc * sizeof(*d->buf_bus), GFP_ATOMIC);
+ 
+ 	if (d->buf_cpu == NULL || d->buf_bus == NULL) {
+-		PRINT(KERN_ERR, "Failed to allocate dma buffer");
++		PRINT(KERN_ERR, "Failed to allocate %s", "DMA buffer");
+ 		free_dma_rcv_ctx(d);
+ 		return -ENOMEM;
+ 	}
+@@ -2796,7 +2794,7 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
+ 	d->prg_bus = kzalloc(d->num_desc * sizeof(*d->prg_bus), GFP_ATOMIC);
+ 
+ 	if (d->prg_cpu == NULL || d->prg_bus == NULL) {
+-		PRINT(KERN_ERR, "Failed to allocate dma prg");
++		PRINT(KERN_ERR, "Failed to allocate %s", "DMA prg");
+ 		free_dma_rcv_ctx(d);
+ 		return -ENOMEM;
+ 	}
+@@ -2804,7 +2802,7 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
+ 	d->spb = kmalloc(d->split_buf_size, GFP_ATOMIC);
+ 
+ 	if (d->spb == NULL) {
+-		PRINT(KERN_ERR, "Failed to allocate split buffer");
++		PRINT(KERN_ERR, "Failed to allocate %s", "split buffer");
+ 		free_dma_rcv_ctx(d);
+ 		return -ENOMEM;
+ 	}
+@@ -2830,7 +2828,7 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
+ 			memset(d->buf_cpu[i], 0, d->buf_size);
+ 		} else {
+ 			PRINT(KERN_ERR,
+-			      "Failed to allocate dma buffer");
++			      "Failed to allocate %s", "DMA buffer");
+ 			free_dma_rcv_ctx(d);
+ 			return -ENOMEM;
+ 		}
+@@ -2841,7 +2839,7 @@ alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d,
+                         memset(d->prg_cpu[i], 0, sizeof(struct dma_cmd));
+ 		} else {
+ 			PRINT(KERN_ERR,
+-			      "Failed to allocate dma prg");
++			      "Failed to allocate %s", "DMA prg");
+ 			free_dma_rcv_ctx(d);
+ 			return -ENOMEM;
+ 		}
+@@ -2902,7 +2900,7 @@ alloc_dma_trm_ctx(struct ti_ohci *ohci, struct dma_trm_ctx *d,
+ 	d->prg_bus = kzalloc(d->num_desc * sizeof(*d->prg_bus), GFP_KERNEL);
+ 
+ 	if (d->prg_cpu == NULL || d->prg_bus == NULL) {
+-		PRINT(KERN_ERR, "Failed to allocate at dma prg");
++		PRINT(KERN_ERR, "Failed to allocate %s", "AT DMA prg");
+ 		free_dma_trm_ctx(d);
+ 		return -ENOMEM;
+ 	}
+@@ -2925,7 +2923,7 @@ alloc_dma_trm_ctx(struct ti_ohci *ohci, struct dma_trm_ctx *d,
+                         memset(d->prg_cpu[i], 0, sizeof(struct at_dma_prg));
+ 		} else {
+ 			PRINT(KERN_ERR,
+-			      "Failed to allocate at dma prg");
++			      "Failed to allocate %s", "AT DMA prg");
+ 			free_dma_trm_ctx(d);
+ 			return -ENOMEM;
+ 		}
+@@ -2986,22 +2984,9 @@ static struct hpsb_host_driver ohci1394_driver = {
+  * PCI Driver Interface functions  *
+  ***********************************/
+ 
+-#define FAIL(err, fmt, args...)			\
+-do {						\
+-	PRINT_G(KERN_ERR, fmt , ## args);	\
+-        ohci1394_pci_remove(dev);               \
+-	return err;				\
+-} while (0)
+-
 -static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
 -					const struct pci_device_id *ent)
 -{
@@ -1578,7 +2279,7 @@
  	if (machine_is(powermac)) {
  		struct device_node *ofn = pci_device_to_OF_node(dev);
  
-@@ -3010,8 +3004,32 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+@@ -3010,15 +2995,45 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
  			pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
  		}
  	}
@@ -1600,19 +2301,161 @@
 +#define ohci1394_pmac_off(dev)
  #endif /* CONFIG_PPC_PMAC */
  
+-        if (pci_enable_device(dev))
+-		FAIL(-ENXIO, "Failed to enable OHCI hardware");
 +static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
 +					const struct pci_device_id *ent)
 +{
 +	struct hpsb_host *host;
 +	struct ti_ohci *ohci;	/* shortcut to currently handled device */
 +	resource_size_t ohci_base;
++	int err = -ENOMEM;
 +
 +	ohci1394_pmac_on(dev);
-         if (pci_enable_device(dev))
- 		FAIL(-ENXIO, "Failed to enable OHCI hardware");
++	if (pci_enable_device(dev)) {
++		PRINT_G(KERN_ERR, "Failed to enable OHCI hardware");
++		err = -ENXIO;
++		goto err;
++	}
          pci_set_master(dev);
-@@ -3203,16 +3221,16 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
- #undef FAIL
+ 
+ 	host = hpsb_alloc_host(&ohci1394_driver, sizeof(struct ti_ohci), &dev->dev);
+-	if (!host) FAIL(-ENOMEM, "Failed to allocate host structure");
+-
++	if (!host) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "host structure");
++		goto err;
++	}
+ 	ohci = host->hostdata;
+ 	ohci->dev = dev;
+ 	ohci->host = host;
+@@ -3067,15 +3082,20 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+ 		      (unsigned long long)pci_resource_len(dev, 0));
+ 
+ 	if (!request_mem_region(ohci_base, OHCI1394_REGISTER_SIZE,
+-				OHCI1394_DRIVER_NAME))
+-		FAIL(-ENOMEM, "MMIO resource (0x%llx - 0x%llx) unavailable",
++				OHCI1394_DRIVER_NAME)) {
++		PRINT_G(KERN_ERR, "MMIO resource (0x%llx - 0x%llx) unavailable",
+ 			(unsigned long long)ohci_base,
+ 			(unsigned long long)ohci_base + OHCI1394_REGISTER_SIZE);
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_HAVE_MEM_REGION;
+ 
+ 	ohci->registers = ioremap(ohci_base, OHCI1394_REGISTER_SIZE);
+-	if (ohci->registers == NULL)
+-		FAIL(-ENXIO, "Failed to remap registers - card not accessible");
++	if (ohci->registers == NULL) {
++		PRINT_G(KERN_ERR, "Failed to remap registers");
++		err = -ENXIO;
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_HAVE_IOMAPPING;
+ 	DBGMSG("Remapped memory spaces reg 0x%p", ohci->registers);
+ 
+@@ -3083,16 +3103,20 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+ 	ohci->csr_config_rom_cpu =
+ 		pci_alloc_consistent(ohci->dev, OHCI_CONFIG_ROM_LEN,
+ 				     &ohci->csr_config_rom_bus);
+-	if (ohci->csr_config_rom_cpu == NULL)
+-		FAIL(-ENOMEM, "Failed to allocate buffer config rom");
++	if (ohci->csr_config_rom_cpu == NULL) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "buffer config rom");
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_HAVE_CONFIG_ROM_BUFFER;
+ 
+ 	/* self-id dma buffer allocation */
+ 	ohci->selfid_buf_cpu =
+ 		pci_alloc_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE,
+                       &ohci->selfid_buf_bus);
+-	if (ohci->selfid_buf_cpu == NULL)
+-		FAIL(-ENOMEM, "Failed to allocate DMA buffer for self-id packets");
++	if (ohci->selfid_buf_cpu == NULL) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "self-ID buffer");
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_HAVE_SELFID_BUFFER;
+ 
+ 	if ((unsigned long)ohci->selfid_buf_cpu & 0x1fff)
+@@ -3108,28 +3132,32 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+ 	if (alloc_dma_rcv_ctx(ohci, &ohci->ar_req_context,
+ 			      DMA_CTX_ASYNC_REQ, 0, AR_REQ_NUM_DESC,
+ 			      AR_REQ_BUF_SIZE, AR_REQ_SPLIT_BUF_SIZE,
+-			      OHCI1394_AsReqRcvContextBase) < 0)
+-		FAIL(-ENOMEM, "Failed to allocate AR Req context");
+-
++			      OHCI1394_AsReqRcvContextBase) < 0) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "AR Req context");
++		goto err;
++	}
+ 	/* AR DMA response context allocation */
+ 	if (alloc_dma_rcv_ctx(ohci, &ohci->ar_resp_context,
+ 			      DMA_CTX_ASYNC_RESP, 0, AR_RESP_NUM_DESC,
+ 			      AR_RESP_BUF_SIZE, AR_RESP_SPLIT_BUF_SIZE,
+-			      OHCI1394_AsRspRcvContextBase) < 0)
+-		FAIL(-ENOMEM, "Failed to allocate AR Resp context");
+-
++			      OHCI1394_AsRspRcvContextBase) < 0) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "AR Resp context");
++		goto err;
++	}
+ 	/* AT DMA request context */
+ 	if (alloc_dma_trm_ctx(ohci, &ohci->at_req_context,
+ 			      DMA_CTX_ASYNC_REQ, 0, AT_REQ_NUM_DESC,
+-			      OHCI1394_AsReqTrContextBase) < 0)
+-		FAIL(-ENOMEM, "Failed to allocate AT Req context");
+-
++			      OHCI1394_AsReqTrContextBase) < 0) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "AT Req context");
++		goto err;
++	}
+ 	/* AT DMA response context */
+ 	if (alloc_dma_trm_ctx(ohci, &ohci->at_resp_context,
+ 			      DMA_CTX_ASYNC_RESP, 1, AT_RESP_NUM_DESC,
+-			      OHCI1394_AsRspTrContextBase) < 0)
+-		FAIL(-ENOMEM, "Failed to allocate AT Resp context");
+-
++			      OHCI1394_AsRspTrContextBase) < 0) {
++		PRINT_G(KERN_ERR, "Failed to allocate %s", "AT Resp context");
++		goto err;
++	}
+ 	/* Start off with a soft reset, to clear everything to a sane
+ 	 * state. */
+ 	ohci_soft_reset(ohci);
+@@ -3172,9 +3200,10 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+ 	 * by that point.
+ 	 */
+ 	if (request_irq(dev->irq, ohci_irq_handler, IRQF_SHARED,
+-			 OHCI1394_DRIVER_NAME, ohci))
+-		FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq);
+-
++			 OHCI1394_DRIVER_NAME, ohci)) {
++		PRINT_G(KERN_ERR, "Failed to allocate interrupt %d", dev->irq);
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_HAVE_IRQ;
+ 	ohci_initialize(ohci);
+ 
+@@ -3194,25 +3223,28 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
+ 	host->middle_addr_space = OHCI1394_MIDDLE_ADDRESS_SPACE;
+ 
+ 	/* Tell the highlevel this host is ready */
+-	if (hpsb_add_host(host))
+-		FAIL(-ENOMEM, "Failed to register host with highlevel");
+-
++	if (hpsb_add_host(host)) {
++		PRINT_G(KERN_ERR, "Failed to register host with highlevel");
++		goto err;
++	}
+ 	ohci->init_state = OHCI_INIT_DONE;
+ 
+ 	return 0;
+-#undef FAIL
++err:
++	ohci1394_pci_remove(dev);
++	return err;
  }
  
 -static void ohci1394_pci_remove(struct pci_dev *pdev)
@@ -1625,14 +2468,15 @@
 -	ohci = pci_get_drvdata(pdev);
 +	ohci = pci_get_drvdata(dev);
  	if (!ohci)
- 		return;
+-		return;
++		goto out;
  
 -	dev = get_device(&ohci->host->device);
 +	device = get_device(&ohci->host->device);
  
  	switch (ohci->init_state) {
  	case OHCI_INIT_DONE:
-@@ -3246,7 +3264,7 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
+@@ -3246,7 +3278,7 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
  		/* Soft reset before we start - this disables
  		 * interrupts and clears linkEnable and LPS. */
  		ohci_soft_reset(ohci);
@@ -1641,7 +2485,7 @@
  
  	case OHCI_INIT_HAVE_TXRX_BUFFERS__MAYBE:
  		/* The ohci_soft_reset() stops all DMA contexts, so we
-@@ -3257,12 +3275,12 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
+@@ -3257,12 +3289,12 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
  		free_dma_trm_ctx(&ohci->at_resp_context);
  
  	case OHCI_INIT_HAVE_SELFID_BUFFER:
@@ -1656,7 +2500,7 @@
  				    ohci->csr_config_rom_cpu,
  				    ohci->csr_config_rom_bus);
  
-@@ -3270,35 +3288,24 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
+@@ -3270,35 +3302,24 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
  		iounmap(ohci->registers);
  
  	case OHCI_INIT_HAVE_MEM_REGION:
@@ -1676,8 +2520,7 @@
 -		}
 -	}
 -#endif /* CONFIG_PPC_PMAC */
-+		ohci1394_pmac_off(dev);
- 
+-
  	case OHCI_INIT_ALLOC_HOST:
 -		pci_set_drvdata(ohci->dev, NULL);
 +		pci_set_drvdata(dev, NULL);
@@ -1687,6 +2530,8 @@
 -		put_device(dev);
 +	if (device)
 +		put_device(device);
++out:
++	ohci1394_pmac_off(dev);
  }
  
  #ifdef CONFIG_PM
@@ -1699,7 +2544,7 @@
  
  	if (!ohci) {
  		printk(KERN_ERR "%s: tried to suspend nonexisting host\n",
-@@ -3326,32 +3333,23 @@ static int ohci1394_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+@@ -3326,32 +3347,23 @@ static int ohci1394_pci_suspend(struct pci_dev *pdev, pm_message_t state)
  	ohci_devctl(ohci->host, RESET_BUS, LONG_RESET_NO_FORCE_ROOT);
  	ohci_soft_reset(ohci);
  
@@ -1737,7 +2582,7 @@
  
  	if (!ohci) {
  		printk(KERN_ERR "%s: tried to resume nonexisting host\n",
-@@ -3360,19 +3358,10 @@ static int ohci1394_pci_resume(struct pci_dev *pdev)
+@@ -3360,19 +3372,10 @@ static int ohci1394_pci_resume(struct pci_dev *pdev)
  	}
  	DBGMSG("resume called");
  
@@ -1762,7 +2607,7 @@
  		PRINT(KERN_ERR, "pci_enable_device failed with %d", err);
  		return err;
 diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
-index 8af01ab..9c35e0d 100644
+index 8af01ab..7aee1ac 100644
 --- a/drivers/ieee1394/pcilynx.c
 +++ b/drivers/ieee1394/pcilynx.c
 @@ -226,7 +226,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr)
@@ -1817,8 +2662,18 @@
                  return -1;
          }
  
+@@ -738,8 +738,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
+                 spin_lock_irqsave(&lynx->async.queue_lock, flags);
+ 
+                 reg_write(lynx, DMA_CHAN_CTRL(CHANNEL_ASYNC_SEND), 0);
+-		list_splice(&lynx->async.queue, &packet_list);
+-		INIT_LIST_HEAD(&lynx->async.queue);
++		list_splice_init(&lynx->async.queue, &packet_list);
+ 
+                 if (list_empty(&lynx->async.pcl_queue)) {
+                         spin_unlock_irqrestore(&lynx->async.queue_lock, flags);
 diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
-index 37e7e10..3634785 100644
+index 37e7e10..04e96ba 100644
 --- a/drivers/ieee1394/raw1394.c
 +++ b/drivers/ieee1394/raw1394.c
 @@ -2959,7 +2959,6 @@ MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table);
@@ -1829,6 +2684,14 @@
  };
  
  /******************************************************************************/
+@@ -3004,7 +3003,6 @@ static int __init init_raw1394(void)
+ 
+ 	cdev_init(&raw1394_cdev, &raw1394_fops);
+ 	raw1394_cdev.owner = THIS_MODULE;
+-	kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME);
+ 	ret = cdev_add(&raw1394_cdev, IEEE1394_RAW1394_DEV, 1);
+ 	if (ret) {
+ 		HPSB_ERR("raw1394 failed to register minor device block");
 diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
 index f53f72d..16b9d0a 100644
 --- a/drivers/ieee1394/sbp2.c
@@ -1866,7 +2729,7 @@
  	if (lu->workarounds & SBP2_WORKAROUND_INQUIRY_36)
  		sdev->inquiry_len = 36;
 diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
-index bd28adf..cc240b2 100644
+index bd28adf..e03024e 100644
 --- a/drivers/ieee1394/video1394.c
 +++ b/drivers/ieee1394/video1394.c
 @@ -1315,8 +1315,7 @@ static struct ieee1394_device_id video1394_id_table[] = {
@@ -1879,6 +2742,14 @@
  };
  
  
+@@ -1504,7 +1503,6 @@ static int __init video1394_init_module (void)
+ 
+ 	cdev_init(&video1394_cdev, &video1394_fops);
+ 	video1394_cdev.owner = THIS_MODULE;
+-	kobject_set_name(&video1394_cdev.kobj, VIDEO1394_DRIVER_NAME);
+ 	ret = cdev_add(&video1394_cdev, IEEE1394_VIDEO1394_DEV, 16);
+ 	if (ret) {
+ 		PRINT_G(KERN_ERR, "video1394: unable to get minor device block");
 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
 index 0796c1a..4e370e1 100644
 --- a/lib/Kconfig.debug




More information about the fedora-extras-commits mailing list