20 May, 2011
1 commit
-
I was investigating some warnings that spew because of the
_DEBUG_FOO ifdef'ery in here.Instead of adding more ifdefs to fix that warning, let's use
pr_debug() and get rid of these CPP checks altogether.Signed-off-by: David S. Miller
07 Apr, 2011
1 commit
-
udev fully replaces this special file system that only contains CAPI
NCCI TTY device nodes. User space (pppdcapiplugin) works without
noticing the difference.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller
18 Feb, 2011
1 commit
-
Only oddities here are a couple of drivers that bogusly called the ldisc
helpers instead of returning -ENOIOCTLCMD. Fix the bug and the rest goes
away.Signed-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman
24 Dec, 2010
2 commits
-
flush_scheduled_work() is deprecated and will be removed. Because
kcapi uses fire-and-forget type works, it's impossible to flush each
work explicitly. Create and use a dedicated workqueue instead.Please note that with recent workqueue changes, each workqueue doesn't
reserve a lot of resources and using it as a flush domain is fine.Signed-off-by: Tejun Heo
Acked-by: Jan Kiszka -
capidrv_init() could leave capictr notifier dangling after init
failure. Fix it.Signed-off-by: Tejun Heo
Acked-by: Jan Kiszka
29 Oct, 2010
1 commit
-
Signed-off-by: Al Viro
21 Oct, 2010
1 commit
-
As long as we hold capi_controller_lock, we can safely access
capi_applications without RCU protection as no one can modify the
application list underneath us. Introduce an RCU-free
__get_capi_appl_by_nr for this purpose. This silences lockdep warnings
on suspicious rcu_dereference usage.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller
09 Sep, 2010
1 commit
-
Signed-off-by: Andy Shevchenko
Cc: Karsten Keil
Cc: Tilman Schmidt
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
16 Jul, 2010
1 commit
-
Signed-off-by: Andy Shevchenko
Cc: Karsten Keil
Cc: Tilman Schmidt
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
13 Jul, 2010
2 commits
-
Signed-off-by: Joe Perches
Signed-off-by: David S. Miller -
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.file=$1
name=$2
if grep -q lock_kernel ${file} ; then
if grep -q 'include.*linux.mutex.h' ${file} ; then
sed -i '/include.*/d' ${file}
else
sed -i 's/include.*.*$/include /g' ${file}
fi
sed -i ${file} \
-e "/^#include.*linux.mutex.h/,$ {
1,/^\(static\|int\|long\)/ {
/^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);} }" \
-e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
-e '/[ ]*cycle_kernel_lock();/d'
else
sed -i -e '/include.*\/d' ${file} \
-e '/cycle_kernel_lock()/d'
fiSigned-off-by: Arnd Bergmann
Cc: Karsten Keil
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
03 Jun, 2010
1 commit
-
copy_from_user() returns the number of bytes remaining but we should
return -EFAULT here. The error code gets returned to the user. Both
old_capi_manufacturer() and capi20_manufacturer() had other places
that already returned -EFAULT so this won't break anything.Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller
26 May, 2010
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits)
drivers/net/usb/asix.c: Fix pointer cast.
be2net: Bug fix to avoid disabling bottom half during firmware upgrade.
proc_dointvec: write a single value
hso: add support for new products
Phonet: fix potential use-after-free in pep_sock_close()
ath9k: remove VEOL support for ad-hoc
ath9k: change beacon allocation to prefer the first beacon slot
sock.h: fix kernel-doc warning
cls_cgroup: Fix build error when built-in
macvlan: do proper cleanup in macvlan_common_newlink() V2
be2net: Bug fix in init code in probe
net/dccp: expansion of error code size
ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
wireless: fix sta_info.h kernel-doc warnings
wireless: fix mac80211.h kernel-doc warnings
iwlwifi: testing the wrong variable in iwl_add_bssid_station()
ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs()
ath9k_htc: dereferencing before check in hif_usb_tx_cb()
rt2x00: Fix rt2800usb TX descriptor writing.
rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions.
...
24 May, 2010
1 commit
-
The CAPI controller operation reset_ctr is marked as optional, and
not all drivers do implement it. Add a check to the kernel CAPI
whether it exists before trying to call it.Signed-off-by: Tilman Schmidt
Acked-by: Karsten Keil
Signed-off-by: David S. Miller
17 May, 2010
1 commit
-
Push down bkl into isdn ioctl functions
[fweisbec: dropped drivers/isdn/divert/divert_procfs.c
as it has been pushed down in procfs branch already]Signed-off-by: Arnd Bergmann
Signed-off-by: Frederic Weisbecker
30 Mar, 2010
1 commit
-
…it slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
17 Feb, 2010
24 commits
-
Despite all its bugs, the middleware support of our CAPI stack was
already in use for many, many moons. And after going through its code,
fixing all issues I found, I feel it deserves to officially become a
non-experimental feature.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
With dynamic TTY nodes and the help of udev, we no longer need this
special filesystem. Schedule it for removal in one year from now.As a last duty to this feature, move its help to right option so that
users can read the rationale.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
This strange special rule to fall back to controller 1 cannot be derived
from the CAPI specs and looks a lot like it was once dedicated to some
out-of-tree driver, probably AVM's broken fcdsl2 (FRITZ!Card DSL v2.0).
I found no in-tree user that needs this check, and I'm now taking care
of the fcdsl2. So drop these bits from our stack.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
We did not evaluate handle_minor_send's return value, just (void)'ed it
away. Time for a cleanup.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
No need for irqsave acquisition of acklock, bh-safe is sufficient.
Moverover, move kfree out of the lock and do not take acklock at all
in capiminor_del_all_ack as we are the last user of the list here.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Introduce outlock as a spin lock that protects capiminor's outqueue,
outbytes and outskb (formerly known as ttyskb). outlock can be acquired
from soft-IRQ context via capinc_write, so make it bh-safe.This finally removes the last reason for keeping the workaround lock
around (which was incomplete and partly broken anyway). And as we no
longer call handle_recv_skb in atomic context, gen_data_b3_resp_for can
use non-atomic allocation now.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
The inbytes counter was only updated but never read.
Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
The capiminor members datahandle and msgid are incremented outside any
lock, so better do this atomically.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
This struct is describing a queue entry, not the queue itself.
Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Avoid re-queuing skbs unless the error detected in handle_recv_skb is
expected to be recoverable such as lacking memory, a full CAPI queue, a
full TTY input buffer, or a not yet existing TTY.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Sending a message down the CAPI stack may trigger the reception of an
answer, but this will go through capi_recv_message and call
handle_minor_recv from there. There is no need to walk the receive queue
on capinc_tty_write.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Not needed, tty->count keeps track of this information. At this chance,
drop traces of ancient attempts to debug this logic via _DEBUG_REFCOUNT.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Use a plain spin lock for capiminors_lock, drop inconsistent irqsafe
acquisitions (it's only used in process context anyway).Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
The nccip in capiminor used to serve as an indicator that the NCCI was
close. But we don't need this, we issue a hangup on capincci_free_minor.
So drop this legacy.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
capincci_free and, thus, capincci_free_minor runs in process context, so
we can issue the hangup of the associated TTY synchronously.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
tty_struct's driver_data cannot be NULL, no need to test for it.
Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Use the reference management features of tty_port to look up and drop
again the tty_struct associated with a capiminor.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Properly associate/disassociate a capiminor object with its TTY via the
install/cleanup handlers instead of trying to guess first open and last
close.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Install a reference counter for capiminor objects. Acquire it when
obtaining a capiminor from the array during capinc_tty_open, drop it
when closing the tty again. Another reference is held for the hook-up
with capincci.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
No need to allocate a fixed major for this TTY, both capifs and udev
make this transparent to the user.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Register capiminors dynamically with the TTY core so that udev can make
them show up as the NCCIs appear or disappear. This removes the need to
check if the capiminor requested in capinc_tty_open actually exists.And this completely obsoletes capifs which will be scheduled for removal
in a later patch.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Return proper error code if tty_register_driver fails. In contrast,
tty_unregister_driver cannot practically fail, so drop that error
handling. Finally, mark capinc_tty_init/exit with __init/__exit.Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Using a plain array of pointers simplifies the management of capiminors.
Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller -
Replace open-coded NCCI list management with standard mechanisms.
Signed-off-by: Jan Kiszka
Signed-off-by: David S. Miller