From patchwork Thu May 25 04:03:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 98766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp100312vqr; Wed, 24 May 2023 21:14:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6rdKyVEuWdwd4YG1pss2DGsybCz6gu4vDLHa1/vsSXvnf9W3+BdkY15pdiWm2uN8k14ZfC X-Received: by 2002:a05:6a00:2343:b0:64c:a554:f577 with SMTP id j3-20020a056a00234300b0064ca554f577mr6271012pfj.11.1684988085034; Wed, 24 May 2023 21:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684988085; cv=none; d=google.com; s=arc-20160816; b=0qiZVTsnpAfHjKUwVuRS+rhshPPq2i/rfDDh9cmxxQQRCbSdhyJTN7B6ACr1Jdt+2T 6d957UX+oN+Wod8i5S7Mkti/K3b/h3Ab7W3aILdDyw5C8skI3QKMFFlEALJGE/bWZqMT NoJq3Q4hBi/PPXUR7/LAM+jXRP7+gQaZrFIeGyk4D6LuXhFjSD7bU2CoqMrbxBmwv0KN vcmRm+tMNAoCTXrFRaakEsas3IUHYBexbf1MwYxjxJ46IOUJSLeil/qMScvGOEEc97EL cXMIe0f/cB5PXixPX/r0dlu4h055URgYgBQytPDztRkZ+NBBKRcxiuvUZ+OXkFYQ82BZ wJHA== 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=JzQwwWHfLn5GqJ+sUpssIPjhRdBj01gT2s8uoqlHWI4=; b=VLDiV3Srt+nhJJzU8a8VIKdAyzqhnQR3Skav0WjEnzcM531ZKTT7URYQmm/oyLqSH7 Z8Zkp1VCAhxbi7RvQyJu0a7AuTWsYnqLB+Blk6nPouCWAGEY/4CV0HG1dh5E2jrS/czo NIXLzYN25XdLoNORByXA/9b/FGjzSNAdYFqQ0evjOlytY8tlR407dIX+BrXw4gU1uq4+ 3m/ze3Oa5nXq+zKXy3hH3c4LSpBdwCZplsUQtLlL6IScFKj2npLhk9t4rCaHzDPW8Eh2 mqZHk2FmkSyJ/VCYqqEbl3nDrAv4OUDMVHKBQ6eEihU4KN1k6mZegLzYBmyOukfKBQHb iD6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="YJgReEa/"; 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 k127-20020a633d85000000b0053eedcc5049si219773pga.105.2023.05.24.21.14.31; Wed, 24 May 2023 21:14:45 -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="YJgReEa/"; 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 S238662AbjEYEGK (ORCPT + 99 others); Thu, 25 May 2023 00:06:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237734AbjEYEE3 (ORCPT ); Thu, 25 May 2023 00:04:29 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FAA91A6; Wed, 24 May 2023 21:04:23 -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=JzQwwWHfLn5GqJ+sUpssIPjhRdBj01gT2s8uoqlHWI4=; b=YJgReEa/vE2riAdBxkk5ViBMZs F8EVEKjd/h5NYSZ8FL+TWOdz/aaDrUNBHbuZ4qbjQ9HOx52QgkIeruEDteW69XE7Ji+nHcNL6TAJN RN2DHwkXn3+zgfWCLpQCBsLfxl+VX1cQLNtCDtL9DFAHcva5Vpdc6vAu9vRNQgtoXhWE=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:52970 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q22D2-0001dB-Ii; Thu, 25 May 2023 00:04:17 -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, 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 Date: Thu, 25 May 2023 00:03:17 -0400 Message-Id: <20230525040324.3773741-5-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230525040324.3773741-1-hugo@hugovil.com> References: <20230525040324.3773741-1-hugo@hugovil.com> 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 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 v3 04/11] 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766838065966581878?= X-GMAIL-MSGID: =?utf-8?q?1766838065966581878?= From: Hugo Villeneuve Make sure we wait at least 3us before initiating communication with the device after reset. Signed-off-by: Hugo Villeneuve --- 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 a7c4da3cfd2b..af7e66db54b4 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1428,6 +1428,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(3, 5); + for (i = 0; i < devtype->nr_uart; ++i) { s->p[i].line = i; /* Initialize port data */