11 Jun, 2009
1 commit
-
There are several pretty much unfixable races in the old ldisc code, especially
with respect to pty behaviour and also to hangup. It's easier to rewrite the
code than simply try and patch it up.This patch
- splits the ldisc from the tty (so we will be able to refcount it more cleanly
later)
- introduces a mutex lock for ldisc changing on an active device
- fixes the complete mess that hangup caused
- implements hopefully correct setldisc/close/hangup lockingThere are still some problems around pty pairs that have always been there but
at least it is now possible to understand the code and fix further problems.This fixes the following known bugs
- hang up can leak ldisc references
- hang up may not call open/close on ldisc in a matched way
- pty/tty pairs can deadlock during an ldisc change
- reading the ldisc proc files can cause every ldisc to be loadedand probably a few other of the mysterious ldisc race reports.
I'm sure it also adds the odd new one.
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds
01 Apr, 2009
1 commit
-
Signed-off-by: Alexey Dobriyan
Cc: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2008
1 commit
-
Now that device_create() has been audited, rename things back to the
original call to be sane.Signed-off-by: Greg Kroah-Hartman
14 Oct, 2008
6 commits
-
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds -
add_timer() is not supposed to be called when the timer is pending.
ip2 driver attempts to avoid that condition by setting and resetting
a flag (TimerOn) in timer function. But there is some gap between
add_timer() and setting TimerOn.This patch fix this problem by using mod_timer() and remove TimerOn
which has been unnecessary by this change.Signed-off-by: Akinobu Mita
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds -
Cleanup of module_init/exit:
- mostly whitespace
- remove empty functions
- replace c++ comments
- remove useless prints (module loaded, unloaded)
- mark the calls as __exit and __init
- use break; and return; to save some indent levels after it
- note resource leakageIt's still mess, but now it's readable.
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds -
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds -
- do not init .bss zeroed data to zero again (by memset or
explicit assignment)
- use char [] instead of char * for string constantsSigned-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds -
It's pretty useless to have one setup() function separated along with
module_init() which only calls a function from ip2main anyway. Get rid
of ip2base.Remove also checks of always-true now.
Signed-off-by: Jiri Slaby
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds
26 Jul, 2008
1 commit
-
(The tty side is already done)
Signed-off-by: Alan Cox
Cc: Jiri Slaby
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Jul, 2008
1 commit
-
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.Signed-off-by: Greg Kroah-Hartman
21 Jul, 2008
1 commit
-
Move the line disciplines towards a conventional ->ops arrangement. For
the moment the actual 'tty_ldisc' struct in the tty is kept as part of
the tty struct but this can then be changed if it turns out that when it
all settles down we want to refcount ldiscs separately to the tty.Pull the ldisc code out of /proc and put it with our ldisc code.
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds
15 Jul, 2008
2 commits
-
* 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6: (64 commits)
firmware: convert sb16_csp driver to use firmware loader exclusively
dsp56k: use request_firmware
edgeport-ti: use request_firmware()
edgeport: use request_firmware()
vicam: use request_firmware()
dabusb: use request_firmware()
cpia2: use request_firmware()
ip2: use request_firmware()
firmware: convert Ambassador ATM driver to request_firmware()
whiteheat: use request_firmware()
ti_usb_3410_5052: use request_firmware()
emi62: use request_firmware()
emi26: use request_firmware()
keyspan_pda: use request_firmware()
keyspan: use request_firmware()
ttusb-budget: use request_firmware()
kaweth: use request_firmware()
smctr: use request_firmware()
firmware: convert ymfpci driver to use firmware loader exclusively
firmware: convert maestro3 driver to use firmware loader exclusively
...Fix up trivial conflicts with BKL removal in drivers/char/dsp56k.c and
drivers/char/ip2/ip2main.c manually.
10 Jul, 2008
1 commit
-
Converted with help from Jaswinder Singh
Signed-off-by: David Woodhouse
Acked-by: Alan Cox
21 Jun, 2008
1 commit
-
All of the open() functions which don't need the BKL on their face may
still depend on its acquisition to serialize opens against driver
initialization. So make those functions acquire then release the BKL to be
on the safe side.Signed-off-by: Jonathan Corbet
25 May, 2008
1 commit
-
This doesn't need to be two modules, and making it one cleans up the
problemSigned-off-by: Alan Cox
Cc: Jiri Slaby
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Apr, 2008
4 commits
-
Signed-off-by: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
- Operations are now a shared const function block as with most other Linux
objects- Introduce wrappers for some optional functions to get consistent behaviour
- Wrap put_char which used to be patched by the tty layer
- Document which functions are needed/optional
- Make put_char report success/fail
- Cache the driver->ops pointer in the tty as tty->ops
- Remove various surplus lock calls we no longer need
- Remove proc_write method as noted by Alexey Dobriyan
- Introduce some missing sanity checks where certain driver/ldisc
combinations would oops as they didn't check needed methods were present[akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
[akpm@linux-foundation.org: fix isicom]
[akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
[akpm@linux-foundation.org: fix kgdb]
Signed-off-by: Alan Cox
Acked-by: Greg Kroah-Hartman
Cc: Jason Wessel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
- remove i2os.h -- there was only macro to macro renaming or useless
stuff
- remove another uselless stuf (NULLFUNC, NULLPTR, YES, NO)
- use outb/inb directly
- use locking functions directly
- don't define another ROUNDUP, use roundup(x, 2) instead
- some comments and whitespace cleanup
- remove some commented crap
- prepend the rest by I2 prefix to not collide with rest of the world
like in following output (pointed out by akpm)In file included from drivers/char/ip2/ip2main.c:128:
drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
In file included from include/net/netns/ipv4.h:8,
from include/net/net_namespace.h:13,
from include/linux/seq_file.h:7,
from include/asm/machdep.h:12,
from include/asm/pci.h:17,
from include/linux/pci.h:951,
from drivers/char/ip2/ip2main.c:95:
include/net/inet_frag.h:28:1: warning: this is the location of the previous definitionSigned-off-by: Jiri Slaby
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Replace init_module and cleanup_module with static functions and
module_init/module_exit.Signed-off-by: Jon Schindler
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Apr, 2008
2 commits
-
/******************************************/
/* Remove useless comment, while I am it. */
/******************************************/Signed-off-by: Alexey Dobriyan
Cc: Greg Kroah-Hartman
Cc: Jeff Garzik
Cc: Jeff Dike
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove proc_root export. Creation and removal works well if parent PDE is
supplied as NULL -- it worked always that way.So, one useless export removed and consistency added, some drivers created
PDEs with &proc_root as parent but removed them as NULL and so on.Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Apr, 2008
1 commit
-
Unlock two grabbed locks on some paths.
Signed-off-by: Jiri Slaby
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Feb, 2008
1 commit
-
Signed-off-by: Jiri Slaby
Cc: Alan Cox
Cc: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Feb, 2008
1 commit
-
Signed-off-by: Joe Perches
Signed-off-by: Adrian Bunk
24 Oct, 2007
2 commits
-
Polling currently calls the irq handler, which loops through all the
boards, calling the work function for all polling boards with work.irq handling loops through all the boards, finding the specific board
that applies to us, and calling the work just for that one board.The two logics are sufficiently different to warrant different
functions, rather than being slack and calling the same function in two
different ways.This serves to make the interrupt handler a -lot- more efficient.
Signed-off-by: Jeff Garzik
-
No changes besides code movement and glue.
Signed-off-by: Jeff Garzik
17 Oct, 2007
2 commits
-
Fix bug flagged by a variable-used-uninitialized warning.
[akpm@linux-foundation.org: coding-style]
Signed-off-by: Jeff Garzik
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
drivers/char/ip2/ip2main.c | 104398 -> 104346 (-52 bytes)
drivers/char/ip2/ip2main.o | 210710 -> 210702 (-8 bytes)Signed-off-by: Mariusz Kozlowski
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Oct, 2007
1 commit
-
Convert from class_device to device in drivers/char.
Signed-off-by: Tony Jones
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
01 Aug, 2007
1 commit
-
CONFIG_PCI=n:
drivers/char/ip2/ip2main.c: In function `ip2_loadmain':
drivers/char/ip2/ip2main.c:503: warning: unused variable `status'Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Jul, 2007
1 commit
-
unregister_chrdev() always returns 0. There is no need to check the return
value.Signed-off-by: Akinobu Mita
Cc: "David S. Miller"
Cc: Takashi Iwai
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Jul, 2007
1 commit
-
Signed-off-by: Jiri Slaby
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Feb, 2007
1 commit
-
Not only was the function way too big to be inlined in the first place,
it was used before it was even defined.Noted-by: Faik Uygur
Cc: Jiri Slaby
Signed-off-by: Linus Torvalds
13 Feb, 2007
2 commits
-
Of kernel subsystems that work with pids the tty layer is probably the largest
consumer. But it has the nice virtue that the assiation with a session only
lasts until the session leader exits. Which means that no reference counting
is required. So using struct pid winds up being a simple optimization to
avoid hash table lookups.In the long term the use of pid_nr also ensures that when we have multiple pid
spaces mixed everything will work correctly.Signed-off-by: Eric W. Biederman
Cc: Alan Cox
Cc: Oleg Nesterov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
- Use timer macros to set function and data members and to modify
expiration time.
- Use DEFINE_TIMER for global timers and do not init them at run-time in
these cases.
- del_timer_sync is common in most cases -- we want to wait for timer
function if it's still running.Signed-off-by: Jiri Slaby
Cc: Dave Airlie
Cc: David Woodhouse
Cc: Dominik Brodowski
Cc: Alessandro Zummo
Cc: Paul Fulghum
Cc: Kylene Jo Hall
Cc: Wim Van Sebroeck
Acked-by: Dmitry Torokhov (Input bits)
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Feb, 2007
1 commit
-
tty_wakeup cleanup
- remove wake_up_interruptible(&tty->write_wait) surrounding
tty_wakup(tty);
- substitute tty->ldisc.write_wakeup(tty) + wake_up() by tty_wakeup(tty);Signed-off-by: Jiri Slaby
Cc: Alan Cox
Acked-by: Tilman Schmidt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 Jan, 2007
1 commit
-
Make this:
drivers/char/ip2/ip2main.c: In function 'ip2_loadmain':
drivers/char/ip2/ip2main.c:654: warning: control may reach end of non-void function 'iiSetAddress' being inlined
drivers/char/ip2/ip2main.c:808: warning: control may reach end of non-void function 'iiInitialize' being inlinedgo away.
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Dec, 2006
1 commit
-
This is the grungy swap all the occurrences in the right places patch that
goes with the updates. At this point we have the same functionality as
before (except that sgttyb() returns speeds not zero) and are ready to
begin turning new stuff on providing nobody reports lots of bugsIf you are a tty driver author converting an out of tree driver the only
impact should be termios->ktermios name changes for the speed/property
setting functions from your upper layers.If you are implementing your own TCGETS function before then your driver
was broken already and its about to get a whole lot more painful for you so
please fix it 8)Also fill in c_ispeed/ospeed on init for most devices, although the current
code will do this for you anyway but I'd like eventually to lose that extra
paranoia[akpm@osdl.org: bluetooth fix]
[mp3@de.ibm.com: sclp fix]
[mp3@de.ibm.com: warning fix for tty3270]
[hugh@veritas.com: fix tty_ioctl powerpc build]
[jdike@addtoit.com: uml: fix ->set_termios declaration]
Signed-off-by: Alan Cox
Signed-off-by: Martin Peschke
Acked-by: Peter Oberparleiter
Cc: Cornelia Huck
Signed-off-by: Hugh Dickins
Signed-off-by: Jeff Dike
Cc: Paolo 'Blaisorblade' Giarrusso
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds