15 May, 2020
1 commit
-
No other functions use the return value of mxser_change_speed() and the
return value is always 0 now. Make it return void. This fixes the
following coccicheck warning:drivers/tty/mxser.c:645:5-8: Unneeded variable: "ret". Return "0" on
line 650Signed-off-by: Jason Yan
Link: https://lore.kernel.org/r/20200506061735.19369-1-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman
13 Oct, 2018
1 commit
-
Signed-off-by: Al Viro
08 Nov, 2017
2 commits
-
Now that the SPDX tag is in all tty files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.No copyright headers or other non-license-description text was removed.
Cc: Jiri Slaby
Cc: James Hogan
Signed-off-by: Greg Kroah-Hartman -
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.Update the drivers/tty files files with the correct SPDX license
identifier based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.Cc: Jiri Slaby
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Chris Metcalf
Cc: Jiri Kosina
Cc: David Sterba
Cc: James Hogan
Cc: Rob Herring
Cc: Eric Anholt
Cc: Stefan Wahren
Cc: Florian Fainelli
Cc: Ray Jui
Cc: Scott Branden
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: "James E.J. Bottomley"
Cc: Helge Deller
Cc: Joachim Eastwood
Cc: Matthias Brugger
Cc: Masahiro Yamada
Cc: Tobias Klauser
Cc: Russell King
Cc: Vineet Gupta
Cc: Richard Genoud
Cc: Alexander Shiyan
Cc: Baruch Siach
Cc: "Maciej W. Rozycki"
Cc: "Uwe Kleine-König"
Cc: Pat Gefre
Cc: "Guilherme G. Piccoli"
Cc: Jason Wessel
Cc: Vladimir Zapolskiy
Cc: Sylvain Lemieux
Cc: Carlo Caione
Cc: Kevin Hilman
Cc: Liviu Dudau
Cc: Sudeep Holla
Cc: Lorenzo Pieralisi
Cc: Andy Gross
Cc: David Brown
Cc: "Andreas Färber"
Cc: Kevin Cernekee
Cc: Laxman Dewangan
Cc: Thierry Reding
Cc: Jonathan Hunter
Cc: Barry Song
Cc: Patrice Chotard
Cc: Maxime Coquelin
Cc: Alexandre Torgue
Cc: "David S. Miller"
Cc: Peter Korsgaard
Cc: Timur Tabi
Cc: Tony Prisk
Cc: Michal Simek
Cc: "Sören Brinkmann"
Cc: Thomas Gleixner
Cc: Kate Stewart
Cc: Philippe Ombredanne
Cc: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
09 Oct, 2017
1 commit
-
We want the tty/serial fixes in here as well.
Signed-off-by: Greg Kroah-Hartman
04 Oct, 2017
1 commit
-
Remove
* pdev from mxser_initbrd
* old_termios from mxser_change_speed
as they are unused and update the callers.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
19 Sep, 2017
1 commit
-
Paul reported, that low rates like B300 make the driver to hang in
mxser_wait_until_sent. His debugging tackled the issue down to the
info->timeout computation in mxser_set_baud. Obviously, ints are used
there and they easily overflow with these low rates: B300 makes
info->timeout to be -373.So switch all these types to unsigned as it ought to be. And use the u64
domain to perform the computation as in the worst case, we need 35 bits
to store the computed value (before division).And use do_div not to break 32 bit kernels.
[v2] make it actually build
Signed-off-by: Jiri Slaby
Cc: Paul
Tested-by:
Signed-off-by: Greg Kroah-Hartman
30 Jul, 2017
1 commit
-
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by work with
const pci_device_id. So mark the non-const structs as const.File size before:
text data bss dec hex filename
20253 1184 19904 41341 a17d drivers/tty/mxser.oFile size After adding 'const':
text data bss dec hex filename
21117 300 19904 41341 a17d drivers/tty/mxser.oSigned-off-by: Arvind Yadav
Signed-off-by: Greg Kroah-Hartman
20 Apr, 2017
1 commit
-
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image. Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify. The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.This patch annotates drivers in drivers/tty/.
Suggested-by: Alan Cox
Signed-off-by: David Howells
Acked-by: Greg Kroah-Hartman
cc: Jiri Slaby
cc: linux-serial@vger.kernel.org
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
25 Jun, 2016
1 commit
-
Do not initialize members of initialized structures to zero. They are
zeroed automatically.Part of hub6 cleanup series.
Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
01 May, 2016
5 commits
-
ASYNC*_SHARE_IRQ is no longer used; remove.
Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman -
Replace ASYNC_INITIALIZED bit in the tty_port::flags field with
TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers
tty_port_set_initialized() and tty_port_initialized() to abstract
atomic bit ops.Note: the transforms for test_and_set_bit() and test_and_clear_bit()
are unnecessary as the state transitions are already mutually exclusive;
the tty lock prevents concurrent open/close/hangup.Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman -
Replace ASYNC_CHECK_CD bit in the tty_port::flags field with
TTY_PORT_CHECK_CD bit in the tty_port::iflags field. Introduce helpers
tty_port_set_check_carrier() and tty_port_check_carrier() to abstract
the atomic bit ops.Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman -
Replace ASYNC_CTS_FLOW bit in the tty_port::flags field with
TTY_PORT_CTS_FLOW bit in the tty_port::iflags field. Add
tty_port_set_cts_flow() helper to abstract the atomic bit ops.Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman -
Abstract TTY_IO_ERROR status test treewide with tty_io_error().
NB: tty->flags uses atomic bit ops; replace non-atomic bit test
with test_bit().Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman
07 Feb, 2016
1 commit
-
Constifies tty_port_operations structures in
the tty driver since they are not modified
after their initialization.Detected and found using Coccinelle.
Suggested-by: Julia Lawall
Signed-off-by: Aya Mahfouz
Signed-off-by: Greg Kroah-Hartman
29 Jan, 2016
2 commits
-
The tty core no longer provides ASYNC_CLOSING. Use private flag for
same purpose, which is to clear the fifos at each and every interrupt
during driver close(). The driver uses this sledgehammer approach because
its close/shutdown sequence is hopelessly borked.Signed-off-by: Peter Hurley
Signed-off-by: Greg Kroah-Hartman -
Expressions of the form "tty->termios.c_*flag & FLAG"
are more clearly expressed with the termios flags macros,
I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG().Convert treewide.
Signed-off-by: Peter Hurley
Acked-by: Johan Hovold
Signed-off-by: Greg Kroah-Hartman
23 May, 2013
1 commit
-
…warning after merge of the tty.current tree)
Fix build warning at mxser.c introduced by dfc7b837c7f9 (tty: mxser: fix
usage of opmode_ioaddr)Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 May, 2013
1 commit
-
mxser_port->opmode_ioaddr is initialized only for MOXA_MUST_MU860_HWID
chips, but no precautions have been undertaken to prevent reading and
writing to undefined port number.Signed-off-by: Matwey V. Kornilov
Signed-off-by: Greg Kroah-Hartman
15 Apr, 2013
1 commit
-
We want the fixes here.
Signed-off-by: Greg Kroah-Hartman
09 Apr, 2013
1 commit
-
There is a bug in resources deallocation code in mxser_probe() and
mxser_module_init(). As soon as variable 'i' is unsigned int, cycle
termination condition i >= 0 is always true. The patch fixes the issue.Signed-off-by: Alexey Khoroshilov
Acked-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
19 Mar, 2013
1 commit
-
Move HUPCL handling to port shutdown so that DTR is dropped also on hang
up (tty_port_close is a noop for hung-up ports).Also do not try to drop DTR for uninitialised ports where it has never
been raised (e.g. after a failed open).Note that this is also the current behaviour of serial-core.
Nine drivers currently call tty_port_close_start directly (rather than
through tty_port_close) and seven of them lower DTR as part of their
close (if the port has been initialised). Fixup the remaining two
drivers so that it continues to be lowered also on normal (non-HUP)
close. [ Note that most of those other seven drivers did not expect DTR
to have been dropped by tty_port_close_start in the first place. ]Signed-off-by: Johan Hovold
Signed-off-by: Greg Kroah-Hartman
19 Feb, 2013
1 commit
-
1. Currently mxser_probe() and mxser_module_init() ignore errors
that can happen in tty_port_register_device().
2. mxser_module_init() does not deallocate resources allocated in mxser_get_ISA_conf()
if mxser_initbrd() failed.The patch adds proper error handling in all the cases.
Also it moves free_irq() from mxser_release_ISA_res() to mxser_board_remove(),
since it makes mxser_release_ISA_res() a counterpart for mxser_get_ISA_conf(),
while free_irq() is relevant to both ISA and PCI boards.Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov
Signed-off-by: Greg Kroah-Hartman
16 Jan, 2013
3 commits
-
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.Now, the one where most of tty_port_tty_get gets removed:
tty_flip_buffer_push.IOW we also closed all the races in drivers not using tty_port_tty_get
at all yet.Also we move tty_flip_buffer_push declaration from include/linux/tty.h
to include/linux/tty_flip.h to all others while we are changing it
anyway.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman -
One point is to have less places where we actually need tty pointer.
The other is that low_latency is bound to buffer processing and
buffers are now in tty_port. So it makes sense to move low_latency to
tty_port too.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman -
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.tty_insert_flip_char is the next one to proceed. This one is used all
over the code, so the patch is huge.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
22 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Jiri Slaby
Cc: Alan Cox
Acked-by: Tobias Klauser
Cc: Lucas Tavares
Cc: Daniel Walker
Cc: Bryan Huntsman
Cc: "David S. Miller"
Cc: Peter Korsgaard
Cc: Tony Prisk
Acked-by: David Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Jiri Slaby
Cc: Alan Cox
Cc: Lucas Tavares
Cc: "David S. Miller"
Cc: Peter Korsgaard
Cc: Tony Prisk
Acked-by: Tobias Klauser
Acked-by: Nicolas Ferre
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
16 Nov, 2012
1 commit
-
After commit "TTY: move tty buffers to tty_port", the tty buffers are
not freed in some drivers. This is because tty_port_destructor is not
called whenever a tty_port is freed. This was an assumption I counted
with but was unfortunately untrue. So fix the drivers to fulfil this
assumption.To be sure, the TTY buffers (and later some stuff) are gone along with
the tty_port, we have to call tty_port_destroy at tear-down places.
This is mostly where the structure containing a tty_port is freed.
This patch does exactly that -- put tty_port_destroy at those places.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
06 Sep, 2012
1 commit
-
In most of the time, the driver needs to check if the cts flow control
is enabled. But now, the driver checks the ASYNC_CTS_FLOW flag manually,
which is not a grace way. So add a new wraper function to make the code
tidy and clean.Signed-off-by: Huang Shijie
Signed-off-by: Greg Kroah-Hartman
14 Aug, 2012
2 commits
-
444 means 0674 and we do not definitely want that. Use S_IRUGO which
is much more safer.Signed-off-by: Jiri Slaby
Reported-by: Rusty Russell
Signed-off-by: Greg Kroah-Hartman -
Currently we have no way to assign tty->port while performing tty
installation. There are two ways to provide the link tty_struct =>
tty_port. Either by calling tty_port_install from tty->ops->install or
tty_port_register_device called instead of tty_register_device when
the device is being set up after connected.In this patch we modify most of the drivers to do the latter. When the
drivers use tty_register_device and we have tty_port already, we
switch to tty_port_register_device. So we have the tty_struct =>
tty_port link for free for those.Signed-off-by: Jiri Slaby
Acked-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman
11 Aug, 2012
1 commit
-
For many cards, this saves some IO space because interrupt status port
has precedence over the rest of ports on the card. Hence it can be
mapped to a hole in I/O ports.Here we add a kernel parameter which allows that if a user wants to.
But they need to explicitly enable it by a module parameter.Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman
17 Jul, 2012
1 commit
-
This will let us sort out a whole pile of tty related races. The
alternative would be to keep points and refcount the termios objects.
However
1. They are tiny anyway
2. Many devices don't use the stored copies
3. We can remove a pty special caseSigned-off-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman
05 May, 2012
1 commit
-
The variable 'mxser_port_ops' is only referenced in this file and
should be marked static to prevent it from being exposed globally.Quites the sparse warning:
warning: symbol 'mxser_port_ops' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten
Cc: Jiri Slaby
Acked-by: Alan Cox
Signed-off-by: Greg Kroah-Hartman
29 Mar, 2012
1 commit
-
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it. Performed with the following command:perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *`
Signed-off-by: David Howells
09 Mar, 2012
1 commit
-
Checking if tty->index is in bounds is not needed. The tty has the
index set in the initial open. This is done in get_tty_driver. And it
can be only in interval num).So remove the tests which check exactly this interval. Some are
left untouched as they check against the current backing device count.
(Leaving apart that the check is racy in most of the cases.)Signed-off-by: Jiri Slaby
Signed-off-by: Greg Kroah-Hartman