Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527949pxf; Mon, 15 Mar 2021 11:33:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwLPx+SVW12cFV29g0xzY4v9QjJtlzX+9lgv3dW7WKV1m1GyJCpup+EKEXZ9p00ES1Ktdk X-Received: by 2002:a05:6402:1517:: with SMTP id f23mr32269074edw.272.1615833199782; Mon, 15 Mar 2021 11:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833199; cv=none; d=google.com; s=arc-20160816; b=huDBoF6lseh5qwNO5tSgadtdrGpRP9tDjAvdnIMISA7fT9yLiVw31cc36QDYoxzPam dy7h8zGXMp73Buq+piYAA6SHvMbFOxqsv4IEgJnIol0nH9+i5Sc9lMvZI39QQXgChzhn P4Va8/EBSqp5+soPJ4p3Wh4T10a4sZi1o5ju/Ko1NsnN7c6dNKHeuA4ZshkmMudtFE65 AVHFe+YizBljclNxtFo9WqHN4uvfhVw7baPk/FFUbWRFYW14JQi/jooTMZlTEjziq/rG AtPRF/VQRz+DG62jFW+tc+OKLRGrqz6u2iXd98qrlb55GrsnNVFfbjyEEaHboN9TIFHe xKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Eebj8Vj5ZRMl4TpbMU1fqcLBv1UBQwmeh3l5xdYQnE=; b=qzi+emEHNNRQ1kReGHEqMot+kLBPOt/Zqh84eKzo37lhPkwpPrZC9LlmK14nzzEbas m+vQm6qytZzn8MiiJaqq1rBZcvKWqFMlzTefLLyhZZDHAzFeQdhhFinqDY5+tvU93lZz CmH54IEvX/4A5nV+jegeDGup76lv6FooeTayt8qwvYJuiLX4lA8rR3Avt87Z7OcY4Lg2 ZwxwrP2u+PAa5XxJJJoZvQLjgT/7k20gOYwGcLROqnLNwhwYdNhDC1LsJWM+IqhXBFr3 fdWTYVLaLfnJbP5TpS2Ontm1dBG58TJ00ekYIm9uA2xYu/E2QGysqs078Kk/Aaw3Cg9Q xU+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v1JPyd5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt26si11436788ejb.216.2021.03.15.11.32.57; Mon, 15 Mar 2021 11:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v1JPyd5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237454AbhCOOmC (ORCPT + 99 others); Mon, 15 Mar 2021 10:42:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234090AbhCOOCz (ORCPT ); Mon, 15 Mar 2021 10:02:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E7D7264E83; Mon, 15 Mar 2021 14:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816975; bh=wYn9ekKjGJS6jyTe0348dfUT899Q5inpi3XsKOBw0Jw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1JPyd5ahdMYKASNUZlfcj3NEi2AhPkNL89VPQDj7cVH5RgjGxSPwd6jIGdOCiXkQ npQK3xV6eHuFqbtBuCI9VxE63IlkZPAwJRtZrGWZCGve6eOQhiUfB3f1BNRm6QSFIU asPVeKIJeftrByD/sVSM5irR/JU/aUJ589+aYFyo= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Shiyan , Thomas Petazzoni Subject: [PATCH 5.10 222/290] Revert "serial: max310x: rework RX interrupt handling" Date: Mon, 15 Mar 2021 14:55:15 +0100 Message-Id: <20210315135549.480725314@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Alexander Shiyan commit 2334de198fed3da72e9785ecdd691d101aa96e77 upstream. This reverts commit fce3c5c1a2d9cd888f2987662ce17c0c651916b2. FIFO is triggered 4 intervals after receiving a byte, it's good when we don't care about the time of reception, but are only interested in the presence of any activity on the line. Unfortunately, this method is not suitable for all tasks, for example, the RS-485 protocol will not work properly, since the state machine must track the request-response time and after the timeout expires, a decision is made that the device on the line is not responding. Signed-off-by: Alexander Shiyan Link: https://lore.kernel.org/r/20210217080608.31192-1-shc_work@mail.ru Fixes: fce3c5c1a2d9 ("serial: max310x: rework RX interrupt handling") Cc: Thomas Petazzoni Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/max310x.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1056,9 +1056,9 @@ static int max310x_startup(struct uart_p max310x_port_update(port, MAX310X_MODE1_REG, MAX310X_MODE1_TRNSCVCTRL_BIT, 0); - /* Reset FIFOs */ - max310x_port_write(port, MAX310X_MODE2_REG, - MAX310X_MODE2_FIFORST_BIT); + /* Configure MODE2 register & Reset FIFOs*/ + val = MAX310X_MODE2_RXEMPTINV_BIT | MAX310X_MODE2_FIFORST_BIT; + max310x_port_write(port, MAX310X_MODE2_REG, val); max310x_port_update(port, MAX310X_MODE2_REG, MAX310X_MODE2_FIFORST_BIT, 0); @@ -1086,27 +1086,8 @@ static int max310x_startup(struct uart_p /* Clear IRQ status register */ max310x_port_read(port, MAX310X_IRQSTS_REG); - /* - * Let's ask for an interrupt after a timeout equivalent to - * the receiving time of 4 characters after the last character - * has been received. - */ - max310x_port_write(port, MAX310X_RXTO_REG, 4); - - /* - * Make sure we also get RX interrupts when the RX FIFO is - * filling up quickly, so get an interrupt when half of the RX - * FIFO has been filled in. - */ - max310x_port_write(port, MAX310X_FIFOTRIGLVL_REG, - MAX310X_FIFOTRIGLVL_RX(MAX310X_FIFO_SIZE / 2)); - - /* Enable RX timeout interrupt in LSR */ - max310x_port_write(port, MAX310X_LSR_IRQEN_REG, - MAX310X_LSR_RXTO_BIT); - - /* Enable LSR, RX FIFO trigger, CTS change interrupts */ - val = MAX310X_IRQ_LSR_BIT | MAX310X_IRQ_RXFIFO_BIT | MAX310X_IRQ_TXEMPTY_BIT; + /* Enable RX, TX, CTS change interrupts */ + val = MAX310X_IRQ_RXEMPTY_BIT | MAX310X_IRQ_TXEMPTY_BIT; max310x_port_write(port, MAX310X_IRQEN_REG, val | MAX310X_IRQ_CTS_BIT); return 0;