Commit Graph

262 Commits (5370f1f5e94f1734f0706044bfb95007ea90fb23)

Author SHA1 Message Date
Stefan Richter 5370f1f5e9 ieee1394: ohci1394: reformat PPC_PMAC platform code
Adjust whitespace and line lengths

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 23:04:24 +01:00
Stefan Richter 48cfae44b4 ieee1394: ohci1394: add PPC_PMAC platform code to driver probe
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7431
iBook G3 threw a machine check exception and put the display backlight
to full brightness after ohci1394 was unloaded and reloaded.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 23:04:14 +01:00
Stefan Richter 58272c1c03 ieee1394: sbp2: wrap two functions into one
Move the body of a function into its only caller.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 23:04:03 +01:00
Stefan Richter 2a533b179d ieee1394: sbp2: update comment on things to do
Some people actually look at those comments.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 23:03:49 +01:00
Stefan Richter cd641f68d6 ieee1394: sbp2: use list_move_tail()
It's OK to reorder list_del() and sbp2util_free_command_dma() here.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 23:03:38 +01:00
Stefan Richter 138c8af864 ieee1394: sbp2: more concise names for types and variables
"struct scsi_id_instance_data" represents a logical unit.
Rename it to "struct sbp2_lu", and "scsi_id" to "lu".
Rename some other variables too.
Wrap almost all lines after at most 80 columns.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:59:34 +01:00
Stefan Richter 9117c6dc43 ieee1394: sbp2: remove unused struct members
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:52:41 +01:00
Stefan Richter 28b066795f ieee1394: sbp2: proper unit in module parameter description
It's 2^20 bit/s, not 0.001 bit.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:52:29 +01:00
Stefan Richter ca0c745399 ieee1394: sbp2: clean up sbp2_ namespace
Prepend sbp2*_ to anything globally defined in sbp2.c except for some
macros.  Strip sbp2_ from names of struct members.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:51:53 +01:00
Stefan Richter 5796aa7b11 ieee1394: sbp2: some conditions in queue_command are unlikely
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:49:39 +01:00
Stefan Richter e8ca5668f1 ieee1394: sbp2: remove superfluous comments
And update and reformat remaining comments.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:45:41 +01:00
Stefan Richter d19c776414 ieee1394: sbp2: delayed_work -> work_struct
This work is not delayed.

Also bring the code format in a state which reduces my work to merge
pending sbp2 patchs.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 22:40:33 +01:00
Stefan Richter 424a9642b8 ieee1394: sbp2: coding style of some macros
Adjust parentheses, indentation, line lengths.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:46:58 +01:00
Stefan Richter edf1fb213e ieee1394: sbp2: remove debug macros
No need to keep them in released sources.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:46:48 +01:00
Stefan Richter 35644090d8 ieee1394: sbp2: consolidate log levels
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-07 21:46:40 +01:00
Stefan Richter 0b885449ac ieee1394: sbp2: remove duplicate code
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-07 21:46:30 +01:00
Stefan Richter 8c8009e69b ieee1394: sbp2: remove dead code
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-07 21:46:20 +01:00
Stefan Richter ea42ea0f58 ieee1394: sbp2: clean up function declarations
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-07 21:46:10 +01:00
Stefan Richter 66743e061f ieee1394: sbp2: remove irritating log message
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-07 21:45:58 +01:00
Alexey Dobriyan c0f00e2797 ohci1394: shortcut irq printing
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-07 21:44:27 +01:00
Stefan Richter 1f72cf5251 ieee1394: nodemgr: take it easy if bus_rescan_devices fails
This happens.  No need to log a BUG trace.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:44:15 +01:00
Eric Sesterhenn bfe89d7245 drivers/ieee1394/*: use kmemdup()
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-07 21:43:02 +01:00
Stefan Richter 5f8d17f602 ieee1394: ohci1394: proper log messages in suspend and resume
- 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-07 21:32:53 +01:00
Stefan Richter 2a3f8ad3a9 ieee1394: ohci1394: revert fail on error in suspend
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-07 21:32:36 +01:00
Randy Dunlap def4d8733b ieee1394: only build OUI database files if config enabled
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-07 21:32:29 +01:00
Randy Dunlap 7f5880394c ieee1394: fix printk format warning
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-07 21:32:19 +01:00
Stefan Richter b07375b155 ieee1394: nodemgr: revise semaphore protection of driver core data
- 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-07 21:32:10 +01:00
Stefan Richter 7fdfc90945 ieee1394: nodemgr: reflect which return values are errors
Give better names to local variables.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:32:01 +01:00
Stefan Richter b7cffc57a7 ieee1394: nodemgr: small fix after sysfs errors patch
One hunk in "ieee1394: handle sysfs errors" was wrong.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:31:51 +01:00
Stefan Richter 7b900c12cd dv1394: remove BKL contention
Purges the one remaining call to lock_kernel() from the 1394 subsystem.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:31:38 +01:00
Daniel Drake 75dcf5dc5a video1394: remove BKL contention
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-07 21:31:25 +01:00
Daniel Drake 3c21cfc4ba video1394: small optimizations to frame retrieval codepath
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-07 21:31:04 +01:00
Stefan Richter c1c9c7cd9f ieee1394: handle sysfs errors
Handle driver core errors with as much care as appropriate.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:29:57 +01:00
Stefan Richter 1ed891c6d4 ieee1394: coding style in hosts.c
Some 80-columns pedantry, and touch up of a // comment.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:29:35 +01:00
Stefan Richter 5c37dcbe13 ieee1394: lock smaller region by host_num_alloc mutex
We need the mutex only around the iteration over existing hosts.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:29:21 +01:00
Stefan Richter b63d4fe95f ieee1394: usecs_to_jiffies takes unsigned int argument
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07 21:29:08 +01:00
Stefan Richter da256c5537 ieee1394: ohci1394: suspend/resume cosmetics
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-07 21:28:40 +01:00
Bernhard Kaindl f011bf085c ohci1394: steps to implement suspend/resume
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-07 21:28:13 +01:00
Stefan Richter f9edc4f5c1 ieee1394: raw1394: add comments on lock usage
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-07 21:28:06 +01:00
Stefan Richter 23077f1d72 ieee1394: sbp2: slightly reorder sbp2scsi_abort
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-07 21:27:30 +01:00
Stefan Richter 0e930f437e ieee1394: remove unused struct member from highlevel API
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 21:20:30 +01:00
Nigel Cunningham 7dfb71030f [PATCH] Add include/linux/freezer.h and move definitions from sched.h
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 08:39:27 -08:00
Christoph Lameter e18b890bb0 [PATCH] slab: remove kmem_cache_t
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 08:39:25 -08:00
Christoph Lameter e94b176609 [PATCH] slab: remove SLAB_KERNEL
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 08:39:24 -08:00
Christoph Lameter 54e6ecb239 [PATCH] slab: remove SLAB_ATOMIC
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-12-07 08:39:24 -08:00
David Howells c4028958b6 WorkStruct: make allyesconfig
Fix up for make allyesconfig.

Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-22 14:57:56 +00:00
David S. Miller c20e3945c7 [ETH1394]: Fix unaligned accesses.
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-30 15:24:38 -08:00
Stefan Richter 346f5c7ee7 ieee1394: ohci1394: revert fail on error in suspend
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-29 20:02:23 +01:00
Linus Torvalds 7ff3e52cf2 Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  ieee1394: nodemgr: fix startup of knodemgrd
2006-10-08 12:28:41 -07:00
Stefan Richter b7a7179dca ieee1394: nodemgr: fix startup of knodemgrd
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-08 12:10:26 +02:00