Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp405345pxu; Tue, 1 Dec 2020 14:26:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyC3st3ilYvlZnEVlnoGonzBVqy6CXzltsZo4oiAwUQFUpUTi+s+ere4nXEq35EyRUzfD03 X-Received: by 2002:a17:906:dd3:: with SMTP id p19mr5109493eji.221.1606861568465; Tue, 01 Dec 2020 14:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861568; cv=none; d=google.com; s=arc-20160816; b=cWSK81flHueEvEadOXQayytGBc1EK3aEh+tOYGq7CQUyXa86TDoxx3eQK3d+j9Zqn3 s5cDUiUFpWD9WmH+3uwPr9uOkUAx7pdRX0HY7N4SZRDEpyL3FWkw/rMW38Tc3tC/v4CN v/HFHnK2wcCgIdSslfa2/T2CoH1iH9PI4BMoHhVrF1F3cVNKBG8Xy26rgAtCIfVn5ncv /u+tKnvkFg3JsneP2L4aMa5d1PFqeE+Mso66A/nFFxnqb9wgZDdW7+/yxJpzBjqOYvFf o2ARZ3OQY/CPHFya997tIHlBLKYVdSL9R+J6Ih7zTl5y7ojb2vD0oUk3NYMPR889+ZAZ D4lw== 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=KVtsZXChTYaZiuPdbU2pCTI3uE1c/4vvu9wps8i7zPk=; b=UTS2tw00ITFppGSL9dZLGRlvgIOkD2kHsF3b9/1X543P6vnrcQuz6uE/OjN35LiyYu XcKxTj4RmRaY6JB3w8qeVVZ8/LwFw5QqzHGTCxaapml5zcnCMFosA3UOx+L7b9fONIjz Z5UFg5AG/iqFIXBm2J5g3uAQ6MmqYrBUdVmQuBrKBXosRhhxcHgjdWkxCORYrjGDtqom oRhD1qIVCBTG14YR/Sf4Q2JJ/ltA8B+uY+QWibgrKk9qV58+vu4mnRd7Zw0t1NBlDMcs mORZM37wgWd6heipfkJo4dAl05x142xm0LoA5Y0ImHPcfpMPnRrEck7BwcMRWhMK3tx9 M95Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r7p4JV0e; 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 e12si797150eje.644.2020.12.01.14.25.45; Tue, 01 Dec 2020 14:26:08 -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=r7p4JV0e; 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 S2389797AbgLAJLC (ORCPT + 99 others); Tue, 1 Dec 2020 04:11:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:48652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389778AbgLAJK5 (ORCPT ); Tue, 1 Dec 2020 04:10:57 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ACAAE21D46; Tue, 1 Dec 2020 09:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813817; bh=1N/kMEsmNUOC9sFU82OMtdArer2/NIxIU2mCVNUY8Is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r7p4JV0epX9QcTJ8Af/abT0YuqB2eVisynD3TpAbrpPcOXrE4D09uxqqSbjS+YG4r CFXQzdKjpe2PFobyYLFoV8Kcl6XIZlJnUjW2hEOOCWXVbB04iMwvu9+xdJpw/CfatZ 4svfAde5sSIOhYzQHOV0BLvvbqhdzPYbaHwJLTC0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Lindgren , Sasha Levin Subject: [PATCH 5.9 069/152] bus: ti-sysc: Fix reset status check for modules with quirks Date: Tue, 1 Dec 2020 09:53:04 +0100 Message-Id: <20201201084720.975693420@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 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: Tony Lindgren [ Upstream commit e275d2109cdaea8b4554b9eb8a828bdb8f8ba068 ] Commit d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit") started showing a "OCP softreset timed out" warning on enable if the interconnect target module is not out of reset. This caused the warning to be often triggered for i2c and hdq while the devices are working properly. Turns out that some interconnect target modules seem to have an unusable reset status bits unless the module specific reset quirks are activated. Let's just skip the reset status check for those modules as we only want to activate the reset quirks when doing a reset, and not on enable. This way we don't see the bogus "OCP softreset timed out" warnings during boot. Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit") Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- drivers/bus/ti-sysc.c | 24 +++++++++++++++--------- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index efb088df12766..88a751c11677b 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -970,9 +970,15 @@ static int sysc_enable_module(struct device *dev) return error; } } - error = sysc_wait_softreset(ddata); - if (error) - dev_warn(ddata->dev, "OCP softreset timed out\n"); + /* + * Some modules like i2c and hdq1w have unusable reset status unless + * the module reset quirk is enabled. Skip status check on enable. + */ + if (!(ddata->cfg.quirks & SYSC_MODULE_QUIRK_ENA_RESETDONE)) { + error = sysc_wait_softreset(ddata); + if (error) + dev_warn(ddata->dev, "OCP softreset timed out\n"); + } if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) sysc_disable_opt_clocks(ddata); @@ -1373,17 +1379,17 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50030200, 0xffffffff, SYSC_QUIRK_OPT_CLKS_NEEDED), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff, - SYSC_MODULE_QUIRK_HDQ1W), + SYSC_MODULE_QUIRK_HDQ1W | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff, - SYSC_MODULE_QUIRK_HDQ1W), + SYSC_MODULE_QUIRK_HDQ1W | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000036, 0x000000ff, - SYSC_MODULE_QUIRK_I2C), + SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x0000003c, 0x000000ff, - SYSC_MODULE_QUIRK_I2C), + SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("i2c", 0, 0, 0x20, 0x10, 0x00000040, 0x000000ff, - SYSC_MODULE_QUIRK_I2C), + SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0, - SYSC_MODULE_QUIRK_I2C), + SYSC_MODULE_QUIRK_I2C | SYSC_MODULE_QUIRK_ENA_RESETDONE), SYSC_QUIRK("gpu", 0x50000000, 0x14, -ENODEV, -ENODEV, 0x00010201, 0xffffffff, 0), SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff, SYSC_MODULE_QUIRK_SGX), diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h index c59999ce044e5..240dce553a0bd 100644 --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h @@ -50,6 +50,7 @@ struct sysc_regbits { s8 emufree_shift; }; +#define SYSC_MODULE_QUIRK_ENA_RESETDONE BIT(25) #define SYSC_MODULE_QUIRK_PRUSS BIT(24) #define SYSC_MODULE_QUIRK_DSS_RESET BIT(23) #define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22) -- 2.27.0