From patchwork Fri Jul 21 16:18:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 123982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp341310vqg; Fri, 21 Jul 2023 10:01:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4O77cRQy+WzzluZW5A9vCzthQvfniwuDDOfsH6958NW+ddg3j9DM8opdH2i1G3joDIJIs X-Received: by 2002:a05:6512:1084:b0:4f8:5905:8e0a with SMTP id j4-20020a056512108400b004f859058e0amr1897269lfg.6.1689958900100; Fri, 21 Jul 2023 10:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689958900; cv=none; d=google.com; s=arc-20160816; b=Ch2ktK3MdNxryu6fcUEfDlk+tSkGuc6VB0e2YW3VIhcy7J5X8uAmUTBJgdU3aTCFeL QuzK6mKfguRI9Pn4nKz7X3gfRpMK5lgcyW4eQefQVvfcb2vnPg8CixsYP+og9zbo0SDt C+N3Oj8gzXPThEvxfRrJyf8vDuts9zZdCij0azrzlnrS46azcENhwPDFe2XjWo9qMuJw YOLUTo9aM3rv5sfhoNwzkQgPCzxOtXJkiaKfQ80iDi2v/fWYcj5E877x8f+mOKkSa5SH Dnp9JNC5eYv/ibAiod3INmetFMu3sO1tUqchDvRMIwhOSqAjUG6ZfqSou0LVr8OP9Unr vYWg== 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 :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=hJjkp3frl86bgh+fvqfTcebGX6hsjlqpFUYax05mOtQ=; fh=8lgP9Q7yUti3QJsgyDqXJNhUNHaf4UcodBK5t7Tk2ug=; b=Ybudtc4778+XiXD08TK7pLqSnRJxOpTN1PrXHFywTGWWeRScHwusMmTw+lIENRvx8K xCdwZGKNvGg+oIrf1/9O+YSz/hJ9YyYKz+pk558Rbogyr0gMshRdL8HEelyPaUZB6zxi He7+WDUw5/yZOEbo7t3VQVxyj9F5KLd7Tra5Ae0lzhwh4n8tpjR//nmpgqy2qyS0gPlq GTfLIZFcEtDnJYcGg/Gg4+yQaUE2EuqJ4zN6FDwVT7BTZgNIPBP+HjNTd+nmbkJ3Hq0C sXdt97p8tmYZSmT6ucBwDqcnRshkntLG1Jva9thWZydhdo5ssxIk/j35oQ+R7l7ut/36 hySw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="ypsF/qq+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a23-20020aa7d757000000b0051da4f1bea9si2453933eds.383.2023.07.21.10.01.05; Fri, 21 Jul 2023 10:01:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="ypsF/qq+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbjGUQVR (ORCPT + 99 others); Fri, 21 Jul 2023 12:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbjGUQU1 (ORCPT ); Fri, 21 Jul 2023 12:20:27 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85B4046AD; Fri, 21 Jul 2023 09:19:10 -0700 (PDT) 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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hJjkp3frl86bgh+fvqfTcebGX6hsjlqpFUYax05mOtQ=; b=ypsF/qq+jJnj0QmZBE0ROJx5eP GyhCcLwBj1QEuypxztfcIsTGgOU0U8hOxeq+J6uFiD8XWE7guAT46grPzJ+yXv7ek9sGCBHuoFrf4 8m3CUUeA1mznOZr/d7mP7KZVhJku1AqYfrBirnviQ3nBnLutZeAv0ZdhRRb5MUjMR0fQ=; Received: from modemcable061.19-161-184.mc.videotron.ca ([184.161.19.61]:50368 helo=localhost.localdomain) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qMsqN-0003IO-IM; Fri, 21 Jul 2023 12:19:04 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, isaac.true@canonical.com, jesse.sung@canonical.com, tomasz.mon@camlingroup.com, l.perczak@camlintechnologies.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , Lech Perczak Date: Fri, 21 Jul 2023 12:18:39 -0400 Message-Id: <20230721161840.1393996-10-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230721161840.1393996-1-hugo@hugovil.com> References: <20230721161840.1393996-1-hugo@hugovil.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 184.161.19.61 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Subject: [RESEND PATCH v8 09/10] serial: sc16is7xx: add post reset delay 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772050343360622056 X-GMAIL-MSGID: 1772050343360622056 From: Hugo Villeneuve Make sure we wait at least 3us before initiating communication with the device after reset. Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 49213be60baf..718e982e1efe 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1526,6 +1526,12 @@ static int sc16is7xx_probe(struct device *dev, regmap_write(s->regmap, SC16IS7XX_IOCONTROL_REG << SC16IS7XX_REG_SHIFT, SC16IS7XX_IOCONTROL_SRESET_BIT); + /* + * After reset, the host must wait at least 3us before initializing a + * communication with the device. + */ + usleep_range(5, 10); + for (i = 0; i < devtype->nr_uart; ++i) { s->p[i].line = i; /* Initialize port data */