Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp147619lqe; Wed, 27 Mar 2024 01:16:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVi1sOGT9TSmO2Hr+47TsW97utKfS+RTOTV15zgiJBYgVVLXp72QNTLWMyb2HTf2c8iGxzZBsD0Fpe7riCPHJrrBUxbSRycW5IqN4N7Sw== X-Google-Smtp-Source: AGHT+IHDWIar+mv/V2D3nzBQ53VKE7INjA5zmJIJvzT6M8DtbWNpn835pLKDe6v0By+YiW/HDOp/ X-Received: by 2002:a50:d758:0:b0:566:4a85:ceba with SMTP id i24-20020a50d758000000b005664a85cebamr1196691edj.1.1711527367813; Wed, 27 Mar 2024 01:16:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711527367; cv=pass; d=google.com; s=arc-20160816; b=DSuuFY5QWCUikrHZ8KN3w+Ee2Oz+Hq+V7g0JFw67st5KqvqY2O5WqVQ4l5pPrWRAzY i9ip3yHk0yX7Xt72c87vt/UKWf4Ol5tjM84T5j/3AItoWfI8TBdeRqY9tibOr+c9xx5d PVigogrBY1UjbHGpjdoAnK3ikiDDKw7cKGHmQUcBo6p0651hc2t2LuJx3XzCALuZ4lvl pA0g708c6QDbParn9FjMc2om88fBt3hu+ylVh9h+bTs9JH4yIo2RhdMRke3TzItzlBzs wXM4ghUWeSBRnEh3Q51t529gj5570EkAdbj0GSYE9rAvgbOvg1FwZGMAk2xgqdvLOWS2 WBIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZHBt7/UW9/oiui5hTdcuUNdJUHNKSazo/t+0vdveUaY=; fh=AhBBpAg3lh+I88+AkRWrI5Uf1UcuTYxs1zmDN5pI7xY=; b=l/JV8xDb3BUz6JP5Sfh9+JS20V4qA8HDOY+rN1YQBBcjVepWhRbYpUtM70aHKOJ/X+ 9iSef5NIH+gktwXHcYxjAgq7TiiDlezr7qZXp3YUYQiL2TkmCHBwEIDS1lCes/T4HwFR UK7hJ88ZroLgwmugjGL/PjIZJnR+9s1AS9Wv3MlUBv7lOk7g7xu/rnSBjZWikDSMYJT6 miXxXF5NuXrw8G68dngxwV2hK6IJ4BL6DTIOs4nBfgiy8MhBVWcuE8/6JzbAKghbuDaR BRU/13duG0Yk0QaeEAkxC4MtW6GBumVBSDKPxVLQDbYn3rL21aDzVHyF+D+o+s4LxBln +U3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=fBzIyneo; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-120512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120512-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j8-20020a05640211c800b0056c3771c31csi726093edw.131.2024.03.27.01.16.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 01:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=fBzIyneo; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-120512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120512-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8B7281F2AC76 for ; Wed, 27 Mar 2024 08:16:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C05182D604; Wed, 27 Mar 2024 08:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="fBzIyneo" Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B678339A8; Wed, 27 Mar 2024 08:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.50.62.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711527344; cv=none; b=cpwLvbx+CMwK3KcxUAkJz4JSNzaFvfcr3cGvBjDjTle6dmoTEq/x+wND8zNvQNQFqWrzEZvynGKEUH7ATgAL048MnPbgYGvTLPcmSdUn0dvGS2ii0EvuubyWjlumgc2YfabB8W4bPvjVs9kOHf7q3db2i2D8vfbyZ1W3/rrpi6s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711527344; c=relaxed/simple; bh=wCs2Bbu3C6J2O1X3vXpkxYOKLXy+CaCvFD4nkCkciKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PAUO8MNXKvusMaYnni7STOpKBU8YUSqpTeqdWUotC4CU9A+/LMrPMoqc4HxJd7ZtVIioT6uMimVmdam10IGFoiaQG+THhbnXfTvVeYD52JYPIIz1FlyZnnDxhoiYDUYIkSr9zeuwQHOYKlf9uUGvQ4YMMJ/oPT4tp/Bmfq2BwFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com; spf=fail smtp.mailfrom=atomide.com; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b=fBzIyneo; arc=none smtp.client-ip=74.50.62.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=atomide.com Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id F409B604C8; Wed, 27 Mar 2024 08:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1711527340; bh=wCs2Bbu3C6J2O1X3vXpkxYOKLXy+CaCvFD4nkCkciKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBzIyneoLfw5GjwkPSQRdG8ZsYygVNsJ6DkfWnX2j0QSW2pasesYCJ3cC8yWQa8TV O6vliLxiZnHT5pJB9TUqeRUDm0N34gs3KG8LdDtjA/L3aDBpKDL+FwDtkWW5spIu3x XFHyyx7bYgymaY3LnKAj1R7jd/20ptpzEtf6tx2ObvDHJW8TYGSSW+Ipmz15ElGJhB RhFMNYWZEACHe7R4bwopXvepxUUmUU2IJva0IofVYBbixQ5PgbuTzdfkutkkEScCuh 2F8yeWYaiN+fi39o2kLOsHC4Tv/7pWScoEyCydNBmel18DQmJI99RsEAA7d+hh2K22 eHlrQGj2OslrQ== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] bus: ti-sysc: Move check for no-reset-on-init Date: Wed, 27 Mar 2024 10:15:04 +0200 Message-ID: <20240327081508.36747-2-tony@atomide.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327081508.36747-1-tony@atomide.com> References: <20240327081508.36747-1-tony@atomide.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We are wrongly checking SYSC_QUIRK_NO_RESET_ON_INIT flag in sysc_reset(), it can be called also after init from sysc_reinit_module(). Let's fix the issue by moving the check to the init code. Fixes: 6a52bc2b81fa ("bus: ti-sysc: Add quirk handling for reset on re-init") Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -2145,8 +2145,7 @@ static int sysc_reset(struct sysc *ddata) sysc_offset = ddata->offsets[SYSC_SYSCONFIG]; if (ddata->legacy_mode || - ddata->cap->regbits->srst_shift < 0 || - ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) + ddata->cap->regbits->srst_shift < 0) return 0; sysc_mask = BIT(ddata->cap->regbits->srst_shift); @@ -2240,12 +2239,14 @@ static int sysc_init_module(struct sysc *ddata) goto err_main_clocks; } - error = sysc_reset(ddata); - if (error) - dev_err(ddata->dev, "Reset failed with %d\n", error); + if (!(ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)) { + error = sysc_reset(ddata); + if (error) + dev_err(ddata->dev, "Reset failed with %d\n", error); - if (error && !ddata->legacy_mode) - sysc_disable_module(ddata->dev); + if (error && !ddata->legacy_mode) + sysc_disable_module(ddata->dev); + } err_main_clocks: if (error) -- 2.44.0