- 01 2月, 2021 7 次提交
-
-
由 Johan Hovold 提交于
Clear the RTS bits of the flow-control request before determining the new value when updating the settings. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Clearing TIOCM_RTS should always deassert RTS and setting the same bit should enable auto-RTS if hardware flow control is enabled. This allows user space to throttle input directly at the source also when hardware-assisted flow control is enabled and makes dtr_rts() always deassert both lines during close (when HUPCL is set). Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Use the 0-flag and a field width to specify zero-padding consistently in printk messages. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Shorten the flow-control debug message by abbreviating the field names and reducing the value width to two characters. The latter improves readability since all but the least significant byte will almost always be zero anyway. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Drop the macros used to shift the flow-control settings to make the code more readable for consistency with the other requests. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
The vendor request used to set the flow-control settings also sets the state of the modem-control lines. Add state variables to keep track of the modem-control lines to avoid always asserting the lines whenever the flow-control settings are updated. This specifically also avoids asserting DTR/RTS when opening a port with the line speed set to B0. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
The CP210X_SET_MHS request cannot be used to control RTS when hardware flow control (auto-RTS) is enabled and instead returns an error which is currently logged as: cp210x ttyUSB0: failed set request 0x7 status: -32 when opening and closing a port (and on TIOCMSET requests). Add a crtscts flag to keep track of the hardware flow-control setting and use it to suppress any request to change RTS when auto-RTS is enabled. Note that RTS is still deasserted when disabling the UART as part of close. Reported-by: NPho Tran <pho.tran@silabs.com> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 28 1月, 2021 1 次提交
-
-
由 Dan Carpenter 提交于
This code should return -ENOMEM if the kmalloc() fails but instead it returns success. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Fixes: 0f64478c ("USB: add USB serial mos7720 driver") Cc: stable@vger.kernel.org Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 26 1月, 2021 11 次提交
-
-
由 Johan Hovold 提交于
Fix up B0 handling which should leave the baud rate unchanged and specifically not report back a non-B0 rate when B0 is requested; must temporarily disable hardware flow control so that RTS can be deasserted; and should reassert DTR/RTS when moving from B0. Fixes: c2d405aa ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Make sure that the modem pins are set up correctly when opening the port to avoid leaving, for example, DTR and RTS configured as inputs, which is the device default. This is specifically needed to be able to control DTR and RTS when hardware flow control is disabled. Fixes: c2d405aa ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Fix the gpio-mode handling so that all the pins are under driver control (i.e. in gpio mode) when hardware flow control is disabled. This is specifically needed to be able to control RTS. Fixes: c2d405aa ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Simplify the changed-line-speed conditional expression. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Shift the line-setting values when defining them rather than in set_termios() for consistency and improved readability. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Add the missing device-recipient define to the vendor control requests for completeness. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Use the termios flag helpers consistently, including for CRTSCTS. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Use the subsystem struct usb_device pointer at probe instead of deriving it from the interface pointer. Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Make sure to release the control interface at disconnect so that the driver can be unbound without leaking resources (and later rebound). Fixes: c2d405aa ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Make sure that the probed device has an interface 0 to avoid dereferencing a NULL pointer in case of a malicious device or during USB-descriptor fuzzing. Fixes: c2d405aa ("USB: serial: add MaxLinear/Exar USB to Serial driver") Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Dan Carpenter 提交于
This should return -ENOMEM instead of 0 if the kmalloc() fails. Fixes: 3f542974 ("USB: Moschip 7840 USB-Serial Driver") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 21 1月, 2021 2 次提交
-
-
由 Mauro Carvalho Chehab 提交于
The Exar XR21V141X can be used in either ACM mode using the cdc-acm driver or in "custom driver" mode in which further features such as hardware and software flow control, GPIO control and in-band line-status reporting are available. In ACM mode the device always enables RTS/CTS flow control, something which could prevent transmission in case the CTS input isn't wired up correctly. Ensure that cdc_acm will not bind to the device if the custom USB-serial driver is enabled. Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: NManivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/20201122170822.21715-4-mani@kernel.org [ johan: rewrite commit message ] Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Manivannan Sadhasivam 提交于
Add support for MaxLinear/Exar USB to Serial converters. This driver only supports XR21V141X series but it can be extended to other series from Exar as well in future. This driver is inspired from the initial one submitted by Patong Yang: https://lore.kernel.org/r/20180404070634.nhspvmxcjwfgjkcv@advantechmxl-desktop While the initial driver was a custom tty USB driver exposing whole new serial interface ttyXRUSBn, this version is completely based on USB serial core thus exposing the interfaces as ttyUSBn. This will avoid the overhead of exposing a new USB serial interface which the userspace tools are unaware of. The Exar XR21V141X can be used in either ACM mode using the cdc-acm driver or in "custom driver" mode in which further features such as hardware and software flow control, GPIO control and in-band line-status reporting are available. In ACM mode the device always enables RTS/CTS flow control, something which could prevent transmission in case the CTS input isn't wired up corrently. A follow-on patch will prevent cdc_acm from binding whenever this driver is enabled. Signed-off-by: NManivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/20201122170822.21715-2-mani@kernel.org [ johan: fix some style nits, group related functions, drop unused callbacks, and amend commit message; a few remaining non-trivial issues will be fixed separately ] Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 18 1月, 2021 13 次提交
-
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity check. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity checks. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Fix a copy-paste error in the ti_vread_sync() debug message. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity check. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity check. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity check. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Add a copyright notice for myself. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Drop include directives that are no longer used. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
There's no need to check for short control transfers when sending data so remove the redundant sanity checks. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
Update the XON/XOFF control characters also when no other flow-control flag has changed and software flow control is enabled. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
At least CP2102 requires the XON/XOFF limits to be initialised in order for software input flow control (IXOFF) to work. Specifically, XOFF is never sent if the XOFF limit is left at its default value of zero. Set the limits so that input is throttled when the FIFO free level drops below 128 bytes and restarted when the FIFO fill level drops below 128 bytes. Note that the threshold values have been chosen so that they can be used also with CP2105 which has the smallest FIFO of the currently supported device types (288 byte for the SCI port). If needed the limits can be made device specific later. Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Wang Sheng Long 提交于
When data is transmitted between two serial ports, the phenomenon of data loss often occurs. The two kinds of flow control commonly used in serial communication are hardware flow control and software flow control. In serial communication, If you only use RX/TX/GND Pins, you can't do hardware flow. So we often used software flow control and prevent data loss. The user sets the software flow control through the application program, and the application program sets the software flow control mode for the serial port chip through the driver. For the cp210 serial port chip, its driver lacks the software flow control setting code, so the user cannot set the software flow control function through the application program. This adds the missing software flow control. Signed-off-by: NWang Sheng Long <shenglong.wang.ext@siemens.com> Link: https://lore.kernel.org/r/20210104094502.3942-1-china_shenglong@163.com [ johan: rework properly on top of recent termios changes ] Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
由 Johan Hovold 提交于
The latest chip family (HXN) apparently does not support setting the line speed using divisors and instead needs to use the direct encoding scheme for all rates. This specifically enables 50, 110, 134, 200 bps and other rates not supported by the original chip type. Fixes: ebd09f1c ("USB: serial: pl2303: add support for PL2303HXN") Cc: stable@vger.kernel.org # 5.5 Cc: Charles Yeh <charlesyeh522@gmail.com> Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 12 1月, 2021 1 次提交
-
-
由 Tom Rix 提交于
clang static analysis reports this problem mos7720.c:352:2: warning: Undefined or garbage value returned to caller return d; ^~~~~~~~ In the parport_mos7715_read_data()'s call to read_mos_reg(), 'd' is only set after the alloc block. buf = kmalloc(1, GFP_KERNEL); if (!buf) return -ENOMEM; Although the problem is reported in parport_most7715_read_data(), none of the callee's of read_mos_reg() check the return status. Make sure to clear the return-value buffer also on allocation failures. Fixes: 0d130367 ("USB: serial: mos7720: fix control-message error handling") Signed-off-by: NTom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20210111220904.1035957-1-trix@redhat.com [ johan: only clear the buffer on errors, amend commit message ] Signed-off-by: NJohan Hovold <johan@kernel.org>
-
- 11 1月, 2021 5 次提交
-
-
由 Linus Torvalds 提交于
-
由 Linus Torvalds 提交于
Merge tag 'kbuild-fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Search for <ncurses.h> in the default header path of HOSTCC - Tweak the option order to be kind to old BSD awk - Remove 'kvmconfig' and 'xenconfig' shorthands - Fix documentation * tag 'kbuild-fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Documentation: kbuild: Fix section reference kconfig: remove 'kvmconfig' and 'xenconfig' shorthands lib/raid6: Let $(UNROLL) rules work with macOS userland kconfig: Support building mconf with vendor sysroot ncurses kconfig: config script: add a little user help MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal
-
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi由 Linus Torvalds 提交于
Pull SCSI fixes from James Bottomley: "This is two driver fixes (megaraid_sas and hisi_sas). The megaraid one is a revert of a previous revert of a cpu hotplug fix which exposed a bug in the block layer which has been fixed in this merge window. The hisi_sas performance enhancement comes from switching to interrupt managed completion queues, which depended on the addition of devm_platform_get_irqs_affinity() which is now upstream via the irq tree in the last merge window" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: hisi_sas: Expose HW queues for v2 hw Revert "Revert "scsi: megaraid_sas: Added support for shared host tagset for cpuhotplug""
-
git://git.kernel.dk/linux-block由 Linus Torvalds 提交于
Pull block fixes from Jens Axboe: - Missing CRC32 selections (Arnd) - Fix for a merge window regression with bdev inode init (Christoph) - bcache fixes - rnbd fixes - NVMe pull request from Christoph: - fix a race in the nvme-tcp send code (Sagi Grimberg) - fix a list corruption in an nvme-rdma error path (Israel Rukshin) - avoid a possible double fetch in nvme-pci (Lalithambika Krishnakumar) - add the susystem NQN quirk for a Samsung driver (Gopal Tiwari) - fix two compiler warnings in nvme-fcloop (James Smart) - don't call sleeping functions from irq context in nvme-fc (James Smart) - remove an unused argument (Max Gurtovoy) - remove unused exports (Minwoo Im) - Use-after-free fix for partition iteration (Ming) - Missing blk-mq debugfs flag annotation (John) - Bdev freeze regression fix (Satya) - blk-iocost NULL pointer deref fix (Tejun) * tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block: (26 commits) bcache: set bcache device into read-only mode for BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket bcache: check unsupported feature sets for bcache register bcache: fix typo from SUUP to SUPP in features.h bcache: set pdev_set_uuid before scond loop iteration blk-mq-debugfs: Add decode for BLK_MQ_F_TAG_HCTX_SHARED block/rnbd-clt: avoid module unload race with close confirmation block/rnbd: Adding name to the Contributors List block/rnbd-clt: Fix sg table use after free block/rnbd-srv: Fix use after free in rnbd_srv_sess_dev_force_close block/rnbd: Select SG_POOL for RNBD_CLIENT block: pre-initialize struct block_device in bdev_alloc_inode fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb nvme: remove the unused status argument from nvme_trace_bio_complete nvmet-rdma: Fix list_del corruption on queue establishment failure nvme: unexport functions with no external caller nvme: avoid possible double fetch in handling CQE nvme-tcp: Fix possible race of io_work and direct send nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN nvme-fcloop: Fix sscanf type and list_first_entry_or_null warnings ...
-
git://git.kernel.dk/linux-block由 Linus Torvalds 提交于
Pull io_uring fixes from Jens Axboe: "A bit larger than I had hoped at this point, but it's all changes that will be directed towards stable anyway. In detail: - Fix a merge window regression on error return (Matthew) - Remove useless variable declaration/assignment (Ye Bin) - IOPOLL fixes (Pavel) - Exit and cancelation fixes (Pavel) - fasync lockdep complaint fix (Pavel) - Ensure SQPOLL is synchronized with creator life time (Pavel)" * tag 'io_uring-5.11-2021-01-10' of git://git.kernel.dk/linux-block: io_uring: stop SQPOLL submit on creator's death io_uring: add warn_once for io_uring_flush() io_uring: inline io_uring_attempt_task_drop() io_uring: io_rw_reissue lockdep annotations io_uring: synchronise ev_posted() with waitqueues io_uring: dont kill fasync under completion_lock io_uring: trigger eventfd for IOPOLL io_uring: Fix return value from alloc_fixed_file_ref_node io_uring: Delete useless variable ‘id’ in io_prep_async_work io_uring: cancel more aggressively in exit_work io_uring: drop file refs after task cancel io_uring: patch up IOPOLL overflow_flush sync io_uring: synchronise IOPOLL on task_submit fail
-