summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2012-04-09TTY: ipwireless, move prints to appropriate placesJiri Slaby1-21/+10
There are two functions which only print a status. Let us do that directly at places where they are called. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: David Sterba <dsterba@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: ipwireless, use synchronous hangupJiri Slaby1-3/+3
Do not touch internal workqueue. Call tty_vhangup instead. Note that finished hangup does not necessarily mean that all processes are dead. Especially when the tty is a console. The code assumes that right now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: David Sterba <dsterba@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvsi, use tty from tty_portJiri Slaby1-14/+21
Now, we switch to the refcounted model and do not need hp->lock to protect hp->tty anymore. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvsi, sanitize uses of ttyJiri Slaby1-58/+30
- use tty, not hp->tty wherever possible - pass tty down to some functions and go to step one - do not defer tty_hangup calls -- it is as simple as schedule_work, so might be called with hp->lock held - do not defer tty buffer flips -- since the driver does not use low_latency (it cannot actually), the flip is a simple tail move plus schedule_work. It will make our life easier in the next patch. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvsi, add tty_portJiri Slaby1-6/+7
And use count from there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvsi, CLOCAL is not in tty->flagsJiri Slaby1-1/+1
It is in termios cflags. So change the test in hvsi_recv_control to do the right thing. Previously it was actually testing TTY_LDISC_OPEN bit, i.e. whether an ldisc is active. And yes, it is most of the time. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvcs, use tty from tty_portJiri Slaby1-9/+7
No refcounting, just a switch. The locking in the driver prevents races, so in fact the refcounting is not needed. But while we have a tty in tty_port, don't duplicate that and remove the one from hvcs_struct. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvcs, use kref from tty_portJiri Slaby1-18/+16
A simple switch. Except we convert destroy_hvcs_struct to be tty_port_operations->destruct... Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hvcs, add tty_portJiri Slaby1-12/+12
And use count from there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: HVC, use count from tty_portJiri Slaby2-20/+21
Now, count is used from tty_port and protected by tty_port->lock. n_outbuf is left unprotected in hvc_hangup now, because there is no point to hold any lock, since other uses are unprotected too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: HVC, use tty from tty_portJiri Slaby3-23/+16
The driver already used refcounting. So we just switch it to tty_port helpers. And switch to tty_port->lock for tty. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: HVC, add tty_portJiri Slaby2-10/+15
And use kref from that. This means we need tty_port->ops->destruct to properly free the structure. This is what destroy_hvc_struct used to do so we leverage that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: bfin_jtag_comm, use tty from tty_portJiri Slaby1-18/+18
Switch from mutex to tty_port->lock and to tty refcounting. This needs a 'continue' to be added to re-grab a tty after schedule returns. And since tty is not protected by bfin_jc_tty_mutex remove it as well. But this needs tty_port->count to be protected by tty_port->lock now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Mike Frysinger <vapier@gentoo.org> Cc: uclinux-dist-devel@blackfin.uclinux.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: bfin_jtag_comm, add tty_portJiri Slaby1-5/+5
And use open count from there. Switch to tty from there will follow. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Mike Frysinger <vapier@gentoo.org> Cc: uclinux-dist-devel@blackfin.uclinux.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: tty3270, add tty_portJiri Slaby3-43/+49
And use tty from that. This means, we convert most of the users to accept tty_port instead. This is not racy and ensures the tty to be properly refcounted. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: tty3270, push tty down to tty3270_do_writeJiri Slaby1-5/+6
So that we do not need to access tp->tty there. It is going away. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: tty3270, get rid of ugly aliasingJiri Slaby1-23/+19
Blah, do not assume that raw3270_view is at the beginning of tty3270. Use proper types and container_of wherever needed. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: tty3270, move initialization to allocationJiri Slaby1-10/+10
Let us initialize all the tty3270's members at the place where the structure is allocated. It cleans up tty->ops->open a bit. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: sclp_vt220, remove unused allocationJiri Slaby1-8/+1
80 bytes which are allocated in tty->ops->open and assigned to tty->driver_data are never used. Remove that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: sclp_vt220, add tty_portJiri Slaby1-10/+14
tty_port will hold tty buffers in the future. So we need to have it even here. The only needed member here is tty, so let us store it in the structure now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: sclp_tty, add tty_portJiri Slaby1-14/+19
tty_port will hold tty buffers in the future. So we need to have it even here. The only needed member here is tty, so let us store it in the structure now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: con3215, centralize allocationJiri Slaby1-35/+39
There are two copies of allocations of device information. One of them is totally broken. See: raw->cdev = cdev; raw->inbuf = (char *) raw + sizeof(struct raw3215_info); memset(raw, 0, sizeof(struct raw3215_info)); It suggests that this path was never executed. The code uses both raw->cdev and raw->inbuf all over. And it is NULL due to the memset here, so it would panic immediately. I believe nobody used that driver without being a system console. Either way, let us fix it by moving the allocations (and initializations) to a single place. This will save us some double initializations later too. And while at it, initialize the timer properly -- once, at the allocation. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hso, use tty from tty_portJiri Slaby1-27/+13
We switched tty refcounting there to the one provided by tty_port helpers. So tty_port->tty is now protected by tty_port->lock, not by hso_serial->serial_lock. Side note: tty->driver_data does not need the lock, so it is needed neither in open, nor in close paths. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jan Dumon <j.dumon@option.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hso, remove tty NULL checks fro tty->opsJiri Slaby1-17/+10
tty is never NULL in tty->ops->* while the device is open. (And they are not called otherwise.) So remove pointless checks and use tty->driver_data directly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jan Dumon <j.dumon@option.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hso, add tty_portJiri Slaby1-12/+13
And use open count from there. Other members will follow. Remark: port.count is (and never was) properly protected. Only a mutex is held, so ISR and all the functions it calls may see an invalid state. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jan Dumon <j.dumon@option.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hso, free tty_driverJiri Slaby1-4/+8
Do not leak tty_driver structure on each module removal. Also do proper frees in fail paths of module_init. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jan Dumon <j.dumon@option.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: hso, do not set TTY MAGICJiri Slaby1-1/+0
It is set in alloc_tty_driver already. No need to re-set. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jan Dumon <j.dumon@option.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use tty_port_block_til_ready helperJiri Slaby1-96/+1
This removes a bunch of duplicated code which does the same as tty_port_block_til_ready does. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, define tty_port_operationsJiri Slaby1-1/+13
Add there .carrier_raised. It is taken from current block_til_ready. We will need tty_port->ops->carrier_raised for tty_port_block_til_ready helper. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use tty_port_close_end helperJiri Slaby1-7/+2
The code does almost the same, so there we can leverage the helper's code. The only difference is locking. The helper protects counts by a spinlock. This never hurts and should be added to other code parts too. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, define local tty_portJiri Slaby1-46/+52
In some functions we use tty_port much. So let us have a local pointer to that variable instead of having info->port all over the code. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use xmit_buf from tty_portJiri Slaby1-7/+9
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use tty from tty_portJiri Slaby1-21/+20
No recounting this time, just a plain switch. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use counts from tty_portJiri Slaby1-22/+21
blocked_open and count this time. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, use open/close_wait from tty_portJiri Slaby2-11/+7
Hmm, the isdn ones were initialized twice. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, add tty_portJiri Slaby1-29/+31
And use tty_port->flags now. Other members will follow. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, make some functions readableJiri Slaby1-85/+93
Huh, this was a mess. * Remove the 5 indent levels by just returning from isdn_tty_try_read when the conditions there are not satisfied. * Use 'continue' in loop in isdn_tty_readmodem to save 2 levels. * Chain 'if's in isdn_tty_modem_escape. * Use 'continue' in loop in isdn_tty_carrier_timeout to save 1 level. Better to look at this patch with -w -b. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, do not play with module refcountsJiri Slaby1-11/+0
The module which called allocate_tty_driver is already refcounted by the TTY layer automatically. And since THIS_MODULE is isdn_tty and it allocated the tty_driver, there is no need to do the counts in isdn's tty->ops->open/close. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, remove ISDN_ASYNC_* flagsJiri Slaby1-29/+30
They are the same as TTY ones. So there is no need to redefine them. Remove ISDN_ASYNC_* and use only ASYNC_*. Except the MAGIC number, of course. While we are there, remove also the SERIAL_TYPE flags which are unused. Perhaps we should move the ASYNC flags from serial.h to tty.h given they are used by the tty layer and tty drivers, not only serial? Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: isdn, remove calloutJiri Slaby1-26/+6
I wonder how this survived there during the whole 2.6 series until now :D. Callouts are not used for a decade, so let us remove it also from isdn. This means removal of ISDN_ASYNC_CALLOUT_ACTIVE which is never raised in info->flags and callout_termios which are never used. This will help us to get rid of ISDN_ASYNC_* flags and use ASYNC ones from serial.h. And then we will switch to tty_port. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09ISDN: i4l, remove cvs crapJiri Slaby1-5/+1
CVS $Id$ is unused and makes no sense in our tree. Get rid of that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: crisv10, initialize tty_portJiri Slaby1-0/+1
The tty_port used in the driver is left uninitialized. Add the initialization there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Mikael Starvik <starvik@axis.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Cc: linux-cris-kernel@axis.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-09TTY: crisv10, remove unused tmp_bufJiri Slaby1-26/+1
This used to be a helper buffer for generic_serial. generic_serial is gone, tmp_buf shall be removed. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Mikael Starvik <starvik@axis.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Cc: linux-cris-kernel@axis.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-07Merge tag 'regmap-3.4-fixes' of ↵Linus Torvalds2-1/+8
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull two more small regmap fixes from Mark Brown: - Now we have users for it that aren't running Android it turns out that regcache_sync_region() is much more useful to drivers if it's exported for use by modules. Who knew? - Make sure we don't divide by zero when doing debugfs dumps of rbtrees, not visible up until now because everything was providing at least some cache on startup. * tag 'regmap-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: prevent division by zero in rbtree_show regmap: Export regcache_sync_region()
2012-04-07Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-shLinus Torvalds2-89/+86
Pull SuperH fixes from Paul Mundt. * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: sh: fix clock-sh7757 for the latest sh_mobile_sdhi driver serial: sh-sci: use serial_port_in/out vs sci_in/out. sh: vsyscall: Fix up .eh_frame generation. sh: dma: Fix up device attribute mismatch from sysdev fallout. sh: dwarf unwinder depends on SHcompact. sh: fix up fallout from system.h disintegration.
2012-04-07Merge branch 'release' of ↵Linus Torvalds2-2/+5
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull ACPI & Power Management patches from Len Brown: "Two fixes for cpuidle merge-window changes, plus a URL fix in MAINTAINERS" * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: MAINTAINERS: Update git url for ACPI cpuidle: Fix panic in CPU off-lining with no idle driver ACPI processor: Use safe_halt() rather than halt() in acpi_idle_play_dead()
2012-04-07Merge branch '3.4-rc-fixes' of ↵Linus Torvalds4-7/+19
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending Pull target fixes from Nicholas Bellinger: "Pull two tcm_fc fabric related fixes for -rc2: Note that both have been CC'ed to stable, and patch #1 is the important one that addresses a memory corruption bug related to FC exchange timeouts + command abort. Thanks again to MDR for tracking down this issue!" * '3.4-rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: tcm_fc: Do not free tpg structure during wq allocation failure tcm_fc: Add abort flag for gracefully handling exchange timeout
2012-04-07tcm_fc: Do not free tpg structure during wq allocation failureMark Rustad1-5/+8
Avoid freeing a registered tpg structure if an alloc_workqueue call fails. This fixes a bug where the failure was leaking memory associated with se_portal_group setup during the original core_tpg_register() call. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Acked-by: Kiran Patil <Kiran.patil@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-04-07tcm_fc: Add abort flag for gracefully handling exchange timeoutMark Rustad3-2/+11
Add abort flag and use it to terminate processing when an exchange is timed out or is reset. The abort flag is used in place of the transport_generic_free_cmd function call in the reset and timeout cases, because calling that function in that context would free memory that was in use. The aborted flag allows the lifetime to be managed in a more normal way, while truncating the processing. This change eliminates a source of memory corruption which manifested in a variety of ugly ways. (nab: Drop unused struct fc_exch *ep in ft_recv_seq) Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Acked-by: Kiran Patil <Kiran.patil@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-04-07Merge branches 'idle-fix' and 'misc' into releaseLen Brown4441-173979/+325606