Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874669pxk; Thu, 17 Sep 2020 19:59:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0pBccJeIorL4K1PKVZkVz6faAgMlm+zlg8ybqmCO1Smdk7ay3TxER/URRKnN3mpRK7KZU X-Received: by 2002:a17:906:7c4c:: with SMTP id g12mr502841ejp.306.1600397977371; Thu, 17 Sep 2020 19:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397977; cv=none; d=google.com; s=arc-20160816; b=ZvKExP0IA86qwYd+9WmdzigaVPAX7w+4HzEbNT46qDP9BOwZK/MhlX8qxEdXWXH/61 5HEXqrZzai/cOlq1ZKxajW8gjJ9c8EAdrJn7KGqOpd0mlYFw3UNkpcrl9lUsSjR98xpG FyPyTkUAR+wNeft8c0hiyKO7VbottN1VpcpFs7n4QDhJsMpgc0AyE9crim2yZR3/jQmM a2yJ+8Ex2xy7mQCg+qjmkgR54r1gCYWujMAkysJ2C1jDFI8yT36h94v+VjQUARf+GC+7 sDFMvbZfjs/NETEz8TLE1nj8U5IWzisw7zqS54fqoqINndZRN5a3I6tz6rUPGolh4QI1 kvMg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qrlkID2oH/43PquLIlL9G/pwxlvZ4SPo++G4c1nYStM=; b=DPb/N0MQOVyZxZIQBaTaRUn7SKk6nphT/avo7DovLCdDSX2ADTXoO/hBoB3jWQK7/T 3AsnTeNlZFmv0Zu/BauYloMRVmOiZkIAQXAR4pAotHEqbecsu5V4aP2OrVs6HpMClKdx L6OC0LGH5J4sGi/lJa2IDYcB8x7kjSSmtA3dEZLQsNloz9l04Tz0EaH6g0qAX/Pggt8+ NRsDwdne+4LSmLW+faEw5tFCc12YdJ85u2ic5XgSbgVWwj9VLre9x5eUm6z31VOM3UeM nVb5/kb0RObJwlHTLzVAIc5hC5XBHD2pSm8Hn6Rf9qwLL0mD7rQlVH9tOSgwG+IqMNMU K8Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QSiXV7qv; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si1247834ejc.63.2020.09.17.19.59.14; Thu, 17 Sep 2020 19:59:37 -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=@kernel.org header.s=default header.b=QSiXV7qv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729059AbgIRC5Q (ORCPT + 99 others); Thu, 17 Sep 2020 22:57:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:55550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgIRCGc (ORCPT ); Thu, 17 Sep 2020 22:06:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 454AE239D3; Fri, 18 Sep 2020 02:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394789; bh=Kn9WjV9upfVvnTTOxznfqCRK8sRSDxv/X8OhWVQV4G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSiXV7qvwyLUtjSuCfDUbxuLft62CPQz5HysGdoQoJ+MpEVQZa27/s4w2qYWwYwra PU/kR5Aa52QtmZd4ClO9wuvqfmtzxCMdd5kRjWcGOIJUvlwxfeJjVuEI0NFiHibolA YY2cioTLUsnosG/sHFfE6YdTfywJ2fIUYdHJiMJ4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jonathan Bakker , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH AUTOSEL 5.4 260/330] phy: samsung: s5pv210-usb2: Add delay after reset Date: Thu, 17 Sep 2020 22:00:00 -0400 Message-Id: <20200918020110.2063155-260-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Bakker [ Upstream commit 05942b8c36c7eb5d3fc5e375d4b0d0c49562e85d ] The USB phy takes some time to reset, so make sure we give it to it. The delay length was taken from the 4x12 phy driver. This manifested in issues with the DWC2 driver since commit fe369e1826b3 ("usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.") where the endianness check would read the DWC ID as 0 due to the phy still resetting, resulting in the wrong endian mode being chosen. Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/BN6PR04MB06605D52502816E500683553A3D10@BN6PR04MB0660.namprd04.prod.outlook.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sasha Levin --- drivers/phy/samsung/phy-s5pv210-usb2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/phy/samsung/phy-s5pv210-usb2.c b/drivers/phy/samsung/phy-s5pv210-usb2.c index 56a5083fe6f94..32be62e498047 100644 --- a/drivers/phy/samsung/phy-s5pv210-usb2.c +++ b/drivers/phy/samsung/phy-s5pv210-usb2.c @@ -139,6 +139,10 @@ static void s5pv210_phy_pwr(struct samsung_usb2_phy_instance *inst, bool on) udelay(10); rst &= ~rstbits; writel(rst, drv->reg_phy + S5PV210_UPHYRST); + /* The following delay is necessary for the reset sequence to be + * completed + */ + udelay(80); } else { pwr = readl(drv->reg_phy + S5PV210_UPHYPWR); pwr |= phypwr; -- 2.25.1