From patchwork Fri Dec 2 08:55:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13062419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72084C4332F for ; Fri, 2 Dec 2022 08:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232721AbiLBI4F (ORCPT ); Fri, 2 Dec 2022 03:56:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbiLBI4B (ORCPT ); Fri, 2 Dec 2022 03:56:01 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3887BE4EC for ; Fri, 2 Dec 2022 00:55:58 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id bs21so6786215wrb.4 for ; Fri, 02 Dec 2022 00:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qzZuugwCL8elJjd0iI5Ef2C4fvgW7dfeF1TuQRXtXLE=; b=yUBWTrtAlhDaWitQiZj4D/Fm6S0OWpMrVPfz26FO792LkjuUs/fBuArlWRI/HI3h/T YwJusY4oq2sfslJbrwDuUQr47VKfvWjedHTqFUVYRVDSfb9Uep1b26H4Ei72xHhoZmHR OYed6avLHrKSFLdUULrnvor/ekaHZ2rnk4x/wwhpco8r/Y3f+SEOjJVoShFT5er97CN8 Is8ZPKl3H9fpsALRsg+U7+LB7LQ4b7uczYH9fRauApX9P+9cZ7gHbJ/R1dex/V9hRNV3 RX0LRgm9TIXa0UeZgVUN2gW2/IONH1eWmveHEmJd1b1gEbP+p76m6LteedX6h9C3Qt52 LCqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qzZuugwCL8elJjd0iI5Ef2C4fvgW7dfeF1TuQRXtXLE=; b=E15aTrP/yCi6po6lgLXiHdeNLQQ66gIn5PC8gUSx2JgoYXvMR4ALUrNWcxwumrLNYO f99DDEbeUxDcB/pfJ9+hwKbyR6xK4uCkmzjGEMZsdhHyBcdwgfUNErcyx9TQkM5S3Wr4 xzbw4+aqGCjlkG1Rp1AT3bmTED3iShol4CHBRg8mwXqOplolMmt7DenieiaA7IMZMSJm a3L7xQQ9WsbUSxvwdzQTaMDo2nRKej2SEu4d6RN3WT9mvMLP4t96M1AvJqe9lnr0e1n2 Yi060U6vihOW4qyaOqHjdIm6h77Or0ZXz9TkUQM3y8Hu/sMBCMifQLyucieg5hqAKzAQ V1bQ== X-Gm-Message-State: ANoB5pkv2WJTfecK1jul2SziCtQkiV446zdOZXKAF/CZe30JUi/VJnnh fxx4LWuI01XYrujAKTGo0ytMJw== X-Google-Smtp-Source: AA0mqf5X570gTEmJ39IsjE027DA4h+SIyNsRE2Hm/9tZ4w6ylyD+YQOtiD5i969LSXyXjX0V0d/Ylw== X-Received: by 2002:a05:6000:146:b0:242:9e3:87ba with SMTP id r6-20020a056000014600b0024209e387bamr19197614wrx.580.1669971357388; Fri, 02 Dec 2022 00:55:57 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:29a4:6f04:ddb1:1ed7]) by smtp.gmail.com with ESMTPSA id a13-20020adfed0d000000b0024219b1cb1bsm6527517wro.60.2022.12.02.00.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 00:55:57 -0800 (PST) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Jiri Slaby , Srinivas Kandagatla , Vinod Koul , Alex Elder , =?utf-8?q?Ilp?= =?utf-8?q?o_J=C3=A4rvinen?= Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v5 00/14] serial: qcom-geni-serial: implement support for SE DMA Date: Fri, 2 Dec 2022 09:55:40 +0100 Message-Id: <20221202085554.59637-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bartosz Golaszewski The goal of this series is to update the qcom-geni-serial driver to use the DMA mode of the QUPv3 serial engine. This is accomplished by the last patch in the series. The previous ones contain either various tweaks, reworks and refactoring or prepare the driver for adding DMA support. More work will follow on the serial engine in order to reduce code redundancy among its users and add support for SE DMA to the qcom GENI SPI driver. v4 -> v5: - split patch 8/13 into two: one for splitting out the chunk sending code and one for refactoring it (for easier review) - when stopping uart: disable the irq first before stopping transfers in progress, otherwise we rist rescheduling additional transfers after interrupt - make types even nore consistent in qcom_geni_serial_send_chunk_fifo() v3 -> v4: - don't assign NULL (even cast) to variables of type dma_addr_t - refactor checking the SE_GENI_STATUS into two inline functions - drop min_t() in favor of regular min() after adding some consistency to types - check if the abort command was successful and emit a message if not when stopping TX in DMA mode v2 -> v3: - drop devres patches from the series v1 -> v2: - turn to_dev_uport() macro into a static inline function - use CIRC_CNT_TO_END() and uart_xmit_advance() where applicable and don't handle xmit->tail directly - drop sizeof() where BYTES_PER_FIFO_WORD can be used - further refactor qcom_geni_serial_handle_tx_fifo() - collect review tags Bartosz Golaszewski (14): tty: serial: qcom-geni-serial: drop unneeded forward definitions tty: serial: qcom-geni-serial: remove unused symbols tty: serial: qcom-geni-serial: align #define values tty: serial: qcom-geni-serial: improve the to_dev_port() macro tty: serial: qcom-geni-serial: remove stray newlines tty: serial: qcom-geni-serial: refactor qcom_geni_serial_isr() tty: serial: qcom-geni-serial: remove unneeded tabs tty: serial: qcom-geni-serial: split out the FIFO tx code tty: serial: qcom-geni-serial: refactor qcom_geni_serial_send_chunk_fifo() tty: serial: qcom-geni-serial: drop the return value from handle_rx tty: serial: qcom-geni-serial: use of_device_id data tty: serial: qcom-geni-serial: stop operations in progress at shutdown soc: qcom-geni-se: add more symbol definitions tty: serial: qcom-geni-serial: add support for serial engine DMA drivers/tty/serial/qcom_geni_serial.c | 626 +++++++++++++++++--------- include/linux/qcom-geni-se.h | 3 + 2 files changed, 413 insertions(+), 216 deletions(-)