rpms/kernel/F-8 kernel.spec, 1.382, 1.383 linux-2.6-firewire-git-pending.patch, 1.3, 1.4 linux-2.6-firewire-git-update.patch, 1.4, 1.5
Jarod Wilson (jwilson)
fedora-extras-commits at redhat.com
Fri Mar 14 19:36:43 UTC 2008
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16884
Modified Files:
kernel.spec linux-2.6-firewire-git-pending.patch
linux-2.6-firewire-git-update.patch
Log Message:
* Fri Mar 14 2008 Jarod Wilson <jwilson at redhat.com> 2.6.24.3-37
- Resync firewire patches w/linux1394-2.6.git
- Add firewire selfID/AT/AR debug support via optional
module parameters
- firewire: fix DMA coherence on x86_64 systems w/memory mapped
over the 4GB boundry (#434830)
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.382
retrieving revision 1.383
diff -u -r1.382 -r1.383
--- kernel.spec 13 Mar 2008 21:35:43 -0000 1.382
+++ kernel.spec 14 Mar 2008 19:36:06 -0000 1.383
@@ -1917,6 +1917,13 @@
%changelog
+* Fri Mar 14 2008 Jarod Wilson <jwilson at redhat.com> 2.6.24.3-37
+- Resync firewire patches w/linux1394-2.6.git
+- Add firewire selfID/AT/AR debug support via optional
+ module parameters
+- firewire: fix DMA coherence on x86_64 systems w/memory mapped
+ over the 4GB boundry (#434830)
+
* Thu Mar 13 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.24.3-36
- Add support for another Dell wireless modem (#437396)
linux-2.6-firewire-git-pending.patch:
Index: linux-2.6-firewire-git-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-firewire-git-pending.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-firewire-git-pending.patch 10 Mar 2008 16:42:26 -0000 1.3
+++ linux-2.6-firewire-git-pending.patch 14 Mar 2008 19:36:06 -0000 1.4
@@ -3,696 +3,393 @@
# tree, which we think we're going to want...
#
-read_bus_info_block() is repeatedly called by workqueue jobs.
-These will step on each others toes eventually if there are multiple
-workqueue threads, and we end up with corrupt config ROM images.
+
+Increase reconnect management orb timeout.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+
+---
+
+ drivers/firewire/fw-sbp2.c | 15 +++++++++++++--
+ 1 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
+index d6d62c6..da315cf 100644
+--- a/drivers/firewire/fw-sbp2.c
++++ b/drivers/firewire/fw-sbp2.c
+@@ -170,6 +170,7 @@ struct sbp2_target {
+ */
+ #define SBP2_MIN_LOGIN_ORB_TIMEOUT 5000U /* Timeout in ms */
+ #define SBP2_MAX_LOGIN_ORB_TIMEOUT 40000U /* Timeout in ms */
++#define SBP2_MAX_RECONNECT_ORB_TIMEOUT 10000U /* Timeout in ms */
+ #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
+ #define SBP2_ORB_NULL 0x80000000
+ #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
+@@ -538,14 +539,24 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+ orb->request.status_fifo.low =
+ cpu_to_be32(lu->address_handler.offset);
+
+- if (function == SBP2_LOGIN_REQUEST) {
++ switch (function) {
++
++ case SBP2_LOGIN_REQUEST:
+ /* Ask for 2^2 == 4 seconds reconnect grace period */
+ orb->request.misc |= cpu_to_be32(
+ MANAGEMENT_ORB_RECONNECT(2) |
+ MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login));
+ timeout = lu->tgt->mgt_orb_timeout;
+- } else {
++ break;
++
++ case SBP2_RECONNECT_REQUEST:
++ timeout = min(SBP2_MAX_RECONNECT_ORB_TIMEOUT,
++ lu->tgt->mgt_orb_timeout);
++ break;
++
++ default:
+ timeout = SBP2_ORB_TIMEOUT;
++ break;
+ }
+
+ 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>
---
- drivers/firewire/fw-device.c | 41 +++++++++++++++++++++++------------
- 1 file changed, 27 insertions(+), 14 deletions(-)
+
+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
-@@ -400,6 +400,9 @@ read_rom(struct fw_device *device, int g
+@@ -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 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
- * the config ROM. We do all this with a cached bus generation. If the bus
-@@ -409,16 +412,23 @@ read_rom(struct fw_device *device, int g
+@@ -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)
++static int read_bus_info_block(struct fw_device *device, int generation,
++ struct config_rom_image *rom_img)
{
-- static u32 rom[256];
-- u32 stack[16], sp, key;
-- int i, end, length;
-+ u32 *rom, *stack;
-+ u32 sp, key;
-+ int i, end, length, ret = -1;
-+
-+ rom = kmalloc(sizeof(*rom) * READ_BIB_ROM_SIZE +
-+ sizeof(*stack) * READ_BIB_STACK_SIZE, GFP_KERNEL);
-+ if (rom == NULL)
-+ return -ENOMEM;
-+
-+ stack = &rom[READ_BIB_ROM_SIZE];
+- 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)
-- return -1;
-+ goto out;
+- 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
-@@ -428,7 +438,7 @@ static int read_bus_info_block(struct fw
+- * 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)
-- return -1;
-+ goto out;
+- goto out;
++ return -EAGAIN;
}
device->max_speed = device->node->max_speed;
-@@ -478,26 +488,26 @@ static int read_bus_info_block(struct fw
+@@ -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 >= ARRAY_SIZE(rom))
-+ if (i >= READ_BIB_ROM_SIZE)
+- 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, something's fishy.
++ * config ROM area.
*/
-- return -1;
-+ goto out;
-
+- 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)
-- return -1;
-+ goto out;
+- 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 > ARRAY_SIZE(rom))
-+ if (end > READ_BIB_ROM_SIZE)
+- 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.
*/
-- return -1;
-+ goto out;
-
+- goto out;
+-
++ return -EINVAL;
++ }
/*
* Now read in the block. If this is a directory
-@@ -507,9 +517,9 @@ static int read_bus_info_block(struct fw
+ * 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)
-- return -1;
-+ goto out;
+- 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 < ARRAY_SIZE(stack))
-+ sp < READ_BIB_STACK_SIZE)
+- sp < READ_BIB_STACK_SIZE)
++ sp < ARRAY_SIZE(stack))
stack[sp++] = i + rom[i];
i++;
}
-@@ -519,11 +529,14 @@ static int read_bus_info_block(struct fw
+@@ -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;
- device->config_rom = kmalloc(length * 4, GFP_KERNEL);
- if (device->config_rom == NULL)
-- return -1;
-+ goto out;
- memcpy(device->config_rom, rom, length * 4);
- device->config_rom_length = length;
-+ ret = 0;
-+ out:
-+ kfree(rom);
+ 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 0;
-+ return ret;
+- 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)
-
---
-Stefan Richter
--=====-==--- --== ---=-
-http://arcgraph.de/sr/
-
-
-When a device changes its configuration ROM, it announces this with a
-bus reset. firewire-core has to check which node initiated a bus reset
-and whether any unit directories went away or were added on this node.
-
-Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
-power is available but does not respond to ROM read requests if self
-power is off. This implements
- - recognition of the units if self power is switched on after fw-core
- gave up the initial attempt to read the config ROM,
- - shutdown of the units when self power is switched off.
-
-Also tested with a second PC running Linux/ieee1394. When the eth1394
-driver is inserted and removed on that node, fw-core now notices the
-addition and removal of the IPv4 unit on the ieee1394 node.
-
-Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
----
-
-Applies after "firewire: replace static ROM cache by allocated cache".
-
- drivers/firewire/fw-cdev.c | 18 ++--
- drivers/firewire/fw-device.c | 147 ++++++++++++++++++++++++++++++---
- drivers/firewire/fw-topology.c | 3
- drivers/firewire/fw-topology.h | 11 +-
- 4 files changed, 158 insertions(+), 21 deletions(-)
-
-Index: linux/drivers/firewire/fw-cdev.c
-===================================================================
---- linux.orig/drivers/firewire/fw-cdev.c
-+++ linux/drivers/firewire/fw-cdev.c
-@@ -32,6 +32,7 @@
- #include <linux/idr.h>
- #include <linux/compat.h>
- #include <linux/firewire-cdev.h>
-+#include <asm/semaphore.h>
- #include <asm/system.h>
- #include <asm/uaccess.h>
- #include "fw-transaction.h"
-@@ -269,20 +270,25 @@ static int ioctl_get_info(struct client
{
- struct fw_cdev_get_info *get_info = buffer;
- struct fw_cdev_event_bus_reset bus_reset;
-+ struct fw_device *device = client->device;
-+ unsigned long ret = 0;
-
- client->version = get_info->version;
- get_info->version = FW_CDEV_VERSION;
-
-+ down(&device->device.sem);
- if (get_info->rom != 0) {
- void __user *uptr = u64_to_uptr(get_info->rom);
- size_t want = get_info->rom_length;
-- size_t have = client->device->config_rom_length * 4;
-+ size_t have;
-
-- if (copy_to_user(uptr, client->device->config_rom,
-- min(want, have)))
-- return -EFAULT;
-+ have = device->config_rom_length * 4;
-+ ret = copy_to_user(uptr, device->config_rom, min(want, have));
- }
-- get_info->rom_length = client->device->config_rom_length * 4;
-+ get_info->rom_length = device->config_rom_length * 4;
-+ up(&device->device.sem);
-+ if (ret != 0)
-+ return -EFAULT;
-
- client->bus_reset_closure = get_info->bus_reset_closure;
- if (get_info->bus_reset != 0) {
-@@ -293,7 +299,7 @@ static int ioctl_get_info(struct client
- return -EFAULT;
+ 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;
}
-- get_info->card = client->device->card->index;
-+ get_info->card = device->card->index;
+ 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 0;
- }
-Index: linux/drivers/firewire/fw-device.c
-===================================================================
---- linux.orig/drivers/firewire/fw-device.c
-+++ linux/drivers/firewire/fw-device.c
-@@ -26,6 +26,7 @@
- #include <linux/delay.h>
- #include <linux/idr.h>
- #include <linux/rwsem.h>
-+#include <linux/string.h>
- #include <asm/semaphore.h>
- #include <asm/system.h>
- #include <linux/ctype.h>
-@@ -160,9 +161,9 @@ static void fw_device_release(struct dev
- * Take the card lock so we don't set this to NULL while a
- * FW_NODE_UPDATED callback is being handled.
- */
-- spin_lock_irqsave(&device->card->lock, flags);
-+ spin_lock_irqsave(&card->lock, flags);
- device->node->data = NULL;
-- spin_unlock_irqrestore(&device->card->lock, flags);
-+ spin_unlock_irqrestore(&card->lock, flags);
-
- fw_node_put(device->node);
- kfree(device->config_rom);
-@@ -337,10 +338,14 @@ static ssize_t
- config_rom_show(struct device *dev, struct device_attribute *attr, char *buf)
- {
- struct fw_device *device = fw_device(dev);
-+ size_t length;
+- return;
++ goto out;
-- memcpy(buf, device->config_rom, device->config_rom_length * 4);
-+ down(&dev->sem);
-+ length = device->config_rom_length * 4;
-+ memcpy(buf, device->config_rom, length);
-+ up(&dev->sem);
+ 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 */
-- return device->config_rom_length * 4;
-+ return length;
+ put_device(&device->device); /* our reference */
++ out:
++ kfree(rom_img);
}
- static ssize_t
-@@ -412,7 +417,7 @@ read_rom(struct fw_device *device, int g
- */
- static int read_bus_info_block(struct fw_device *device, int generation)
- {
-- u32 *rom, *stack;
-+ u32 *rom, *stack, *old_rom, *new_rom;
- u32 sp, key;
- int i, end, length, ret = -1;
-
-@@ -527,11 +532,18 @@ static int read_bus_info_block(struct fw
- length = i;
- }
+ 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);
-- device->config_rom = kmalloc(length * 4, GFP_KERNEL);
-- if (device->config_rom == NULL)
-+ old_rom = device->config_rom;
-+ new_rom = kmemdup(rom, length * 4, GFP_KERNEL);
-+ if (new_rom == NULL)
- goto out;
-- memcpy(device->config_rom, rom, length * 4);
-+
-+ /* serialize with readers via sysfs or ioctl */
-+ down(&device->device.sem);
-+ device->config_rom = new_rom;
- device->config_rom_length = length;
-+ up(&device->device.sem);
+- if (read_bus_info_block(device, device->generation) < 0) {
++ rom_img = kzalloc(sizeof(*rom_img), GFP_KERNEL);
+
-+ kfree(old_rom);
- ret = 0;
- out:
- kfree(rom);
-@@ -724,7 +736,7 @@ static void fw_device_init(struct work_s
- if (atomic_cmpxchg(&device->state,
- FW_DEVICE_INITIALIZING,
- FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
-- fw_device_shutdown(&device->work.work);
-+ fw_device_shutdown(work);
- } else {
- if (device->config_rom_retries)
- fw_notify("created device %s: GUID %08x%08x, S%d00, "
-@@ -738,6 +750,7 @@ static void fw_device_init(struct work_s
- device->device.bus_id,
- device->config_rom[3], device->config_rom[4],
- 1 << device->max_speed);
-+ device->config_rom_retries = 0;
++ 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
- /*
-@@ -784,6 +797,104 @@ static void fw_device_update(struct work
- device_for_each_child(&device->device, NULL, update_unit);
+ 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);
}
-+enum {
-+ REREAD_BIB_ERROR,
-+ REREAD_BIB_GONE,
-+ REREAD_BIB_UNCHANGED,
-+ REREAD_BIB_CHANGED,
-+};
-+
-+/* Reread and compare bus info block and header of root directory */
-+static int reread_bus_info_block(struct fw_device *device, int generation)
-+{
-+ u32 q;
-+ int i;
-+
-+ for (i = 0; i < 6; i++) {
-+ if (read_rom(device, generation, i, &q) != RCODE_COMPLETE)
-+ return REREAD_BIB_ERROR;
-+
-+ if (i == 0 && q == 0)
-+ return REREAD_BIB_GONE;
-+
-+ if (i > device->config_rom_length || q != device->config_rom[i])
-+ return REREAD_BIB_CHANGED;
-+ }
-+
-+ return REREAD_BIB_UNCHANGED;
-+}
-+
-+static void fw_device_refresh(struct work_struct *work)
-+{
-+ struct fw_device *device =
-+ container_of(work, struct fw_device, work.work);
-+ struct fw_card *card = device->card;
-+ int node_id = device->node_id;
-+
-+ switch (reread_bus_info_block(device, device->generation)) {
-+ case REREAD_BIB_ERROR:
-+ if (device->config_rom_retries < MAX_RETRIES / 2 &&
-+ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
-+ device->config_rom_retries++;
-+ schedule_delayed_work(&device->work, RETRY_DELAY / 2);
-+
-+ return;
-+ }
-+ goto give_up;
-+
-+ case REREAD_BIB_GONE:
-+ goto gone;
-+
-+ case REREAD_BIB_UNCHANGED:
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_INITIALIZING,
-+ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
-+ goto gone;
-+
-+ fw_device_update(work);
-+ device->config_rom_retries = 0;
-+
-+ return;
-+ }
-+
-+ /*
-+ * Something changed. We keep things simple and don't investigate
-+ * further. We just destroy all previous units and create new ones.
-+ */
-+ device_for_each_child(&device->device, NULL, shutdown_unit);
-+
-+ if (read_bus_info_block(device, device->generation) < 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 give_up;
-+ }
-+
-+ create_units(device);
-+
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_INITIALIZING,
-+ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
-+ goto gone;
-+
-+ fw_notify("refreshed device %s\n", device->device.bus_id);
-+ device->config_rom_retries = 0;
-+ goto out;
-+
-+ 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:
-+ if (node_id == card->root_node->node_id)
-+ schedule_delayed_work(&card->work, 0);
-+}
-+
void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
- {
- struct fw_device *device;
-@@ -793,7 +904,7 @@ void fw_node_event(struct fw_card *card,
- case FW_NODE_LINK_ON:
- if (!node->link_on)
- break;
--
-+ create:
- device = kzalloc(sizeof(*device), GFP_ATOMIC);
- if (device == NULL)
- break;
-@@ -832,6 +943,22 @@ void fw_node_event(struct fw_card *card,
- schedule_delayed_work(&device->work, INITIAL_DELAY);
- break;
-
-+ case FW_NODE_INITIATED_RESET:
-+ device = node->data;
-+ if (device == NULL)
-+ goto create;
-+
-+ device->node_id = node->node_id;
-+ smp_wmb(); /* update node_id before generation */
-+ device->generation = card->generation;
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_RUNNING,
-+ FW_DEVICE_INITIALIZING) == FW_DEVICE_RUNNING) {
-+ PREPARE_DELAYED_WORK(&device->work, fw_device_refresh);
-+ schedule_delayed_work(&device->work, INITIAL_DELAY);
-+ }
-+ break;
-+
- case FW_NODE_UPDATED:
- if (!node->link_on || node->data == NULL)
- break;
-Index: linux/drivers/firewire/fw-topology.c
+Index: linux/drivers/firewire/fw-device.h
===================================================================
---- linux.orig/drivers/firewire/fw-topology.c
-+++ linux/drivers/firewire/fw-topology.c
-@@ -107,6 +107,7 @@ static struct fw_node *fw_node_create(u3
- node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
- node->link_on = SELF_ID_LINK_ON(sid);
- node->phy_speed = SELF_ID_PHY_SPEED(sid);
-+ node->initiated_reset = SELF_ID_PHY_INITIATOR(sid);
- node->port_count = port_count;
-
- atomic_set(&node->ref_count, 1);
-@@ -430,6 +431,8 @@ update_tree(struct fw_card *card, struct
- event = FW_NODE_LINK_OFF;
- else if (!node0->link_on && node1->link_on)
- event = FW_NODE_LINK_ON;
-+ else if (node1->initiated_reset && node1->link_on)
-+ event = FW_NODE_INITIATED_RESET;
- else
- event = FW_NODE_UPDATED;
+--- 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
-Index: linux/drivers/firewire/fw-topology.h
-===================================================================
---- linux.orig/drivers/firewire/fw-topology.h
-+++ linux/drivers/firewire/fw-topology.h
-@@ -20,11 +20,12 @@
- #define __fw_topology_h
-
- enum {
-- FW_NODE_CREATED = 0x00,
-- FW_NODE_UPDATED = 0x01,
-- FW_NODE_DESTROYED = 0x02,
-- FW_NODE_LINK_ON = 0x03,
-- FW_NODE_LINK_OFF = 0x04,
-+ FW_NODE_CREATED,
-+ FW_NODE_UPDATED,
-+ FW_NODE_DESTROYED,
-+ FW_NODE_LINK_ON,
-+ FW_NODE_LINK_OFF,
-+ FW_NODE_INITIATED_RESET,
- };
-
- struct fw_node {
+ struct fw_csr_iterator {
--
Stefan Richter
--=====-==--- --== ---==
+-=====-==--- --== -=---
http://arcgraph.de/sr/
-Increase reconnect management orb timeout value.
-
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
----
-
- drivers/firewire/fw-sbp2.c | 15 +++++++++++++--
- 1 files changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
-index d6d62c6..da315cf 100644
---- a/drivers/firewire/fw-sbp2.c
-+++ b/drivers/firewire/fw-sbp2.c
-@@ -170,6 +170,7 @@ struct sbp2_target {
- */
- #define SBP2_MIN_LOGIN_ORB_TIMEOUT 5000U /* Timeout in ms */
- #define SBP2_MAX_LOGIN_ORB_TIMEOUT 40000U /* Timeout in ms */
-+#define SBP2_MAX_RECONNECT_ORB_TIMEOUT 6000U /* Timeout in ms */
- #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
- #define SBP2_ORB_NULL 0x80000000
- #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
-@@ -538,14 +539,24 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
- orb->request.status_fifo.low =
- cpu_to_be32(lu->address_handler.offset);
-
-- if (function == SBP2_LOGIN_REQUEST) {
-+ switch (function) {
-+
-+ case SBP2_LOGIN_REQUEST:
- /* Ask for 2^2 == 4 seconds reconnect grace period */
- orb->request.misc |= cpu_to_be32(
- MANAGEMENT_ORB_RECONNECT(2) |
- MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login));
- timeout = lu->tgt->mgt_orb_timeout;
-- } else {
-+ break;
-+
-+ case SBP2_RECONNECT_REQUEST:
-+ timeout = min(SBP2_MAX_RECONNECT_ORB_TIMEOUT,
-+ lu->tgt->mgt_orb_timeout);
-+ break;
-+
-+ default:
- timeout = SBP2_ORB_TIMEOUT;
-+ break;
- }
-
- init_completion(&orb->done);
-
-
-
-Per the SBP-2 specification, all SBP-2 target devices must have a BUSY_TIMEOUT
-register. Per the 1394-1995 specification, the retry_limt portion of the
-register should be set to 0x0 initially, and set on the target by a logged in
-initiator (i.e., a Linux host w/firewire controller(s)).
-
-Well, as it turns out, lots of devices these days have actually moved on to
-starting to implement SBP-3 compliance, which says that retry_limit should
-default to 0xf instead (yes, SBP-3 stomps directly on 1394-1995, oops).
-
-Prior to this change, the firewire driver stack didn't touch retry_limit, and
-any SBP-3 compliant device worked fine, while SBP-2 compliant ones were unable
-to retransmit when the host returned an ack_busy_X, which resulted in stalled
-out I/O, eventually causing the SCSI layer to give up and offline the device.
-
-The simple fix is for us to set retry_limit to 0xf in the register for all
-devices (which actually matches what the old ieee1394 stack did).
-
-Prior to this change, a hard disk behind an SBP-2 Prolific PL-3507 bridge chip
-would routinely encounter buffer I/O errors and wind up offlined by the SCSI
-layer. With this change, I've encountered zero I/O failures moving tens of GB
-of data around.
-
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
-
----
-
-Update: use CSR_BUSY_TIMEOUT from fw-transaction.h instead of needlessly
- creating an SBP2_BUSY_TIMEOUT
-
- drivers/firewire/fw-sbp2.c | 31 +++++++++++++++++++++++++++----
- 1 files changed, 27 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
-index d6d62c6..fbf5b7a 100644
---- a/drivers/firewire/fw-sbp2.c
-+++ b/drivers/firewire/fw-sbp2.c
-@@ -173,6 +173,7 @@ struct sbp2_target {
- #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
- #define SBP2_ORB_NULL 0x80000000
- #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
-+#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
-
- /* Unit directory keys */
- #define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a
-@@ -800,6 +801,30 @@ static void sbp2_target_put(struct sbp2_target *tgt)
- kref_put(&tgt->kref, sbp2_release_target);
- }
-
-+static void
-+complete_set_busy_timeout(struct fw_card *card, int rcode,
-+ void *payload, size_t length, void *done)
-+{
-+ complete(done);
-+}
-+
-+static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
-+{
-+ struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
-+ DECLARE_COMPLETION_ONSTACK(done);
-+ struct fw_transaction t;
-+ static u32 busy_timeout;
-+
-+ /* FIXME: we should try to set dual-phase cycle_limit too */
-+ busy_timeout = cpu_to_be32(SBP2_RETRY_LIMIT);
-+
-+ fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
-+ lu->tgt->node_id, lu->generation, device->max_speed,
-+ CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, &busy_timeout,
-+ sizeof(busy_timeout), complete_set_busy_timeout, &done);
-+ wait_for_completion(&done);
-+}
-+
- static void sbp2_reconnect(struct work_struct *work);
-
- static void sbp2_login(struct work_struct *work)
-@@ -851,10 +876,8 @@ static void sbp2_login(struct work_struct *work)
- fw_notify("%s: logged in to LUN %04x (%d retries)\n",
- tgt->bus_id, lu->lun, lu->retries);
-
--#if 0
-- /* FIXME: The linux1394 sbp2 does this last step. */
-- sbp2_set_busy_timeout(scsi_id);
--#endif
-+ /* set appropriate retry limit(s) in BUSY_TIMEOUT register */
-+ sbp2_set_busy_timeout(lu);
-
- PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect);
- sbp2_agent_reset(lu);
-
----
-
-Try to write dual-phase retry protocol limits to BUSY_TIMEOUT register.
-- The dual-phase retry protocol is optional to implement, and if not
- supported, writes to the dual-phase portion of the register will be
- ignored. We try to write the original 1394-1995 default here.
-- In the case of devices that are also SBP-3-compliant, all writes are
- ignored, as the register is read-only, but contains single-phase retry of
- 15, which is what we're trying to set for all SBP-2 device anyway, so this
- write attempt is safe and yields more consistent behavior for all devices.
-
-See section 8.3.2.3.5 of the 1394-1995 spec, section 6.2 of the SBP-2 spec,
-and section 6.4 of the SBP-3 spec for further details.
-
-Signed-off-by: Jarod Wilson <jwilson at redhat.com>
----
-
-Update: refresh for updated patch 1/2 using CSR_BUSY_TIMEOUT
-
- drivers/firewire/fw-sbp2.c | 22 +++++++++++++++++++---
- 1 files changed, 19 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
-index fbf5b7a..763f653 100644
---- a/drivers/firewire/fw-sbp2.c
-+++ b/drivers/firewire/fw-sbp2.c
-@@ -173,7 +173,8 @@ struct sbp2_target {
- #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
- #define SBP2_ORB_NULL 0x80000000
- #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
--#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
-+#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
-+#define SBP2_CYCLE_LIMIT (0xc8 << 12) /* 200 125us cycles */
-
- /* Unit directory keys */
- #define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a
-@@ -808,6 +809,22 @@ complete_set_busy_timeout(struct fw_card *card, int rcode,
- complete(done);
- }
-
-+/*
-+ * Write retransmit retry values into the BUSY_TIMEOUT register.
-+ * - The single-phase retry protocol is supported by all SBP-2 devices, but the
-+ * default retry_limit value is 0 (i.e. never retry transmission). We write a
-+ * saner value after logging into the device.
-+ * - The dual-phase retry protocol is optional to implement, and if not
-+ * supported, writes to the dual-phase portion of the register will be
-+ * ignored. We try to write the original 1394-1995 default here.
-+ * - In the case of devices that are also SBP-3-compliant, all writes are
-+ * ignored, as the register is read-only, but contains single-phase retry of
-+ * 15, which is what we're trying to set for all SBP-2 device anyway, so this
-+ * write attempt is safe and yields more consistent behavior for all devices.
-+ *
-+ * See section 8.3.2.3.5 of the 1394-1995 spec, section 6.2 of the SBP-2 spec,
-+ * and section 6.4 of the SBP-3 spec for further details.
-+ */
- static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
- {
- struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
-@@ -815,8 +832,7 @@ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
- struct fw_transaction t;
- static u32 busy_timeout;
-
-- /* FIXME: we should try to set dual-phase cycle_limit too */
-- busy_timeout = cpu_to_be32(SBP2_RETRY_LIMIT);
-+ busy_timeout = cpu_to_be32(SBP2_CYCLE_LIMIT | SBP2_RETRY_LIMIT);
-
- fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
- lu->tgt->node_id, lu->generation, device->max_speed,
-
-
-
linux-2.6-firewire-git-update.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.4 -r 1.5 linux-2.6-firewire-git-update.patch
Index: linux-2.6-firewire-git-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-firewire-git-update.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-firewire-git-update.patch 4 Mar 2008 05:03:18 -0000 1.4
+++ linux-2.6-firewire-git-update.patch 14 Mar 2008 19:36:06 -0000 1.5
@@ -1,26 +1,220 @@
-IEEE 1394 updates for Linux 2.6.24 (v659 2008-03-02)
+IEEE 1394 updates for Linux 2.6.24 (v669 2008-03-11)
MAINTAINERS | 4
+ drivers/firewire/Kconfig | 50 -
drivers/firewire/fw-card.c | 99 +--
- drivers/firewire/fw-cdev.c | 20
- drivers/firewire/fw-device.c | 107 ++--
- drivers/firewire/fw-device.h | 49 +
- drivers/firewire/fw-ohci.c | 494 ++++++++++++-------
- drivers/firewire/fw-sbp2.c | 588 +++++++++++++++--------
- drivers/firewire/fw-topology.c | 7
- drivers/firewire/fw-transaction.c | 6
+ drivers/firewire/fw-cdev.c | 33 -
+ drivers/firewire/fw-device.c | 360 +++++++++---
+ drivers/firewire/fw-device.h | 60 +-
+ drivers/firewire/fw-ohci.c | 633 ++++++++++++++++------
+ drivers/firewire/fw-sbp2.c | 647 ++++++++++++++++-------
+ drivers/firewire/fw-topology.c | 13
+ drivers/firewire/fw-topology.h | 11
+ drivers/firewire/fw-transaction.c | 17
drivers/firewire/fw-transaction.h | 12
drivers/ieee1394/dma.c | 37 -
drivers/ieee1394/dv1394.c | 3
+ drivers/ieee1394/highlevel.c | 6
+ drivers/ieee1394/ieee1394_core.c | 2
drivers/ieee1394/ieee1394_transactions.c | 68 --
drivers/ieee1394/nodemgr.c | 6
- drivers/ieee1394/ohci1394.c | 121 ++--
+ drivers/ieee1394/ohci1394.c | 123 ++--
+ drivers/ieee1394/pcilynx.c | 12
drivers/ieee1394/raw1394.c | 5
- drivers/ieee1394/sbp2.c | 67 +-
+ drivers/ieee1394/sbp2.c | 71 +-
drivers/ieee1394/sbp2.h | 3
drivers/ieee1394/video1394.c | 3
lib/Kconfig.debug | 11
- 20 files changed, 1042 insertions(+), 668 deletions(-)
+ 25 files changed, 1511 insertions(+), 778 deletions(-)
+
+========================================================================
+Date: Mon, 10 Mar 2008 23:28:07 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: firewire: debug AT, AR, and selfID-complete events
+
+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.
+
+This code inflates firewire-ohci.ko by 6 kB = 24% on x86-64 and
+by 4 kB = 20% on i686.
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-ohci.c | 139 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 139 insertions(+)
+
+========================================================================
+Date: Sun, 9 Mar 2008 00:27:20 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: firewire: update Kconfig help text
+
+Remove some less necessary information, point out that video1394 and
+dv1394 should be blacklisted along with ohci1394.
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/Kconfig | 50 ++++++++++++++-------------------------
+ 1 file changed, 19 insertions(+), 31 deletions(-)
+
+========================================================================
+Date: Sat, 8 Mar 2008 22:38:16 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: firewire: warn on fatal condition in topology code
+
+If this ever happens to anybody, we want to have it in his log.
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-topology.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+========================================================================
+Date: Sat, 8 Mar 2008 13:18:58 -0500
+From: Jarod Wilson <jwilson at redhat.com>
+Subject: firewire: use bitwise and to get reg in handle_registers
+
+for code efficiency.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-transaction.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+========================================================================
+Date: Sat, 8 Mar 2008 12:52:03 -0500
+From: Jarod Wilson <jwilson at redhat.com>
+Subject: firewire: replace more hex values with defined csr constants
+
+Trivial change to replace more meaningless (to the untrained eye) hex
+values with defined CSR constants.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-device.c | 2 +-
+ drivers/firewire/fw-transaction.c | 9 ++++++---
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+========================================================================
+Date: Fri, 7 Mar 2008 01:43:31 -0500
+From: Jarod Wilson <jwilson at redhat.com>
+Subject: firewire: fw-sbp2: set dual-phase cycle_limit
+
+Try to write dual-phase retry protocol limits to BUSY_TIMEOUT register.
+- The dual-phase retry protocol is optional to implement, and if not
+ supported, writes to the dual-phase portion of the register will be
+ ignored. We try to write the original 1394-1995 default here.
+- In the case of devices that are also SBP-3-compliant, all writes are
+ ignored, as the register is read-only, but contains single-phase retry of
+ 15, which is what we're trying to set for all SBP-2 device anyway, so this
+ write attempt is safe and yields more consistent behavior for all devices.
+
+See section 8.3.2.3.5 of the 1394-1995 spec, section 6.2 of the SBP-2 spec,
+and section 6.4 of the SBP-3 spec for further details.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-sbp2.c | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+========================================================================
+Date: Fri, 7 Mar 2008 01:43:01 -0500
+From: Jarod Wilson <jwilson at redhat.com>
+Subject: firewire: fw-sbp2: set single-phase retry_limit
+
+Per the SBP-2 specification, all SBP-2 target devices must have a BUSY_TIMEOUT
+register. Per the 1394-1995 specification, the retry_limt portion of the
+register should be set to 0x0 initially, and set on the target by a logged in
+initiator (i.e., a Linux host w/firewire controller(s)).
+
+Well, as it turns out, lots of devices these days have actually moved on to
+starting to implement SBP-3 compliance, which says that retry_limit should
+default to 0xf instead (yes, SBP-3 stomps directly on 1394-1995, oops).
+
+Prior to this change, the firewire driver stack didn't touch retry_limit, and
+any SBP-3 compliant device worked fine, while SBP-2 compliant ones were unable
+to retransmit when the host returned an ack_busy_X, which resulted in stalled
+out I/O, eventually causing the SCSI layer to give up and offline the device.
+
+The simple fix is for us to set retry_limit to 0xf in the register for all
+devices (which actually matches what the old ieee1394 stack did).
+
+Prior to this change, a hard disk behind an SBP-2 Prolific PL-3507 bridge chip
+would routinely encounter buffer I/O errors and wind up offlined by the SCSI
+layer. With this change, I've encountered zero I/O failures moving tens of GB
+of data around.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-sbp2.c | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
+
+========================================================================
+Date: Wed, 05 Mar 2008 18:24:54 -0800
+From: Harvey Harrison <harvey.harrison at gmail.com>
+Subject: ieee1394: replace remaining __FUNCTION__ occurrences
+
+__FUNCTION__ is gcc-specific, use __func__
+
+Signed-off-by: Harvey Harrison <harvey.harrison at gmail.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/ieee1394/highlevel.c | 6 +++---
+ drivers/ieee1394/ieee1394_core.c | 2 +-
+ drivers/ieee1394/ohci1394.c | 2 +-
+ drivers/ieee1394/pcilynx.c | 12 ++++++------
+ drivers/ieee1394/sbp2.c | 4 ++--
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+========================================================================
+Date: Wed, 5 Mar 2008 01:34:55 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: firewire: reread config ROM when device reset the bus
+
+When a device changes its configuration ROM, it announces this with a
+bus reset. firewire-core has to check which node initiated a bus reset
[...1954 lines suppressed...]
+
source "samples/Kconfig"
+Index: linux-2.6.24/drivers/firewire/fw-topology.h
+===================================================================
+--- linux-2.6.24.orig/drivers/firewire/fw-topology.h
++++ linux-2.6.24/drivers/firewire/fw-topology.h
+@@ -20,11 +20,12 @@
+ #define __fw_topology_h
+
+ enum {
+- FW_NODE_CREATED = 0x00,
+- FW_NODE_UPDATED = 0x01,
+- FW_NODE_DESTROYED = 0x02,
+- FW_NODE_LINK_ON = 0x03,
+- FW_NODE_LINK_OFF = 0x04,
++ FW_NODE_CREATED,
++ FW_NODE_UPDATED,
++ FW_NODE_DESTROYED,
++ FW_NODE_LINK_ON,
++ FW_NODE_LINK_OFF,
++ FW_NODE_INITIATED_RESET,
+ };
+
+ struct fw_node {
+Index: linux-2.6.24/drivers/ieee1394/highlevel.c
+===================================================================
+--- linux-2.6.24.orig/drivers/ieee1394/highlevel.c
++++ linux-2.6.24/drivers/ieee1394/highlevel.c
+@@ -339,7 +339,7 @@ u64 hpsb_allocate_and_register_addrspace
+ if ((alignment & 3) || (alignment > 0x800000000000ULL) ||
+ (hweight64(alignment) != 1)) {
+ HPSB_ERR("%s called with invalid alignment: 0x%048llx",
+- __FUNCTION__, (unsigned long long)alignment);
++ __func__, (unsigned long long)alignment);
+ return retval;
+ }
+
+@@ -354,7 +354,7 @@ u64 hpsb_allocate_and_register_addrspace
+ if (((start|end) & ~align_mask) || (start >= end) ||
+ (end > CSR1212_ALL_SPACE_END)) {
+ HPSB_ERR("%s called with invalid addresses "
+- "(start = %012Lx end = %012Lx)", __FUNCTION__,
++ "(start = %012Lx end = %012Lx)", __func__,
+ (unsigned long long)start,(unsigned long long)end);
+ return retval;
+ }
+@@ -422,7 +422,7 @@ int hpsb_register_addrspace(struct hpsb_
+
+ if (((start|end) & 3) || (start >= end) ||
+ (end > CSR1212_ALL_SPACE_END)) {
+- HPSB_ERR("%s called with invalid addresses", __FUNCTION__);
++ HPSB_ERR("%s called with invalid addresses", __func__);
+ return 0;
+ }
+
+Index: linux-2.6.24/drivers/ieee1394/ieee1394_core.c
+===================================================================
+--- linux-2.6.24.orig/drivers/ieee1394/ieee1394_core.c
++++ linux-2.6.24/drivers/ieee1394/ieee1394_core.c
+@@ -242,7 +242,7 @@ int hpsb_bus_reset(struct hpsb_host *hos
+ {
+ if (host->in_bus_reset) {
+ HPSB_NOTICE("%s called while bus reset already in progress",
+- __FUNCTION__);
++ __func__);
+ return 1;
+ }
+
+Index: linux-2.6.24/drivers/ieee1394/pcilynx.c
+===================================================================
+--- linux-2.6.24.orig/drivers/ieee1394/pcilynx.c
++++ linux-2.6.24/drivers/ieee1394/pcilynx.c
+@@ -226,7 +226,7 @@ static int get_phy_reg(struct ti_lynx *l
+ if (addr > 15) {
+ PRINT(KERN_ERR, lynx->id,
+ "%s: PHY register address %d out of range",
+- __FUNCTION__, addr);
++ __func__, addr);
+ return -1;
+ }
+
+@@ -238,7 +238,7 @@ static int get_phy_reg(struct ti_lynx *l
+
+ if (i > 10000) {
+ PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting",
+- __FUNCTION__);
++ __func__);
+ retval = -1;
+ break;
+ }
+@@ -261,13 +261,13 @@ static int set_phy_reg(struct ti_lynx *l
+
+ if (addr > 15) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY register address %d out of range", __FUNCTION__, addr);
++ "%s: PHY register address %d out of range", __func__, addr);
+ return -1;
+ }
+
+ if (val > 0xff) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY register value %d out of range", __FUNCTION__, val);
++ "%s: PHY register value %d out of range", __func__, val);
+ return -1;
+ }
+
+@@ -287,7 +287,7 @@ static int sel_phy_reg_page(struct ti_ly
+
+ if (page > 7) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY page %d out of range", __FUNCTION__, page);
++ "%s: PHY page %d out of range", __func__, page);
+ return -1;
+ }
+
+@@ -309,7 +309,7 @@ static int sel_phy_reg_port(struct ti_ly
+
+ if (port > 15) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY port %d out of range", __FUNCTION__, port);
++ "%s: PHY port %d out of range", __func__, port);
+ return -1;
+ }
+
+Index: linux-2.6.24/drivers/firewire/Kconfig
+===================================================================
+--- linux-2.6.24.orig/drivers/firewire/Kconfig
++++ linux-2.6.24/drivers/firewire/Kconfig
+@@ -1,5 +1,3 @@
+-# -*- shell-script -*-
+-
+ comment "An alternative FireWire stack is available with EXPERIMENTAL=y"
+ depends on EXPERIMENTAL=n
+
+@@ -21,27 +19,7 @@ config FIREWIRE
+ NOTE:
+
+ You should only build ONE of the stacks, unless you REALLY know what
+- you are doing. If you install both, you should configure them only as
+- modules rather than link them statically, and you should blacklist one
+- of the concurrent low-level drivers in /etc/modprobe.conf. Add either
+-
+- blacklist firewire-ohci
+- or
+- blacklist ohci1394
+-
+- there depending on which driver you DON'T want to have auto-loaded.
+- You can optionally do the same with the other IEEE 1394/ FireWire
+- drivers.
+-
+- If you have an old modprobe which doesn't implement the blacklist
+- directive, use either
+-
+- install firewire-ohci /bin/true
+- or
+- install ohci1394 /bin/true
+-
+- and so on, depending on which modules you DON't want to have
+- auto-loaded.
++ you are doing.
+
+ config FIREWIRE_OHCI
+ tristate "Support for OHCI FireWire host controllers"
+@@ -57,8 +35,24 @@ config FIREWIRE_OHCI
+
+ NOTE:
+
+- If you also build ohci1394 of the classic stack, blacklist either
+- ohci1394 or firewire-ohci to let hotplug load only the desired driver.
++ You should only build ohci1394 or firewire-ohci, but not both.
++ If you nevertheless want to install both, you should configure them
++ only as modules and blacklist the driver(s) which you don't want to
++ have auto-loaded. Add either
++
++ blacklist firewire-ohci
++ or
++ blacklist ohci1394
++ blacklist video1394
++ blacklist dv1394
++
++ to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
++ depending on your distribution. The latter two modules should be
++ blacklisted together with ohci1394 because they depend on ohci1394.
++
++ If you have an old modprobe which doesn't implement the blacklist
++ directive, use "install modulename /bin/true" for the modules to be
++ blacklisted.
+
+ config FIREWIRE_SBP2
+ tristate "Support for storage devices (SBP-2 protocol driver)"
+@@ -75,9 +69,3 @@ config FIREWIRE_SBP2
+
+ You should also enable support for disks, CD-ROMs, etc. in the SCSI
+ configuration section.
+-
+- NOTE:
+-
+- If you also build sbp2 of the classic stack, blacklist either sbp2
+- or firewire-sbp2 to let hotplug load only the desired driver.
+-
More information about the fedora-extras-commits
mailing list