From patchwork Tue Jul 25 14:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 125667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2511989vqg; Tue, 25 Jul 2023 07:31:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHEW3CAyTrydfUFCZv84S/ALjRZYFQ78uVMlk/k7Aq9Vf2z2zBg4JUROQLySt2Zd7OAIS3w X-Received: by 2002:a05:6a20:430a:b0:133:8784:15f7 with SMTP id h10-20020a056a20430a00b00133878415f7mr3493617pzk.14.1690295466872; Tue, 25 Jul 2023 07:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690295466; cv=none; d=google.com; s=arc-20160816; b=HxrNozF/r9GqgfU4lv11N8+VcjSf/UzYAC93qUQr2HK9VsiV4fVqTrqwRRzo5ZgZXb s7lgp8D7mdoN2tcc/FyXxVma90ii7a7VBmnEOpv4QZZNwFMJidWPfEf8FoCU83xAi1u3 l/kChkXdO9IDuaB+6x5gh0cMYixje8b9KDCaXPdby/EYwAxh6xwdApnqmymWXcHCT4Lk 39AUl7V2NEKxkPwI6z3C/CxBtNvqF6SfzNeUCn2xGfAQ67RSq3bdpGLzuBA9l4F7bDrc om99whCYxyuLlFDWHKawj1e3VV12YPzn7uT4uEO5uJNWw/05rB2XyB9VO6cu8w6Oiwcz LXQw== 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=WkAAKP2XDLTpD1NV5kL3+zXj4aEvohtt5uFwZPTRCiE=; b=GYgdWeR0u7KitEP1cvVA45lMI/DmQP52gH6kjiKC7PAjwP1i0ZpxeD+tB4kpJNCPOH jqeYB4pv9EMCth6K7e1uhjqiaf60QqUJ2Rd/8zDQTDhjWhRqKoUv6iWX7patSEA/TGYD CoXILmcx2R9YBC0CLJb+6fSrKVdaT4RT/Bphz0E1jMk/1qGsIcT5MRd3XOWlepYhM5dQ Z4fNq/X5kig5EyBRnI3iEMEw7tSUZcIv1HvEMNLA2PGTzHAxsPQR5CVM/Zvbd/aLz5fb q7KAB+VDPtFuOltTAcTHTzj0XS7EL3EiMTlbVxH7r6dip3Jbrc/m7SQthQtgE4c7cpdw kh7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=dfUCdmeL; 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 j37-20020a634a65000000b00563dc438e52si209307pgl.518.2023.07.25.07.30.52; Tue, 25 Jul 2023 07:31:06 -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=dfUCdmeL; 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 S230116AbjGYOYz (ORCPT + 99 others); Tue, 25 Jul 2023 10:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232920AbjGYOYQ (ORCPT ); Tue, 25 Jul 2023 10:24:16 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999572137; Tue, 25 Jul 2023 07:24:12 -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=dfUCdmeL2XJPxphgf3hkO0tu2i MxQ8dn+8avpS1q+u1doFYd7E7+w74G9jdH7+iPV4nad18XA/WnqtbxWiEg5cB0xyrHYBxUvhb0XhH iPnbWWYXtWsog4CYwPSnQtlkSfOGYTGmZ+Zn4cRAbAB8q+c9QtCNZbVbxm07B1Au4EUw=; Received: from modemcable061.19-161-184.mc.videotron.ca ([184.161.19.61]:34256 helo=localhost.localdomain) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qOIxJ-0003Kt-J7; Tue, 25 Jul 2023 10:24:06 -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, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.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: Tue, 25 Jul 2023 10:23:41 -0400 Message-Id: <20230725142343.1724130-10-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230725142343.1724130-1-hugo@hugovil.com> References: <20230725142343.1724130-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: [PATCH v9 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: 1772403259409006204 X-GMAIL-MSGID: 1772403259409006204 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 */