All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: Peter Korsgaard <peter.korsgaard@barco.com>,
	Peter Korsgaard <peter@korsgaard.com>,
	linux-serial@vger.kernel.org
Cc: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michal Simek <michal.simek@xilinx.com>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>,
	Sean Anderson <sean.anderson@seco.com>,
	Rich Felker <dalias@libc.org>, Rob Herring <robh@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	devicetree@vger.kernel.org
Subject: [PATCH v3 0/4] tty: serial: uartlite: Disable changing fixed parameters
Date: Thu, 26 Aug 2021 15:21:50 -0400	[thread overview]
Message-ID: <20210826192154.3202269-1-sean.anderson@seco.com> (raw)

The uartlite device is a "soft" device and certain parameters (such as
data bits, parity, and baud) are configured at synthesis time, and
cannot be discovered at runtime. Fortunately, bindings for this device
typically include some of these parameters (especially baud rate).
Instead of silently letting Linux's termios drift away from what the
hardware is actually doing, make the termios reflect the hardware, and
prevent them from being changed. With this series applied, the user
recieves an error message when they try to change these parameters:

    # stty parity
    stty: standard input: cannot perform all requested operations

Changes in v3:
- Use unevaluatedProperties: false instead of additionalProperties
- Removed defaults for required properties
- Remove warnings about unsupported termios
- Set defaults for xlnx,data-bits and xlnx,use-parity

Changes in v2:
- Compare the baud computed with uart_get_baud_rate to pdata->baud,
  instead of just checking c_cflag. This will catch anything that messes
  with ispeed and ospeed.
- Don't bother trying to set the initial termios. Instead, just skip
  warning if old is NULL.
- Because we no longer use uart_set_options, just convert the devicetree
  properties directly to clflags.

Sean Anderson (4):
  dt-bindings: serial: uartlite: Convert to json-schema
  dt-bindings: serial: uartlite: Add properties for synthesis-time
    parameters
  sh: j2: Update uartlite binding with data and parity properties
  tty: serial: uartlite: Prevent changing fixed parameters

 .../bindings/serial/xlnx,opb-uartlite.txt     | 23 -----
 .../bindings/serial/xlnx,opb-uartlite.yaml    | 90 ++++++++++++++++++
 arch/sh/boot/dts/j2_mimas_v2.dts              |  2 +
 drivers/tty/serial/uartlite.c                 | 91 ++++++++++++++++---
 4 files changed, 172 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt
 create mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml

-- 
2.25.1


             reply	other threads:[~2021-08-26 19:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 19:21 Sean Anderson [this message]
2021-08-26 19:21 ` [PATCH v3 1/4] dt-bindings: serial: uartlite: Convert to json-schema Sean Anderson
2021-08-26 19:21 ` [PATCH v3 2/4] dt-bindings: serial: uartlite: Add properties for synthesis-time parameters Sean Anderson
2021-08-31 20:06   ` Rob Herring
2021-08-26 19:21 ` [PATCH v3 3/4] sh: j2: Update uartlite binding with data and parity properties Sean Anderson
2021-08-26 19:21 ` [PATCH v3 4/4] tty: serial: uartlite: Prevent changing fixed parameters Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210826192154.3202269-1-sean.anderson@seco.com \
    --to=sean.anderson@seco.com \
    --cc=alexander.sverdlin@nokia.com \
    --cc=dalias@libc.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=peter.korsgaard@barco.com \
    --cc=peter@korsgaard.com \
    --cc=robh@kernel.org \
    --cc=shubhrajyoti.datta@xilinx.com \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.