From: Thierry Reding <thierry.reding@gmail.com> To: Thierry Reding <thierry.reding@gmail.com>, Jassi Brar <jassisinghbrar@gmail.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: devicetree@vger.kernel.org, Mika Liljeberg <mliljeberg@nvidia.com>, Mikko Perttunen <mperttunen@nvidia.com>, Timo Alho <talho@nvidia.com>, linux-serial@vger.kernel.org, Jiri Slaby <jslaby@suse.com>, linux-tegra@vger.kernel.org, Pekka Pessi <ppessi@nvidia.com>, Jon Hunter <jonathanh@nvidia.com>, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 00/10] serial: Add Tegra Combined UART driver Date: Mon, 12 Nov 2018 16:18:43 +0100 [thread overview] Message-ID: <20181112151853.29289-1-thierry.reding@gmail.com> (raw) From: Thierry Reding <treding@nvidia.com> Hi everyone, this is a reworked version of Mikko's earlier proposal[0]. I've reworked the TCU driver itself so that it relies less on global variables as well as added a Kconfig option to allow the console support to be selected. I also fixed a couple of issues that manifested themselves as I was moving towards the IRQ driven mode (TCU was passing a pointer to a local variable which was getting stored in the mailbox's ring buffer and the data pointed at was becoming stale by the time the mailbox got around to dequeue it). The biggest bulk of the changes is in the mailbox driver. This series addresses all of Jassi's comments from back at the time. One notable additional change is that shared mailboxes are now interrupt driven, which removes the need for polling mode. Unfortunately there is still an issue because the TCU uses the mailbox in atomic context for both TTY and console modes, so we get a sleeping- while-atomic BUG when using mbox_client->tx_block = true in order to rate-limit mbox_send_message(). In order to work around this, I added a mechanism to mbox_send_message() that will allow blocking from atomic context if the mailbox controller implements the new ->flush() callback. For Tegra HSP shared mailboxes this is done by spinning on the shared mailbox register until the receiver has marked the mailbox as empty. I have been running this locally for a couple of days now and it works perfectly. Furthermore this series incorporates Mikko's work in progress on splitting up the mailbox controllers and allowing multiple controllers to match on the same device tree node during mbox_request_channel(). Last but not least there are no build-time dependencies between the mailbox and serial drivers, so I think the easiest way to merge this is if Jassi picks up patches 1-5, Greg takes patches 6 & 7 and I pick up patches 8-10 into the Tegra tree. Changes in v2: - address all of Pekka's comments regarding shared interrupts, registers that don't exist on Tegra186 and shared mailbox directionality - add a patch to enable the TCU in the 64-bit ARM default configuration Thanks, Thierry [0]: https://lore.kernel.org/patchwork/project/lkml/list/?series=357641 Mikko Perttunen (5): mailbox: Allow multiple controllers per device dt-bindings: tegra186-hsp: Add shared mailboxes dt-bindings: serial: Add bindings for nvidia,tegra194-tcu arm64: tegra: Add nodes for TCU on Tegra194 arm64: tegra: Mark TCU as primary serial port on Tegra194 P2888 Thierry Reding (5): mailbox: Support blocking transfers in atomic context mailbox: tegra-hsp: Add support for shared mailboxes mailbox: tegra-hsp: Add suspend/resume support serial: Add Tegra Combined UART driver arm64: defconfig: Enable Tegra TCU .../bindings/mailbox/nvidia,tegra186-hsp.txt | 30 +- .../bindings/serial/nvidia,tegra194-tcu.txt | 35 ++ .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 38 +- arch/arm64/configs/defconfig | 1 + drivers/mailbox/mailbox.c | 11 +- drivers/mailbox/tegra-hsp.c | 517 +++++++++++++++--- drivers/tty/serial/Kconfig | 22 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/tegra-tcu.c | 299 ++++++++++ include/dt-bindings/mailbox/tegra186-hsp.h | 11 + include/linux/mailbox_controller.h | 4 + include/uapi/linux/serial_core.h | 3 + 13 files changed, 903 insertions(+), 71 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.txt create mode 100644 drivers/tty/serial/tegra-tcu.c -- 2.19.1
WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@gmail.com (Thierry Reding) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 00/10] serial: Add Tegra Combined UART driver Date: Mon, 12 Nov 2018 16:18:43 +0100 [thread overview] Message-ID: <20181112151853.29289-1-thierry.reding@gmail.com> (raw) From: Thierry Reding <treding@nvidia.com> Hi everyone, this is a reworked version of Mikko's earlier proposal[0]. I've reworked the TCU driver itself so that it relies less on global variables as well as added a Kconfig option to allow the console support to be selected. I also fixed a couple of issues that manifested themselves as I was moving towards the IRQ driven mode (TCU was passing a pointer to a local variable which was getting stored in the mailbox's ring buffer and the data pointed at was becoming stale by the time the mailbox got around to dequeue it). The biggest bulk of the changes is in the mailbox driver. This series addresses all of Jassi's comments from back at the time. One notable additional change is that shared mailboxes are now interrupt driven, which removes the need for polling mode. Unfortunately there is still an issue because the TCU uses the mailbox in atomic context for both TTY and console modes, so we get a sleeping- while-atomic BUG when using mbox_client->tx_block = true in order to rate-limit mbox_send_message(). In order to work around this, I added a mechanism to mbox_send_message() that will allow blocking from atomic context if the mailbox controller implements the new ->flush() callback. For Tegra HSP shared mailboxes this is done by spinning on the shared mailbox register until the receiver has marked the mailbox as empty. I have been running this locally for a couple of days now and it works perfectly. Furthermore this series incorporates Mikko's work in progress on splitting up the mailbox controllers and allowing multiple controllers to match on the same device tree node during mbox_request_channel(). Last but not least there are no build-time dependencies between the mailbox and serial drivers, so I think the easiest way to merge this is if Jassi picks up patches 1-5, Greg takes patches 6 & 7 and I pick up patches 8-10 into the Tegra tree. Changes in v2: - address all of Pekka's comments regarding shared interrupts, registers that don't exist on Tegra186 and shared mailbox directionality - add a patch to enable the TCU in the 64-bit ARM default configuration Thanks, Thierry [0]: https://lore.kernel.org/patchwork/project/lkml/list/?series=357641 Mikko Perttunen (5): mailbox: Allow multiple controllers per device dt-bindings: tegra186-hsp: Add shared mailboxes dt-bindings: serial: Add bindings for nvidia,tegra194-tcu arm64: tegra: Add nodes for TCU on Tegra194 arm64: tegra: Mark TCU as primary serial port on Tegra194 P2888 Thierry Reding (5): mailbox: Support blocking transfers in atomic context mailbox: tegra-hsp: Add support for shared mailboxes mailbox: tegra-hsp: Add suspend/resume support serial: Add Tegra Combined UART driver arm64: defconfig: Enable Tegra TCU .../bindings/mailbox/nvidia,tegra186-hsp.txt | 30 +- .../bindings/serial/nvidia,tegra194-tcu.txt | 35 ++ .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 38 +- arch/arm64/configs/defconfig | 1 + drivers/mailbox/mailbox.c | 11 +- drivers/mailbox/tegra-hsp.c | 517 +++++++++++++++--- drivers/tty/serial/Kconfig | 22 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/tegra-tcu.c | 299 ++++++++++ include/dt-bindings/mailbox/tegra186-hsp.h | 11 + include/linux/mailbox_controller.h | 4 + include/uapi/linux/serial_core.h | 3 + 13 files changed, 903 insertions(+), 71 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.txt create mode 100644 drivers/tty/serial/tegra-tcu.c -- 2.19.1
next reply other threads:[~2018-11-12 15:18 UTC|newest] Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-11-12 15:18 Thierry Reding [this message] 2018-11-12 15:18 ` [PATCH v2 00/10] serial: Add Tegra Combined UART driver Thierry Reding 2018-11-12 15:18 ` [PATCH v2 01/10] mailbox: Support blocking transfers in atomic context Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-17 17:27 ` Jassi Brar 2018-11-17 17:27 ` Jassi Brar 2018-11-20 15:29 ` Thierry Reding 2018-11-20 15:29 ` Thierry Reding 2018-11-21 14:27 ` Thierry Reding 2018-11-21 14:27 ` Thierry Reding 2018-11-22 2:18 ` Jassi Brar 2018-11-22 2:18 ` Jassi Brar 2018-11-22 8:47 ` Thierry Reding 2018-11-22 8:47 ` Thierry Reding 2018-11-22 16:07 ` Jassi Brar 2018-11-22 16:07 ` Jassi Brar 2018-11-22 17:34 ` Thierry Reding 2018-11-22 17:34 ` Thierry Reding 2018-11-23 11:17 ` Thierry Reding 2018-11-23 11:17 ` Thierry Reding 2018-11-23 11:56 ` Thierry Reding 2018-11-23 11:56 ` Thierry Reding 2018-11-28 9:43 ` Jon Hunter 2018-11-28 9:43 ` Jon Hunter 2018-11-28 10:08 ` Thierry Reding 2018-11-28 10:08 ` Thierry Reding 2018-11-29 5:23 ` Jassi Brar 2018-11-29 5:23 ` Jassi Brar 2018-11-29 15:23 ` Thierry Reding 2018-12-07 5:56 ` Jassi Brar 2018-12-07 5:56 ` Jassi Brar 2018-12-07 6:19 ` Mikko Perttunen 2018-12-07 6:19 ` Mikko Perttunen 2018-12-08 5:51 ` Jassi Brar 2018-12-08 5:51 ` Jassi Brar 2018-12-08 8:50 ` Greg KH 2018-12-08 8:50 ` Greg KH 2018-12-09 1:20 ` Jassi Brar 2018-12-09 1:20 ` Jassi Brar 2018-12-07 11:32 ` Thierry Reding 2018-12-07 15:39 ` Greg KH 2018-12-07 15:39 ` Greg KH 2018-12-08 6:09 ` Jassi Brar 2018-12-08 6:09 ` Jassi Brar 2018-12-10 9:52 ` Thierry Reding 2018-12-10 20:30 ` Jassi Brar 2018-12-10 20:30 ` Jassi Brar 2018-12-10 20:45 ` Thierry Reding 2018-12-10 21:32 ` Jassi Brar 2018-12-10 21:32 ` Jassi Brar 2018-11-12 15:18 ` [PATCH v2 02/10] mailbox: Allow multiple controllers per device Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 03/10] dt-bindings: tegra186-hsp: Add shared mailboxes Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 04/10] mailbox: tegra-hsp: Add support for " Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-13 11:09 ` Jon Hunter 2018-11-13 11:09 ` Jon Hunter 2018-11-13 13:09 ` Thierry Reding 2018-11-13 13:09 ` Thierry Reding 2018-11-13 19:24 ` Jon Hunter 2018-11-13 19:24 ` Jon Hunter 2018-11-12 15:18 ` [PATCH v2 05/10] mailbox: tegra-hsp: Add suspend/resume support Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-13 11:17 ` Jon Hunter 2018-11-13 11:17 ` Jon Hunter 2018-12-10 9:58 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 06/10] dt-bindings: serial: Add bindings for nvidia, tegra194-tcu Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-13 9:39 ` [PATCH v2 06/10] dt-bindings: serial: Add bindings for nvidia,tegra194-tcu Jon Hunter 2018-11-13 9:39 ` Jon Hunter 2018-11-13 10:03 ` Thierry Reding 2018-11-13 10:03 ` Thierry Reding 2018-11-13 10:11 ` Jon Hunter 2018-11-13 10:11 ` Jon Hunter 2018-11-12 15:18 ` [PATCH v2 07/10] serial: Add Tegra Combined UART driver Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 08/10] arm64: tegra: Add nodes for TCU on Tegra194 Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 09/10] arm64: tegra: Mark TCU as primary serial port on Tegra194 P2888 Thierry Reding 2018-11-12 15:18 ` Thierry Reding 2018-11-12 15:18 ` [PATCH v2 10/10] arm64: defconfig: Enable Tegra TCU Thierry Reding 2018-11-12 15:18 ` Thierry Reding
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=20181112151853.29289-1-thierry.reding@gmail.com \ --to=thierry.reding@gmail.com \ --cc=devicetree@vger.kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=jassisinghbrar@gmail.com \ --cc=jonathanh@nvidia.com \ --cc=jslaby@suse.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-serial@vger.kernel.org \ --cc=linux-tegra@vger.kernel.org \ --cc=mliljeberg@nvidia.com \ --cc=mperttunen@nvidia.com \ --cc=ppessi@nvidia.com \ --cc=talho@nvidia.com \ /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: linkBe 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.