Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2318602pxb; Fri, 5 Feb 2021 14:59:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJVkhrwvEJH6NCr/HBgj4FNFjX9Fl3YFh9V8+cN0/UPRHSXn+2iQ1y4gMCPI4QZ/oAGIrA X-Received: by 2002:a50:fe02:: with SMTP id f2mr5639784edt.195.1612565959802; Fri, 05 Feb 2021 14:59:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612565959; cv=none; d=google.com; s=arc-20160816; b=c9bR3V/6B22NqawT21wnniGuna0B0UApieFxEljfyrxlXz2EyoEW5KIsWEbnwQCiOy DPD3zHmu0zIsIHW1dWXNAfuHYDFs7WkLbiCSYW/8HxROIlB9RklQWRSX+lu/x31LH99Q Vw5ElvfBgbDgqe4mNtQ6W3PY907UVGS1pjByN/g+nvOG46h3MG+lTOEEN9rTbeBdGl5b NvVm5/qwStZr8t6SiE43nK5CNMOBkbuqcjYiqqNtb/5ZIu1+ErePKMqTgmrnJnMED1Qz FdxKzMFEhadXQ1NpFk99w6lN9sNUaE/UC4MVAwcTixWd5TZkbJtFcw3buFJu3SWYJXNU 2wKA== 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=hz7BB9ZvBAlhaPmhsqK+fYYbAXEAhMPbDEHZTRD7ABM=; b=Hk4OGIRY7/Wv8/ZIpIUAptY827Hwpi6nnwV7k5Acoe9cZZp/lBbW2hzVBzRjhhvRTK d5OuXv7t0qUseh4c2vZGg7/+0NCyBEYI9oWz72mlrwzcJVcrKNj2RMJLLB6ja6WUSJTL d5KJlanj5e0YW1DnwSH0ofka3TaiQgX7zEBWxXwyIOcklMIfuIH/3zDo3HwsL4Uv1P3k sZmMgZn2vOiystrO+RvJy+aeEeNT/bzgScQrE/D7+rGNyrh71Fu6ITHdKzhkOdaEJZdT 4WFzHjvUAi2vFUoej2Wol8I18SiC17v3+M+tB7WwWZAQjSm8MYhLyAaP6+n/Zch5gdcK 5c+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0XSZoagz; 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 df22si6254579edb.163.2021.02.05.14.58.54; Fri, 05 Feb 2021 14:59:19 -0800 (PST) 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=0XSZoagz; 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 S232457AbhBEWz5 (ORCPT + 99 others); Fri, 5 Feb 2021 17:55:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:43242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbhBEOld (ORCPT ); Fri, 5 Feb 2021 09:41:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E8E7C64FCA; Fri, 5 Feb 2021 14:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534154; bh=c7Q8ewKd/jRSRoeS+fbFYVXJ7RfUsOeiMX6bRQu4UYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0XSZoagzfJjY+ItuMtSVaLkrqBCNjszBkDE/3N0IaO4hCFEElyfRjdkHkwZGFgwwQ VDGOBpoGsoJ4259D4GMH0sM8qlqxcIrw+YWq3oypKRSSI4rMObhD4o/R5iQ2BWDtQX 8dYZxPLDVIn7rPwBPh3AIhd5bq3nbJFJfgVHqqkA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Marek Vasut , Michael Grzeschik , Paul Barker , Andrew Lunn , Jakub Kicinski Subject: [PATCH 5.10 01/57] net: dsa: microchip: Adjust reset release timing to match reference reset circuit Date: Fri, 5 Feb 2021 15:06:27 +0100 Message-Id: <20210205140656.043955711@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140655.982616732@linuxfoundation.org> References: <20210205140655.982616732@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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: Marek Vasut commit 1c45ba93d34cd6af75228f34d0675200c81738b5 upstream. KSZ8794CNX datasheet section 8.0 RESET CIRCUIT describes recommended circuit for interfacing with CPU/FPGA reset consisting of 10k pullup resistor and 10uF capacitor to ground. This circuit takes ~100 ms to rise enough to release the reset. For maximum supply voltage VDDIO=3.3V VIH=2.0V R=10kR C=10uF that is VDDIO - VIH t = R * C * -ln( ------------- ) = 10000*0.00001*-(-0.93)=0.093 s VDDIO so we need ~95 ms for the reset to really de-assert, and then the original 100us for the switch itself to come out of reset. Simply msleep() for 100 ms which fits the constraint with a bit of extra space. Fixes: 5b797980908a ("net: dsa: microchip: Implement recommended reset timing") Reviewed-by: Florian Fainelli Signed-off-by: Marek Vasut Cc: Michael Grzeschik Reviewed-by: Paul Barker Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210120030502.617185-1-marex@denx.de Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/microchip/ksz_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 489963664443..389abfd27770 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -400,7 +400,7 @@ int ksz_switch_register(struct ksz_device *dev, gpiod_set_value_cansleep(dev->reset_gpio, 1); usleep_range(10000, 12000); gpiod_set_value_cansleep(dev->reset_gpio, 0); - usleep_range(100, 1000); + msleep(100); } mutex_init(&dev->dev_mutex); -- 2.30.0