aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2006-12-07ieee1394: sbp2: consolidate log levelsStefan Richter1-19/+12
Replace some calls to SBP2_ERR and SBP2_WARN by SBP2_INFO. Remove logging macros SBP2_NOTICE and SBP2_WARN. Remove direct usage of HPSB_ logging macros. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove duplicate codeStefan Richter1-11/+0
The same case is handled further below in sbp2scsi_complete_command. Note, the second version behaves slightly different but looks preferable. It's an extremely unlikely case by the way. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove dead codeStefan Richter1-15/+0
This has been within #if 0 for a long time and is wrong anyway. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: clean up function declarationsStefan Richter2-104/+86
Remove unnecessary function prototypes. Remove variable names from function prototypes. Move declarations from sbp2.h to sbp2.c. Move definitions of driver templates together near the top of sbp2.c. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove irritating log messageStefan Richter1-2/+0
The queue depth can be read from /sys/bus/scsi/devices/*/queue_depth, so don't log it. And the hint about speed improvements is misleading, at least under current kernels. If serialization is switched off, read performance is typically increased by less than 10%. (I did not test write performance recently.) On the other hand, serialize_io=0 is not yet safe due to some implementation issues that are not trivial to fix. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ohci1394: shortcut irq printingAlexey Dobriyan1-4/+2
To print irq number no need to transform to string using %d, then print using %s. Just use %d. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
2006-12-07ieee1394: nodemgr: take it easy if bus_rescan_devices failsStefan Richter1-3/+2
This happens. No need to log a BUG trace. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07drivers/ieee1394/*: use kmemdup()Eric Sesterhenn2-4/+2
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: proper log messages in suspend and resumeStefan Richter1-11/+15
- correct thinko in one of my last commits: cannot use PRINT macro with ohci == NULL - add log messages on ohci == NULL and on pci_enable_device != 0 - update log macros from patch "revert fail on error in suspend" to use PRINT and DBGMSG where possible Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: revert fail on error in suspendStefan Richter1-2/+11
Some errors during preparation for suspended state can be skipped with a warning instead of a failure of the whole suspend transition, notably an error in pci_set_power_state. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: only build OUI database files if config enabledRandy Dunlap1-1/+4
Only build IEEE1394 OUI database files if the config option is enabled. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: fix printk format warningRandy Dunlap1-1/+1
Fix printk format warning: drivers/ieee1394/nodemgr.c:364: warning: long long unsigned int format, u64 arg (arg 3) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: revise semaphore protection of driver core dataStefan Richter1-50/+92
- The list "struct class.children" is supposed to be protected by class.sem, not by class.subsys.rwsem. - nodemgr_remove_uds() iterated over nodemgr_ud_class.children without proper protection. This was never observed as a bug since the code is usually only accessed by knodemgrd. All knodemgrds are currently globally serialized. But userspace can trigger this code too by writing to /sys/bus/ieee1394/destroy_node. - Clean up access to the FireWire bus type's subsys.rwsem: Access it uniformly via ieee1394_bus_type. Shrink rwsem protected regions where possible. Expand them where necessary. The latter wasn't a problem so far because knodemgr is globally serialized. This should harden the interaction of ieee1394 with sysfs and lay ground for deserialized operation of multiple knodemgrds and for implementation of subthreads for parallelized scanning and probing. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: reflect which return values are errorsStefan Richter1-34/+30
Give better names to local variables. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: small fix after sysfs errors patchStefan Richter1-1/+1
One hunk in "ieee1394: handle sysfs errors" was wrong. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07dv1394: remove BKL contentionStefan Richter1-11/+3
Purges the one remaining call to lock_kernel() from the 1394 subsystem. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07video1394: remove BKL contentionDaniel Drake1-24/+6
video1394 does not need to take the BKL. The data structures shared between file_operations and interrupts are already protected through context-specific spinlocks. The only other danger is video1394_release() being called during another operation, however this cannot happen because release is only ever invoked when the last thread has closed the fd. Signed-off-by: Daniel Drake <ddrake@brontes3d.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07video1394: small optimizations to frame retrieval codepathDaniel Drake1-8/+10
Add some GCC branch prediction optimizations to unlikely error/safety conditions in the ioctl handling code commonly called during an application's capture loop. Signed-off-by: Daniel Drake <ddrake@brontes3d.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: handle sysfs errorsStefan Richter2-49/+118
Handle driver core errors with as much care as appropriate. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: coding style in hosts.cStefan Richter1-7/+11
Some 80-columns pedantry, and touch up of a // comment. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: lock smaller region by host_num_alloc mutexStefan Richter1-4/+1
We need the mutex only around the iteration over existing hosts. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: usecs_to_jiffies takes unsigned int argumentStefan Richter1-5/+3
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: suspend/resume cosmeticsStefan Richter1-78/+48
Reorder the definitions of ohci1394_pci_suspend and _resume. Remove redundant comments. Beautify return statements. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ohci1394: steps to implement suspend/resumeBernhard Kaindl1-14/+78
I did a quick shot on what I described and the appended patch does the first thing needed for working suspend/resume in ohci1394 which is HW de- and re-initialisation. It works with suspend2disk on my Ricoh R5C552 IEEE 1394 Controller with the 2.6.17 kernel to the extent that if I call dvgrab --interactive after suspend2disk without unloading ohci1394, it does not lock up dvgrab with 100% CPU but properly connects to the camera, given that I first unplug and plug the camera after coming back from suspend. I guess that could be fixed by forcing a bus reset in the resume function. I cannot test suspend to RAM here at the moment and should follow the guidelines in Documentation/power/pci.txt also, so this is rather a quick report than a finished patch and there are some rough edges: However, with this patch, I have to unload at least some in-kernel users of ohci1394 like dv1394 or video1394 before suspending. Not doing that caused an Oops and a bad tasklet error, probably from not handling ISO tasklets during suspend/resume properly. Maybe these can be temporarily cleared or unregistered and re-registered for suspend/resume with help from the other layers or from the highlevel 1394 core, but I do not really know what these do. But this patch provides a useful base to start from and is already of much help for people which do not need dv1394 and video1394 or can unload them at least during suspend. I cannot test function with sbp2 at the moment, but raw1394 seems to work fine. Signed-off-by: Bernhard Kaindl <bk@fsfe.org> Update 1: merge with previous two ohci1394 suspend/resume patches Update 2: version for application on top of Linux 2.6.19-rc4 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: raw1394: add comments on lock usageStefan Richter1-5/+5
Add a who-is-who about some locks and list heads in raw1394's struct definitions. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: slightly reorder sbp2scsi_abortStefan Richter1-8/+2
Put the target's fetch agent into reset state before the underlying ORB DMA is unmapped and the ->done handler is called. It is highly unlikely but the target could access that ORB right before sbp2 sends the reset request. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: remove unused struct member from highlevel APIStefan Richter1-1/+0
struct hpsb_highlevel's struct module *owner is neither used by the IEEE 1394 core nor set by any of the in-tree drivers or the two out-of-tree highlevel drivers I know about (dfg1394, mem1394) --- nor is this member documented. An unscheduled removal seems acceptable. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07[PATCH] Add include/linux/freezer.h and move definitions from sched.hNigel Cunningham1-0/+1
Move process freezing functions from include/linux/sched.h to freezer.h, so that modifications to the freezer or the kernel configuration don't require recompiling just about everything. [akpm@osdl.org: fix ueagle driver] Signed-off-by: Nigel Cunningham <nigel@suspend2.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove kmem_cache_tChristoph Lameter1-1/+1
Replace all uses of kmem_cache_t with struct kmem_cache. The patch was generated using the following script: #!/bin/sh # # Replace one string by another in all the kernel sources. # set -e for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do quilt add $file sed -e "1,\$s/$1/$2/g" $file >/tmp/$$ mv /tmp/$$ $file quilt refresh done The script was run like this sh replace kmem_cache_t "struct kmem_cache" Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove SLAB_KERNELChristoph Lameter4-11/+11
SLAB_KERNEL is an alias of GFP_KERNEL. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove SLAB_ATOMICChristoph Lameter1-15/+15
SLAB_ATOMIC is an alias of GFP_ATOMIC Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-22WorkStruct: make allyesconfigDavid Howells4-18/+23
Fix up for make allyesconfig. Signed-Off-By: David Howells <dhowells@redhat.com>
2006-10-30[ETH1394]: Fix unaligned accesses.David S. Miller1-8/+12
Several u64 objects are derefernced in situations where the pointer is not guarenteed to be aligned correctly. Use get_unaligned() as needed. Thanks to Will Simoneau for lots of testing and debugging help. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-29ieee1394: ohci1394: revert fail on error in suspendStefan Richter1-5/+14
Some errors during preparation for suspended state can be skipped with a warning instead of a failure of the whole suspend transition, notably an error in pci_set_power_state. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-08Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds1-1/+1
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: nodemgr: fix startup of knodemgrd
2006-10-08ieee1394: nodemgr: fix startup of knodemgrdStefan Richter1-1/+1
Revert a thinko in commit d2f119fe319528da8c76a1107459d6f478cbf28c: When knodemgrd starts, it needs to sleep until host->generation was incremented above its initial value of 0. My wrong logic caused it to start sending requests when the bus wasn't completely ready. Seen as "AT dma reset ctx=0, aborting transmission" messages in 2.6.19-rc1. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells2-4/+2
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-03Fix several typos in drivers/Matt LaPlante1-1/+1
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-09-30Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6Linus Torvalds29-1133/+1200
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (48 commits) ieee1394: raw1394: arm functions slept in atomic context ieee1394: sbp2: enable auto spin-up for all SBP-2 devices MAINTAINERS: updates to IEEE 1394 subsystem maintainership ieee1394: ohci1394: check for errors in suspend or resume set power state of firewire host during suspend ieee1394: ohci1394: more obvious endianess handling ieee1394: ohci1394: fix endianess bug in debug message ieee1394: sbp2: don't prefer MODE SENSE 10 ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne ieee1394: nodemgr: fix rwsem recursion ieee1394: sbp2: more help in Kconfig ieee1394: sbp2: prevent rare deadlock in shutdown ieee1394: sbp2: update includes ieee1394: sbp2: better handling of transport errors ieee1394: sbp2: recheck node generation in sbp2_update ieee1394: sbp2: safer agent reset in error handlers ieee1394: sbp2: handle "sbp2util_node_write_no_wait failed" CONFIG_PM=n slim: drivers/ieee1394/ohci1394.c ieee1394: safer definition of empty macros video1394: add poll file operation support ...
2006-09-26i2c-algo-bit: Discard the mdelay data struct memberJean Delvare1-1/+0
i2c-algo-bit: Discard the mdelay data struct member The i2c_algo_bit_data structure has an mdelay member, which is not used by the algorithm code (the code has always been ifdef'd out.) Let's discard it to save some code and memory. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-23ieee1394: raw1394: arm functions slept in atomic contextStefan Richter1-18/+16
Sleeping functions like copy_to_user were accessed inside spinlocks in raw1394's arm_register, arm_unregister, arm_get_buf, arm_set_buf. http://bugzilla.kernel.org/show_bug.cgi?id=7120 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: David Trent <DTrent@piacton.com> (cherry picked from e575953ec17c3f5c1e738847d2d16c241bb99783 commit)
2006-09-17ieee1394: sbp2: enable auto spin-up for all SBP-2 devicesStefan Richter1-3/+1
This is a follow-up to patch "ieee1394: sbp2: enable auto spin-up for Maxtor disks". When I 'ejected' an OXUF922 based HDD from a Mac OS X box, it was spun down by the Mac and did not spin up by itself when attached to a Linux box right after that. The first SCSI command that required the bridge to access the drive ended in sda:<6>sd 18:0:0:0: Device not ready: <6>: Current: sense key: Not Ready Additional sense: Logical unit not ready, initializing cmd. required Therefore the flag which instructs scsi_mod to send START STOP UNIT with START=1 ("make medium ready") after such a condition is now enabled unconditionally for all FireWire storage devices. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: check for errors in suspend or resumeStefan Richter1-6/+11
Some of the suspend and resume litany may fail. Tell the PCI core about it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17set power state of firewire host during suspendPavel Machek1-4/+6
Put firewire host controller in PCI Dx state for system suspend. (I was not able to measure any power savings, but it sounds like right thing to do, anyway.) Signed-off-by: Pavel Machek <pavel@suse.cz> Update by stefanr: Shuffle with existing PPC_PMAC code. Set power state in the resume hook too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: more obvious endianess handlingStefan Richter1-14/+13
Rename ohci1394's packet_swab to header_le32_to_cpu to better reflect what it actually does. Also, define a constant array as 'const' and check the array index properly. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: fix endianess bug in debug messageStefan Richter1-1/+1
The transaction labels were misprinted int the debug printk "Packet received from node..." due two byte-swapping once too often. Affected were big endian machines, except UniNorth based ones. Fix tested by Wolfgang Pfeiffer. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: don't prefer MODE SENSE 10Stefan Richter1-1/+0
In the old days, sbp2 used to coerce all MODE SENSE commands into the 10 bytes version. When all command set conversions were removed from sbp2 several months ago, sdev->use_10_for_ms = 1 was added. Meaning, higher SCSI layers preferred the 10 bytes version but would try the 6 bytes version if the former failed. Recently, a problem with the 10 bytes version was discovered. An Initio INIC-1530 firmware accepted the 10 bytes version but replied with bogus data, showing the HDD incorrectly as write-protected. Since RBC actually mandates MODE SENSE (6), I checked which version was sent by Windows XP and Mac OS X 10.3 to an SBP-2 target hosted by Linux --- it was the 6 bytes version. (Exception: OS X sent the 10 bytes version to an MMC target. RBC and SBC got MODE SENSE (6).) Therefore, drop the use_10_for_ms flag from sbp2. Now the upper layers will try MODE SENSE (6) before MODE SENSE (10) on all SBP-2 devices. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_neStefan Richter1-0/+2
nodemgr_resume_ne was iterating over nodemgr_ud_class.children without protection by nodemgr_ud_class.subsys.rwsem. FIXME: Shouldn't we rather use class->sem there, not class->subsys.rwsem? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: nodemgr: fix rwsem recursionStefan Richter1-4/+5
nodemgr_update_pdrv grabbed an rw semaphore (as reader) which was already taken by its caller's caller, nodemgr_probe_ne (as reader too). Reported by Miles Lane, call path pointed out by Arjan van de Ven. FIXME: Shouldn't we rather use class->sem there, not class->subsys.rwsem? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: more help in KconfigStefan Richter1-2/+9
Add some pointers to SCSI to the configuration menu item of sbp2. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>