Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp19398lqj; Wed, 10 Apr 2024 02:29:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9ZV+x0FNNvxOMsKD+uco5EtjqTm6nDIo5PxJqBu9aUYxtrx1Syj9z5IuE1Q/p4YviFez5klkCUMhBcXJNZqkHmMwM0xP1CZw711s8DA== X-Google-Smtp-Source: AGHT+IEBDQsLuVegh5Qu7EAzmH9aDeC9mTHYJr+b68pJO3wLsLs3oQNXv/pHcjKdmMmR6rue47MA X-Received: by 2002:a9d:3e4d:0:b0:6ea:2146:7909 with SMTP id h13-20020a9d3e4d000000b006ea21467909mr2666075otg.1.1712741353789; Wed, 10 Apr 2024 02:29:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712741353; cv=pass; d=google.com; s=arc-20160816; b=sSrjLYjpp2r5qZYWmpwqW5dGWPBe2C9zpElMNd3k/D5/b/S0hX1xn9gA24MAiMkSFs rkBV1wVO7I4vmfOEszjOF+vjJe5YyHl3vXgGV/EwJYwHqzmZ415KULe8vXFydSUQOB+i XgIoOsDRrAbrQJ/0xmZb5FpdkogKDRzl2kSB9bg025peuF/gJTgXT978VLmWCk2XQInO k4X+nMoeBGN1rUfBFVGNXJRl+XHTgm3Hbljhzdrlze3bQAaMLvit6CDEuJwu8smQKe9J WceBzVrmP2vEkdhIsbm4ieWByUrRJyTP61d7rDsv3TU1SPFHcvrJzvhnBsI1padGQrKS e7Jg== 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=eaFBJsc7lR8zizearUb7CEWMc3tEsTOW/jJ8EPF62+Zvsa3FYQqgio5rVycTfKcaoD IHfowo24lvimPSuCw1Sr5T1ZuozVSjNgms7QwG65PKrco2m3ioDWoUDXKs3zB99/ox6l rUdlraVkypirdWt6S8/xRQBMYfORbh395LkgV7mjkd7TO6Ov+lBFz3cNXf+Lnjsv1wwv zeMZbITBnO7SwO2h2oeRFzglag6J9EOJIj/T/BgG7TuBx0L9cA1PeaVr2gGO6LQxJJP/ KUArAIDxeMcbUj8OCq9CHtWgpYl/qXJpy9WWGrlniOI2tDZBrs2vBQJi05HdA2TIxShO cJQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=orLVkBQJ; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-138006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138006-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 207-20020a6300d8000000b005d80a51e1c0si10004002pga.851.2024.04.10.02.29.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@atomide.com header.s=25mailst header.b=orLVkBQJ; arc=pass (i=1 dkim=pass dkdomain=atomide.com); spf=pass (google.com: domain of linux-kernel+bounces-138006-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138006-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 525CE286617 for ; Wed, 10 Apr 2024 06:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00F6522085; Wed, 10 Apr 2024 06:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="orLVkBQJ" 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 A70132C853; Wed, 10 Apr 2024 06:40:45 +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=1712731247; cv=none; b=fk9vBJ6FHCpzfMyDJIaG8GFy83LFwxrIvQQ6r5dQB0P37hVrI6kAU6JPJJgiWgxJ6t//q7HAhgI4KHkyratBgPT4ifquKmkbOMBFq81BkpzSvidt/zOmoQorpWWq9nxIG5Hw/Vac/Z69r0m2oGpkjQqOGlU+zHxuGeibfAKJ9No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712731247; c=relaxed/simple; bh=wCs2Bbu3C6J2O1X3vXpkxYOKLXy+CaCvFD4nkCkciKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KssEc8OiieciaIuZvqac6WUQ7+NJlCaxaN1w50o0riauoSabY5yFsXgoyLjrQEo+jN+XU4jrmVp9k1nqb9I5MvJpA9c0nULvdh9XezoCKaS6hzwc3PlIXgLIGfGf/ORwTnpB3+6k1spjJy4wFJapLeKYITtywXfomVokWkvqeLA= 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=orLVkBQJ; 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 2F5896034B; Wed, 10 Apr 2024 06:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1712731244; bh=wCs2Bbu3C6J2O1X3vXpkxYOKLXy+CaCvFD4nkCkciKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=orLVkBQJfV+c+rBP/F3QSmmJmqSlU6ELvRrzvfbVlzQnKiRpHVIus0cBip4t6Gq9a gg06zQ6Es+P7PkJ/fSqbf7Lvy1xTzS331jAjDzLW79BfYR3HBDygliYDNlVPOfb5QA UoKciRsBNf+iMmB7NfHnQ0Hx61+i0omzfngzrpSYE5cn5tNXSnBTF2JYhuP+PtqRBN ZeXFwGNl5CNQ4FlCVGOSrzwulPG7LyAWGiD9Q4qoZj6rdY3AytWPXtMxOk+4q3F/dm 13mjgqdcTV7GWWGIc7HhzLIyIaW9CqpimNX3ZuiQS8Fa9W18OBEwxmb69rPAODzzfS c2q0cqXFtumGQ== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] bus: ti-sysc: Move check for no-reset-on-init Date: Wed, 10 Apr 2024 09:40:05 +0300 Message-ID: <20240410064010.57142-2-tony@atomide.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240410064010.57142-1-tony@atomide.com> References: <20240410064010.57142-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