Author: maks Date: Wed Jan 23 10:38:41 2008 New Revision: 10169 Log: fw: sync with latest git, step two.
add the relevant sbp2 patches. Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-incr-login-orb-reply-timeout.patch dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-skip-unnecessary-logout.patch dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-try-increase-reconnect_hold.patch Modified: dists/trunk/linux-2.6/debian/changelog dists/trunk/linux-2.6/debian/patches/series/1~experimental.2 Modified: dists/trunk/linux-2.6/debian/changelog ============================================================================== --- dists/trunk/linux-2.6/debian/changelog (original) +++ dists/trunk/linux-2.6/debian/changelog Wed Jan 23 10:38:41 2008 @@ -10,8 +10,9 @@ [ maximilian attems ] * [amd64, i386]: Enable ACPI_SYSFS_POWER and disable ACPI_PROCFS_POWER. + * [fw] Sync with latest git-ieee1394 for sbp2 fixes. - -- maximilian attems <[EMAIL PROTECTED]> Tue, 22 Jan 2008 20:22:43 +0100 + -- maximilian attems <[EMAIL PROTECTED]> Wed, 23 Jan 2008 11:35:31 +0100 linux-2.6 (2.6.24~rc8-1~experimental.1) experimental; urgency=low Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-incr-login-orb-reply-timeout.patch ============================================================================== --- (empty file) +++ dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-incr-login-orb-reply-timeout.patch Wed Jan 23 10:38:41 2008 @@ -0,0 +1,68 @@ +From: Jarod Wilson <[EMAIL PROTECTED]> +Date: Sat, 19 Jan 2008 12:15:05 +0000 (+0100) +Subject: firewire: fw-sbp2: increase login orb reply timeout, fix "failed to login" +X-Git-Url: http://git.eu.kernel.org/?p=linux%2Fkernel%2Fgit%2Fieee1394%2Flinux1394-2.6.git;a=commitdiff_plain;h=a1c0f0c7405a932a760c371afe74124bdedfe874 + +firewire: fw-sbp2: increase login orb reply timeout, fix "failed to login" + +Increase (and rename) the login orb reply timeout value to 20s +to match that of the old firewire stack. 2s simply didn't give +many devices enough time to spin up and reply. + +Fixes inability to recognize some devices. +Failure mode was "orb reply timed out"/"failed to login". + +Signed-off-by: Jarod Wilson <[EMAIL PROTECTED]> +Signed-off-by: Stefan Richter <[EMAIL PROTECTED]> (style, comments, changelog) +--- + +diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c +index 6064c6e..05dd188 100644 +--- a/drivers/firewire/fw-sbp2.c ++++ b/drivers/firewire/fw-sbp2.c +@@ -150,9 +150,16 @@ struct sbp2_target { + struct list_head lu_list; + }; + +-#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 ++/* ++ * Per section 7.4.8 of the SBP-2 spec, a mgt_ORB_timeout value can be ++ * provided in the config rom. A high timeout value really only matters ++ * on initial login, where we'll just use 20s rather than hassling with ++ * reading the config rom, since it really wouldn't buy us much. ++ */ ++#define SBP2_LOGIN_ORB_TIMEOUT 20000 /* Timeout in ms */ + #define SBP2_ORB_TIMEOUT 2000 /* Timeout in ms */ + #define SBP2_ORB_NULL 0x80000000 ++#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 + + #define SBP2_DIRECTION_TO_MEDIA 0x0 + #define SBP2_DIRECTION_FROM_MEDIA 0x1 +@@ -487,6 +494,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, + { + struct fw_device *device = fw_device(lu->tgt->unit->device.parent); + struct sbp2_management_orb *orb; ++ unsigned int timeout; + int retval = -ENOMEM; + + orb = kzalloc(sizeof(*orb), GFP_ATOMIC); +@@ -517,6 +525,9 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, + orb->request.misc |= + MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login) | + MANAGEMENT_ORB_RECONNECT(0); ++ timeout = SBP2_LOGIN_ORB_TIMEOUT; ++ } else { ++ timeout = SBP2_ORB_TIMEOUT; + } + + fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request)); +@@ -533,8 +544,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, + sbp2_send_orb(&orb->base, lu, node_id, generation, + lu->tgt->management_agent_address); + +- wait_for_completion_timeout(&orb->done, +- msecs_to_jiffies(SBP2_ORB_TIMEOUT)); ++ wait_for_completion_timeout(&orb->done, msecs_to_jiffies(timeout)); + + retval = -EIO; + if (sbp2_cancel_orbs(lu) == 0) { Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-skip-unnecessary-logout.patch ============================================================================== --- (empty file) +++ dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-skip-unnecessary-logout.patch Wed Jan 23 10:38:41 2008 @@ -0,0 +1,40 @@ +From: Stefan Richter <[EMAIL PROTECTED]> +Date: Sun, 20 Jan 2008 00:24:26 +0000 (+0100) +Subject: firewire: fw-sbp2: skip unnecessary logout +X-Git-Url: http://git.eu.kernel.org/?p=linux%2Fkernel%2Fgit%2Fieee1394%2Flinux1394-2.6.git;a=commitdiff_plain;h=13ddc9e12470ad4cf2dcb954a747f6d8e6a1899b + +firewire: fw-sbp2: skip unnecessary logout + +Don't attempt to send a logout ORB if the target was already unplugged +or had its link switched off. If two targets are attached, this +enhances the chance to quickly reconnect to the remaining target when +one target is plugged out. + +Signed-off-by: Stefan Richter <[EMAIL PROTECTED]> +Acked-by: Jarod Wilson <[EMAIL PROTECTED]> +--- + +diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c +index 05dd188..b5e9a64 100644 +--- a/drivers/firewire/fw-sbp2.c ++++ b/drivers/firewire/fw-sbp2.c +@@ -628,13 +628,17 @@ static void sbp2_release_target(struct kref *kref) + struct sbp2_logical_unit *lu, *next; + struct Scsi_Host *shost = + container_of((void *)tgt, struct Scsi_Host, hostdata[0]); ++ struct fw_device *device = fw_device(tgt->unit->device.parent); + + list_for_each_entry_safe(lu, next, &tgt->lu_list, link) { + if (lu->sdev) + scsi_remove_device(lu->sdev); + +- sbp2_send_management_orb(lu, tgt->node_id, lu->generation, +- SBP2_LOGOUT_REQUEST, lu->login_id, NULL); ++ if (!fw_device_is_shutdown(device)) ++ sbp2_send_management_orb(lu, tgt->node_id, ++ lu->generation, SBP2_LOGOUT_REQUEST, ++ lu->login_id, NULL); ++ + fw_core_remove_address_handler(&lu->address_handler); + list_del(&lu->link); + kfree(lu); Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-try-increase-reconnect_hold.patch ============================================================================== --- (empty file) +++ dists/trunk/linux-2.6/debian/patches/bugfix/all/fw-sbp2-try-increase-reconnect_hold.patch Wed Jan 23 10:38:41 2008 @@ -0,0 +1,62 @@ +From: Stefan Richter <[EMAIL PROTECTED]> +Date: Sun, 20 Jan 2008 00:25:31 +0000 (+0100) +Subject: firewire: fw-sbp2: try to increase reconnect_hold (speed up reconnection) +X-Git-Url: http://git.eu.kernel.org/?p=linux%2Fkernel%2Fgit%2Fieee1394%2Flinux1394-2.6.git;a=commitdiff_plain;h=b6fdd2a6c4d905c9343153e6c385518edaaf6727 + +firewire: fw-sbp2: try to increase reconnect_hold (speed up reconnection) + +Ask the target to grant 4 seconds instead of the standard and minimum of +1 second window after bus reset for reconnection. This accelerates +reconnection if there are more than one targets on the bus: If a login +and inquiry to one target blocks the fw-sbp2 workqueue for more than 1s +after bus reset, we now still can reconnect to the other target. + +Before that, fw-sbp2's reconnect attempts would be rejected with "error +status: 0:9" (function rejected), and fw-sbp2 would finally re-login. +All those futile reconnect attemps cost extra time until the target +which needs re-login is ready for I/O again. + +The reconnect timeout field in the login ORB doesn't have to be honored +by the target though. I found that we could get up to + - allegedly 32768s from an old OXFW911 firmware + - 256s from LSI bridges + - 4s from OXUF922 and OXFW912 bridges, + - 2s from TI bridges, + - only the standard 1s from Initio and Prolific bridges and from + Apple OpenFirmware in target mode. + +We just try to get 4 seconds which already covers the case of a few +HDDs on the same bus quite nicely. + +A minor drawback occurs in the following (rare and impractical) border +case: + - two initiators are there, initiator 1 holds an exclusive login to + a target, + - initiator 1 goes off the bus, + - target refuses login attempts from initiator 2 until reconnect_hold + seconds after bus reset. + +An alternative approach to the issue at hand would be to parallelize +fw-sbp2's reconnect and login work. + +Signed-off-by: Stefan Richter <[EMAIL PROTECTED]> +Acked-by: Jarod Wilson <[EMAIL PROTECTED]> +--- + +diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c +index b5e9a64..21122e5 100644 +--- a/drivers/firewire/fw-sbp2.c ++++ b/drivers/firewire/fw-sbp2.c +@@ -522,9 +522,10 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id, + orb->request.status_fifo.low = lu->address_handler.offset; + + if (function == SBP2_LOGIN_REQUEST) { ++ /* Ask for 2^2 == 4 seconds reconnect grace period */ + orb->request.misc |= +- MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login) | +- MANAGEMENT_ORB_RECONNECT(0); ++ MANAGEMENT_ORB_RECONNECT(2) | ++ MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login); + timeout = SBP2_LOGIN_ORB_TIMEOUT; + } else { + timeout = SBP2_ORB_TIMEOUT; Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.2 ============================================================================== --- dists/trunk/linux-2.6/debian/patches/series/1~experimental.2 (original) +++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.2 Wed Jan 23 10:38:41 2008 @@ -1,2 +1,5 @@ + bugfix/arm/disable-ath5k.patch + bugfix/all/patch-2.6.24-rc8-git5 ++ bugfix/all/fw-sbp2-incr-login-orb-reply-timeout.patch ++ bugfix/all/fw-sbp2-skip-unnecessary-logout.patch ++ bugfix/all/fw-sbp2-try-increase-reconnect_hold.patch _______________________________________________ Kernel-svn-changes mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes

