From patchwork Mon Dec 11 17:13:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 17860 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7205529vqy; Mon, 11 Dec 2023 09:14:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyjCcGsO64q/QEGQFO5iI7A54bDcEdA39CQDzmLefqKRD2UfAMm1MWkB/SdK6NBisuJS0U X-Received: by 2002:a17:90a:eb0d:b0:286:6cc0:b915 with SMTP id j13-20020a17090aeb0d00b002866cc0b915mr1678494pjz.76.1702314871553; Mon, 11 Dec 2023 09:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702314871; cv=none; d=google.com; s=arc-20160816; b=B3T/jefqy8RIjfjEmeqJ+U1Fm5jahfrJivSfQcjCPup2MlSRNWpZS5tAGWMRK7bG5c eDHLTlFOyKRTXHfzG6estNYzzfQt1zXMPsZEmpLrXcljW68lmYY1yEi9ZEYTP3Hqflxq 21Nd8TJTZ4XZi/RCspfSXg0vzrGgxQN3NDsdzTa93NLKmUduCy/EWZmjbugcsbeHsQwS uWvvm4EiW23N5Exq3oc3WrKODGXzPp43vMhgl1AIgQXzyQOiU37cGbxpqxBRHrnnQFMb nUw5oGk1r/3ZtvjebLq9oqGTxCTKtzEhwvWe9b+VZAtbEdXTtOhuxIN3pT699T/hDvWT rEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :message-id:date:cc:to:from:dkim-signature; bh=aaEer9pudS/c8D2BByKXGhQ3YN3/xyWWrP78YkybY7w=; fh=FnEeHqfK7GG3DQSOZfOQpMEycjoLCcCKkdtByb5fZGg=; b=HVOKkBdJwf5kr+36evJGGr7rd1zm8ApT6a7GUfMZ7Gj4NvptyFireLDy+BsWmRUy30 +wuX+Eli2Zpm9Uz4PotSQksr+UQBZqthq/ggi9PPz4+V3k7j7SQpYdxx5bm7TYs9Pn92 Gq4baj/yVZOSOkbvFvt3XGtHK3hgWX9Ab7gtsJ8U8ARxF7GhwszVhx2rSTWVXeuzeAQo EuNFKbnQp25censM9SQlc+LfaOM+1exZdnT4VaWmOvdFW8HpveRSy3RlOxCUEUfEG8vw UIX228M7EFNn0dI9SvGnOj56jRunM1h/s+/oYg6pIsO8RFOblu+x+J11J3lHy1lI6EwA g+pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=Qgm79yfy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v10-20020a1709029a0a00b001cfdd31f20esi6235417plp.267.2023.12.11.09.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 09:14:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=Qgm79yfy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5DD4F8041C07; Mon, 11 Dec 2023 09:14:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344301AbjLKROC (ORCPT + 99 others); Mon, 11 Dec 2023 12:14:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjLKRN7 (ORCPT ); Mon, 11 Dec 2023 12:13:59 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2834BD; Mon, 11 Dec 2023 09:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=aaEer9pudS/c8D2BByKXGhQ3YN3/xyWWrP78YkybY7w=; b=Qgm79yfyq7y322Vd2gcF4MfK4v mLJF4PM/q+uGiyL8NpxAYe515C3j8JKzIHgSc3E1gbfNUfv8Ej9jpOi9w/gw2FnS7zzH7HHOSm99c L7mc69O1xHKEWiCZME7gP8JbSRLJR+5tzSEaihh5X/tYBsmNqQXPxXMk5j7NKf55gHak=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:56730 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rCjqw-0003yC-1y; Mon, 11 Dec 2023 12:13:59 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com, jringle@gridpoint.com, tomasz.mon@camlingroup.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Mon, 11 Dec 2023 12:13:47 -0500 Message-Id: <20231211171353.2901416-1-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH v2 0/6] serial: sc16is7xx: regmap fixes and improvements X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 09:14:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785006518818264129 X-GMAIL-MSGID: 1785006518818264129 From: Hugo Villeneuve Hello, this patch series brings fixes and improvements related to regmap access for the sc16is7xx driver. Most of the patches are related to commit 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port"). I did not originally add a "Cc: stable" tag for the above mentioned commit, as it was intended only to improve debugging using debugfs. But since then, I have been able to confirm that it also fixes a long standing bug in our system where the Tx interrupt are no longer enabled at some point when transmitting large RS-485 paquets that completely fill the FIFO and thus require multiple and subsequent writes to the FIFO once space in it becomes available. I have been investigating why, but so far I haven't found the exact cause, altough I suspect it has something to do with regmap caching. Therefore, I have added this commit as a prerequisite for some of the patches in this series so that it is automatically added to the stable kernels. I have tested the changes on a custom board with two SC16IS752 DUART over a SPI interface using a Variscite IMX8MN NANO SOM. The four UARTs are configured in RS-485 mode. I did not test the change on a SC16is7xx using I2C interface, as my custom board is only using SPI. Thank you. Link: [v1] https://lore.kernel.org/all/20231130191050.3165862-1-hugo@hugovil.com Changes for V2: - Refactor patch 1 to avoid a truncation warning when using "%u" in snprintf. - Keep only fixing patches in this series. Non-fixes patches will be resubmitted in a new separate series. - Add 3 new fixing patches (4 to 6). Hugo Villeneuve (6): serial: sc16is7xx: remove wasteful static buffer in sc16is7xx_regmap_name() serial: sc16is7xx: remove global regmap from struct sc16is7xx_port serial: sc16is7xx: remove unused line structure member serial: sc16is7xx: change EFR lock to operate on each channels serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO serial: sc16is7xx: fix unconditional activation of THRI interrupt drivers/tty/serial/sc16is7xx.c | 104 ++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 48 deletions(-) base-commit: e045e18dbf3eaac32cdeb2799a5ec84fa694636c