Age | Commit message (Collapse) | Author |
|
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
firewire: fw-sbp2: log scsi_target ID at release
ieee1394: fix NULL pointer dereference in sysfs access
|
|
Regression since "ieee1394: prevent device binding of raw1394,
video1394, dv1394", commit d2ace29fa44589da51fedc06a67b3f05301f3bfd:
$ cat /sys/bus/ieee1394/drivers/raw1394/device_ids
triggers a NULL pointer dereference in fw_show_drv_device_ids.
Reported by Miles Lane.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Tested-by: Miles Lane <miles.lane@gmail.com>
|
|
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
|
|
These drivers don't need to match any unit_directory type device.
They just need the id_table for module autoloading per module alias.
Not binding any of these drivers allows special-purpose drivers with
similar or same IDs to bind to devices. This currently only benefits
out-of-tree drivers; on the other hand it is in no way detrimental to
in-tree drivers.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Convert to use the class iteration api.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
At least since nodemgr got rid of coarse global locking, accesses to
struct csr1212_keyval's reference counter should be atomic and coupled
with proper barriers. Also, calls to csr1212_keep_keyval(kv) should
occur before kv is being used.
(We probably should convert refcnt to struct kref, but how to keep
csr1212_destroy_keyval's implementation non-recursively then?)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
csr1212_keep_keyval(kv) in nodemgr_process_root_directory was
unbalanced if ne->vendor_name_kv already exists. This happens for
example if eth1394 or raw1394 modify the local config ROM and it is
parsed again.
As a bonus, the attempt to add the vendor_name_kv sysfs attribute
when it already exists is now fixed for good.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
The nodemgr host thread can exit on its own even when kthread_should_stop
is not true, on receiving a signal (might never happen in practice, as
it ignores signals). But considering kthread_stop() must not be mixed with
kthreads that can exit on their own, I think changing the code like this
is clearer. This change means the thread can cut its sleep short when
receive a signal but looking at the code around, that sounds okay (and
again, it might never actually recieve a signal in practice).
Signed-off-by: Satyam Sharma <satyam@infradead.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
This changes the uevent buffer functions to use a struct instead of a
long list of parameters. It does no longer require the caller to do the
proper buffer termination and size accounting, which is currently wrong
in some places. It fixes a known bug where parts of the uevent
environment are overwritten because of wrong index calculations.
Many thanks to Mathieu Desnoyers for finding bugs and improving the
error handling.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.
It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.
The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.
[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Going through the string and waiting for _pointer_ to become '\0'
is not what the authors meant...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Ben Collins <ben.collins@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Remove the global nodemgr_serialize mutex which enclosed most of the
host thread event loop. This allows for parallelism between several
host adapter cards.
Properly serialize the driver hooks .update(), .suspend(), .resume(),
and .remove() by means of device->sem. These hooks can be called from
outside the host threads' contexts.
Get() and put() the device.driver when calling its hooks.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Here is a straightforward conversion to "struct device". The "struct
class_device" will be removed from the kernel.
It seems to work fine for me with and without CONFIG_SYSFS_DEPRECATED
set.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
With "modprobe sbp2 long_ieee1394_id=y", the format of
/sys/bus/scsi/devices/*:*:*:*/ieee1394_id is changed from e.g.
0001041010004beb:0:0 to 0001041010004beb:00042c:0000.
The longer format fully conforms to object identifier sizes as per
SAM(-2...4) and reflects what the SAM target port identifier is meant to
contain: A Discovery ID allegedly specified by ISO/IEC 13213:1994 ---
however there is no such thing; the authors of SAM probably meant
Directory ID). Especially target nodes with multiple dynamically added
targets may use Directory IDs to persistently identify target ports.
The new format is independent of implementation details of nodemgr.
Thus the same ieee1394_id attribute format can be implemented in the new
firewire stack.
The ieee1394_id is typically used to create persistently named links in
/dev/disk/by-id.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
struct csr1212_keyval.offset is relative to 0xffff f000 0000 rather than
0xffff f000 0400.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Signed-off-by: Michael Opdenacker <michael@free-electrons.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
|
|
Shrinks object file size a little bit.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Everytime when eth1394 or a libraw1394 client updates the configuration
ROM, a certain sysfs attribute cannot be added since it already exists.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
csr1212 was written to be compiled either as part of the ieee1394 kernel
driver or of an anticipated IEEE 1212 userspace library. We now drop
support for the latter. The costs in terms of code footprint and depth
of abstraction are not countered by any actual benefit.
Also remove some obsolete #includes.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
The subsystem rwsem is not used by the driver core at all, so the use of
it in the ieee1394 code doesn't make any sense. They might possibly
want to use a local lock, but as most of these operations are already
protected by a local lock, it really doesn't look like it would be
needed.
Cc: Ben Collins <bcollins@debian.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel <linux1394-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
Make use of add_uevent_var() instead of (often incorrectly) open coding it.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
A "modprobe ohci1394; sleep 1.5; modprobe -r ohci1394" could get stuck
in uninterruptible state, especially if an external node was connected.
http://bugzilla.kernel.org/show_bug.cgi?id=7792
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Since my commit 8252bbb1363b7fe963a3eb6f8a36da619a6f5a65 in 2.6.20-rc1,
host devices have a dummy driver attached. Alas the driver was not
registered before use if ieee1394 was loaded with disable_nodemgr=1.
This resulted in non-functional FireWire drivers or kernel lockup.
http://bugzilla.kernel.org/show_bug.cgi?id=7942
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
This patch contains the scheduled IEEE1394_OUI_DB removal.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Update: Also remove drivers/ieee1394/.gitignore.
Remove now unused struct members in drivers/ieee1394/nodemgr.h.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Was I sleepwalking when I wrote this?
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
This patch consolidates some bookkeeping for driver registering. It
closely models what pci_register_driver() does. The main addition is
that the owner of the driver is set, so we get a proper symlink
for /sys/bus/ieee1394/driver/*/module.
Also moves setting of name and bus type into nodemgr. Because of this,
we can remove the EXPORT_SYMBOL for ieee1394_bus_type, since it's now
only used in ieee1394.ko.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
whitespace pedantry
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
If "modprobe ohci1394" was quickly followed by "modprobe -r ohci1394",
say with 1 second pause in between, the modprobe -r got stuck in
uninterruptible sleep in kthread_stop. At the same time the knodemgrd
slept uninterruptibly in bus_rescan_devices_helper. That's because
driver_detach took the semaphore of the PCI device and
bus_rescan_devices_helper wanted to take the semaphore of the FireWire
host device's parent, which is the same semaphore. This was a regression
since Linux 2.6.16, commit bf74ad5bc41727d5f2f1c6bedb2c1fac394de731,
"Hold the device's parent's lock during probe and remove".
The fix (or workaround) adds a dummy driver to the hpsb_host device. Now
bus_rescan_devices_helper won't scan the host device anymore. This
doesn't hurt since we have no drivers which will bind to these devices
and it is unlikely that there will ever be such a driver. The dummy
driver is befittingly presented as a representation of ieee1394 itself.
Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=6706
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
This happens. No need to log a BUG trace.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
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>
|
|
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>
|
|
- 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>
|
|
Give better names to local variables.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
One hunk in "ieee1394: handle sysfs errors" was wrong.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Handle driver core errors with as much care as appropriate.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
This patch reduces the size of struct hpsb_host and also removes
semaphores from ieee1394_transactions.c. On i386, struct hpsb_host
shrinks from 10656 bytes to 6688 bytes. This is accomplished by
- using a single wait_queue for hpsb_get_tlabel instead of many
instances of semaphores,
- using a single lock to serialize access to all tlabel pools (the
protected code regions are small, i.e. lock contention very low),
- omitting the sysfs attribute tlabels_allocations.
Drawback: In the rare case that a process needs to sleep because all
transaction labels for the node are temporarily exhausted, it is also
woken up if a tlabel for a different node became free, checks for an
available tlabel, and is put to sleep again. The check is not costly
and the situation occurs extremely rarely. (Tlabels are typically
only exhausted if there was no context switch to the khpsbpkt thread
which recycles tlables.) Therefore the benefit of reduced tpool size
outweighs this drawback.
The sysfs attributes tlabels_free and tlabels_mask are not compiled
anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set.
The by far biggest member of struct hpsb_host, the struct csr_control
csr (5272 bytes on i386), is now placed at the end of struct hpsb_host.
Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a
condition argument which has a side effect (allocation of a tlabel and
manipulation of the packet). This side effect happens only if the
condition is true. The patch relies on wait_event_interruptible not
evaluating the condition again after it became true.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
|
|
Another trivial sem2mutex conversion.
Side note: nodemgr_serialize's purpose, when introduced in linux1394's
revision 529 in July 2002, was to protect several data structures which
are now largely handled by or together with Linux' driver core and are
now protected by the LDM's own mechanisms. It may very well be possible
to remove this mutex now. But fully parallelized node scanning is on
our long-term TODO list anyway; the mutex will certainly go away then.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|
|
Convert nodemgr's host thread from kernel_thread to kthread and its
sleep/restart mechanism from a counting semaphore to a schedule()/
wake_up_process() scheme.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|
|
Nodemgr's ignore_drivers variable is exposed as a module load parameter
(therefore also as a sysfs attribute below /sys/module) and additionally
as an attribute below /sys/bus/ieee1394. Since the latter is writable,
make the former writable too.
Note, the bus's attribute ignore_drivers is only relevant to newly added
units, not to present or suspended or resuming units. Those have their
own attribute ignore_driver.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|
|
nodemgr.c::fw_set_rescan() is used to re-run the driver core over
nodemgr's representation of unit directories in order to initiate
protocol driver probes. It is initiated via write access to one of
nodemgr's sysfs attributes. The purpose is to attach drivers to
units after switching a unit's ignore_driver attribute from 1 to 0.
It is not really necessary to fork a kernel_thread for this job. The
call to kernel_thread() can be eliminated to avoid the deprecated API
and to simplify the code a bit.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|
|
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|
|
Remove unnecessary includes, add missing includes.
Use forward type declarations for some structs.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
|