rpms/kernel/F-9 kernel.spec, 1.684, 1.685 linux-2.6-firewire-git-pending.patch, 1.29, 1.30
Jarod Wilson (jwilson)
fedora-extras-commits at redhat.com
Fri Jun 20 21:26:30 UTC 2008
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14070
Modified Files:
kernel.spec linux-2.6-firewire-git-pending.patch
Log Message:
* Fri Jun 20 2008 Jarod Wilson <jwilson at redhat.com> 2.6.25.7-66
- firewire: add phy config packet send timeout, prevents deadlock
with flaky ALi controllers (#446763, #444694)
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/kernel.spec,v
retrieving revision 1.684
retrieving revision 1.685
diff -u -r1.684 -r1.685
--- kernel.spec 19 Jun 2008 03:47:35 -0000 1.684
+++ kernel.spec 20 Jun 2008 21:25:44 -0000 1.685
@@ -1847,6 +1847,10 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
%changelog
+* Fri Jun 20 2008 Jarod Wilson <jwilson at redhat.com> 2.6.25.7-66
+- firewire: add phy config packet send timeout, prevents deadlock
+ with flaky ALi controllers (#446763, #444694)
+
* Thu Jun 19 2008 Dave Airlie <airlied at redhat.com> 2.6.25.7-65
- update radeon patches to newer upstream
linux-2.6-firewire-git-pending.patch:
Index: linux-2.6-firewire-git-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-9/linux-2.6-firewire-git-pending.patch,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- linux-2.6-firewire-git-pending.patch 13 Apr 2008 02:57:01 -0000 1.29
+++ linux-2.6-firewire-git-pending.patch 20 Jun 2008 21:25:44 -0000 1.30
@@ -1,6 +1,6 @@
#
# Patches under review and/or pending inclusion in the linux1394-git
-# tree, which we think we're going to want...
+# tree (and/or in by the time your read this), which we want...
#
Date: Sat, 12 Apr 2008 22:31:25 +0200 (CEST)
@@ -104,3 +104,123 @@
http://arcgraph.de/sr/
+
+Date: Wed, 18 Jun 2008 18:20:45 +0200 (CEST)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: [PATCH update] firewire: deadline for PHY config transmission
+To: linux1394-devel at lists.sourceforge.net
+
+If the low-level driver failed to initialize a card properly without
+noticing it, fw-core was blocked indefinitely when trying to send a
+PHY config packet. This hung up the events kernel thread, e.g. locked
+up keyboard input.
+https://bugzilla.redhat.com/show_bug.cgi?id=444694
+https://bugzilla.redhat.com/show_bug.cgi?id=446763
+
+This problem was introduced between 2.6.25 and 2.6.26-rc1 by commit
+2a0a2590498be7b92e3e76409c9b8ee722e23c8f "firewire: wait until PHY
+configuration packet was transmitted (fix bus reset loop)".
+
+The solution is to wait with timeout. I tested it with 7 different
+working controllers and 1 non-working controller. On the working ones,
+the packet callback complete()s usually --- but not always --- before a
+timeout of 10ms. Hence I chose a safer timeout of 100ms.
+
+On the few tests with the non-working controller ALi M5271, PHY config
+packet transmission always timed out so far. (Fw-ohci needs to be fixed
+for this controller independently of this deadline fix. Often the core
+doesn't even attempt to send a phy config because not even self ID
+reception works.)
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/fw-transaction.c | 47 +++++++++++++++++++++---------
+ 1 file changed, 33 insertions(+), 14 deletions(-)
+
+Index: linux/drivers/firewire/fw-transaction.c
+===================================================================
+--- linux.orig/drivers/firewire/fw-transaction.c
++++ linux/drivers/firewire/fw-transaction.c
+@@ -20,6 +20,7 @@
+
+ #include <linux/completion.h>
+ #include <linux/kernel.h>
++#include <linux/kref.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/interrupt.h>
+@@ -300,37 +301,55 @@ EXPORT_SYMBOL(fw_send_request);
+ struct fw_phy_packet {
+ struct fw_packet packet;
+ struct completion done;
++ struct kref kref;
+ };
+
+-static void
+-transmit_phy_packet_callback(struct fw_packet *packet,
+- struct fw_card *card, int status)
++static void phy_packet_release(struct kref *kref)
++{
++ struct fw_phy_packet *p =
++ container_of(kref, struct fw_phy_packet, kref);
++ kfree(p);
++}
++
++static void transmit_phy_packet_callback(struct fw_packet *packet,
++ struct fw_card *card, int status)
+ {
+ struct fw_phy_packet *p =
+ container_of(packet, struct fw_phy_packet, packet);
+
+ complete(&p->done);
++ kref_put(&p->kref, phy_packet_release);
+ }
+
+ void fw_send_phy_config(struct fw_card *card,
+ int node_id, int generation, int gap_count)
+ {
+- struct fw_phy_packet p;
++ struct fw_phy_packet *p;
++ long timeout = DIV_ROUND_UP(HZ, 10);
+ 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);
++ p = kmalloc(sizeof(*p), GFP_KERNEL);
++ if (p == NULL)
++ return;
++
++ 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);
++ kref_set(&p->kref, 2);
++
++ card->driver->send_request(card, &p->packet);
++ timeout = wait_for_completion_timeout(&p->done, timeout);
++ kref_put(&p->kref, phy_packet_release);
+
+- card->driver->send_request(card, &p.packet);
+- wait_for_completion(&p.done);
++ /* will leak p if the callback is never executed */
++ WARN_ON(timeout == 0);
+ }
+
+ void fw_flush_transactions(struct fw_card *card)
+
+--
+Stefan Richter
+-=====-==--- -==- =--=-
+http://arcgraph.de/sr/
More information about the scm-commits
mailing list