IEEE 1394 updates for Linux 2.6.26 (v939 2009-03-05) drivers/firewire/Kconfig | 13 drivers/firewire/fw-card.c | 359 ++++-- drivers/firewire/fw-cdev.c | 1058 ++++++++++++----- drivers/firewire/fw-device.c | 364 +++--- drivers/firewire/fw-device.h | 22 drivers/firewire/fw-iso.c | 227 +++ drivers/firewire/fw-ohci.c | 365 +++--- drivers/firewire/fw-sbp2.c | 356 +++-- drivers/firewire/fw-topology.c | 60 - drivers/firewire/fw-topology.h | 19 drivers/firewire/fw-transaction.c | 314 ++--- drivers/firewire/fw-transaction.h | 192 +-- drivers/ieee1394/csr.c | 12 drivers/ieee1394/csr.h | 10 drivers/ieee1394/csr1212.c | 79 - drivers/ieee1394/csr1212.h | 9 drivers/ieee1394/dma.c | 2 drivers/ieee1394/dma.h | 1 drivers/ieee1394/dv1394-private.h | 44 drivers/ieee1394/dv1394.c | 34 drivers/ieee1394/eth1394.c | 32 drivers/ieee1394/eth1394.h | 16 drivers/ieee1394/highlevel.c | 36 drivers/ieee1394/highlevel.h | 20 drivers/ieee1394/hosts.c | 10 drivers/ieee1394/hosts.h | 6 drivers/ieee1394/ieee1394.h | 7 drivers/ieee1394/ieee1394_core.c | 19 drivers/ieee1394/ieee1394_transactions.c | 31 drivers/ieee1394/ieee1394_transactions.h | 2 drivers/ieee1394/iso.h | 1 drivers/ieee1394/nodemgr.c | 363 ++---- drivers/ieee1394/nodemgr.h | 27 drivers/ieee1394/ohci1394.c | 26 drivers/ieee1394/ohci1394.h | 2 drivers/ieee1394/pcilynx.c | 2 drivers/ieee1394/pcilynx.h | 2 drivers/ieee1394/raw1394-private.h | 1 drivers/ieee1394/raw1394.c | 241 ++-- drivers/ieee1394/sbp2.c | 338 ++--- drivers/ieee1394/sbp2.h | 34 drivers/ieee1394/video1394.c | 12 drivers/media/dvb/Kconfig | 4 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firewire/Kconfig | 22 drivers/media/dvb/firewire/Makefile | 8 drivers/media/dvb/firewire/firedtv-1394.c | 285 ++++ drivers/media/dvb/firewire/firedtv-avc.c | 1315 ++++++++++++++++++++++ drivers/media/dvb/firewire/firedtv-ci.c | 260 ++++ drivers/media/dvb/firewire/firedtv-dvb.c | 364 ++++++ drivers/media/dvb/firewire/firedtv-fe.c | 247 ++++ drivers/media/dvb/firewire/firedtv-rc.c | 190 +++ drivers/media/dvb/firewire/firedtv.h | 182 +++ drivers/scsi/sd.c | 5 include/linux/firewire-cdev.h | 208 +++ include/linux/pci_ids.h | 1 include/scsi/scsi_device.h | 1 57 files changed, 5943 insertions(+), 1919 deletions(-) Date: Thu, 5 Mar 2009 19:13:43 +0100 (CET) From: Stefan Richter firedtv: fix printk format mismatch Eliminate drivers/media/dvb/firewire/firedtv-avc.c: In function 'debug_fcp': drivers/media/dvb/firewire/firedtv-avc.c:156: warning: format '%d' expects type 'int', but argument 5 has type 'size_t' Acked-by: Mauro Carvalho Chehab Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Mon, 23 Feb 2009 15:59:34 -0500 From: Jay Fenlason firewire: broadcast channel support This patch adds the ISO broadcast channel support that is required of a 1394a IRM. In specific, if the local device the IRM, it allocates ISO channel 31 and sets the broadcast channel register of all devices on the local bus to BROADCAST_CHANNEL_INITIAL | BROADCAST_CHANNEL_VALID to indicate that channel 31 can be use for broadcast messages. One minor complication is that on startup the local device may become IRM before all the devices on the bus have been enumerated by the stack. Therefore we have to keep a "the local device is IRM" flag and possibly set the broadcast channel register of new devices at enumeration time. Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 172 ++++++++++++++++++++++++++++-- drivers/firewire/fw-device.c | 3 drivers/firewire/fw-transaction.h | 8 + 3 files changed, 177 insertions(+), 6 deletions(-) Date: Thu, 5 Mar 2009 19:08:40 +0100 (CET) From: Jay Fenlason firewire: implement asynchronous stream transmission Allow userspace and other firewire drivers (fw-ipv4 I'm looking at you!) to send Asynchronous Transmit Streams as described in 7.8.3 of release 1.1 of the 1394 Open Host Controller Interface Specification. Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter (tweaks) --- drivers/firewire/fw-cdev.c | 33 ++++++++++++++++++++++++++++++ drivers/firewire/fw-ohci.c | 21 +++++++++++++++++-- drivers/firewire/fw-transaction.c | 25 ++++++++++++++++++++++ drivers/firewire/fw-transaction.h | 4 +++ include/linux/firewire-cdev.h | 27 ++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 2 deletions(-) Date: Thu, 5 Mar 2009 19:07:00 +0100 (CET) From: Stefan Richter firewire: core: normalize a function argument name It's called "payload" rather than "data" almost everywhere in fw-transaction.c. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 6 +++--- drivers/firewire/fw-transaction.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) Date: Thu, 26 Feb 2009 10:32:31 -0800 From: Linus Torvalds Make ieee1394_init a fs-initcall It needs to happen before any firewire driver actually registers itself, and that was previously handled by having the Makefile list the core ieee1394 files before the drivers. But now there are firewire drivers in drivers/media, and the Makefile games aren't enough. So just make ieee1394_init happen earlier in the init sequence, the way all other bus layers already do. Reported-and-tested-by: Ingo Molnar Cc: Stefan Richter Cc: Henrik Kurelid Cc: Mauro Carvalho Chehab Cc: Ben Backx Signed-off-by: Linus Torvalds --- drivers/ieee1394/ieee1394_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Tue, 24 Feb 2009 15:52:49 +0100 (CET) From: Beat Michel Liechti firedtv: dvb_frontend_info for FireDTV S2, fix "frequency limits undefined" error I found that the function fdtv_frontend_init in the file firedtv-fe.c was missing a case for FIREDTV_DVB_S2 which resulted in "frequency limits undefined" errors in syslog. Signed-off-by: Beat Michel Liechti Change by Stefan R: combine it with case case FIREDTV_DVB_S as originally suggested by Beat Michel. This enables FE_CAN_FEC_AUTO also for FireDTV-S2 devices which is possible as long as only DVB-S channels are used. FE_CAN_FEC_AUTO would be wrong for DVB-S2 channels, but those cannot be used yet since the driver is not yet converted to S2API. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-fe.c | 1 + 1 file changed, 1 insertion(+) Date: Mon, 23 Feb 2009 14:21:10 +0100 (CET) From: Stefan Richter firedtv: reinstate debug logging option Henrik Kurelid tells me that FCP debug logging (which I removed during cleanups) is still useful when working on driver issues together with end users. So bring it back in an updated form with only 60% of the original code footprint. Logging can be enabled with # echo -1 > /sys/module/firedtv/parameters/debug 1 instead of -1 enables only FCP header logging, 2 instead of -1 enables only hexdumps of the entire FCP frames. 0 switches logging off again. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) Date: Fri, 20 Feb 2009 20:54:27 +0100 (CET) From: Stefan Richter firedtv: build fix for INPUT=m and DVB_FIREDTV=y Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Thu, 19 Feb 2009 20:40:39 +0100 From: Stefan Richter firedtv: use msecs_to_jiffies Pointed out by Mauro Carvalho Chehab. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-avc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Date: Mon, 16 Feb 2009 23:42:31 +0100 (CET) From: Stefan Richter ieee1394: remove superfluous assertions hpsb_read, hpsb_write, hpsb_lock are sleeping functions which nobody is in danger to use in atomic context. Besides, in_interrupt does not cover all types of atomic context. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394_transactions.c | 6 ------ 1 file changed, 6 deletions(-) Date: Sun, 15 Feb 2009 23:11:38 +0100 (CET) From: Stefan Richter ieee1394: constify device ID tables Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 2 +- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/nodemgr.c | 4 ++-- drivers/ieee1394/nodemgr.h | 2 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 2 +- drivers/ieee1394/video1394.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) Date: Sun, 15 Feb 2009 22:49:24 +0100 (CET) From: Stefan Richter ieee1394: raw1394: add sparse annotations to raw1394_compat_write Eliminate the following warnings in raw1394_compat_write()'s error return path, seen on x86-64 with CONFIG_COMPAT=y: drivers/ieee1394/raw1394.c:381:17: warning: incorrect type in return expression (different address spaces) drivers/ieee1394/raw1394.c:381:17: expected char const [noderef] * drivers/ieee1394/raw1394.c:381:17: got void * drivers/ieee1394/raw1394.c:2252:14: warning: incorrect type in argument 1 (different address spaces) drivers/ieee1394/raw1394.c:2252:14: expected void const *ptr drivers/ieee1394/raw1394.c:2252:14: got char const [noderef] *[assigned] buffer drivers/ieee1394/raw1394.c:2253:19: warning: incorrect type in argument 1 (different address spaces) drivers/ieee1394/raw1394.c:2253:19: expected void const *ptr drivers/ieee1394/raw1394.c:2253:19: got char const [noderef] *[assigned] buffer Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Date: Sun Feb 15 20:50:46 CET 2009 From: Stefan Richter firedtv: some more housekeeping Fix an old checkpatch warning and a new compiler warning. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-ci.c | 2 +- drivers/media/dvb/firewire/firedtv-dvb.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: rename a file once more At the moment, about a third of avc.c is specific to FireDTVs rather than generic AV/C code. Rename it to firedtv-avc.c. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 2 drivers/media/dvb/firewire/avc.c | 1235 ----------------------- drivers/media/dvb/firewire/firedtv-avc.c | 1235 +++++++++++++++++++++++ drivers/media/dvb/firewire/firedtv.h | 64 - 4 files changed, 1268 insertions(+), 1268 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: more compact channels backing store Replace struct firedtv_channel { bool active; int pid; } channel[16]; by unsigned long channel_active; u16 channel_pid[16];. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 52 ++++++++++------------- drivers/media/dvb/firewire/firedtv.h | 10 +--- 2 files changed, 27 insertions(+), 35 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: some simplifications c->active was unnecessarily cleared twice. Also, by marking the channel inactive before the for loop, the loop becomes identical with fdtv_channel_collect(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: remove a bogus loop This loop is unnecessary because - only active channel[].pid's will be sent to the device, - when a channel is activated, its pid is set to dvbdmxfeed->pid. Perhaps the original code was there because it was initially not fully covered by the fdtv->demux_mutex. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: fix mutex protection fdtv_start_feed() accessed the channel list unsafely. Fully serialize it with itself and fdtv_stop_feed(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 80 +++++++++-------------- 1 file changed, 32 insertions(+), 48 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: dvb demux: fix missing braces Original code was: ... case DMX_TS_PES_OTHER: //Dirty fix to keep firesat->channel pid-list up to date for(k=0;k<16;k++){ if(firesat->channel[k].active == 0) firesat->channel[k].pid = dvbdmxfeed->pid; break; } channel = firesat_channel_allocate(firesat); break; default: ... Looks bogus in several respects. For now let's just add braces to the if because that seems to be what the author meant. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: allow build without input subsystem !CONFIG_INPUT is very unlikely on systems on which firedtv is of interest. But we can easily support it. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 5 ++++- drivers/media/dvb/firewire/Makefile | 3 ++- drivers/media/dvb/firewire/firedtv.h | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: replace EXTRA_CFLAGS by ccflags The former are deprecated. The latter can depend on Kconfig variables. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: concentrate ieee1394 dependencies Move the entire interface with drivers/ieee1394 to firedtv-1394.c. Move 1394-independent module initialization code to firedtv-dvb.c. This prepares interfacing with drivers/firewire. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Kconfig | 7 drivers/media/dvb/firewire/Makefile | 10 drivers/media/dvb/firewire/avc.c | 82 +++--- drivers/media/dvb/firewire/firedtv-1394.c | 263 +++++++--------------- drivers/media/dvb/firewire/firedtv-ci.c | 11 drivers/media/dvb/firewire/firedtv-dvb.c | 162 ++++++++++++- drivers/media/dvb/firewire/firedtv-fe.c | 10 drivers/media/dvb/firewire/firedtv.h | 60 +++-- 8 files changed, 332 insertions(+), 273 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: amend Kconfig menu prompt Signed-off-by: Stefan Richter --- drivers/media/dvb/Kconfig | 2 ++ drivers/media/dvb/firewire/Kconfig | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: remove kernel version compatibility macro Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-dvb.c | 7 ++++--- drivers/media/dvb/firewire/firedtv.h | 8 -------- 2 files changed, 4 insertions(+), 11 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: combine header files avc.h and firedtv-*.h are small and currently not shared with other drivers, hence concatenate them all into firedtv.h. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 2 drivers/media/dvb/firewire/avc.h | 52 ---------------------- drivers/media/dvb/firewire/firedtv-1394.c | 3 - drivers/media/dvb/firewire/firedtv-ci.c | 2 drivers/media/dvb/firewire/firedtv-ci.h | 9 --- drivers/media/dvb/firewire/firedtv-dvb.c | 2 drivers/media/dvb/firewire/firedtv-fe.c | 1 drivers/media/dvb/firewire/firedtv-rc.c | 1 drivers/media/dvb/firewire/firedtv-rc.h | 11 ---- drivers/media/dvb/firewire/firedtv.h | 33 +++++++++++++ 10 files changed, 33 insertions(+), 83 deletions(-) Date: Sun Feb 15 15:33:17 CET 2009 From: Stefan Richter firedtv: misc style touch-ups Standardize on lower-case hexadecimal constants. Adjust whitespace. Omit unnecessary pointer type casts and an unnecessary list head initialization. Use dev_printk. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 32 +++++----- drivers/media/dvb/firewire/firedtv-1394.c | 35 +++-------- drivers/media/dvb/firewire/firedtv-ci.c | 29 ++++----- drivers/media/dvb/firewire/firedtv-dvb.c | 65 ++++++++++------------ drivers/media/dvb/firewire/firedtv-fe.c | 27 +++++---- 5 files changed, 85 insertions(+), 103 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc, ci: remove unused constants Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 14 ++-- drivers/media/dvb/firewire/firedtv-ci.c | 17 +++-- drivers/media/dvb/firewire/firedtv.h | 81 ------------------------ 3 files changed, 19 insertions(+), 93 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from read descriptor response operands Don't use bitfields in struct types of on-the-wire data. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 48 +++++++++- drivers/media/dvb/firewire/avc.h | 106 ------------------------ drivers/media/dvb/firewire/firedtv-ci.c | 46 +++++----- drivers/media/dvb/firewire/firedtv-fe.c | 26 ++--- drivers/media/dvb/firewire/firedtv.h | 29 ++++++ 5 files changed, 107 insertions(+), 148 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from DSD command operands Don't use bitfields in struct types of on-the-wire data. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 109 ++++++++++++++----------------- drivers/media/dvb/firewire/avc.h | 74 --------------------- 2 files changed, 52 insertions(+), 131 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: header file cleanup Remove unused constants and declarations. Move privately used constants into .c files. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 6 +- drivers/media/dvb/firewire/avc.h | 67 ------------------------ drivers/media/dvb/firewire/firedtv-fe.c | 2 3 files changed, 6 insertions(+), 69 deletions(-) Date: Wed Feb 11 21:21:04 CET 2009 From: Stefan Richter firedtv: avc: remove bitfields from FCP frame types Don't use bitfields in struct types of on-the-wire data. Also move many privately used constants from avc.h to avc.c and remove some unused constants. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 210 +++++++++++++----------- drivers/media/dvb/firewire/avc.h | 134 --------------- drivers/media/dvb/firewire/firedtv-fe.c | 2 3 files changed, 123 insertions(+), 223 deletions(-) Date: Mon, 9 Feb 2009 22:05:06 +0100 From: Tobias Klauser ieee1394: Storage class should be before const qualifier The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 8 ++++---- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/highlevel.c | 2 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) Date: Tue, 3 Feb 2009 17:55:19 +0100 (CET) From: Stefan Richter firewire: normalize a variable name Standardize on if (err) handle_error; and if (ret < 0) handle_error; Don't call a variable err if we store values in it which mean success. Also, offset some return statements by a blank line since this how we do it in drivers/firewire. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 9 +++++---- drivers/firewire/fw-device.c | 6 +++--- drivers/firewire/fw-iso.c | 10 ++++++---- drivers/firewire/fw-ohci.c | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) Date: Tue, 3 Feb 2009 17:54:31 +0100 (CET) From: Stefan Richter ieee1394: dv1394: move deprecation message from module init to file open On many Linux installations, the dv1394 driver will be auto-loaded whenever an AV/C device (e.g. camcorder or audio device) is plugged in. An irritating message would then appear in the kernel log. Defer this message to until a dv1394 character device file is actually used by a program. Also include the program name in the message and update the message slightly. Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sun, 1 Feb 2009 01:29:35 -0800 (PST) From: Petr Vandrovec firewire: core: Remove card from list of cards when enable fails Signed-off-by: Petr Vandrovec After a controller initialization failure, addition of another card got stuck due to card_list corruption. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Date: Thu, 29 Jan 2009 00:13:20 +0100 (CET) From: Stefan Richter ieee1394: sbp2: add workarounds for 2nd and 3rd generation iPods as per https://bugs.launchpad.net/bugs/294391. These got one sample of each iPod generation going. However there still occurred I/O stalls with the 3rd generation iPod which remain undiagnosed at the time of this writing. Acked-by: Jarod Wilson Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) Date: Thu, 29 Jan 2009 00:11:59 +0100 (CET) From: Stefan Richter firewire: sbp2: add workarounds for 2nd and 3rd generation iPods According to https://bugs.launchpad.net/bugs/294391 - 3rd generation iPods need the "fix capacity" workaround after all (apparently they crash after the last sector was accessed), - 2nd generation iPods need the "128 kB maximum request size" workaround. Alas both iPod generations feature the same model ID in the config ROM, hence we can only define a shared quirks list entry for them. Luckily the fix capacity workaround did not show a negative effect in Jarod's tests with 2nd gen. iPod. A side note: Apple computers in target mode (or at least an x86 Mac mini) don't have firmware_version and model_id, hence none of the iPod quirks list entries is active for them. Tested-by: Jarod Wilson Acked-by: Jarod Wilson Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) Date: Wed, 28 Jan 2009 01:03:34 +0100 (CET) From: Stefan Richter firewire: sbp2: fix DMA mapping leak on the failure path Reported-by: FUJITA Tomonori who also provided a first version of the fix. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) Date: Sat, 24 Jan 2009 20:35:38 +0100 (CET) From: Stefan Richter firewire: core: optimize card shutdown This fixes a regression by "firewire: keep highlevel drivers attached during brief connection loss": There were 2 seconds unnecessary waiting added to the shutdown procedure of each controller. We use card->link as status flag to signal the device handler that there is no use to wait for a come-back. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 2 +- drivers/firewire/fw-device.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: follow up on "ieee1394: inherit ud vendor_id from node vendor_id" Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: don't assume zero model_id or firmware_revision if there is none This makes sbp2 behave more like firewire-sbp2 which reports 0xff000000 as immediate value if there are no unit directory entries for model_id or firmware_revision. It does not reduce matches with the currently existing quirks table; the only zero entry there is for a device which actually does have a zero model_id. It only changes how model_id and firmware_revision are logged if they are missing. Other functionally unrelated changes: The model_id member of quirks list entries is renamed to model; the value (but not the effect) of SBP2_ROM_VALUE_WILDCARD is changed. Now this part of the source is identical with firewire-sbp2 for easier maintenance. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter ieee1394: sbp2: fix payload limit at S1600 and S3200 1394-2008 clause 16.3.4.1 (1394b-2002 clause 16.3.1.1) defines tighter limits than 1394-2008 clause 6.2.2.3 (1394a-2000 clause 6.2.2.3). Our previously too large limit doesn't matter though if the controller reports its max_receive correctly. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter firewire: sbp2: define some magic numbers as macros Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) Date: Sat, 24 Jan 2009 19:41:46 +0100 (CET) From: Stefan Richter firewire: sbp2: fix payload limit at S1600 and S3200 1394-2008 clause 16.3.4.1 (1394b-2002 clause 16.3.1.1) defines tighter limits than 1394-2008 clause 6.2.2.3 (1394a-2000 clause 6.2.2.3). Our previously too large limit doesn't matter though if the controller reports its max_receive correctly. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) Date: Tue, 20 Jan 2009 19:10:58 +0100 (CET) From: Stefan Richter firewire: ohci: increase AT req. retries, fix ack_busy_X from Panasonic camcorders and others Camcorders have a tendency to fail read requests to their config ROM and write request to their FCP command register with ack_busy_X. This has become a problem with newer kernels and especially Panasonic camcorders, causing AV/C in dvgrab and kino to fail. Dvgrab for example frequently logs "send oops"; kino reports loss of AV/C control. I suspect that lower CPU scheduling latencies in newer kernels made this issue more prominent now. According to https://sourceforge.net/tracker/?func=detail&atid=114103&aid=2492640&group_id=14103 this can be fixed by configuring the FireWire controller for more hardware retries for request transmission; these retries are evidently more successful than libavc1394's own retry loop (typically 3 tries on top of hardware retries). Presumably the same issue has been reported at https://bugzilla.redhat.com/show_bug.cgi?id=449252 and https://bugzilla.redhat.com/show_bug.cgi?id=477279 . In a quick test with a JVC camcorder (which didn't malfunction like the reported camcorders), this change decreased the number of ack_busy_X from 16 in three runs of dvgrab to 4 in three runs of the same capture duration. Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Tue, 20 Jan 2009 19:09:58 +0100 (CET) From: Stefan Richter ieee1394: ohci1394: increase AT req. retries, fix ack_busy_X from Panasonic camcorders and others Camcorders have a tendency to fail read requests to their config ROM and write request to their FCP command register with ack_busy_X. This has become a problem with newer kernels and especially Panasonic camcorders, causing AV/C in dvgrab and kino to fail. Dvgrab for example frequently logs "send oops"; kino reports loss of AV/C control. I suspect that lower CPU scheduling latencies in newer kernels made this issue more prominent now. According to https://sourceforge.net/tracker/?func=detail&atid=114103&aid=2492640&group_id=14103 this can be fixed by configuring the FireWire controller for more hardware retries for request transmission; these retries are evidently more successful than libavc1394's own retry loop (typically 3 tries on top of hardware retries). Presumably the same issue has been reported at https://bugzilla.redhat.com/show_bug.cgi?id=449252 and https://bugzilla.redhat.com/show_bug.cgi?id=477279 . Tested-by: Mathias Beilstein Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Mon, 19 Jan 2009 19:20:31 +0100 (CET) From: Stefan Richter ieee1394: sbp2: update a help string Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Mon, 19 Jan 2009 19:19:55 +0100 (CET) From: Stefan Richter ieee1394: support for speeds greater than S800 The hard-wired configuration of the top speed (until now S800) was unnecessary, remove it. If the local link layer controller supports S1600 or S3200, we now assume this speed for all present 1394b PHYs (except if they are behind 1394a repeaters) until nodemgr figured out the actual speed while fetching the config ROM. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394.h | 4 +--- drivers/ieee1394/ieee1394_core.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: avc: fix offset in avc_tuner_get_ts The parentheses were wrong. It didn't matter though because this code only writes a 0 into an area which is already initialized to 0. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: avc: reduce stack usage, remove two typedefs It is safe to share a memory buffer for command frame and response frame because the response data come in after the command frame was last used. Even less stack would be required if only the actual required frame size instead of the entire FCP register size was allocated. Also, rename the defined types AVCCmdFrm and AVCRspFrm to struct avc_command_frame and struct avc_response_frame. TODO: Remove the bitfields in these types. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 1064 +++++++++++++++---------------- drivers/media/dvb/firewire/avc.h | 24 2 files changed, 532 insertions(+), 556 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: cmp: move code to avc Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 1 drivers/media/dvb/firewire/avc.c | 147 ++++++++++++++++++ drivers/media/dvb/firewire/avc.h | 3 drivers/media/dvb/firewire/cmp.c | 171 ---------------------- drivers/media/dvb/firewire/cmp.h | 9 - drivers/media/dvb/firewire/firedtv-1394.c | 1 drivers/media/dvb/firewire/firedtv-fe.c | 1 7 files changed, 150 insertions(+), 183 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: move code to firedtv-1394 Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/Makefile | 1 drivers/media/dvb/firewire/firedtv-1394.c | 96 ++++++++++++++++++- drivers/media/dvb/firewire/firedtv-iso.c | 110 ---------------------- drivers/media/dvb/firewire/firedtv.h | 5 - 4 files changed, 93 insertions(+), 119 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: remove unnecessary struct type definitions Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-iso.c | 17 ++++++----- drivers/media/dvb/firewire/firedtv.h | 34 ----------------------- 2 files changed, 10 insertions(+), 41 deletions(-) Date: Sun, 18 Jan 2009 16:30:00 +0100 (CET) From: Stefan Richter firedtv: iso: style changes and fixlets Add cleanup after failure in setup_iso_channel. Replace printk() by dv_err(). Decrease indentation level in rawiso_activity_cb(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/firedtv-iso.c | 136 +++++++++++------------ 1 file changed, 66 insertions(+), 70 deletions(-) Date: Sat, 17 Jan 2009 14:47:34 +0100 From: Rambaldi firedtv: rename variables and functions from firesat to firedtv Signed-off-by: Rambaldi Additional changes by Stefan Richter: Renamed struct firedtv *firedtv to struct firedtv *fdtv and firedtv_foo_bar() to fdtv_foo_bar() for brevity. Signed-off-by: Stefan Richter --- drivers/media/dvb/firewire/avc.c | 188 ++++++++++----------- drivers/media/dvb/firewire/avc.h | 34 +-- drivers/media/dvb/firewire/cmp.c | 40 ++-- drivers/media/dvb/firewire/cmp.h | 6 drivers/media/dvb/firewire/firedtv-1394.c | 190 +++++++++++----------- drivers/media/dvb/firewire/firedtv-ci.c | 106 ++++++------ drivers/media/dvb/firewire/firedtv-ci.h | 6 drivers/media/dvb/firewire/firedtv-dvb.c | 142 ++++++++-------- drivers/media/dvb/firewire/firedtv-fe.c | 124 +++++++------- drivers/media/dvb/firewire/firedtv-iso.c | 40 ++-- drivers/media/dvb/firewire/firedtv-rc.c | 18 +- drivers/media/dvb/firewire/firedtv-rc.h | 8 drivers/media/dvb/firewire/firedtv.h | 32 +-- 13 files changed, 467 insertions(+), 467 deletions(-) Date: Sat, 17 Jan 2009 13:07:44 +0100 From: Rambaldi firedtv: rename files from firesat to firedtv Signed-off-by: Rambaldi Additional changes by Stefan Richter: Name the directory "firewire" instead of "firedtv". Standardize on "-" instead of "_" in file names, because that's what drivers/firewire/ and drivers/media/dvb/dvb-usb/ use too. Build fix. Signed-off-by: Stefan Richter --- drivers/media/dvb/Kconfig | 2 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firesat/Kconfig | 12 drivers/media/dvb/firesat/Makefile | 13 drivers/media/dvb/firesat/avc_api.c | 1051 ---------------------- drivers/media/dvb/firesat/avc_api.h | 432 --------- drivers/media/dvb/firesat/cmp.c | 171 --- drivers/media/dvb/firesat/cmp.h | 9 drivers/media/dvb/firesat/firesat-ci.c | 261 ----- drivers/media/dvb/firesat/firesat-ci.h | 9 drivers/media/dvb/firesat/firesat-rc.c | 191 --- drivers/media/dvb/firesat/firesat-rc.h | 11 drivers/media/dvb/firesat/firesat.h | 227 ---- drivers/media/dvb/firesat/firesat_1394.c | 291 ------ drivers/media/dvb/firesat/firesat_dvb.c | 276 ----- drivers/media/dvb/firesat/firesat_fe.c | 245 ----- drivers/media/dvb/firesat/firesat_iso.c | 111 -- drivers/media/dvb/firewire/Kconfig | 12 drivers/media/dvb/firewire/Makefile | 13 drivers/media/dvb/firewire/avc.c | 1051 ++++++++++++++++++++++ drivers/media/dvb/firewire/avc.h | 432 +++++++++ drivers/media/dvb/firewire/cmp.c | 171 +++ drivers/media/dvb/firewire/cmp.h | 9 drivers/media/dvb/firewire/firedtv-1394.c | 291 ++++++ drivers/media/dvb/firewire/firedtv-ci.c | 261 +++++ drivers/media/dvb/firewire/firedtv-ci.h | 9 drivers/media/dvb/firewire/firedtv-dvb.c | 276 +++++ drivers/media/dvb/firewire/firedtv-fe.c | 245 +++++ drivers/media/dvb/firewire/firedtv-iso.c | 111 ++ drivers/media/dvb/firewire/firedtv-rc.c | 191 +++ drivers/media/dvb/firewire/firedtv-rc.h | 11 drivers/media/dvb/firewire/firedtv.h | 227 ++++ 32 files changed, 3312 insertions(+), 3312 deletions(-) create mode 100644 drivers/media/dvb/firewire/Kconfig create mode 100644 drivers/media/dvb/firewire/Makefile create mode 100644 drivers/media/dvb/firewire/avc.c create mode 100644 drivers/media/dvb/firewire/avc.h create mode 100644 drivers/media/dvb/firewire/cmp.c create mode 100644 drivers/media/dvb/firewire/cmp.h create mode 100644 drivers/media/dvb/firewire/firedtv-ci.c create mode 100644 drivers/media/dvb/firewire/firedtv-ci.h create mode 100644 drivers/media/dvb/firewire/firedtv-rc.c create mode 100644 drivers/media/dvb/firewire/firedtv-rc.h create mode 100644 drivers/media/dvb/firewire/firedtv.h create mode 100644 drivers/media/dvb/firewire/firedtv-1394.c create mode 100644 drivers/media/dvb/firewire/firedtv-dvb.c create mode 100644 drivers/media/dvb/firewire/firedtv-fe.c create mode 100644 drivers/media/dvb/firewire/firedtv-iso.c delete mode 100644 drivers/media/dvb/firesat/Kconfig delete mode 100644 drivers/media/dvb/firesat/Makefile delete mode 100644 drivers/media/dvb/firesat/avc_api.c delete mode 100644 drivers/media/dvb/firesat/avc_api.h delete mode 100644 drivers/media/dvb/firesat/cmp.c delete mode 100644 drivers/media/dvb/firesat/cmp.h delete mode 100644 drivers/media/dvb/firesat/firesat-ci.c delete mode 100644 drivers/media/dvb/firesat/firesat-ci.h delete mode 100644 drivers/media/dvb/firesat/firesat-rc.c delete mode 100644 drivers/media/dvb/firesat/firesat-rc.h delete mode 100644 drivers/media/dvb/firesat/firesat.h delete mode 100644 drivers/media/dvb/firesat/firesat_1394.c delete mode 100644 drivers/media/dvb/firesat/firesat_dvb.c delete mode 100644 drivers/media/dvb/firesat/firesat_fe.c delete mode 100644 drivers/media/dvb/firesat/firesat_iso.c Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: remove condition which is always false reread_bus_info_block() only gets to see devices whose config_rom_length is at least 6 (ROM header, bus info block, root directory header). Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: move some functions Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 90 +++++++++++++++++------------------ 1 file changed, 44 insertions(+), 46 deletions(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: core: clean up includes Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 20 +++++++++++--------- drivers/firewire/fw-device.h | 13 +++++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) Date: Sat, 17 Jan 2009 22:45:54 +0100 (CET) From: Stefan Richter firewire: keep highlevel drivers attached during brief connection loss There are situations when nodes vanish from the bus and come back quickly thereafter: - When certain bus-powered hubs are plugged in, - when certain devices are plugged into 6-port hubs, - when certain disk enclosures are switched from self-power to bus power or vice versa and break the daisy chain during the transition, - when the user plugs a cable out and quickly plugs it back in, e.g. to reorder a daisy chain (works on Mac OS X if done quickly enough), - when certain hubs temporarily malfunction during high bus traffic. Until now, firewire-core reported affected nodes as lost to the highlevel drivers (firewire-sbp2 and userspace drivers). We now delay the destruction of device representations until after at least two seconds after the last bus reset. If a "new" device is detected in this period whose bus information block and root directory header match that of a device which is pending for deletion, we resurrect that device and send update calls to highlevel drivers. Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 121 ++++++++++++++++++++++++++++------- drivers/firewire/fw-device.h | 1 2 files changed, 100 insertions(+), 22 deletions(-) Date: Wed, 14 Jan 2009 23:01:35 +0100 (CET) From: Stefan Richter firedtv: add missing dependency on CONFIG_INPUT Fix build error \ Reported-by: Randy Dunlap Perhaps we should make the remote control part of firedtv modular so that the driver can be built without input support. But it's not very likely that anybody would have use for such a constellation. Signed-off-by: Stefan Richter --- I need to fold it into "DVB: add firesat driver" before I submit the driver for mainline merge. drivers/media/dvb/firesat/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 11 Jan 2009 13:44:46 +0100 (CET) From: Stefan Richter firewire: cdev: simplify a schedule_delayed_work wrapper The kernel API documentation says that queue_delayed_work() returns 0 (only) if the work was already queued. The return codes of schedule_delayed_work() are not documented but the same. In init_iso_resource(), the work has never been queued yet, hence we can assume schedule_delayed_work() to be a guaranteed success there. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) Date: Fri, 09 Jan 2009 16:20:31 -0800 From: David Moore firewire: cdev: Workaround bug in idr_remove_all() There is a memory clearing problem in idr_remove_all(). Specifically, idr_remove_all() should be clearing some idr data structures before returning them to the idr free list but it's not. Because the idr kmem_cache is persistent, that's why different instantiations of the firewire client would interact with each other. Here's a workaround while I work on a patch to idr.c: Purposefully clear new memory allocated by the idr API to workaround a bug in idr_remove_all. Signed-off-by: David Moore Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Fri, 9 Jan 2009 20:49:37 +0100 (CET) From: Stefan Richter firewire: core: fix sleep in atomic context due to driver core change Due to commit 2831fe6f9cc4e16c103504ee09a47a084297c0f3, "driver core: create a private portion of struct device", device_initialize() can no longer be called from atomic contexts. We now defer it until after config ROM probing. This requires changes to the bus manager code because this may use a device before it was probed. Reported-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 13 +++++++------ drivers/firewire/fw-device.c | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) Date: Thu, 8 Jan 2009 23:07:40 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for iso resource management, amendment Some fixes: - Remove stale documentation. - Fix a != vs. == thinko that got in the way of channel management. - Try bandwidth deallocation even if channel deallocation failed. A simplification: - fw_cdev_allocate_iso_resource.channels is now ordered like libdc1394's dc1394_iso_allocate_channel() channels_allowed argument. By the way, I looked closer at cards from NEC, TI, and VIA, and noticed that they all don't implement IEEE 1394a behaviour which is meant to deviate from IEEE 1212's notion of lock compare-swap. This means that we have to do two lock transactions instead of one in many cases where one transaction would already succeed on a fully 1394a compliant IRM. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 - drivers/firewire/fw-iso.c | 38 +++++++++++++++++++--------------- include/linux/firewire-cdev.h | 10 +++----- 3 files changed, 27 insertions(+), 23 deletions(-) Date: Wed, 7 Jan 2009 20:14:53 +0100 (CET) From: Stefan Richter firewire: cdev: increment fw_cdev_version, update documentation Necessary due to Date: Tue, 22 Jul 2008 23:23:40 -0700 From: David Moore Subject: firewire: Include iso timestamp in headers when header_size > 4 Side note: The lack of upwards compatibility sounds worse than it is. All existing client implementations, libraw1394 and libdc1394, set header_size = 4. And since the ABI v1 behaviour does not offer any advantages over the new behaviour, we deliberately do not provide the old behaviour anymore. Also add documentation about the format of fw_cdev_get_cycle_timer which may be used in conjunction with the timestamp of iso packets but has a different format. Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 35 +++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) Date: Mon, 5 Jan 2009 20:43:23 +0100 (CET) From: Stefan Richter firewire: ohci: change "context_stop: still active" log message The present message is mostly just noise. We only need to be notified if the "active" flag does not go off before the retry loop terminates. Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Mon, 5 Jan 2009 20:28:10 +0100 (CET) From: Stefan Richter firewire: cdev: shut down iso context before freeing the buffer DMA must be halted before we DMA-unmap and free the DMA buffer. Since we cannot rely on the client to stop the context before it closes the fd, we have to reorder fw_iso_buffer_destroy vs. fw_iso_context_destroy. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: replace some spin_lock_irqsave by spin_lock_irq All of these functions are entered with IRQs enabled. Hence the unconditional spin_unlock_irq can be used. Function: Caller context: dequeue_event() client process, via read(2) fill_bus_reset_event() fw-device.c update worqueue job release_client_resource() client process, via ioctl(2) fw_device_op_release() client process, via close(2) Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: extend transaction payload size check Make the size check of ioctl_send_request and ioctl_send_broadcast_request speed dependent. Also change the error return code from -EINVAL to -EIO to distinguish this from other errors concerning the ioctl parameters. Another payload size limit for which we don't check here though is the remote node's Bus_Info_Block.max_rec. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: restrict broadcast write requests to Units Space We don't want random users write to Memory Space (e.g. PCs with physical DMA filters down) or to core CSRs like Reset_Start. This does not protect SBP-2 target CSRs. But properly behaving SBP-2 targets ignore broadcast write requests to these registers, and the maximum damage which can happen with laxer targets is DOS. But there are ways to create DOS situations anyway if there are devices with weak device file permissions (like audio/video devices) present at the same bus as an SBP-2 target. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 4 ++++ 1 file changed, 4 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctl for broadcast write requests Write transactions to the broadcast node ID are a convenient way to trigger functions of multiple nodes at once. IIDC is a protocol which can make use of this if multiple cameras with same command_regs_base are connected at the same bus. Based on Date: Wed, 10 Sep 2008 11:32:16 -0400 From: Jay Fenlason Subject: [patch] SEND_BROADCAST_REQUEST Changes: ioctl_send_request() and ioctl_send_broadcast_request() now share code. Broadcast speed corrected to S100. Check for proper tcode. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 74 +++++++++++++++++++++------------- include/linux/firewire-cdev.h | 1 2 files changed, 48 insertions(+), 27 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctl to query maximum transmission speed While the speed of asynchronous transactions is automatically chosen by the kernel, the speed of isochronous streams has to be chosen by the initiating client. In case of 1394a bus topologies, the maximum possible speed could be figured out with some effort by evaluation of the remote node's link speed field in the config ROM, the local node's link speed field, and the PHY speeds and topologic information in the local node's or IRM's topology map CSR. However, this does not work in case of 1394b buses. Hence add an ioctl to export the maximum speed which the kernel already determined. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 10 ++++++++++ include/linux/firewire-cdev.h | 10 ++++++++++ 2 files changed, 20 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for manual iso resource management This adds ioctls for allocation and deallocation of a channel or/and bandwidth without auto-reallocation and without auto-deallocation. The benefit of these ioctls is that libraw1394-style isochronous resource management can be implemented without write access to the IRM's character device file. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 67 +++++++++++++++++++++++++++------- include/linux/firewire-cdev.h | 42 ++++++++++++++++----- 2 files changed, 86 insertions(+), 23 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: add ioctls for isochronous resource management Based on Date: Tue, 18 Nov 2008 11:41:27 -0500 From: Jay Fenlason Subject: [Patch V4] Add ISO resource management support with several changes to the ABI and implementation. Only the part of the ABI which enables auto-reallocation and auto-deallocation is included here. This implements ioctls for kernel-assisted allocation of isochronous channels and isochronous bandwidth. The benefits are: - The client does not have to have write access to the /dev/fw* device corresponding to the IRM. - The client does not have to perform reallocation after bus resets. - Channel and bandwidth are deallocated by the kernel if the file is closed before the client deallocated the resources. Thus resources are released even if the client crashes. It is anticipated that future in-kernel code (firewire-core IRM code; the firewire port of firedtv), will use the fw-iso.c portions of this code too. Signed-off-by: Stefan Richter Tested-by: David Moore --- drivers/firewire/fw-cdev.c | 215 +++++++++++++++++++++++++++++- drivers/firewire/fw-iso.c | 176 +++++++++++++++++++++++- drivers/firewire/fw-transaction.h | 4 include/linux/firewire-cdev.h | 100 ++++++++++++- 4 files changed, 475 insertions(+), 20 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: core: topology header fix Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.h | 6 ++++++ 1 file changed, 6 insertions(+) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: sort includes Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: unify names of struct types and of their instances to indicate that they are specializations of struct event or of struct client_resource, respectively. struct response was both an event and a client_resource; it is now split into struct outbound_transaction_resource and ~_event in order to document more explicitly which types of client resources exist. struct request and struct_request_event are renamed to struct inbound_transaction_resource and ~_event because requests and responses occur in outbound and in inbound transactions. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 337 ++++++++++++++++++------------------- 1 file changed, 169 insertions(+), 168 deletions(-) Date: Sun, 4 Jan 2009 16:23:29 +0100 (CET) From: Stefan Richter firewire: cdev: reference-count client instances The lifetime of struct client instances must be longer than the lifetime of any client resource. This fixes a possible race between fw_device_op_release and transaction completions. It also prepares for new ioctls for isochronous resource management which will involve delayed processing of client resources. Signed-off-by: Stefan Richter Reviewed-by: David Moore --- drivers/firewire/fw-cdev.c | 55 ++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 9 deletions(-) Date: Fri, 2 Jan 2009 12:47:13 +0100 (CET) From: Stefan Richter firewire: cdev: fix documentation of FW_CDEV_IOC_GET_INFO The FW_CDEV_IOC_GET_INFO ioctl looks at client->device->config_rom, not at the local node's config ROM. We could fix the implementation or the documentation. I believe the way how it is currently implemented is more useful than the way how it is currently documented. In fact, libdc1394 uses the ABI already as implemented, not as documented. Hence let's change the documentation. Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Thu, 25 Dec 2008 15:34:25 +0100 (CET) From: Julia Lawall firedtv: Use DEFINE_SPINLOCK SPIN_LOCK_UNLOCKED is deprecated. The following makes the change suggested in Documentation/spinlocks.txt Signed-off-by: Julia Lawall Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_1394.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 21 Dec 2008 16:39:46 +0100 (CET) From: Stefan Richter firewire: prevent creation of multiple IR DMA contexts for the same channel OHCI-1394 1.1 clause 10.4.3 says: "If more than one IR DMA context specifies receives for packets from the same isochronous channel, the context destination for that channel's packets is undefined." Any userspace client and in the future also kernelspace clients can allocate IR DMA contexts for any channel. We don't want them to interfere with each other, hence it is preferable to return -EBUSY if allocation of a second context for a channel is attempted. Notes: - This limitation is OHCI-1394 specific, therefore its proper place of implementation is down in the low-level driver. - Since the ABI simply maps one userspace iso client context to one hardware iso context, this OHCI-1394 limitation alas requires userspace to implement its own multiplexing of iso reception from the same channel and card to multiple clients when needed. - The limitation is independent of channel allocation at the IRM; the latter is really only important for the initiation of iso transmission but not of iso reception. - We don't need to do the same for IT DMA because OHCI-1394 does not have any ties between IT contexts and channels. Only the voluntary channel allocation protocol via the IRM, globally to the FireWire bus, can ensure proper isochronous transmit behaviour anyway. Signed-off-by: Stefan Richter --- drivers/firewire/fw-iso.c | 3 ++- drivers/firewire/fw-ohci.c | 14 +++++++++++--- drivers/firewire/fw-transaction.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) Date: Sun, 21 Dec 2008 16:49:57 +0100 (CET) From: Stefan Richter firewire: cdev: use list_first_entry Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Mon, 15 Dec 2008 08:17:12 +0100 From: Henrik Kurelid firedtv: fix registration - adapter number could only be zero There was a bug causing the initialization to fail if adapter number was greater than zero. The adapter was however registered which caused the driver to oops the second time initialization was tried. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 14 Dec 2008 21:47:36 +0100 (CET) From: Stefan Richter firewire: core: remove unused definitions Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 12 ------------ 1 file changed, 12 deletions(-) Date: Sun, 14 Dec 2008 21:47:04 +0100 (CET) From: Stefan Richter firewire: remove line breaks before function names type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 68 ++++++------------ drivers/firewire/fw-cdev.c | 88 ++++++++++-------------- drivers/firewire/fw-device.c | 40 ++++------- drivers/firewire/fw-device.h | 3 drivers/firewire/fw-iso.c | 28 +++---- drivers/firewire/fw-ohci.c | 100 ++++++++++++--------------- drivers/firewire/fw-sbp2.c | 57 ++++++--------- drivers/firewire/fw-topology.c | 28 +++---- drivers/firewire/fw-topology.h | 13 +-- drivers/firewire/fw-transaction.c | 92 ++++++++++--------------- drivers/firewire/fw-transaction.h | 109 +++++++++--------------------- 11 files changed, 249 insertions(+), 377 deletions(-) Date: Sun, 14 Dec 2008 21:45:45 +0100 (CET) From: Stefan Richter firewire: standardize a variable name "ret" is the new "retval". Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 44 ++++++++++++------------- drivers/firewire/fw-iso.c | 12 +++---- drivers/firewire/fw-ohci.c | 51 ++++++++++++++---------------- drivers/firewire/fw-transaction.c | 8 ++-- 4 files changed, 57 insertions(+), 58 deletions(-) Date: Sun, 14 Dec 2008 21:45:14 +0100 (CET) From: Stefan Richter firewire: core: remove obsolete assertions This code never changes. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) Date: Sun, 14 Dec 2008 19:21:31 +0100 (CET) From: Stefan Richter firewire: core: remove outdated comment Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) Date: Sun, 14 Dec 2008 19:21:01 +0100 (CET) From: Stefan Richter firewire: cdev: address handler input validation Like before my commit 1415d9189e8c59aa9c77a3bba419dcea062c145f, fw_core_add_address_handler() does not align the address region now. Instead the caller is required to pass valid parameters. Since one of the callers of fw_core_add_address_handler() is the cdev userspace interface, we now check for valid input. If the client is buggy, we give it a hint with -EINVAL. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 5 +++-- drivers/firewire/fw-transaction.c | 27 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) Date: Sun, 21 Dec 2008 16:47:17 +0100 (CET) From: Jay Fenlason firewire: cdev: use an idr rather than a linked list for resources The current code uses a linked list and a counter for storing resources and the corresponding handle numbers. By changing to an idr we can be safe from counter wrap-around giving two resources the same handle. Furthermore, the deallocation ioctls now check whether the resource to be freed is of the intended type. Signed-off-by: Jay Fenlason Some rework by Stefan R: - The idr API documentation says we get an ID within 0...0x7fffffff. Hence we can rest assured that idr handles fit into cdev handles. - Fix some races. Add a client->in_shutdown flag for this purpose. - Add allocation retry to add_client_resource(). - It is possible to use idr_for_each() in fw_device_op_release(). - Fix ioctl_send_response() regression. - Small style changes. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 165 +++++++++++++++++++++++++------------ 1 file changed, 114 insertions(+), 51 deletions(-) Date: Sun, 14 Dec 2008 19:19:23 +0100 (CET) From: Stefan Richter firewire: cdev: fix race of fw_device_op_release with bus reset Unlink the client from the fw_device earlier in order to prevent bus reset events being added to client->event_list during shutdown. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sat, 13 Dec 2008 15:21:29 -0800 From: Harvey Harrison ieee1934: dv1394: interrupt enabling/disabling broken on big-endian After annotating the frame structs, this was left: drivers/ieee1394/dv1394.c:2113:23: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2113:23: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2113:23: right side has type int drivers/ieee1394/dv1394.c:2121:24: warning: invalid assignment: &= drivers/ieee1394/dv1394.c:2121:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2121:24: right side has type int drivers/ieee1394/dv1394.c:2123:24: warning: invalid assignment: |= drivers/ieee1394/dv1394.c:2123:24: left side has type restricted __le32 drivers/ieee1394/dv1394.c:2123:24: right side has type int Which looks like a real bug on a big-endian arch as it would set/clear the wrong bit. Signed-off-by: Harvey Harrison Bill Fink writes: I finally got a chance to test the patch on my kernel, and live DV viewing using xine still worked fine. Although I admit to being mystified how it works both before and after the patch, since the cpu_to_le32() calls that were added should result in byte swapping on PPC that wasn't being done before. I guess that either the code paths involved aren't actually being triggered by my xine DV viewing, or there's some fortuitous palindromic setting of bits. Tested-by: Bill Fink Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sat, 13 Dec 2008 15:20:39 -0800 From: Harvey Harrison ieee1394: dv1394: annotate frame input/output structs as little endian No Functional changes. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394-private.h | 44 +++++++++++++++--------------- drivers/ieee1394/dv1394.c | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) Date: Sat, 13 Dec 2008 15:03:06 -0800 From: Harvey Harrison ieee1394: eth1394: trivial sparse annotations Mostly annotations of ether_type as a be16. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/eth1394.c | 26 +++++++++++++------------- drivers/ieee1394/eth1394.h | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) Date: Sat, 13 Dec 2008 15:02:34 -0800 From: Harvey Harrison ieee1394: mark bus_info_data as a __be32 array Two access functions get_max_rom and set_hw_config_rom are changed to take __be32 as well. Only bus_info_data was ever passed in so this is OK. All other uses of bus_info_data treated it as a be32 value already. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.h | 2 +- drivers/ieee1394/hosts.h | 2 +- drivers/ieee1394/ohci1394.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Date: Sat, 13 Dec 2008 15:02:21 -0800 From: Harvey Harrison ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.h | 10 +++++----- drivers/ieee1394/hosts.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) Date: Sat, 13 Dec 2008 15:01:50 -0800 From: Harvey Harrison ieee1394: pcilynx: trivial endian annotation bus_info_block was treated as a be32 everywhere, annotate as such. Removes plenty of sparse warnings. Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/pcilynx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 13 Dec 2008 23:12:06 +0100 (CET) From: Stefan Richter ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets It is already known that buggy firmwares exist which report a bogus link_spd in their config ROM bus info block. We now got the first report of a bogus max_rom too (Freecom FireWire Hard Drive 1TB, http://bugzilla.kernel.org/show_bug.cgi?id=12206). I suspect other OSs only use quadlet reads to fetch the config ROM, otherwise the firmware authors would have noticed their mistake. Hence limit ieee1394's config ROM fetching routine to quadlets as the safe minimum regardless of what the bus info block says. This will potentially slow the bus reset handling by nodemgr somewhat down. But most existing devices support only quadlet reads anyway, hence there will often be no actual difference to before this change. Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.c | 45 +++++++++++-------------------------- drivers/ieee1394/csr1212.h | 7 ----- drivers/ieee1394/nodemgr.c | 20 +++------------- 3 files changed, 19 insertions(+), 53 deletions(-) Date: Fri, 5 Dec 2008 10:00:16 +0100 From: Henrik Kurelid firedtv: use length_field() of PMT as length Parsed and used the length_field() of the PMT message instead of using the length field of the message struct, which does not seem to be filled correctly by e.g. MythTV. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) Date: Thu, 4 Dec 2008 22:40:52 +0100 From: Henrik Kurelid firedtv: fix returned struct for ca_info The SystemId of the ca_info message was filled with garbage. It now returns what the card returns. Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: increase FCP frame length for DVB-S2 tune QSPK The last three bytes didn't go out to the wire. Effect of the fix not yet tested. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: replace mdelay by msleep These functions can sleep (and in fact sleep for the duration of a whole FCP transaction). Hence msleep is more appropriate here. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial reorganization in avc_api Reduce nesting level by factoring code out of avc_tuner_dsd() into helper functions. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 519 +++++++++++++--------------- 1 file changed, 257 insertions(+), 262 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in avc_api Use dev_err(), no CamelCase function names, adjust comment style, put #if 0 around unused code and add FIXME comments, standardize on lower-case hexadecimal constants, use ALIGN() for some frame length calculations, make a local function static... The code which writes FCP command frames and reads FCP response frames is not yet brought into canonical kernel coding style because this involves changes of typedefs (on-the-wire bitfields). Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 206 +++++++++++------------ drivers/media/dvb/firesat/avc_api.h | 31 +-- drivers/media/dvb/firesat/firesat-ci.c | 8 drivers/media/dvb/firesat/firesat_1394.c | 6 drivers/media/dvb/firesat/firesat_dvb.c | 13 - drivers/media/dvb/firesat/firesat_fe.c | 46 ++--- 6 files changed, 146 insertions(+), 164 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: don't retry oPCR updates endlessly In the theoretical case that the target node wasn't handling the lock transactions as expected or there was continued interference by other initiating nodes, these functions wouldn't return for ages. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove bitfield typedefs from cmp, fix for big endian CPUs Use macros/ inline functions/ standard byte order accessors to read and write oPCR register values (big endian bitfields, on-the-wire data). The new code may not be the ultimate optimum, but it doesn't occur in a hot path. This fixes the CMP code for big endian CPUs. So far I tested it only on a little endian CPU though. For now, include instead of because drivers/ieee1394/*.h also include the former. I will fix this in drivers/ieee1394 and firedtv later. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 70 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 32 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in cmp Reduce nesting level by means of early exit and goto. Remove obsolete includes, use dev_err(), no CamelCase function names... Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 199 +++++++++-------------- drivers/media/dvb/firesat/cmp.h | 6 drivers/media/dvb/firesat/firesat_1394.c | 4 drivers/media/dvb/firesat/firesat_fe.c | 6 4 files changed, 93 insertions(+), 122 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: trivial cleanups in firesat-ci Whitespace, variable names, comment style... Also, use dvb_generic_open() and dvb_generic_release() directly as our hooks in struct file_operations because firedtv's wrappers merely called these generic functions. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 162 ++++++++++--------------- 1 file changed, 66 insertions(+), 96 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove CA debug code This looks like it is not necessary to have available for endusers who cannot patch kernels for bug reporting and tests of fixes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat-ci.c | 67 ------------------------- 1 file changed, 67 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove AV/C debug code This looks like it is not necessary to have available for endusers who cannot patch kernels for bug reporting and tests of fixes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 171 ---------------------------- 1 file changed, 6 insertions(+), 165 deletions(-) Date: Sun, 2 Nov 2008 13:45:00 +0100 (CET) From: Stefan Richter firedtv: remove various debug code Most of this was already commented out. And that which wasn't is not relevant in normal use. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/cmp.c | 11 +---------- drivers/media/dvb/firesat/firesat_1394.c | 4 ---- drivers/media/dvb/firesat/firesat_dvb.c | 4 ---- drivers/media/dvb/firesat/firesat_iso.c | 8 +------- 4 files changed, 2 insertions(+), 25 deletions(-) Date: Mon, 29 Sep 2008 19:22:48 +0200 (CEST) From: Stefan Richter firedtv: register input device as child of a FireWire device Instead of one virtual input device which exists for the whole lifetime of the driver and receives events from all connected FireDTVs, register one input device for each firedtv device. These input devices will show up as children of the respective firedtv devices in the sysfs hierarchy. However, the implementation falls short because of a bug in userspace: Udev's path_id script gets stuck with 100% CPU utilization, maybe because of an assumption about the maximum ieee1394 device hierarchy depth. To avoid this bug, we use the fw-host device instead of the proper unit_directory device as parent of the input device. There is hope that the port to the new firewire stack won't be inhibited by this userspace bug because there are no fw-host devices there. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 4 +- drivers/media/dvb/firesat/firesat-rc.c | 42 +++++++++++++++-------- drivers/media/dvb/firesat/firesat-rc.h | 9 +++- drivers/media/dvb/firesat/firesat.h | 5 +- drivers/media/dvb/firesat/firesat_1394.c | 26 ++++++-------- 5 files changed, 52 insertions(+), 34 deletions(-) Date: Mon, 29 Sep 2008 19:21:52 +0200 (CEST) From: Stefan Richter firedtv: fix string comparison and a few sparse warnings Sparse found a bug: while ((kv_buf + kv_len - 1) == '\0') should have been while (kv_buf[kv_len - 1] == '\0') We fix it by a better implementation without a temporary copy. Also fix sparse warnings of 0 instead of NULL and signedness mismatches. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 14 +++++++------- drivers/media/dvb/firesat/avc_api.h | 6 +++--- drivers/media/dvb/firesat/firesat_1394.c | 23 +++++++---------------- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- 4 files changed, 18 insertions(+), 27 deletions(-) Date: Mon, 29 Sep 2008 19:21:20 +0200 (CEST) From: Stefan Richter firedtv: remove unused struct members and redefine an int as a bool. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat.h | 7 +------ drivers/media/dvb/firesat/firesat_dvb.c | 20 ++++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) Date: Mon, 29 Sep 2008 19:20:36 +0200 (CEST) From: Stefan Richter firedtv: fix initialization of dvb_frontend.ops There was a NULL pointer reference if no dvb_frontend_info was found. Also, don't directly assign struct typed values to struct typed variables. Instead write out assignments to individual strcut members. This reduces module size by about 1 kB. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat.h | 34 ++-- drivers/media/dvb/firesat/firesat_dvb.c | 3 drivers/media/dvb/firesat/firesat_fe.c | 167 ++++++++++-------------- 3 files changed, 91 insertions(+), 113 deletions(-) Date: Mon, 29 Sep 2008 19:19:41 +0200 (CEST) From: Stefan Richter firedtv: remove unused dual subunit code from initialization No FireDTVs with more than one subunit exists, hence simplify the initialization for the special case of one subunit. The driver was able to check for more than one subunit but was broken for more than two subunits. While we are at it, add several missing cleanups after failure, and include a few dynamically allocated structures diretly into struct firesat instead of allocating them separately. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 36 --- drivers/media/dvb/firesat/avc_api.h | 1 drivers/media/dvb/firesat/firesat-ci.c | 15 - drivers/media/dvb/firesat/firesat-ci.h | 2 drivers/media/dvb/firesat/firesat.h | 18 - drivers/media/dvb/firesat/firesat_1394.c | 214 ++++++++--------------- drivers/media/dvb/firesat/firesat_dvb.c | 166 +++++++---------- drivers/media/dvb/firesat/firesat_fe.c | 22 -- 8 files changed, 171 insertions(+), 303 deletions(-) Date: Mon, 29 Sep 2008 19:19:08 +0200 (CEST) From: Stefan Richter firedtv: add vendor_id and version to driver match table Now that nodemgr was enhanced to match against the root directory's vendor ID if there isn't one in the unit directory, use this to prevent firedtv to be bound to wrong devices by accident. Also add the AV/C software version ID to the match flags for completeness; specifier ID and software only make sense as a pair. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/firesat_1394.c | 52 ++++++++++++++--------- 1 file changed, 33 insertions(+), 19 deletions(-) Date: Mon, 29 Sep 2008 19:18:30 +0200 (CEST) From: Stefan Richter firedtv: use hpsb_node_read(), _write(), _lock() because they are simpler and treat the node generation more correctly. While we are at it, clean up and simplify surrounding code. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 133 +++++++---------------- drivers/media/dvb/firesat/cmp.c | 7 - drivers/media/dvb/firesat/firesat.h | 10 - drivers/media/dvb/firesat/firesat_1394.c | 24 +--- drivers/media/dvb/firesat/firesat_iso.c | 3 5 files changed, 58 insertions(+), 119 deletions(-) Date: Wed, 27 Aug 2008 01:24:25 +0200 (CEST) From: Stefan Richter ieee1394: inherit ud vendor_id from node vendor_id While Module_Vendor_ID in the configuration ROM's root directory is mandatory, there often aren't vendor IDs in unit directories. This affects the new firedtv driver which is meant to be auto-loaded and matched only for vendor-specific devices. We now always copy ne->vendor_id into ud->vendor_id before we scan a unit directory (and fill in a possibly present vendor ID from there). This way, the root directory's vendor ID is used as fallback in the "uevent" environment for modprobe'ing per module alias when a node was plugged in, and in the driver match routine when protocol drivers are bound to unit directories. It will however not be used as sysfs attribute of a unit directory device. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 3 +++ 1 file changed, 3 insertions(+) Date: Wed, 27 Aug 2008 13:40:02 +0200 From: Stefan Richter ieee1394: add hpsb_node_read() and hpsb_node_lock() These will be used by the firedtv driver. Like hpsb_node_write() they are much better APIs for high-level drivers than hpsb_write() and its siblings --- easier to use correctly and also terser. Unlike hspb_node_write(), the two new functions will only be used by one call site. Hence make them static inline instead of exported symbols. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) Date: Wed, 27 Aug 2008 01:18:32 +0200 (CEST) From: Stefan Richter ieee1394: use correct barrier types between accesses of nodeid and generation A compiler barrier (explicit on the read side, implicit on the write side) is not quite enough for what has to be accomplished here. Use hardware memory barriers on systems which need them. (Of course a full fix of generation handling would require much more than this. The ieee1394 core's bus generation counter had to be tied to the controller's bus generation counter; cf. Kristian's stack. It's just that I have other current business with the code around these barrier()s, so why not do at least this small fix.) Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Date: Tue, 26 Aug 2008 00:17:30 +0200 (CEST) From: Stefan Richter firedtv: fix remote control input and update the scancode-to-keycode mapping to a current model. Per default, various media key keycodes are emitted which closely match what is printed on the remote. Userland can modify the mapping by means of evdev ioctls. (Not tested.) The old scancode-to-keycode mapping is left in the driver but cannot be modified by ioctls. This preserves status quo for old remotes. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 31 ++--- drivers/media/dvb/firesat/firesat-rc.c | 137 ++++++++++++++++++----- drivers/media/dvb/firesat/firesat-rc.h | 6 - drivers/media/dvb/firesat/firesat_1394.c | 25 ++-- 4 files changed, 139 insertions(+), 60 deletions(-) Date: Tue, 26 Aug 2008 00:11:28 +0200 (CEST) From: Stefan Richter firedtv: replace tasklet by workqueue job Non-atomic context is a lot nicer to work with. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 57 ++++------------------- drivers/media/dvb/firesat/avc_api.h | 1 drivers/media/dvb/firesat/firesat.h | 4 - drivers/media/dvb/firesat/firesat_1394.c | 4 + 4 files changed, 18 insertions(+), 48 deletions(-) Date: Sun, 24 Aug 2008 23:30:00 +0200 (CEST) From: Stefan Richter firedtv: move some code back to ieee1394 core Partially reverts "ieee1394: remove unused code" of Linux 2.6.25. Signed-off-by: Stefan Richter --- drivers/ieee1394/ieee1394_core.c | 1 drivers/ieee1394/ieee1394_transactions.c | 29 ++++++++++ drivers/ieee1394/ieee1394_transactions.h | 2 drivers/media/dvb/firesat/cmp.c | 61 +---------------------- 4 files changed, 35 insertions(+), 58 deletions(-) Date: Sun, 24 Aug 2008 23:29:30 +0200 (CEST) From: Stefan Richter firedtv: replace semaphore by mutex firesat->avc_sem and ->demux_sem have been used exactly like a mutex. The only exception is the schedule_remotecontrol tasklet which did a down_trylock in atomic context. This is not possible with mutex_trylock; however the whole remote control related code is non-functional anyway at the moment. This should be fixed eventually, probably by turning the tasklet into a worqueue job. Convert everything else from semaphore to mutex. Also rewrite a few of the affected functions to unlock the mutex at a single exit point, instead of in several branches. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 11 +++- drivers/media/dvb/firesat/cmp.c | 27 +++++++---- drivers/media/dvb/firesat/firesat.h | 11 +--- drivers/media/dvb/firesat/firesat_1394.c | 5 +- drivers/media/dvb/firesat/firesat_dvb.c | 54 +++++++++-------------- 5 files changed, 55 insertions(+), 53 deletions(-) Date: Sun, 24 Aug 2008 23:28:45 +0200 (CEST) From: Stefan Richter firedtv: some header cleanups Unify #ifndef/#define/#endif guards against multiple inclusion. Drop extern keyword from function declarations. Remove #include's into header files where struct declarations suffice. Remove unused ohci1394 interface and related unused ieee1394 interfaces. Add a few missing #include's and remove a few apparently obsolete ones. Sort them alphabetically. Signed-off-by: Stefan Richter --- drivers/ieee1394/dma.h | 1 drivers/ieee1394/iso.h | 1 drivers/media/dvb/firesat/avc_api.c | 13 ++- drivers/media/dvb/firesat/avc_api.h | 69 +++++++++--------- drivers/media/dvb/firesat/cmp.c | 15 ++-- drivers/media/dvb/firesat/cmp.h | 14 ++- drivers/media/dvb/firesat/firesat-ci.c | 11 +-- drivers/media/dvb/firesat/firesat-ci.h | 8 +- drivers/media/dvb/firesat/firesat-rc.c | 5 - drivers/media/dvb/firesat/firesat-rc.h | 13 +-- drivers/media/dvb/firesat/firesat.h | 48 +++++++------ drivers/media/dvb/firesat/firesat_1394.c | 84 ++++++----------------- drivers/media/dvb/firesat/firesat_dvb.c | 21 +---- drivers/media/dvb/firesat/firesat_fe.c | 21 +---- drivers/media/dvb/firesat/firesat_iso.c | 10 ++ 15 files changed, 160 insertions(+), 174 deletions(-) Date: Sun, 24 Aug 2008 23:27:45 +0200 (CEST) From: Stefan Richter firedtv: nicer registration message and some initialization fixes Print the correct name in dvb_register_adapter(). While we are at it, replace two switch cascades by one for loop, remove a superfluous member of struct firesat and of two unused arguments of AVCIdentifySubunit(), and fix bogus kfree's in firesat_dvbdev_init(). Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 5 - drivers/media/dvb/firesat/avc_api.h | 2 drivers/media/dvb/firesat/firesat.h | 11 ++- drivers/media/dvb/firesat/firesat_1394.c | 30 +++++----- drivers/media/dvb/firesat/firesat_dvb.c | 68 ++++------------------- drivers/media/dvb/firesat/firesat_fe.c | 8 -- 6 files changed, 40 insertions(+), 84 deletions(-) Date: Tue, 26 Aug 2008 14:24:17 +0200 (CEST) From: Stefan Richter firesat: rename to firedtv Suggested by Andreas Monitzer. Besides DVB-S/-S2 receivers, the driver also supports DVB-C and DVB-T receivers, hence the previous project name is too narrow now. Not yet done: Rename source directory, files, types, variables... Signed-off-by: Stefan Richter --- drivers/media/dvb/Makefile | 2 +- drivers/media/dvb/firesat/Kconfig | 13 +++++++------ drivers/media/dvb/firesat/Makefile | 4 ++-- drivers/media/dvb/firesat/avc_api.c | 2 +- drivers/media/dvb/firesat/cmp.c | 2 +- drivers/media/dvb/firesat/firesat-ci.c | 2 +- drivers/media/dvb/firesat/firesat-rc.c | 2 +- drivers/media/dvb/firesat/firesat.h | 2 +- drivers/media/dvb/firesat/firesat_1394.c | 16 ++++++++-------- drivers/media/dvb/firesat/firesat_dvb.c | 2 +- drivers/media/dvb/firesat/firesat_fe.c | 8 ++++---- 11 files changed, 28 insertions(+), 27 deletions(-) Date: Sun, 24 Aug 2008 23:26:23 +0200 (CEST) From: Stefan Richter firesat: add missing copyright notes Reported by Andreas Monitzer and Christian Dolzer. Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 +-- drivers/media/dvb/firesat/avc_api.h | 39 +++++++++-------------- drivers/media/dvb/firesat/cmp.c | 4 +- drivers/media/dvb/firesat/firesat-ci.c | 3 + drivers/media/dvb/firesat/firesat-rc.c | 11 ++++++ drivers/media/dvb/firesat/firesat.h | 4 +- drivers/media/dvb/firesat/firesat_1394.c | 6 +-- drivers/media/dvb/firesat/firesat_dvb.c | 4 +- drivers/media/dvb/firesat/firesat_fe.c | 4 +- drivers/media/dvb/firesat/firesat_iso.c | 2 - 10 files changed, 44 insertions(+), 39 deletions(-) Date: Sun, 24 Aug 2008 15:20:07 +0200 From: Henrik Kurelid firesat: avc resend - Add resending of AVC message to the card if no answer is received - Replace the homebrewed event_wait function with a standard wait queue - Clean up of log/error messages - Increase debug level of avc communication Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 171 ++++++++++++----------- drivers/media/dvb/firesat/firesat.h | 1 drivers/media/dvb/firesat/firesat_1394.c | 1 3 files changed, 94 insertions(+), 79 deletions(-) Date: Fri, 1 Aug 2008 10:00:45 +0200 (CEST) From: Henrik Kurelid firesat: update isochronous interface, add CI support I have finally managed to get the CI support for the card working. The implementation is a bare minimum to get encrypted channels to work in kaffeine. It works fine with my T/CI card. Now and then I get an AVC timeout and have to retune a channel in order to get it to work. Once the CAM seemed to hang so I needed to remove and insert it again. I.e. there are a number of glitches. The latest version contains the following changes: - Implemented the new hpsb iso interface so that data can be received from the card - Reduced some timers for demux setup which caused scanning to timeout - Added possibility to unload driver - Added support for getting C/N ratio - Added two debug parameters to the driver; ca_debug and avc_comm_debug. - Added CI support that works for me in kaffeine - Started working on CI MMI support. It now supports: o Enter menu o Receiving MMI objects - Added support for 64-bit platforms - Corrected DVB-C modulations problems Signed-off-by: Henrik Kurelid Signed-off-by: Stefan Richter (rebased, whitespace) --- drivers/media/dvb/firesat/Makefile | 1 drivers/media/dvb/firesat/avc_api.c | 768 ++++++++++++++++++----- drivers/media/dvb/firesat/avc_api.h | 296 +++++--- drivers/media/dvb/firesat/cmp.c | 44 - drivers/media/dvb/firesat/firesat-ci.c | 342 ++++++++-- drivers/media/dvb/firesat/firesat.h | 174 ++++- drivers/media/dvb/firesat/firesat_1394.c | 123 --- drivers/media/dvb/firesat/firesat_dvb.c | 49 - drivers/media/dvb/firesat/firesat_fe.c | 80 +- drivers/media/dvb/firesat/firesat_iso.c | 106 +++ 10 files changed, 1488 insertions(+), 495 deletions(-) Date: Sat, 09 Aug 2008 14:35:55 +0200 From: Ben Backx firesat: add DVB-S support for DVB-S2 devices ...so S2 owners now can at least watch DVB-S channels in linux. Signed-off-by: Ben Backx Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 6 ++++++ 1 file changed, 6 insertions(+) Date: Sun, 22 Jun 2008 16:00:53 +0200 From: Ben Backx firesat: fix DVB-S2 device recognition This only makes sure that a DVB-S2 device is really recognized as a S2, nothing else is added yet. It's using the string containing the model that is stored in the configuration ROM, the older version was using some hardware revision dependent part of the ROM. Signed-off-by: Ben Backx Signed-off-by: Stefan Richter --- drivers/media/dvb/firesat/avc_api.c | 17 ------------- drivers/media/dvb/firesat/firesat.h | 3 +- drivers/media/dvb/firesat/firesat_1394.c | 28 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 17 deletions(-) Date: Thu, 6 Mar 2008 21:30:23 -0800 From: Greg Kroah-Hartman DVB: add firesat driver Original code written by Christian Dolzer Cleaned up by Greg. Major cleanup and reorg by Manu Abraham Additions also by Ben Backx Cc: Christian Dolzer Cc: Andreas Monitzer Cc: Manu Abraham Cc: Fabio De Lorenzo Cc: Robert Berger Signed-off-by: Ben Backx Signed-off-by: Greg Kroah-Hartman Signed-off-by: Stefan Richter (tweaked dvb/Makefile) --- drivers/media/dvb/Kconfig | 2 drivers/media/dvb/Makefile | 2 drivers/media/dvb/firesat/Kconfig | 11 drivers/media/dvb/firesat/Makefile | 12 drivers/media/dvb/firesat/avc_api.c | 848 +++++++++++++++++++++++ drivers/media/dvb/firesat/avc_api.h | 381 ++++++++++ drivers/media/dvb/firesat/cmp.c | 230 ++++++ drivers/media/dvb/firesat/cmp.h | 9 drivers/media/dvb/firesat/firesat-ci.c | 95 ++ drivers/media/dvb/firesat/firesat-ci.h | 9 drivers/media/dvb/firesat/firesat-rc.c | 84 ++ drivers/media/dvb/firesat/firesat-rc.h | 9 drivers/media/dvb/firesat/firesat.h | 85 ++ drivers/media/dvb/firesat/firesat_1394.c | 468 ++++++++++++ drivers/media/dvb/firesat/firesat_dvb.c | 350 +++++++++ drivers/media/dvb/firesat/firesat_fe.c | 263 +++++++ 16 files changed, 2858 insertions(+) Date: Sat, 13 Dec 2008 01:43:59 +0100 (CET) From: Stefan Richter ieee1394: add quirk fix for Freecom HDD According to http://bugzilla.kernel.org/show_bug.cgi?id=12206, Freecom FireWire Hard Drive 1TB reports max_rom=2 but returns garbage if block read requests are used to read the config ROM. Force max_rom=0 to limit them to quadlet read requests. Reported-by: Christian Mueller Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 6 ++++++ 1 file changed, 6 insertions(+) Date: Fri, 12 Dec 2008 21:57:50 -0800 From: Harvey Harrison ieee1394: consolidate uses of IEEE1934_BUSID_MAGIC Move the definition out of nodemgr.h and use it in csr.c/pcilynx.c Signed-off-by: Harvey Harrison Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 4 ++-- drivers/ieee1394/ieee1394.h | 3 +++ drivers/ieee1394/nodemgr.h | 3 --- drivers/ieee1394/pcilynx.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) Date: Wed, 10 Dec 2008 00:20:38 +0100 (CET) From: Stefan Richter firewire: fw-ohci: fix IOMMU resource exhaustion There is a DMA map/ unmap imbalance whenever a block write request packet is sent and then dequeued with ohci_cancel_packet. The latter may happen frequently if the AR resp tasklet is executed before the AT req tasklet for the same transaction. Add the missing dma_unmap_single. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=475156 Reported-by: Emmanuel Kowalski Tested-by: Emmanuel Kowalski Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 11 +++++++---- drivers/firewire/fw-transaction.c | 3 +++ drivers/firewire/fw-transaction.h | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) Date: Tue, 09 Dec 2008 22:40:20 +1100 From: Nigel Cunningham ieee1394: node manager causes up to ~3.25s delay in freezing tasks The firewire nodemanager function "nodemgr_host_thread" contains a loop that calls try_to_freeze near the top of the loop, but then delays for up to 3.25 seconds (plus time to do work) before getting back to the top of the loop. When starting a cycle post-boot, this doesn't seem to bite, but it is causing a noticeable delay at boot time, when freezing processes prior to starting to read the image. The following patch adds invocation of try_to_freeze to the subloops that are used in the body of this function. With these additions, the time to freeze when starting to resume at boot time is virtually zero. I'm no expert on firewire, and so don't know that we shouldn't check the return value and jump back to the top of the loop or such like after being frozen, but I submit it for your consideration. Signed-off-by: Nigel Cunningham The delay until nodemgr freezes was up to 0.25s (plus time for node probes) in Linux 2.6.27 and older and up to 3.25s (plus ~) since Linux 2.6.28-rc1, hence much more noticeable. try_to_freeze() without any jump is correct. The surrounding code in the respective loops will catch whether another bus reset happens during the freeze and handle it. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 2 ++ 1 file changed, 2 insertions(+) Date: Sat, 6 Dec 2008 17:35:59 +0100 (CET) From: Stefan Richter ieee1394: ohci1394: flush MMIO writes before delay in initialization and replace busy-wait by msleep. Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) Date: Sat, 6 Dec 2008 17:35:20 +0100 (CET) From: Stefan Richter ieee1394: ohci1394: pass error codes from request_irq through Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) Date: Sat, 6 Dec 2008 15:36:47 +0100 From: Frans Pop ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume On my HP 2510p I get the following in dmesg during near the end of most resumes from suspend to RAM: irq 19: nobody cared (try booting with the "irqpoll" option) Pid: 0, comm: swapper Not tainted 2.6.28-rc7 #67 Call Trace: [] ? ohci_irq_handler+0x60/0x7e9 [ohci1394] [] __report_bad_irq+0x38/0x87 [] note_interrupt+0x10e/0x174 [] handle_fasteoi_irq+0xa7/0xd1 [] do_IRQ+0x73/0xe4 [] ret_from_intr+0x0/0xa [] ? acpi_idle_enter_bm+0x26b/0x2b2 [processor] [] ? acpi_idle_enter_bm+0x261/0x2b2 [processor] [] ? notifier_call_chain+0x33/0x5b [] ? cpuidle_idle_call+0x8c/0xc4 [] ? cpu_idle+0x4a/0x9a [] ? rest_init+0x5c/0x5e handlers: [] (ohci_irq_handler+0x0/0x7e9 [ohci1394]) Disabling IRQ #19 There also seems to be an interrupt storm during suspend/resume when this happens: 19: 99968 33 IO-APIC-fasteoi ohci1394 This patch gets rid of both issues and makes the resume as a whole significantly faster. Signed-off-by: Frans Pop As was pointed out in http://lkml.org/lkml/2008/12/6/127, this does not fix the cause of the interrupt storm. However, since the source of the interrupts could not be determined yet, we make the system at least more usable with this change. Signed-off-by: Stefan Richter --- drivers/ieee1394/ohci1394.c | 8 ++++++++ 1 file changed, 8 insertions(+) Date: Fri, 5 Dec 2008 22:44:42 +0100 (CET) From: Stefan Richter firewire: cdev: tcodes input validation The behaviour of fw-transaction.c::fw_send_request is ill-defined for any other tcodes than read/ write/ lock request tcodes. Therefore prevent requests with wrong tcodes from entering the transaction layer. Maybe fw_send_request should check them itself, but I am not inclined to change it and fw_fill_request from void-valued functions to ones which return error codes and pass those up. Besides, maybe fw_send_request is going to support one more tcode than ioctl_send_request in the future (TCODE_STREAM_DATA). Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) Date: Fri, 5 Dec 2008 22:43:41 +0100 (CET) From: Stefan Richter firewire: cdev: documentation fixlet Reported-by: Jay Fenlason Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 29 Nov 2008 19:00:56 +0100 (CET) From: Stefan Richter firewire: reorder struct fw_card for better cache efficiency topology_map is by far the largest member in struct fw_card. Move it to the very end of the struct so that card pointer dereferences have better chances to hit the CPU cache. This requires to increase the topology_map backing store to the size specified in IEEE 1394, i.e. 256 rather than 255 quadlets. Otherwise the topology_map response handler may access invalid memory. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) Date: Sat, 29 Nov 2008 18:56:47 +0100 (CET) From: Stefan Richter firewire: fix resetting of bus manager retry counter An earlier change, maybe long ago, removed the copying of self_id_count into card->self_id_count. Since then each bus reset cleared card->bm_retries even when it shouldn't. Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.c | 14 ++++++-------- drivers/firewire/fw-transaction.h | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) Date: Sat, 29 Nov 2008 17:44:57 +0100 (CET) From: Jay Fenlason firewire: improve refcounting of fw_card Take a reference to the card whenever fw_card_bm_work() is scheduled on that card and release it when the work is done. This allows us to remove the cancel_delayed_work_sync() in fw_core_remove_card(). Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter (patch update) --- drivers/firewire/fw-card.c | 18 +++++++++++++++--- drivers/firewire/fw-device.c | 6 +++--- drivers/firewire/fw-topology.c | 2 +- drivers/firewire/fw-transaction.h | 2 ++ 4 files changed, 21 insertions(+), 7 deletions(-) Date: Wed, 22 Oct 2008 15:59:42 -0400 From: Jay Fenlason firewire: typo in comment Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 29 Nov 2008 14:55:47 +0100 (CET) From: Stefan Richter ieee1394: sbp2: fix race condition in state change An intermediate transition from _RUNNING to _IN_SHUTDOWN could have been missed by the former code. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Date: Wed, 26 Nov 2008 01:35:21 +0100 (CET) From: Stefan Richter ieee1394: mark all hpsb_address_ops instances as const These are never modified. Signed-off-by: Stefan Richter --- drivers/ieee1394/csr.c | 8 ++++---- drivers/ieee1394/eth1394.c | 2 +- drivers/ieee1394/highlevel.c | 7 ++++--- drivers/ieee1394/highlevel.h | 7 ++++--- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/sbp2.c | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) Date: Wed, 26 Nov 2008 01:34:55 +0100 (CET) From: Stefan Richter ieee1394: replace a GFP_ATOMIC by GFP_KERNEL allocation All callers of hpsb_register_addrspace() can sleep. Signed-off-by: Stefan Richter --- drivers/ieee1394/highlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Wed, 26 Nov 2008 01:34:25 +0100 (CET) From: Stefan Richter ieee1394: fix list corruption at module removal If there is more than one FireWire controller present, dummy_zero_addr and dummy_max_addr were added multiple times to different lists, thus corrupting the lists. Fix this by allocating them dynamically per host instead of just once globally. (Perhaps a better address space allocation algorithm could rid us of the two dummy address spaces.) Fixes http://bugzilla.kernel.org/show_bug.cgi?id=10129 . Signed-off-by: Stefan Richter --- drivers/ieee1394/highlevel.c | 25 ++++++++++++------------- drivers/ieee1394/hosts.h | 4 ++++ 2 files changed, 16 insertions(+), 13 deletions(-) Date: Mon, 24 Nov 2008 20:40:00 +0100 (CET) From: Stefan Richter firewire: fix small memory leak at module removal Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 2 +- drivers/firewire/fw-device.h | 2 ++ drivers/firewire/fw-transaction.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) Date: Sat, 22 Nov 2008 12:38:58 +0100 (CET) From: Stefan Richter firewire: fw-sbp2: another iPod mini quirk entry Add another model ID of a broken firmware to prevent early I/O errors by acesses at the end of the disk. Reported at linux1394-user, http://marc.info/?t=122670842900002 Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 5 +++++ 1 file changed, 5 insertions(+) Date: Sat, 22 Nov 2008 12:38:24 +0100 (CET) From: Stefan Richter ieee1394: sbp2: another iPod mini quirk entry Add another model ID of a broken firmware to prevent early I/O errors by acesses at the end of the disk. Reported at linux1394-user, http://marc.info/?t=122670842900002 Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 5 +++++ 1 file changed, 5 insertions(+) Date: Thu, 30 Oct 2008 01:49:20 +0100 From: Kay Sievers ieee1394: struct device - replace bus_id with dev_name(), dev_set_name() Acked-by: Greg Kroah-Hartman Signed-off-by: Kay Sievers Signed-off-by: Stefan Richter --- drivers/ieee1394/hosts.c | 4 ++-- drivers/ieee1394/nodemgr.c | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) Date: Thu, 30 Oct 2008 01:41:56 +0100 From: Kay Sievers firewire: struct device - replace bus_id with dev_name(), dev_set_name() Acked-by: Greg Kroah-Hartman Signed-off-by: Kay Sievers Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.c | 14 ++++++-------- drivers/firewire/fw-ohci.c | 2 +- drivers/firewire/fw-sbp2.c | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) Date: Sun, 26 Oct 2008 11:04:20 +0100 (CET) From: Stefan Richter firewire: fw-sbp2: remove unnecessary locking What was I thinking when I added sbp2_set_generation()? Its locking did nothing (except for implicitly providing the necessary barrier between node IDs update and generation update). Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) Date: Sun, 26 Oct 2008 12:02:03 +0100 (CET) From: Stefan Richter ieee1394: dv1394: fix possible deadlock in multithreaded clients Fix a possible though highly unlikely deadlock: Thread A: Thread B: - acquire mmap_sem - dv1394_ioctl/read/write() - dv1394_mmap() - acquire video->mtx - acquire video->mtx - copy_to/from_user(), possible page fault: acquire mmap_sem The simplest fix is to use mutex_trylock() instead of mutex_lock() in dv1394_mmap(). This changes the behavior under contention in a way which is visible to userspace clients. However, my guess is that no clients exist which use mmap vs. ioctl/read/write on the dv1394 character device file interface in concurrent threads. Reported-by: Johannes Weiner Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) Date: Sun, 26 Oct 2008 12:03:37 +0100 (CET) From: Stefan Richter ieee1394: raw1394: fix possible deadlock in multithreaded clients Regression in 2.6.28-rc1: When I added the new state_mutex which prevents corruption of raw1394's internal state when accessed by multithreaded client applications, the following possible though highly unlikely deadlock slipped in: Thread A: Thread B: - acquire mmap_sem - raw1394_write() or raw1394_ioctl() - raw1394_mmap() - acquire state_mutex - acquire state_mutex - copy_to/from_user(), possible page fault: acquire mmap_sem The simplest fix is to use mutex_trylock() instead of mutex_lock() in raw1394_mmap(). This changes the behavior under contention in a way which is visible to userspace clients. However, since multithreaded access was entirely buggy before state_mutex was added and libraw1394's documentation advised application programmers to use a handle only in a single thread, this change in behaviour should not be an issue in practice at all. Since we have to use mutex_trylock() in raw1394_mmap() regardless whether /dev/raw1394 was opened with O_NONBLOCK or not, we now use mutex_trylock() unconditionally everywhere for state_mutex, just to have consistent behavior. Reported-by: Johannes Weiner Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Date: Fri, 24 Oct 2008 15:26:20 -0400 From: Jay Fenlason firewire: fw-sbp2: fix races 1: There is a small race between queue_delayed_work() and its corresponding kref_get(). Do the kref_get first, and _put it again if the queue_delayed_work() failed, so there is no chance of the kref going to zero while the work is scheduled. 2: An SBP2_LOGOUT_REQUEST could be sent out with a login_id full of garbage. Initialize it to an invalid value so we can tell if we ever got a valid login_id. 3: The node ID and generation may have changed but the new values may not yet have been recorded in lu and tgt when the final logout is attempted. Use the latest values from the device in sbp2_release_target(). Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) Date: Wed, 22 Oct 2008 00:28:36 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: delay first login to avoid retries This optimizes firewire-sbp2's device probe for the case that the local node and the SBP-2 node were discovered at the same time. In this case, fw-core's bus management work and fw-sbp2's login and SCSI probe work are scheduled in parallel (in the globally shared workqueue and in fw-sbp2's workqueue, respectively). The bus reset from fw-core may then disturb and extremely delay the login and SCSI probe because the latter fails with several command timeouts and retries and has to be retried from scratch. We avoid this particular situation of sbp2_login() and fw_card_bm_work() running in parallel by delaying the first sbp2_login() a little bit. This is meant to be a short-term fix for https://bugzilla.redhat.com/show_bug.cgi?id=466679. In the long run, the SCSI probe, i.e. fw-sbp2's call of __scsi_add_device(), should be parallelized with sbp2_reconnect(). Problem reported and fix tested and confirmed by Alex Kanavin. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sun, 26 Oct 2008 09:50:31 +0100 (CET) From: Stefan Richter firewire: fw-ohci: initialization failure path fixes Fix leaks when pci_probe fails. Simplify error log strings. Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) Date: Wed, 22 Oct 2008 15:59:42 -0400 From: Jay Fenlason firewire: fw-ohci: don't leak dma memory on module removal The transmit and receive context dma memory was not being freed on module removal. Neither was the config rom memory. Fix that. The ab->next assignment is pure paranoia. Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) Date: Thu, 16 Oct 2008 18:00:15 -0400 From: Jay Fenlason firewire: fix struct fw_node memory leak With the bus_resets patch applied, it is easy to see this memory leak by repeatedly resetting the firewire bus while running slabtop in another window. Just watch kmalloc-32 grow and grow... Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Date: Thu, 16 Oct 2008 15:51:59 -0400 From: Jay Fenlason firewire: Survive more than 256 bus resets The "color" is used during the topology building after a bus reset, hovever in "struct fw_node"s it is stored in a u8, but in struct fw_card it is stored in an int. When the value wraps in one struct, but not the other, disaster strikes. Signed-off-by: Jay Fenlason Fixes http://bugzilla.kernel.org/show_bug.cgi?id=10922. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Wed, 15 Oct 2008 00:10:53 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: extend failure check after SCSI probe https://bugzilla.redhat.com/show_bug.cgi?id=466679 indicates that the SCSI stack's probe may fail (with the sdev offlined) even if no 1394 bus generation update happened. It's cheap to check for offline status, hence add this check to initiate a logout/ login/ SCSI probe retry. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Date: Sun, 5 Oct 2008 10:37:11 +0200 (CEST) From: Stefan Richter firewire: convert client_list_lock to mutex So far it is only taken in non-atomic contexts. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 20 ++++++++------------ drivers/firewire/fw-device.c | 3 ++- drivers/firewire/fw-device.h | 7 ++++--- 3 files changed, 14 insertions(+), 16 deletions(-) Date: Fri, 3 Oct 2008 11:19:09 -0400 From: Jay Fenlason firewire: add a client_list_lock This adds a client_list_lock, which only protects the device's client_list, so that future versions of the driver can call code that takes the card->lock while holding the client_list_lock. Adding this lock is much simpler than adding __ versions of all the functions that the future version may need. The one ordering issue is to make sure code never takes the client_list_lock with card->lock held. Since client_list_lock is only used in three places, that isn't hard. Signed-off-by: Jay Fenlason Update fill_bus_reset_event() accordingly. Include linux/spinlock.h. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 28 +++++++++++++--------------- drivers/firewire/fw-device.c | 2 ++ drivers/firewire/fw-device.h | 3 +++ 3 files changed, 18 insertions(+), 15 deletions(-) Date: Wed, 1 Oct 2008 18:13:20 -0400 From: Jay Fenlason firewire: Add more documentation to firewire-cdev.h Signed-off-by: Jay Fenlason Signed-off-by: Stefan Richter --- include/linux/firewire-cdev.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Date: Fri, 12 Sep 2008 18:20:16 +0200 (CEST) From: Stefan Richter firewire: fix ioctl() return code Reported by Jay Fenlason: ioctl() did not return as intended - the size of data read into ioctl_send_request, - the number of datagrams enqueued by ioctl_queue_iso. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Fri, 12 Sep 2008 18:09:55 +0200 (CEST) From: Stefan Richter firewire: fix setting tag and sy in iso transmission Reported by Jay Fenlason: The iso packet control accessors in fw-cdev.c had bogus masks. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Thu, 11 Sep 2008 19:22:53 +0200 (CEST) From: Stefan Richter ieee1394: dv1394, video1394: remove unnecessary expressions init->channel and v.buffer are unsigned and tests for < 0 therefore always false. gcc knows this and eliminates the code, but anyway... Reported by Roel Kluin. Signed-off-by: Stefan Richter --- drivers/ieee1394/dv1394.c | 2 +- drivers/ieee1394/video1394.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) Date: Tue, 19 Aug 2008 21:30:17 +0200 (CEST) From: Stefan Richter ieee1394: survive a few seconds connection loss There are situations when nodes vanish from the bus and come back in quickly thereafter: - When certain bus-powered hubs are plugged in, - when certain disk enclosures are switched from self-power to bus power or vice versa and break the daisy chain during the transition, - when the user plugs a cable out and quickly plugs it back in, e.g. to reorder a daisy chain (works on Mac OS X if done quickly enough), - when certain hubs temporarily malfunction during high bus traffic. The ieee1394 driver's nodemgr already contained a function to set vanished nodes aside into "limbo"; i.e. they wouldn't actually be deleted right away. (In fact, only unloading the driver or writing into an obscure sysfs attribute would delete them eventually.) If nodes reappeared later, they would be resurrected out of limbo. Moving nodes into and out of limbo was accompanied with calling the .suspend() and .resume() driver methods of the drivers which were bound to a respective node's unit directories. Not only is this somewhat strange due to the intended use of these driver methods for power management, also the sbp2 driver in particular does not implement .suspend() and .resume(). Hence sbp2 would be disconnected from devices in situations as listed above. We now: - leave drivers bound when nodes go into limbo, - call the drivers' .update() when nodes come out of limbo, - automatically delete in-limbo nodes 3 seconds after the last bus reset and bus rescan. - Because of the automatic removal, the now obsolete bus attribute /sys/bus/ieee1394/destroy_node is removed. This especially lets sbp2 survive brief disconnections. You can for example yank a disk's cable and plug it back in while reading the respective disk with dd, but dd will happily continue as if nothing happened. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 147 ++++++++++++------------------------- drivers/ieee1394/nodemgr.h | 2 2 files changed, 51 insertions(+), 98 deletions(-) Date: Tue, 19 Aug 2008 21:29:23 +0200 (CEST) From: Stefan Richter ieee1394: nodemgr clean up class iterators Remove useless pointer type casts. Remove unnecessary hi->host indirection where only host is used. Remove an unnecessary WARN_ON. Change a few names. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 172 +++++++++++++++++-------------------- 1 file changed, 81 insertions(+), 91 deletions(-) Date: Sat, 16 Aug 2008 21:52:28 +0200 (CEST) From: Stefan Richter firewire: Kconfig help update Signed-off-by: Stefan Richter --- drivers/firewire/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Date: Sat, 16 Aug 2008 00:15:16 +0200 (CEST) From: Stefan Richter ieee1394: raw1394: make write() thread-safe Application programs should use a libraw1394 handle only in a single thread. The raw1394 driver was apparently relying on this, because it did nothing to protect its fi->state variable from corruption due to concurrent accesses. We now serialize the fi->state accesses. This affects the write() path. We re-use the state_mutex which was introduced to protect fi->iso_state accesses in the ioctl() path. These paths and accesses are independent of each other, hence separate mutexes could be used. But I don't see much benefit in that. Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 4 ++++ 1 file changed, 4 insertions(+) Date: Sat, 16 Aug 2008 17:52:04 +0200 (CEST) From: Stefan Richter ieee1394: raw1394: narrow down the state_mutex protected region Refactor the ioctl dispatcher in order to move a fraction of it out of the section which is serialized by fi->state_mutex. This is not so much about performance but more about self-documentation: The mutex_lock()/ mutex_unlock() calls are now closer to the data accesses which the mutex protects, i.e. to the iso_state switch. Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 211 +++++++++++++++++++------------------ 1 file changed, 110 insertions(+), 101 deletions(-) Date: Sat, 16 Aug 2008 00:11:48 +0200 (CEST) From: Stefan Richter ieee1394: raw1394: replace BKL by local mutex, make ioctl() and mmap() thread-safe This removes the last usage of the Big Kernel Lock from the ieee1394 stack, i.e. from raw1394's (unlocked_)ioctl and compat_ioctl. The ioctl()s don't need to take the BKL, but they need to be serialized per struct file *. In particular, accesses to ->iso_state need to be serial. We simply use a blocking mutex for this purpose because libraw1394 does not use O_NONBLOCK. In practice, there is no lock contention anyway because most if not all libraw1394 clients use a libraw1394 handle only in a single thread. mmap() also accesses ->iso_state. Until now this was unprotected against concurrent changes by ioctls. Fix this bug while we are at it. Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394-private.h | 1 + drivers/ieee1394/raw1394.c | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) Date: Sat, 9 Aug 2008 20:22:17 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: fix another small generation access bug queuecommand() looked at the remote and local node IDs before it read the bus generation. The corresponding race with sbp2_reconnect updating these data was probably impossible to happen though because the current code blocks the SCSI layer during reconnection. However, better safe than sorry, especially if someone later improves the code to not block the SCSI layer. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Date: Thu, 14 Aug 2008 21:47:21 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: enforce s/g segment size limit 1. We don't need to round the SBP-2 segment size limit down to a multiple of 4 kB (0xffff -> 0xf000). It is only necessary to ensure quadlet alignment (0xffff -> 0xfffc). 2. Use dma_set_max_seg_size() to tell the DMA mapping infrastructure and the block IO layer about the restriction. This way we can remove the size checks and segment splitting in the queuecommand path. This assumes that no other code in the firewire stack uses dma_map_sg() with conflicting requirements. It furthermore assumes that the controller device's platform actually allows us to set the segment size to our liking. Assert the latter with a BUG_ON(). 3. Also use blk_queue_max_segment_size() to tell the block IO layer about it. It cannot know it because our scsi_add_host() does not point to the FireWire controller's device. Thanks to Grant Grundler and FUJITA Tomonori for advice. Signed-off-by: Stefan Richter --- drivers/firewire/fw-sbp2.c | 63 +++++++++++++++---------------------- 1 file changed, 27 insertions(+), 36 deletions(-) Date: Thu, 14 Aug 2008 09:28:14 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: enforce s/g segment size limit 1. We don't need to round the SBP-2 segment size limit down to a multiple of 4 kB (0xffff -> 0xf000). It is only necessary to ensure quadlet alignment (0xffff -> 0xfffc). 2. Use dma_set_max_seg_size() to tell the DMA mapping infrastructure and the block IO layer about the restriction. This way we can remove the size checks and segment splitting in the queuecommand path. This assumes that no other code in the ieee1394 stack uses dma_map_sg() with conflicting requirements. It furthermore assumes that the controller device's platform actually allows us to set the segment size to our liking. Assert the latter with a BUG_ON(). 3. Also use blk_queue_max_segment_size() to tell the block IO layer about it. It cannot know it because our scsi_add_host() does not point to the FireWire controller's device. We can also uniformly use dma_map_sg() for the single segment case just like for the multi segment case, to further simplify the code. Also clean up how the page table is converted to big endian. Thanks to Grant Grundler and FUJITA Tomonori for advice. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 98 +++++++++++----------------------------- drivers/ieee1394/sbp2.h | 33 ++++--------- 2 files changed, 39 insertions(+), 92 deletions(-) Date: Sat, 9 Aug 2008 20:16:24 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: check for DMA mapping failures Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 94 +++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 35 deletions(-) Date: Sat, 9 Aug 2008 20:13:00 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: stricter dma_sync Two dma_sync_single_for_cpu() were called in the wrong place. Luckily they were merely for DMA_TO_DEVICE, hence nobody noticed. Also reorder the matching dma_sync_single_for_device() a little bit so that they reside in the same functions as their counterparts. This also avoids syncing the s/g table for requests which don't use it. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 50 ++++++++++++---------------------------- 1 file changed, 16 insertions(+), 34 deletions(-) Date: Mon, 24 Mar 2008 20:56:40 +0100 (CET) From: Stefan Richter firewire: unnecessary BM delay after generation rollover Noticed by Jarod Wilson: The bus manager work was unnecessarily delayed each time the bus generation counter rolled over. Signed-off-by: Stefan Richter Signed-off-by: Jarod Wilson --- drivers/firewire/fw-card.c | 2 +- drivers/firewire/fw-topology.c | 2 +- drivers/firewire/fw-transaction.h | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) Date: Wed, 19 Mar 2008 22:02:40 +0100 (CET) From: Stefan Richter firewire: insist on successive self ID complete events The whole topology code only works if the old and new topologies which are compared come from immediately successive self ID complete events. If there happened bus resets without self ID complete events in the meantime, or self ID complete events with invalid selfIDs, the topology comparison could identify nodes wrongly, or more likely just corrupt kernel memory or panic right away. We now discard all nodes of the old topology and treat all current nodes as new ones if the current self ID generation is not the previous one plus 1. Signed-off-by: Stefan Richter Signed-off-by: Jarod Wilson --- drivers/firewire/fw-topology.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) Date: Tue, 22 Jul 2008 23:23:40 -0700 From: David Moore firewire: Include iso timestamp in headers when header_size > 4 Previously, when an iso context had header_size > 4, the iso header (len/tag/channel/tcode/sy) was passed to userspace followed by quadlets stripped from the payload. This patch changes the behavior: header_size = 8 now passes the header quadlet followed by the timestamp quadlet. When header_size > 8, quadlets are stripped from the payload. The header_size = 4 case remains identical. Since this alters the semantics of the API, the firewire API version needs to be bumped concurrently with this change. This change also refactors the header copying code slightly to be much easier to read. Signed-off-by: David Moore Signed-off-by: Stefan Richter --- drivers/firewire/fw-ohci.c | 73 +++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) Date: Sun, 20 Jul 2008 14:20:53 +0200 From: Jay Fenlason firewire: fw_send_request_sync() Share code between fw_send_request + wait_for_completion callers. Signed-off-by: Jay Fenlason Addendum: Removes an unnecessary struct and an ununsed retry loop. Calls it fw_run_transaction() instead of fw_send_request_sync(). Signed-off-by: Stefan Richter Acked-by: Kristian Høgsberg --- drivers/firewire/fw-card.c | 56 +++++++----------------------- drivers/firewire/fw-device.c | 37 +++---------------- drivers/firewire/fw-sbp2.c | 46 ++++++------------------ drivers/firewire/fw-transaction.c | 48 +++++++++++++++++++++++-- drivers/firewire/fw-transaction.h | 9 +++- 5 files changed, 82 insertions(+), 114 deletions(-) Date: Sat, 2 Aug 2008 17:13:09 +0200 (CEST) From: Julia Lawall ieee1394: Use DIV_ROUND_UP Signed-off-by: Julia Lawall Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.c | 2 +- drivers/ieee1394/eth1394.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Date: Tue, 29 Jul 2008 23:46:25 -0700 From: David Moore firewire: Preserve response data alignment bug when it is harmless Recently, a bug having to do with the alignment of transaction response data was fixed. However, some apps such as libdc1394 relied on the presence of that bug in order to function correctly. In order to stay compatible with old versions of those apps, this patch preserves the bug in cases where it is harmless to normal operation (such as the single quadlet read) due to a simple duplication of data. This guarantees maximum compatability for those users who are using the old app with the fixed kernel. Signed-off-by: David Moore Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) Date: Fri, 25 Jul 2008 16:24:19 +0200 (CEST) From: Stefan Richter firewire: state userland requirements in Kconfig help Signed-off-by: Stefan Richter --- drivers/firewire/Kconfig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Date: Tue, 22 Jul 2008 21:35:47 +0200 (CEST) From: Stefan Richter firewire: avoid memleak after phy config transmit failure Use only statically allocated data for PHY config packet transmission. With the previous incarnation, some data wouldn't be freed if the packet transmit callback was never called. A theoretical drawback now is that, in PCs with more than one card, card A may complete() for a waiter on card B. But this is highly unlikely and its impact not serious. Bus manager B may reset bus B before the PHY config went out, but the next phy config on B should be fine. However, with a timeout of 100ms, this situation is close to impossible. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 56 ++++++++++-------------------- 1 file changed, 20 insertions(+), 36 deletions(-) Date: Tue, 22 Jul 2008 18:41:10 +0200 (CEST) From: Stefan Richter firewire: fw-ohci: TSB43AB22/A dualbuffer workaround Isochronous reception in dualbuffer mode is reportedly broken with TI TSB43AB22A on x86-64. Descriptor addresses above 2G have been determined as the trigger: https://bugzilla.redhat.com/show_bug.cgi?id=435550 Two fixes are possible: - pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK); at least when IR descriptors are allocated, or - simply don't use dualbuffer. This fix implements the latter workaround. But we keep using dualbuffer on x86-32 which won't give us highmen (and thus physical addresses outside the 31bit range) in coherent DMA memory allocations. Right now we could for example also whitelist PPC32, but DMA mapping implementation details are expected to change there. Signed-off-by: Stefan Richter Signed-off-by: Jarod Wilson --- drivers/firewire/fw-ohci.c | 37 ++++++++++++++++++++++++------------- include/linux/pci_ids.h | 1 + 2 files changed, 25 insertions(+), 13 deletions(-) Date: Sat, 19 Jul 2008 15:35:41 +0800 From: JiSheng Zhang firewire: queue the right number of data There will be 4 padding bytes in struct fw_cdev_event_response on some platforms The member:__u32 data will point to these padding bytes. While queue the response and data in complete_transaction in fw-cdev.c, it will queue like this: |response(excluding padding bytes)|4 padding bytes|4 padding bytes|data. It queue 4 extra bytes. That is to say it use "&response + sizeof(response)" while other place of kernel and userspace library use "&response + offsetof (typeof(response), data)". So it will lost the last 4 bytes of data. This patch can fix it while not changing the struct definition. Signed-off-by: JiSheng Zhang This fixes responses to outbound block read requests on 64bit architectures. Tested on i686, x86-64, and x86-64 with i686 userland, using firecontrol and gscanbus. Signed-off-by: Stefan Richter --- drivers/firewire/fw-cdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Date: Sat, 12 Jul 2008 14:51:18 +0200 (CEST) From: Stefan Richter firewire: warn on unfinished transactions during card removal After card->done and card->work are completed, any remaining pending request would be a bug. We cannot safely complete a transaction at that point anymore. IOW card users must not drop their last fw_card reference (usually indirect references through fw_device references) before their last outbound transaction through that card was finished. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Sat, 12 Jul 2008 14:50:42 +0200 (CEST) From: Stefan Richter firewire: small fw_fill_request cleanup - better name for a function argument - removal of a local variable which became unnecessary after "fully initialize fw_transaction before marking it pending" Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) Date: Sat, 12 Jul 2008 14:50:06 +0200 (CEST) From: Stefan Richter firewire: fully initialize fw_transaction before marking it pending In theory, card->flush_timer could already access a transaction between fw_send_request()'s spin_unlock_irqrestore and the rest of what happens in fw_send_request(). This would happen if the process which sends the request is preempted and put to sleep right after spin_unlock_irqrestore for longer than 100ms. Therefore we fill in everything in struct fw_transaction at which the flush_timer might look at before we lift the lock. To do: Ensure that the timer does not pick up the transaction before the time of the AT request event plus split transaction timeout. Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Date: Sat, 12 Jul 2008 14:49:19 +0200 (CEST) From: Stefan Richter firewire: fix race of bus reset with request transmission Reported by Jay Fenlason: A bus reset tasklet may call fw_flush_transactions and touch transactions (call their callback which will free them) while the context which submitted the transaction is still inserting it into the transmission queue. A simple solution to this problem is to _not_ "flush" the transactions because of a bus reset (complete the transcations as 'cancelled'). They will now simply time out (completed as 'cancelled' by the split-timeout timer). Jay Fenlason thought of this fix too but I was quicker to type it out. :-) Background: Contexts which access an instance of struct fw_transaction are: 1. the submitter, until it inserted the packet which is embedded in the transaction into the AT req DMA, 2. the AsReqTrContext tasklet when the request packet was acked by the responder node or transmission to the responder failed, 3. the AsRspRcvContext tasklet when it found a request which matched an incoming response, 4. the card->flush_timer when it picks up timed-out transactions to cancel them, 5. the bus reset tasklet when it cancels transactions (this access is eliminated by this patch), 6. a process which shuts down an fw_card (unregisters it from fw-core when the controller is unbound from fw-ohci) --- although in this case there shouldn't really be any transactions anymore because we wait until all card users finished their business with the card. All of these contexts run concurrently (except for the 6th, presumably). The 1st is safe against the 2nd and 3rd because of the way how a request packet is carefully submitted to the hardware. A race between 2nd and 3rd has been fixed a while ago (bug 9617). The 4th is almost safe against 1st, 2nd, 3rd; there are issues with it if huge scheduling latencies occur, to be fixed separately. The 5th looks safe against 2nd, 3rd, and 4th but is unsafe against 1st. Maybe this could be fixed with an explicit state variable in struct fw_transaction. But this would require fw_transaction to be rewritten as only dynamically allocatable object with reference counting --- not a good solution if we also can simply kill this 5th accessing context (replace it by the 4th). Signed-off-by: Stefan Richter --- drivers/firewire/fw-topology.c | 2 -- 1 file changed, 2 deletions(-) Date: Sun, 25 May 2008 11:06:55 +0200 (CEST) From: Stefan Richter firewire: don't respond to broadcast write requests Contrary to a comment in the source, request->ack of a broadcast write request can be ACK_PENDING. Hence the existing check is insufficient. Debug dmesg before: AR spd 0 tl 00, ffc0 -> ffff, ack_pending , QW req, fffff0000234 = ffffffff AT spd 0 tl 00, ffff -> ffc0, ack_complete, W resp And the requesting node (linux1394) reports an unsolicited response. Debug dmesg after: AR spd 0 tl 00, ffc0 -> ffff, ack_pending , QW req, fffff0000234 = ffffffff Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Date: Sat, 24 May 2008 16:50:22 +0200 (CEST) From: Stefan Richter firewire: clean up fw_card reference counting This is a functionally equivalent replacement of the current reference counting of struct fw_card instances. It only converts it to common idioms as suggested by Kristian Høgsberg: - struct kref replaces atomic_t as the counter. - wait_for_completion is used to wait for all card users to complete. BTW, it may make sense to count card->flush_timer and card->work as card users too. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 30 ++++++++++++++++++++---------- drivers/firewire/fw-device.c | 5 ++--- drivers/firewire/fw-transaction.h | 20 ++++++++++++++++++-- 3 files changed, 40 insertions(+), 15 deletions(-) Date: Sat, 24 May 2008 16:48:05 +0200 (CEST) From: Stefan Richter firewire: clean up some includes Signed-off-by: Stefan Richter --- drivers/firewire/fw-transaction.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Date: Sat, 24 May 2008 16:46:10 +0200 (CEST) From: Stefan Richter firewire: remove unused struct members Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 1 - drivers/firewire/fw-device.h | 1 - drivers/firewire/fw-ohci.c | 1 - drivers/firewire/fw-transaction.h | 2 -- 4 files changed, 5 deletions(-) Date: Sat, 24 May 2008 16:41:09 +0200 (CEST) From: Stefan Richter firewire: implement broadcast_channel CSR for 1394a compliance See IEEE 1394a clause 8.3.2.3.11. Signed-off-by: Stefan Richter --- drivers/firewire/fw-card.c | 1 + drivers/firewire/fw-transaction.c | 20 +++++++++++++++++--- drivers/firewire/fw-transaction.h | 4 ++++ 3 files changed, 22 insertions(+), 3 deletions(-) Date: Thu, 3 Jul 2008 18:52:28 +0200 From: Philippe De Muyter ieee1394: dump mmapped iso buffers in core files Currently, core files do not contain the mmapped memory of the video1394 or dv1394 devices, which contain the actual video input, making it impossible to analyse the cause of abnormal program termination for image analysis or (de)compression software. Fix that. Signed-off-by: Philippe De Muyter Also affects users of the rawiso ioctl API of raw1394. Signed-off-by: Stefan Richter --- drivers/ieee1394/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Date: Fri, 23 May 2008 11:57:41 +0100 From: Alan Cox ieee1394: raw1394: Push the BKL down into the driver ioctls Actually in this case wrap the function for now. Signed-off-by: Alan Cox Added raw1394_compat_ioctl hunk. Signed-off-by: Stefan Richter --- drivers/ieee1394/raw1394.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) Date: Mon, 19 May 2008 22:07:28 +0200 (CEST) From: Stefan Richter ieee1394: video1394: reorder module init, prepare BKL removal This prepares video1394 for removal of the BKL (big kernel lock): It allows video1394_open() to be called while video1394_init_module() is still in progress. Signed-off-by: Stefan Richter --- drivers/ieee1394/highlevel.c | 4 +--- drivers/ieee1394/highlevel.h | 13 ++++++++++++- drivers/ieee1394/video1394.c | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) Date: Fri, 2 May 2008 20:14:52 +0200 (CEST) From: Stefan Richter ieee1394: reduce log noise about config ROM CRC errors This avoids redundant messages about a special and usually harmless firmware flaw. Signed-off-by: Stefan Richter --- drivers/ieee1394/csr1212.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) Date: Sun, 11 May 2008 00:37:14 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: spin disks down on suspend and shutdown This instructs sd_mod to send START STOP UNIT on suspend and resume, and on driver unbinding or unloading (including when the system is shut down). We don't do this though if multiple initiators may log in to the target. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 2 ++ 1 file changed, 2 insertions(+) Date: Sun, 11 May 2008 00:36:47 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: spin disks down on suspend and shutdown This instructs sd_mod to send START STOP UNIT on suspend and resume, and on driver unbinding or unloading (including when the system is shut down). We don't do this though if multiple initiators may log in to the target. Signed-off-by: Stefan Richter Tested-by: Tino Keitel --- drivers/firewire/fw-sbp2.c | 3 +++ 1 file changed, 3 insertions(+) Date: Sun, 11 May 2008 00:35:55 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares Reported by Tino Keitel: PL-3507 with firmware from Prolific does not spin down the disk on START STOP UNIT with power condition = 0 and start = 0. It does however work with power condition = 2 or 3. Also found while investigating this: DViCO Momobay CX-1 and FX-3A (TI TSB42AA9/A based) become unresponsive after START STOP UNIT with power condition = 0 and start = 0. They stay responsive if power condition is set when stopping the motor. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 20 ++++++++++++++++++-- drivers/ieee1394/sbp2.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) Date: Sun, 11 May 2008 00:35:04 +0200 (CEST) From: Stefan Richter firewire: fw-sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares Reported by Tino Keitel: PL-3507 with firmware from Prolific does not spin down the disk on START STOP UNIT with power condition = 0 and start = 0. It does however work with power condition = 2 or 3. Also found while investigating this: DViCO Momobay CX-1 and FX-3A (TI TSB42AA9/A based) become unresponsive after START STOP UNIT with power condition = 0 and start = 0. They stay responsive if power condition is set when stopping the motor. Signed-off-by: Stefan Richter Tested-by: Tino Keitel --- drivers/firewire/fw-sbp2.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) Date: Sun, 11 May 2008 00:34:07 +0200 (CEST) From: Stefan Richter scsi: sd: optionally set power condition in START STOP UNIT Adds a new scsi_device flag, start_stop_pwr_cond: If enabled, the sd driver will not send plain START STOP UNIT commands but ones with the power condition field set to 3 (standby) or 1 (active) respectively. Some FireWire disk firmwares do not stop the motor if power condition is zero. Or worse, they become unresponsive after a START STOP UNIT with power condition = 0 and start = 0. http://lkml.org/lkml/2008/4/29/704 This patch only adds the necessary code to sd_mod but doesn't activate it. Follow-up patches to the FireWire drivers will add detection of affected devices and enable the code for them. I did not add power condition values to scsi_error.c::scsi_eh_try_stu() for now. The three firmwares which suffer from above mentioned problems do not need START STOP UNIT in the error handler, and they are not adversely affected by START STOP UNIT with power condition = 0 and start = 1 (like scsi_eh_try_stu() sends it if scsi_device.allow_restart is enabled). Signed-off-by: Stefan Richter Tested-by: Tino Keitel --- drivers/scsi/sd.c | 5 +++++ include/scsi/scsi_device.h | 1 + 2 files changed, 6 insertions(+) Date: Sat, 16 Aug 2008 13:39:26 +0200 (CEST) From: Stefan Richter ieee1394: sbp2: let nodemgr retry node updates during bus reset series sbp2 was too quick to report .update() to the ieee1394 core as failed. (Logged as "Failed to reconnect to sbp2 device!".) The core would then unbind sbp2 from the device. This is not justified if the .update() failed because another bus reset happened. We check this and tell the ieee1394 that .update() succeeded, and the core will call sbp2's .update() for the new bus reset as well. This improves reconnection/re-login especially on buses with several disks as they may issue bus resets in close succession when they come online. Tested by Damien Benoist. Signed-off-by: Stefan Richter --- drivers/ieee1394/sbp2.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) Date: Sat, 16 Aug 2008 13:38:11 +0200 (CEST) From: Stefan Richter ieee1394: don't drop nodes during bus reset series nodemgr_node_probe checked for generation increments too late and therefore prematurely reported nodes as "suspended". Fixes http://bugzilla.kernel.org/show_bug.cgi?id=11349. Reported and tested by Damien Benoist. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) Date: Sat, 16 Aug 2008 13:36:47 +0200 (CEST) From: Stefan Richter ieee1394: regression in 2.6.25: updates should happen before probes Regression since commit 73cf60232ef16e1f8a64defa97214a1722db1e6c, "ieee1394: use class iteration api": The two loops for (1.) driver updates and (2.) driver probes were replaced by a single loop with bogus needs_probe checks. Hence updates and probes were now intermixed, and especially sbp2 updates (reconnects) held up longer than necessary. While we fix it, change the needs_probe flag to bool type for clarity. Tested by Damien Benoist. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 28 +++++++++++++++------------- drivers/ieee1394/nodemgr.h | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-)