- 09 Jun, 2022 1 commit
-
-
Robert Eckelmann authored
Add support for Agilent E5805A (rebranded ION Edgeport/4) to io_ti. Signed-off-by:
Robert Eckelmann <longnoserob@gmail.com> Link: https://lore.kernel.org/r/20220521230808.30931eca@octoberrain Cc: stable@vger.kernel.org Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 26 Aug, 2021 1 commit
-
-
Utkarsh Verma authored
Replace symbolic permission macros with octal permission numbers because octal permission numbers are easier to read and understand instead of their symbolic macro names. No functional change. Suggested-by:
Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by:
Utkarsh Verma <utkarshverma294@gmail.com> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 19 May, 2021 2 commits
-
-
Jiri Slaby authored
tty_operations::chars_in_buffer is being switched to return uint. Do the same for usb_serial_driver's chars_in_buffer. Signed-off-by:
Jiri Slaby <jslaby@suse.cz> [ johan: amend commit message ] Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Jiri Slaby authored
Line disciplines expect a positive value or zero returned from tty->ops->write_room (invoked by tty_write_room). Both of them are being updated to return an unsigned int. Switch also usb_serial_driver::write_room and all its users. Signed-off-by:
Jiri Slaby <jslaby@suse.cz> [ johan: amend commit message, drop unrelated comment change ] Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 13 Apr, 2021 6 commits
-
-
Johan Hovold authored
Drop unnecessary packed attributes from structures that don't need it and use the __packed macro consistently. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Use kernel types consistently by replacing the remaining __uXX types. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Add a read-port-command helper analogous to the send-port-command helper to take care of the UART module id instead of open coding. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Add a send-port-command helper which takes care of determining the UART module id when sending commands instead of doing so at every call site. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Clean up the vendor-request helpers by using kernel-types consistently and using void pointers for the data arguments, which allows removing a cast from one caller. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Document that the device line-status register doesn't tell when the transmitter shift register has emptied and that this is why the one-character drain delay is needed. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 08 Apr, 2021 5 commits
-
-
Johan Hovold authored
Switch to using the system-wide default 30-second closing-wait timeout instead of the driver specific 40-second timeout. The timeout can be changed per port using TIOCSSERIAL (setserial) if needed. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Now that all USB serial drivers supports setting the closing_wait parameter through TIOCSSERIAL (setserial) it's time to drop the corresponding io_ti module parameter. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
The TIOCGSERIAL ioctl can be used to set and retrieve the UART type for legacy UARTs, but some USB serial drivers have been reporting back random types in order to "make user-space happy". Some applications have historically expected TIOCGSERIAL to be implemented, but judging from the Debian sources, the port type not being PORT_UNKNOWN is only used to check for the existence of legacy serial ports (ttySn). Drivers like ftdi_sio have been using PORT_UNKNOWN for twenty years (and option for 10 years) without anyone complaining so let's stop reporting back anything else. In the unlikely event that this do cause problems, this should be fixed tree-wide anyway (e.g. for all USB serial drivers and also CDC-ACM). Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. The closing_wait parameter determines how long to wait for the transfer buffers to drain during close and the default timeout of 30 seconds may not be sufficient at low line speeds. In other cases, when for example flow is stopped, the default timeout may instead be too long. Add generic support for TIOCSSERIAL and TIOCGSERIAL with handling of the three common parameters close_delay, closing_wait and line for the benefit of all USB serial drivers while still allowing drivers to implement further functionality through the existing callbacks. This currently includes a few drivers that report their base baud clock rate even if that is really only of interest when setting custom divisors through the deprecated ASYNC_SPD_CUST interface; an interface which only the FTDI driver actually implements. Some drivers have also been reporting back a fake UART type, something which should no longer be needed and will be dropped by a follow-on patch. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. The port parameter is used to set the I/O port and does not make any sense to use for USB serial devices. The xmit_fifo_size parameter could be used to set the hardware transmit fifo size of a legacy UART when it could not be detected, but the interface is limited to eight bits and should be left unset when not used. Similarly, baud_base could be used to set the UART base clock when it could not be detected but might as well be left unset when it is not known. The close_delay and closing_wait parameters returned by TIOCGSERIAL are specified in centiseconds (not jiffies). The driver does not yet support changing close_delay, but let's report back the default value actually used (0.5 seconds). Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 09 Feb, 2021 1 commit
-
-
Uwe Kleine-König authored
All usb_serial drivers return 0 in their remove callbacks and driver core ignores the value returned by usb_serial_device_remove(). So change the remove callback to return void and return 0 unconditionally in usb_serial_device_remove(). Signed-off-by:
Uwe Kleine-König <uwe@kleine-koenig.org> Link: https://lore.kernel.org/r/20210208143149.963644-2-uwe@kleine-koenig.org Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 18 Jan, 2021 2 commits
-
-
Johan Hovold authored
Fix a copy-paste error in the ti_vread_sync() debug message. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
There's no need to check for short control transfers when sending data so remove the redundant sanity check. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 13 Oct, 2018 1 commit
-
-
Al Viro authored
Reviewed-by:
Johan Hovold <johan@kernel.org> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 26 Jun, 2018 1 commit
-
-
John Ogness authored
The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by:
John Ogness <john.ogness@linutronix.de> Signed-off-by:
Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 04 Nov, 2017 2 commits
-
-
Greg Kroah-Hartman authored
Now that the SPDX tag is in all USB 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. Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by:
Johan Hovold <johan@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Greg Kroah-Hartman authored
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/usb/ and include/linux/usb* 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: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by:
Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by:
Johan Hovold <johan@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 15 May, 2017 1 commit
-
-
Johan Hovold authored
Fix a division-by-zero in set_termios when debugging is enabled and a high-enough speed has been requested so that the divisor value becomes zero. Instead of just fixing the offending debug statement, cap the baud rate at the base as a zero divisor value also appears to crash the firmware. Fixes: 1da177e4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> # 2.6.12 Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 29 Mar, 2017 1 commit
-
-
Johan Hovold authored
Drop some unnecessary termios-flag debugging that have been faithfully reproduced in a few old drivers, including the "clfag" typo and all. This also addresses a compiler warning on sparc where tcflag_t is unsigned long and would have required an explicit cast. Reported-by:
Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 28 Mar, 2017 4 commits
-
-
Johan Hovold authored
Drop the redundant read-urb check from open. The presence of a bulk-in endpoint is now verified during probe and core has allocated the corresponding resources. Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Verify that the required interrupt endpoint is present at probe rather than at open to avoid allocating resources for an unusable device. Note that the endpoint is only required when in download mode. Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
These devices always require at least one bulk-out endpoint so let core verify that. This avoids attempting to send bulk data to the default pipe when downloading firmware in boot mode. Note that further endpoints are still needed when not in boot mode. Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Use the calc_num_ports rather than attach callback to verify that the required endpoints are present when in download mode. This avoids allocating port resources for interfaces that won't be bound. Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 08 Mar, 2017 2 commits
-
-
Johan Hovold authored
Add missing sanity check to the bulk-in completion handler to avoid an integer underflow that can be triggered by a malicious device. This avoids leaking 128 kB of memory content from after the URB transfer buffer to user space. Fixes: 8c209e67 ("USB: make actual_length in struct urb field u32") Fixes: 1da177e4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> # 2.6.30 Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Fix a NULL-pointer dereference in the interrupt callback should a malicious device send data containing a bad port number by adding the missing sanity check. Fixes: 1da177e4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 26 Jan, 2017 1 commit
-
-
Johan Hovold authored
Do not report ASYNC_SKIP_TEST or ASYNC_AUTO_IRQ as being set in TIOCGSERIAL handlers as these flags are not supported and do not really make any sense for USB serial devices in the first place. Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 04 Jan, 2017 4 commits
-
-
Johan Hovold authored
Bind to the interface, but do not register any ports, after having downloaded the firmware. The device will still disconnect and re-enumerate, but this way we avoid an error messages from being logged as part of the process: io_ti: probe of 1-1.3:1.0 failed with error -5 Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Cancel the heartbeat work on driver unbind in order to avoid I/O after disconnect in case the port is held open. Note that the cancel in release() is still needed to stop the heartbeat after late probe errors. Fixes: 26c78daa ("USB: io_ti: Add heartbeat to keep idle EP/416 ports from disconnecting") Cc: stable <stable@vger.kernel.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
In case a device is left in "boot-mode" we must not register any port devices in order to avoid a NULL-pointer dereference on open due to missing endpoints. This could be used by a malicious device to trigger an OOPS: Unable to handle kernel NULL pointer dereference at virtual address 00000030 ... [<bf0caa84>] (edge_open [io_ti]) from [<bf0b0118>] (serial_port_activate+0x68/0x98 [usbserial]) [<bf0b0118>] (serial_port_activate [usbserial]) from [<c0470ca4>] (tty_port_open+0x9c/0xe8) [<c0470ca4>] (tty_port_open) from [<bf0b0da0>] (serial_open+0x48/0x6c [usbserial]) [<bf0b0da0>] (serial_open [usbserial]) from [<c0469178>] (tty_open+0xcc/0x5cc) Fixes: 1da177e4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Fix NULL-pointer dereference when clearing halt at open should a malicious device lack the expected endpoints when in download mode. Unable to handle kernel NULL pointer dereference at virtual address 00000030 ... [<bf011ed8>] (edge_open [io_ti]) from [<bf000118>] (serial_port_activate+0x68/0x98 [usbserial]) [<bf000118>] (serial_port_activate [usbserial]) from [<c0470ca4>] (tty_port_open+0x9c/0xe8) [<c0470ca4>] (tty_port_open) from [<bf000da0>] (serial_open+0x48/0x6c [usbserial]) [<bf000da0>] (serial_open [usbserial]) from [<c0469178>] (tty_open+0xcc/0x5cc) Fixes: 1da177e4 ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 11 Nov, 2016 1 commit
-
-
Johan Hovold authored
Drop invalid user-pointer checks from ioctl handlers. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Signed-off-by:
Johan Hovold <johan@kernel.org>
-
- 09 Oct, 2015 4 commits
-
-
Peter E. Berger authored
Remove extra blank lines in the several places where functions were separated by more than one. Signed-off-by:
Peter E. Berger <pberger@brimson.com> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Peter E. Berger authored
Fix non-standard formatting in some of the comments. Signed-off-by:
Peter E. Berger <pberger@brimson.com> [johan: minor fixes ] Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Peter E. Berger authored
Move request_firmware from edge_startup to download_fw. Signed-off-by:
Peter E. Berger <pberger@brimson.com> Signed-off-by:
Johan Hovold <johan@kernel.org>
-
Peter E. Berger authored
Separate the download and boot mode code from download_fw() into two new helper functions: do_download_mode() and do_boot_mode(). Signed-off-by:
Peter E. Berger <pberger@brimson.com> Signed-off-by:
Johan Hovold <johan@kernel.org>
-