From patchwork Fri Jan 13 18:43:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 13101488 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28EC7C3DA78 for ; Fri, 13 Jan 2023 18:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zM9FIbvvJixRinOFj0W2Y7FnfFT+U1M7NX6q8x7fpAo=; b=FU+RLDgfxZwjps lsNdofvaJgR9r36Vh7OqRkE9Ajqrz/cIf4xKSyoEJC25hZwgNrzuMqYBtHTwnIuXYw4x0AC9U59xZ DczyBkzMU5/5cSi268g8ZeoS4+ust5r3QCd3soGLbwpgjwSz+7pi6co+9kNHfOwcy9ALHRiUWtMyV UVSBRlzN3WUGbTQDwv0zInmaiGDjf1i+jXWKI60vnAHyLUs93UfFXKZHP1Ki6zf1jwLGytFCBYskL Ei/ylA9VKYBmT1JuOB+KmtJFTT5O6GD6xAUAvOfJCLXIQ+b11geoW6aQ1Y2uTaoNpeMtfIn+oImLN HJTTjPE56DDsbx02oIJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGP1o-0045IS-HV; Fri, 13 Jan 2023 18:43:48 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGP1l-0045Gm-Qf for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2023 18:43:47 +0000 Received: by mail-lf1-x131.google.com with SMTP id g18so1463852lfh.0 for ; Fri, 13 Jan 2023 10:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rvVnDzmB7vtZ40bWPlhv9/lTTZEFrO1fNbWGIPYFVJQ=; b=MZNIG/PW0r4yIsr9HqFlVN0DnpDVVxQaVl5W6BvALYroCXLTuk1RlJz522URnpNfJ/ R16aTZI4s5VATtTQ2cg+k6Me0rUhXuIeyLKlOz9YJNBenNlWEFXhSd/R4Op/CLL6q4zI v46vzhyU/bQajh+5VKscirj2WRPJDZC9TWpm1WU7gtrAU9Vu2dkCTQOvmB2fs41S049l sAHPUKHwMHJ59DxrhDmfJRmjR5uJ4bDgk/NOgw/AUKFqC2opv8gbtyfBbS4fkGTKx95e KIQGqHIC2TLVP9/eBbxNsY40/1uOsgqVtrchbbBaDK11WJscv4gqpT6fAIi4Yv1Mur5f e3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rvVnDzmB7vtZ40bWPlhv9/lTTZEFrO1fNbWGIPYFVJQ=; b=K27TPzj6v2+HAmHRq5MoRNRsR2ukZhp+saGzU8ad/xoyxpd+4th8XQcGV8z+uK3rO/ UjKZPfTJZbsbExNVnGdwXwsoPGaPM6UPdjS1a1GtzlYU0++2YAZiZIwy5qyG9W6QgJWF rd3a3pYY51rPQGVFT1ug+37oUJXXhw8Gt7E/bV7ZHI6+e79vm65ot9cIc3KX3Ub6SFDK 6v2pSw/CgxvW1D8HfWCmMomGZEk+o001vdYQEZZ/8mihRt562bbAWCEla6MOuQ46jvpG mrzSPfeAmS0755oalwfQkCSi1IYxFsFNOeL2sAKGAlkpgynpN9DzAFDmih1MzzgBeN4B TJgg== X-Gm-Message-State: AFqh2kq05Huvf1Qv2hi/mg0w+SxMYuEXFPnT7uJp/DgWGYmZF8rxS2kG 0lj/uZB1YmmcdKBkuMdRDiU= X-Google-Smtp-Source: AMrXdXv5Zpqy4SsYnG6NdqnaFGNGolU0laGYsdoGVyZUMtV7siQcvoJUH5DvQg5SYQbdNvbb3T3YBg== X-Received: by 2002:a19:8c51:0:b0:4b6:ed1d:38e9 with SMTP id i17-20020a198c51000000b004b6ed1d38e9mr240411lfj.64.1673635420064; Fri, 13 Jan 2023 10:43:40 -0800 (PST) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id o11-20020ac2434b000000b004cc9ddce3adsm1261439lfl.82.2023.01.13.10.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 10:43:39 -0800 (PST) From: Sergey Organov To: linux-serial@vger.kernel.org Cc: Fabio Estevam , Greg Kroah-Hartman , Jiri Slaby , Richard Genoud , Sascha Hauer , Shawn Guo , Tim Harvey , =?utf-8?q?Tomasz_Mo=C5=84?= , linux-arm-kernel@lists.infradead.org, NXP Linux Team , Pengutronix Kernel Team , Sergey Organov Subject: [PATCH 0/8] serial: imx: work-around for hardware RX flood, and then isr improvements Date: Fri, 13 Jan 2023 21:43:26 +0300 Message-Id: <20230113184334.287130-1-sorganov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <87bko4e65y.fsf@osv.gnss.ru> References: <87bko4e65y.fsf@osv.gnss.ru> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230113_104345_886133_B478DE75 X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These series contain a work-around for hardware RX flood in first 2 commits, and then further cleanups and optimizations of the receive IRQ handler. WARNING: the flood fix is extensively tested with older version of the kernel with DMA turned off. The DMA path is tested only a bit, as DMA has receive problems on my kernel version. Sergey Organov (8): serial: imx: factor-out common code to imx_uart_soft_reset() serial: imx: work-around for hardware RX flood serial: imx: do not sysrq broken chars serial: imx: do not break from FIFO reading loop prematurely serial: imx: remove redundant USR2 read from FIFO reading loop serial: imx: stop using USR2 in FIFO reading loop serial: imx: use readl() to optimize FIFO reading loop serial: imx: refine local variables in rxint() drivers/tty/serial/imx.c | 227 ++++++++++++++++++++++++--------------- 1 file changed, 141 insertions(+), 86 deletions(-)