summaryrefslogtreecommitdiffstats
path: root/drivers/tty
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'tty-4.5-rc1' of ↵Linus Torvalds2016-01-1350-1399/+1194
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial updates from Greg KH: "Here is the big serial/tty driver update for 4.5-rc1. Lots of driver updates and some tty core changes. All of these have been in linux-next and the details are in the shortlog" * tag 'tty-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (127 commits) drivers/tty/serial: delete unused MODULE_DEVICE_TABLE from atmel_serial.c serial: sh-sci: Remove cpufreq notifier to fix crash/deadlock serial: 8250: of: Fix the driver and actually compile the 8250_of tty: amba-pl011: use iotype instead of access_32b to track 32-bit I/O tty: amba-pl011: fix earlycon register offsets serial: sh-sci: Drop the sci_fck clock fallback sh: sh7734: Correct SCIF type for BRG sh: Remove sci_ick clock alias sh: Rename sci_ick and sci_fck clock to fck serial: sh-sci: Add support for optional BRG on (H)SCIF serial: sh-sci: Add support for optional external (H)SCK input serial: sh-sci: Prepare for multiple sampling clock sources serial: sh-sci: Correct SCIF type on R-Car for BRG serial: sh-sci: Correct SCIF type on RZ/A1H serial: sh-sci: Replace struct sci_port_info by type/regtype encoding serial: sh-sci: Add BRG register definitions serial: sh-sci: Take into account sampling rate for max baud rate serial: sh-sci: Merge sci_scbrr_calc() and sci_baud_calc_hscif() serial: sh-sci: Avoid calculating the receive margin for HSCIF serial: sh-sci: Improve bit rate error calculation for HSCIF ...
| * drivers/tty/serial: delete unused MODULE_DEVICE_TABLE from atmel_serial.cPaul Gortmaker2016-01-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit c39dfebc7798956fd2140ae6321786ff35da30c3 ("drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular") we removed the code relating to modular support since it currently only supports built in. However, when redoing my build coverage for mips allmodconfig, which sets CONFIG_OF, I noticed a remaining line that needs to be removed, else we will get a build failure for an undefined module macro. Unfortunately this didn't appear for any of the other arch I tested more frequently, such as ARM. Since MODULE_DEVICE_TABLE is a no-op for non-modular code, we can just remove the offending line. Fixes: c39dfebc7798 ("drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular") Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Jiri Slaby <jslaby@suse.com> Reported-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: sh-sci: Remove cpufreq notifier to fix crash/deadlockGeert Uytterhoeven2016-01-071-42/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BSP team noticed that there is spin/mutex lock issue on sh-sci when CPUFREQ is used. The issue is that the notifier function may call mutex_lock() while the spinlock is held, which can lead to a BUG(). This may happen if CPUFREQ is changed while another CPU calls clk_get_rate(). Taking the spinlock was added to the notifier function in commit e552de2413edad1a ("sh-sci: add platform device private data"), to protect the list of serial ports against modification during traversal. At that time the Common Clock Framework didn't exist yet, and clk_get_rate() just returned clk->rate without taking a mutex. Note that since commit d535a2305facf9b4 ("serial: sh-sci: Require a device per port mapping."), there's no longer a list of serial ports to traverse, and taking the spinlock became superfluous. To fix the issue, just remove the cpufreq notifier: 1. The notifier doesn't work correctly: all it does is update stored clock rates; it does not update the divider in the hardware. The divider will only be updated when calling sci_set_termios(). I believe this was broken back in 2004, when the old drivers/char/sh-sci.c driver (where the notifier did update the divider) was replaced by drivers/serial/sh-sci.c (where the notifier just updated port->uartclk). Cfr. full-history-linux commits 6f8deaef2e9675d9 ("[PATCH] sh: port sh-sci driver to the new API") and 3f73fe878dc9210a ("[PATCH] Remove old sh-sci driver"). 2. On modern SoCs, the sh-sci parent clock rate is no longer related to the CPU clock rate anyway, so using a cpufreq notifier is futile. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge branch 'scif-clk-sck-brg-for-v4.5' of ↵Greg Kroah-Hartman2016-01-072-152/+413
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into tty-next Geert writes: Summary: - Clean up the naming of clocks in the sh-sci driver and its DT bindings, - Add support for the optional external clock on (H)SCI(F), where this pin can serve as a clock input, - Add support for the optional clock sources for the Baud Rate Generator for External Clock (BRG), as found on some SCIF variants and on HSCIF.
| | * serial: sh-sci: Drop the sci_fck clock fallbackLaurent Pinchart2015-12-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All platforms that used to define an sci_fck clock have now switched to the fck name. Remove the fallback code. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Add support for optional BRG on (H)SCIFGeert Uytterhoeven2015-12-171-5/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using the Baud Rate Generator for External Clock (BRG), as found on some SCIF and HSCIF variants, to provide the sampling clock. This can improve baud rate range and accuracy. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Add support for optional external (H)SCK inputGeert Uytterhoeven2015-12-171-3/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using the SCIx clock pin "(H)SCK" as an external clock input on (H)SCI(F), providing the sampling clock. Note that this feature is not yet supported on the select SCIFA variants that also have it (e.g. sh7723, sh7724, and r8a7740). On (H)SCIF variants with an External Baud Rate Generator (BRG), the BRG Clock Select Register must be configured for the external clock. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Prepare for multiple sampling clock sourcesGeert Uytterhoeven2015-12-171-60/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the clock and baud rate parameter code to ease adding support for multiple sampling clock sources. sci_scbrr_calc() now returns the bit rate error, so it can be compared to the bit rate error using other sampling clock sources. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Correct SCIF type on R-Car for BRGGeert Uytterhoeven2015-12-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "renesas,scif" compatible value is currently used for the SCIF variant in all Renesas SoCs of the R-Car family. However, the variant used in the R-Car family is not the common "SH-4(A)" variant, but a derivative with added "Baud Rate Generator for External Clock" (BRG), which is also present in sh7734. Use the family-specific SCIF compatible values for R-Car Gen1, Gen2, and Gen3 SoCs to differentiate. The "renesas,scif" compatible value can still be used as a common denominator for SCIF variants with the "SH-4(A)" register layout (i.e. ignoring the "Serial Extension Mode Register" (SCEMR) and the new BRG-specific registers). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Correct SCIF type on RZ/A1HGeert Uytterhoeven2015-12-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "renesas,scif" compatible value is currently used for the SCIF variant in all Renesas SoCs of the R-Car and RZ families. However, the variant used in the RZ family is not the common "SH-4(A)" variant, but the "SH-2(A) with FIFO data count register" variant, as it has the "Serial Extension Mode Register" (SCEMR), just like on sh7203, sh7263, sh7264, and sh7269. Use the (already documented) SoC-specific "renesas,scif-r7s72100" compatible value to differentiate. The "renesas,scif" compatible value can still be used as a common denominator for SCIF variants with the "SH-4(A)" register layout (i.e. ignoring the SCEMR register). Note that currently both variants are treated the same, but this may change if support for the SCEMR register is ever added. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Replace struct sci_port_info by type/regtype encodingGeert Uytterhoeven2015-12-171-29/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the encoded port and register types directly in of_device_id.data, instead of using a pointer to a structure. This saves memory and simplifies the source code, especially when adding more compatible entries later. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Add BRG register definitionsGeert Uytterhoeven2015-12-172-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add register definitions for the Baud Rate Generator for External Clock (BRG), as found in some SCIF and in HSCIF, including a new regtype for the "SH-4(A)"-derived SCIF variant with BRG. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Take into account sampling rate for max baud rateGeert Uytterhoeven2015-12-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The maximum baud rate depends on the sampling rate. HSCIF has a variable sampling rate and sets s->sampling_rate to zero, hence use the minimum sampling rate of 8. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Merge sci_scbrr_calc() and sci_baud_calc_hscif()Geert Uytterhoeven2015-12-171-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For low bit rates, the for-loop that reduces the divider returned by sci_scbrr_calc() and picks the clock select value may terminate without finding suitable values, leading to out-of-range divider and clock select values. sci_baud_calc_hscif() doesn't suffer from this problem, as it correctly uses clamp(). Since there are only two relevant differences between HSCIF and other variants w.r.t. bit rate configuration (fixed vs. variable sample rate, and an additional factor of two), sci_scbrr_calc() and sci_baud_calc_hscif() can be merged, fixing the issue with out-of-range values. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Avoid calculating the receive margin for HSCIFGeert Uytterhoeven2015-12-171-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When assuming D = 0.5 and F = 0, maximizing the receive margin M is equivalent to maximizing the sample rate N. Hence there's no need to calculate the receive margin, as we can obtain the same result by iterating over all possible sample rates in reverse order, and skipping parameter sets that don't provide a lower bit rate error. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Improve bit rate error calculation for HSCIFGeert Uytterhoeven2015-12-171-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The algorithm to find the best parameters for the requested bit rate calculates the relative bit rate error, using "(br * scrate) / 1000". For small "br * scrate", this has two problems: - The quotient may be zero, leading to a division by zero error, - This may introduce a large rounding error. Switch from relative to absolute bit rate error calculation to fix this. The default baud rate generator values can be removed, as there will always be one set of values that gives the smallest absolute error. Print the best set of values when debugging. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Avoid overflow in sci_baud_calc_hscif()Geert Uytterhoeven2015-12-171-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If bps >= 1048576, the multiplication of the predivider and "bps" will overflow, and both br and err will contain bogus values. Skip the current and all higher clock select predividers when overflow is detected. Simplify the calculations using intermediates while we're at it. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Make unsigned values in sci_baud_calc_hscif() unsignedGeert Uytterhoeven2015-12-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the -1 offset of br to the assignment to *brr, so br cannot become negative anymore, and update the clamp() call. Now all unsigned values in sci_baud_calc_hscif() can become unsigned. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Convert from clk_get() to devm_clk_get()Geert Uytterhoeven2015-12-171-6/+4
| | | | | | | | | | | | | | | | | | | | | Transfer clock cleanup handling to the core device management code. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Don't overwrite clock selection in serial_console_write()Geert Uytterhoeven2015-12-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blindly writing the default configuration value into the SCSCR register may change the clock selection bits, breaking the serial console if the current driver settings differ from the default settings. Keep the current clock selection bits to prevent this from happening on e.g. r8a7791/koelsch when support for the BRG will be added. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Drop unused frame_len parameter for sci_baud_calc_hscif()Geert Uytterhoeven2015-12-171-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As F is assumed to be zero in the receive margin formula, frame_len is not used. Remove it, together with the sci_baud_calc_frame_len() helper function. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Use existing local variable in sci_parse_dt()Geert Uytterhoeven2015-12-171-1/+1
| | | | | | | | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| | * serial: sh-sci: Grammar s/Get ... for/Get ... from/Geert Uytterhoeven2015-12-171-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Drop useless check for zero sampling_rateGeert Uytterhoeven2015-12-171-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | sci_port.sampling_rate is always non-zero, except for HSCIF, which uses sci_baud_calc_hscif() instead of sci_scbrr_calc(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial: sh-sci: Drop the interface clockLaurent Pinchart2015-12-171-23/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As no platform defines an interface clock the SCI driver always falls back to a clock named "peripheral_clk". - On SH platforms that clock is the base clock for the SCI functional clock and has the same frequency, - On ARM platforms that clock doesn't exist, and clk_get() will return the default clock for the device. We can thus make the functional clock mandatory and drop the interface clock. EPROBE_DEFER is handled for clocks that may be referenced from DT (i.e. "fck", and the deprecated "sci_ick"). Cc: devicetree@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> [geert: Handle EPROBE_DEFER, reformat description, break long comment line] Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250: of: Fix the driver and actually compile the 8250_ofPeter Ujfalusi2016-01-072-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 8250_of never compiled since in the Kconfig we have SERIAL_OF_PLATFORM but in the makefile we expect to have SERIAL_8250_OF... When the 8250_of.c is actually compiled we will have two errors: missing linux/nwpserial.h and 8250/8250.h. Fix those as well at the same time when enable the compilation of the driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Fixes: afd7f88f1577 ("serial: 8250: move of_serial code to 8250 directory") Reported-by: Guenter Roeck <linux@roeck-us.net> CC: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: amba-pl011: use iotype instead of access_32b to track 32-bit I/OTimur Tabi2016-01-061-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of defining a new field in the uart_amba_port structure, use the existing iotype field of the uart_port structure, which is intended for this purpose. If we need to use 32-bit register access, we set iotype to UPIO_MEM32, otherwise we set it to UPIO_MEM. For early console, specify the "mmio32" option on the kernel command-line. Example: earlycon=pl011,mmio32,0x3ced1000 Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: amba-pl011: fix earlycon register offsetsRussell King2016-01-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The REG_x macros are indices into a table, not register offsets. Since earlycon does not have access to the vendor data, we can currently only support standard ARM PL011 devices. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Huang Shijie <shijie.huang@arm.com> Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge 4.4-rc6 into tty-nextGreg Kroah-Hartman2015-12-215-17/+19
| |\ \ | | | | | | | | | | | | | | | | | | | | We want the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: imx: implement handshaking using gpios with the mctrl_gpio helperUwe Kleine-König2015-12-132-20/+70
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: mctrl_gpio: export mctrl_gpio_disable_ms and mctrl_gpio_initUwe Kleine-König2015-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to make use of the mctrl-gpio helper from a module these functions must be exported. This was forgotten in the commit introducing support interrupt handling for these functions (while it was done for mctrl_gpio_enable_ms, *sigh*). Fixes: ce59e48fdbad ("serial: mctrl_gpio: implement interrupt handling") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: tty: 68328serial.c: Remove parentheses after returnFrederik Völkel2015-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes parentheses after return as checkpatch suggests. Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: tty: 68328serial.c: Fix "foo * bar" should be "foo *bar"Frederik Völkel2015-12-131-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes checkpatch errors "foo * bar" should be "foo *bar". Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: tty: 68328serial.c: Do not initialize statics to 0Frederik Völkel2015-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes an initialization of a static to 0 as checkpatch suggests. Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: tty: 68328serial.c: remove unnecessary spaces(checkpatch)Frederik Völkel2015-12-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes unnecessary spaces reported by checkpatch. Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: tty: 68328serial.c: Add missing spaces(checkpatch)Frederik Völkel2015-12-131-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing spaces reported by checkpatch. Signed-off-by: Frederik Völkel <frederik.voelkel@fau.de> Signed-off-by: Lukas Braun <lukas.braun@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: 8250_mid: fix broken DMA dependencyHeikki Krogerus2015-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to enable HSU DMA PCI driver, the HSU DMA Engine must be enabled. This add a check for that. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: Prevent ldisc drivers from re-using stale tty fieldsPeter Hurley2015-12-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Line discipline drivers may mistakenly misuse ldisc-related fields when initializing. For example, a failure to initialize tty->receive_room in the N_GIGASET_M101 line discipline was recently found and fixed [1]. Now, the N_X25 line discipline has been discovered accessing the previous line discipline's already-freed private data [2]. Harden the ldisc interface against misuse by initializing revelant tty fields before instancing the new line discipline. [1] commit fd98e9419d8d622a4de91f76b306af6aa627aa9c Author: Tilman Schmidt <tilman@imap.cc> Date: Tue Jul 14 00:37:13 2015 +0200 isdn/gigaset: reset tty->receive_room when attaching ser_gigaset [2] Report from Sasha Levin <sasha.levin@oracle.com> [ 634.336761] ================================================================== [ 634.338226] BUG: KASAN: use-after-free in x25_asy_open_tty+0x13d/0x490 at addr ffff8800a743efd0 [ 634.339558] Read of size 4 by task syzkaller_execu/8981 [ 634.340359] ============================================================================= [ 634.341598] BUG kmalloc-512 (Not tainted): kasan: bad access detected ... [ 634.405018] Call Trace: [ 634.405277] dump_stack (lib/dump_stack.c:52) [ 634.405775] print_trailer (mm/slub.c:655) [ 634.406361] object_err (mm/slub.c:662) [ 634.406824] kasan_report_error (mm/kasan/report.c:138 mm/kasan/report.c:236) [ 634.409581] __asan_report_load4_noabort (mm/kasan/report.c:279) [ 634.411355] x25_asy_open_tty (drivers/net/wan/x25_asy.c:559 (discriminator 1)) [ 634.413997] tty_ldisc_open.isra.2 (drivers/tty/tty_ldisc.c:447) [ 634.414549] tty_set_ldisc (drivers/tty/tty_ldisc.c:567) [ 634.415057] tty_ioctl (drivers/tty/tty_io.c:2646 drivers/tty/tty_io.c:2879) [ 634.423524] do_vfs_ioctl (fs/ioctl.c:43 fs/ioctl.c:607) [ 634.427491] SyS_ioctl (fs/ioctl.c:622 fs/ioctl.c:613) [ 634.427945] entry_SYSCALL_64_fastpath (arch/x86/entry/entry_64.S:188) Cc: Tilman Schmidt <tilman@imap.cc> Cc: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: check for tx-irq enabled in irq codeBen Dooks2015-12-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that if the interrupt handler is entered then only try and do tx work if the tx irq is enabled. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: ensure tx irq on if more work to doBen Dooks2015-12-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tx_stop() call turns the interrupt off, but the tx_start() does not check if the interrupt is enabled. Switch it back on if there is more work to do. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: disable rx/tx irqs during console writeBen Dooks2015-12-131-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As an attempt to stop issues with bad console output, ensure that both the rx and tx interrupts are disabled during the console write to avoid any problems with console and non-console being called together. This should help with the SMP case as it should stop other cores being signalled during the console write. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: use meson_uart_tx_empty() to wait for emptyBen Dooks2015-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the meson_uart_tx_empty() instead of a direct read of the status register. This is easier to read and will ensure the UART's transmit state machine is idle when trying to update the baud rate. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: only disable tx irq on stopBen Dooks2015-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since disabling the transmit state machine still allows characters to be transmitted when written to the UART write FIFO, simply disable the transmit interrupt when the UART port is stopped. This has not shown an improvement with the console issues when running systemd, but seems like it should be done. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reported-by: Edward Cragg <ed.cragg@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: ensure console port uart enabledBen Dooks2015-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure the UART's transmitter is enabled when meson_console_putchar is called. If not, then the console output is corrupt (the hardware seems to try and send /something/ even if the TX is disabled). This fixes corrupt console output on events such as trying to reboot the system since the console tx may be called after drivers shutdown method has been called. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reported-by: Edward Cragg <edward.cragg@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: tx_empty fails to check for transmitter busyBen Dooks2015-12-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tx_empty() uart_op should only return empty if both the transmit fifo and the transmit state-machine are both idle. Add a test for the hardware's XMIT_BUSY flag. Note, this is possibly related to an issue where the port is being shutdown with paritally transmitted characters in it. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reported-by: Edward Cragg <edward.cragg@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: don't reset port on uart startupBen Dooks2015-12-131-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the uart startup entry is called, do not reset the port as this could cause issues with anything left in the FIFO from a previous operation such as a console write. Move the hardware reset to probe time and simply clear the errors before enabling the port. This fixes the issue where the console could become corrupted as there where characters left in the output or output fifo when a user process such as systemd would open/close the uart to transmit characters. For example, you get: [ 3.252263] systemd[1]: Dete instead of: [ 3.338801] systemd[1]: Detected architecture arm. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | ARM: meson: serial: release region on port releaseBen Dooks2015-12-131-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meson_uart_release_port() unmaps the register area but does not release it. The meson_uart_request_port() calls devm_request_mem_region so the release should call devm_release_mem_region() for that area so that anyt subsequent use of these calls will work. This fixes an issue where the addition of reset code before registering the uart stops the console from working. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: amba-pl011: switch to using relaxed IO accessorsRussell King2015-12-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using relaxed IO accessors allows GCC to better optimise this code as we eliminate the heavy memory barriers - for example, GCC can now cache the address of a register across a read-modify-write sequence, rather than reloading the base address, offset and access size flag. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: amba-pl011: add support for ZTE UART (EXPERIMENTAL)Russell King2015-12-131-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add (incomplete) support for the ZTE UART to the AMBA PL011 driver. This is similar to the ARM and ST variants, except it has a different register address layout, and requires 32-bit accesses to the registers. Use the newly introduced register tables and access size support to cope with these differences. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | tty: amba-pl011: add support for 32-bit register accessRussell King2015-12-131-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for 32-bit register accesses to the AMBA PL011 UART. This is needed for ZTE UARTs, which require 32-bit accesses as opposed to the more normal 16-bit accesses. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud