From patchwork Wed Apr 10 06:40:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 787814 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="orLVkBQJ" 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-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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) From patchwork Wed Apr 10 06:40:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 788186 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 C834F29CEE; Wed, 10 Apr 2024 06:40:55 +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=1712731257; cv=none; b=VQIH9Hr2l5YEOxZSWlwXSQ3gtrIX16vq7E1eBbemEcZ0uBNhFceIHBzAlp+KiO0attYkxNN5SZovmund6T7Q02Tv33QHRyJogMEfoGoTTDRgLEhFwOHD+frpKK0z4tfIwv4qFihxCnGSusZ3BOB7ecHYLb8rPhBqwxAks6sjJ0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712731257; c=relaxed/simple; bh=7hYUrnoWxpf8qalg/aAuLUeCZM0W4vumG3VPC7KziA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S6M6ag3ZqnPo3yy+ERIM+CVYT3suOdSCQSYvSXgk26+Aqt1m9N3h2CXNZOt0Za+7QgHCzew1wfdiSU2JshzzmL1pwKcH7+0zf4ETQ0HPCoASxzB+oLnbBfSGnYWVp5kRu4ptorsdsVOaqzOfIlFAumOJZsYXG7y+4DIlsMVMF+Y= 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=aOwoZ8q9; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="aOwoZ8q9" Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id A040D6034B; Wed, 10 Apr 2024 06:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1712731255; bh=7hYUrnoWxpf8qalg/aAuLUeCZM0W4vumG3VPC7KziA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aOwoZ8q9uWshMlHmTFTTwwSbCXrfI82u20Y1P3npst9j7ymKrpAHUverjhSaFmMix Y71kgypRVDxjclybZN9FQVsMQJOojemS4YyavBySedBCbg4u8Cf/MKCZ7NrnJMty36 tcayCH1Yfyx3P98jUh9YIPUJq2XxlwHHWllSIxht8BK/BuRfY5CpI96Z6rLBLIJRQF D7jAfhUijKlj7rs3pYpTVAuwMP84EVnr4FTd0bxUqkFo7Rhod+S4mmfZtzFZwLz2cT hi2P84BE/Z+YaAMOiQhN+Zry7Ty30xXFBZa02mjAlc2OXcbnDyQ+fKJtmQNgAlM52y smmBW3/BcpUqg== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] bus: ti-sysc: Add a description and copyrights Date: Wed, 10 Apr 2024 09:40:06 +0300 Message-ID: <20240410064010.57142-3-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-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The ti-sysc driver is missing coprights and description, let's add those. Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 @@ -1,6 +1,17 @@ // SPDX-License-Identifier: GPL-2.0 /* * ti-sysc.c - Texas Instruments sysc interconnect target driver + * + * TI SoCs have an interconnect target wrapper IP for many devices. The wrapper + * IP manages clock gating, resets, and PM capabilities for the connected devices. + * + * Copyright (C) 2017-2024 Texas Instruments Incorporated - https://www.ti.com/ + * + * Many features are based on the earlier omap_hwmod arch code with thanks to all + * the people who developed and debugged the code over the years: + * + * Copyright (C) 2009-2011 Nokia Corporation + * Copyright (C) 2011-2021 Texas Instruments Incorporated - https://www.ti.com/ */ #include From patchwork Wed Apr 10 06:40:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 787813 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 730F3383AE; Wed, 10 Apr 2024 06:41:06 +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=1712731267; cv=none; b=pkObeI7OpZDCV/UyUYgOxvEuF1u1MpoRpvhCmWsUOtXBQ8zYpxrembQ1Ew7QK+CETPOyzwDYaXM48kKZ0Z480LmqLgi3PYWLhOrqYeVwSyXKtWkZNHWe+G9Ha3wxvnuErzboZSOruvQ+FKnXpj/ABlw+EwarD5uwxy8jjn2LZvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712731267; c=relaxed/simple; bh=0nz944gsPunaEY0WbXrcZZChPstAF/Sym3EL2KX9RZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jI1IPE69e0ef5GQuKm/fjaD962NbplYrGKJhi77Ox5FIeeYsZiioUvygwJegFOZkS4/b1BWHwPwwDI0mkDcHNs5/q3MWLRhUDYVn2aEwZgvIOpnEMMurM9/Yc8B5LNIursQ8PXOHEW+l8JGB+AUEjqxC9E00qTYYt8zppzUFvjE= 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=Iq1/6OHu; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="Iq1/6OHu" Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 1F1806034B; Wed, 10 Apr 2024 06:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1712731265; bh=0nz944gsPunaEY0WbXrcZZChPstAF/Sym3EL2KX9RZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iq1/6OHu4/+HyEuowU+W+/qcXh13w2bFxc8NgZQcu3Sy4AK7lv8z3aYx76S1QFNno 1AB0TwYB3p+GzEmGRqqJQOV+jCnVLaLCIgYxyy7l6ce2nid54n/iV3MS+EPvodBFCl nLx9awSUFIKNhGYvEVgivFqwzA2l2qTh79Rgw0PIQyje5h6fe/BqNrNJPat60SFql0 IVx93JS0T+L8hbQQppa0GYMBH6XeyAY+PHpUQginN2i0l01PZpXv4lu/eNziZpZNB+ ZnAu1yyQOF7tTpnftruyiFPZi1EoZ8DaB5J/rKj+4dDtydhs92ZykkzVQEkKsuDsog xFEQA9vxC8KrA== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] bus: ti-sysc: Drop legacy quirk handling for uarts Date: Wed, 10 Apr 2024 09:40:07 +0300 Message-ID: <20240410064010.57142-4-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-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With the 8250_omap and omap-serial drivers no longer relying on the use of pm_runtime_irq_safe(), we can finally drop the related legacy quirk handling for uarts. Signed-off-by: Tony Lindgren Reviewed-by: Dhruva Gole --- drivers/bus/ti-sysc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 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 @@ -1540,19 +1540,6 @@ struct sysc_revision_quirk { } static const struct sysc_revision_quirk sysc_revision_quirks[] = { - /* These drivers need to be fixed to not use pm_runtime_irq_safe() */ - SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff, - SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), - SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, - SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), - /* Uarts on omap4 and later */ - SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff, - SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), - SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff, - SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), - SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47424e03, 0xffffffff, - SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), - /* Quirks that need to be set based on the module address */ SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff, SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT | @@ -1610,6 +1597,17 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), SYSC_QUIRK("sata", 0, 0xfc, 0x1100, -ENODEV, 0x5e412000, 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff, + SYSC_QUIRK_SWSUP_SIDLE_ACT), + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, + SYSC_QUIRK_SWSUP_SIDLE_ACT), + /* Uarts on omap4 and later */ + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff, + SYSC_QUIRK_SWSUP_SIDLE_ACT), + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff, + SYSC_QUIRK_SWSUP_SIDLE_ACT), + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47424e03, 0xffffffff, + SYSC_QUIRK_SWSUP_SIDLE_ACT), SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff, From patchwork Wed Apr 10 06:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 788185 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 1863139FF7; Wed, 10 Apr 2024 06:41:16 +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=1712731278; cv=none; b=eH75i2Gdr/ZuTLh2slTgR1NHpYwY76jt4/mWa6LFXUDp6hIMPTigwYYwqyu3b5MDnk9bN+imSZyS5Egw5dFbRD1smjXookAK9j5bSKXjPWoTc3raRc2k9vxUhoswLYAEkHPinupjg/nkFM1Su2ZLGrUKGca3E8rjP2S+9pIkFK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712731278; c=relaxed/simple; bh=YjYH50vrqQM3j2i9OBrQHvAxKdE+aBtGBhlx9HJrVR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sovUwSAKVnld+DU8vqMtvTAtcqiSeYk6UGTgJnsTVEJRxtLLBS5EQE4F6NPCKZwoviZaWqwpQMWwhjDK4A7tEOJu/PjHBop9OKZLrUlr71rnKLqS9Bxe3VUo6rTH6BlBwSde0mjoPhpEEriy8uvMjvmp/JMBpUFoTwGhNh4k/AI= 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=jvGhVEDR; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="jvGhVEDR" Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 950956034B; Wed, 10 Apr 2024 06:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1712731276; bh=YjYH50vrqQM3j2i9OBrQHvAxKdE+aBtGBhlx9HJrVR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jvGhVEDRIUhrafCSJrDR2Dsmc3/6Erbss1LBdNhG4tpqGyknPVVfeA40Df81qLawJ ZHomXeTm9Uj5oH01KxF30WVzF4IVY4E6HeYrrYllwnEdI0w5wG4UPM9Hydrr6j5Cmd 7CIwbYxX8L8MyAXAuhfo53s5Xs/f3ZzVbtnQhxBwr570TuCQ/CP9SLUTJaBrkP1k8G TJAF6jIb4sEsBRJlQApci0p1QKIRD/WH6tSP1ZPMyqzC7NJZPEmhNwdbyIQvLBdCaJ j4d61+MscavKh009kGHyGuBt50ojrm2ZYdZkWwgwJJ0ktZF3sx8gGUuKVpMA2Jbcbh 71bvF49yAJPqg== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] bus: ti-sysc: Drop legacy quirk handling for smartreflex Date: Wed, 10 Apr 2024 09:40:08 +0300 Message-ID: <20240410064010.57142-5-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-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With the smartreflex driver no longer relying on the use of pm_runtime_irq_safe(), we can finally drop the related legacy quirk handling. Reviewed-by: Dhruva Gole Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 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 @@ -2869,8 +2869,7 @@ static const struct sysc_capabilities sysc_34xx_sr = { .type = TI_SYSC_OMAP34XX_SR, .sysc_mask = SYSC_OMAP2_CLOCKACTIVITY, .regbits = &sysc_regbits_omap34xx_sr, - .mod_quirks = SYSC_QUIRK_USE_CLOCKACT | SYSC_QUIRK_UNCACHED | - SYSC_QUIRK_LEGACY_IDLE, + .mod_quirks = SYSC_QUIRK_USE_CLOCKACT | SYSC_QUIRK_UNCACHED, }; /* @@ -2891,13 +2890,12 @@ static const struct sysc_capabilities sysc_36xx_sr = { .type = TI_SYSC_OMAP36XX_SR, .sysc_mask = SYSC_OMAP3_SR_ENAWAKEUP, .regbits = &sysc_regbits_omap36xx_sr, - .mod_quirks = SYSC_QUIRK_UNCACHED | SYSC_QUIRK_LEGACY_IDLE, + .mod_quirks = SYSC_QUIRK_UNCACHED, }; static const struct sysc_capabilities sysc_omap4_sr = { .type = TI_SYSC_OMAP4_SR, .regbits = &sysc_regbits_omap36xx_sr, - .mod_quirks = SYSC_QUIRK_LEGACY_IDLE, }; /* From patchwork Wed Apr 10 06:40:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 787812 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 762303A1B5; Wed, 10 Apr 2024 06:41:27 +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=1712731289; cv=none; b=IE7gYvQ57PkX8uR7nvMZwVsbmVJAkRDpsDPs09PQksDPEYwv09hNXnVuDiv8lEdi9h5h2MnFzjE1g+SGoa0j6BYg+ItfA8JUahr826nAOBQ0/O7VUQ9JXpzmvuPH/BzkvbmoDnhkZ+ehN/YoY7c6JDj6eXoy3AgK+fEfcHOZ1to= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712731289; c=relaxed/simple; bh=8bGZqPY7HaCj+eCY7bxYO4nE9VKSXNZpeySHbLtdy9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E7KgorsQB2g97Hr9zOR3AOXeMYRvBqCM0DGU8je106jEQwmRUdJF5jS6aCuhF8OsRrKlLo1UgTdExOO4Dacj56/J+Gf/xcWcdPN9D6GyrdMi1jlc3tW9Pc0fD27v3IaYTaRsKdB3Zlfg9Wxz+oWvr5gzPbnO4oax2ggn3KQKLdg= 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=FrJkEGEf; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="FrJkEGEf" Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 0F6116034B; Wed, 10 Apr 2024 06:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1712731286; bh=8bGZqPY7HaCj+eCY7bxYO4nE9VKSXNZpeySHbLtdy9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FrJkEGEfDNekjel8w+hiZvzQP8wl3K0pTBiYikgZFJ8nRrLcwGxlgwg1BOJhYx/5m 1ds1xBDXOIo8X2+FkR1k/quydNaViOvuq5n43xlp7qVURxrkGo5azeQHcJyQA3vHqs up/rj9Vnmk694VrVGwC5AWUUTRU8acptAXWhUiFzzlXNZdZRn+j93XzGdhJhb2dwuZ mMvv0YvWvY4cp8ZMuqxWWdSa+Ups5mLGS0c4OslfBC6BUQSgUfvcavVp+9ajTSg1p0 LDqcgXSktbmClwwlKrQlkJ/MivrYGZ6awbM6zr9OH7Wn3020i/F7m1/5PMHNjmaCwI ZtGKZFC7j5mog== From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dhruva Gole , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] bus: ti-sysc: Drop legacy idle quirk handling Date: Wed, 10 Apr 2024 09:40:09 +0300 Message-ID: <20240410064010.57142-6-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-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are no more users that need the legacy idle quirk so let's drop the legacy idle quirk handling. This simplifies the PM code to just sysc_pm_ops with unified handling for all the interconnect targets. Reviewed-by: Dhruva Gole Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 109 +------------------------- include/linux/platform_data/ti-sysc.h | 1 - 2 files changed, 2 insertions(+), 108 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 @@ -1469,8 +1469,7 @@ static int __maybe_unused sysc_noirq_suspend(struct device *dev) ddata = dev_get_drvdata(dev); - if (ddata->cfg.quirks & - (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE)) + if (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE) return 0; if (!ddata->enabled) @@ -1488,8 +1487,7 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev) ddata = dev_get_drvdata(dev); - if (ddata->cfg.quirks & - (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE)) + if (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE) return 0; if (ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME) { @@ -2457,89 +2455,6 @@ static int __maybe_unused sysc_child_runtime_resume(struct device *dev) return pm_generic_runtime_resume(dev); } -#ifdef CONFIG_PM_SLEEP -static int sysc_child_suspend_noirq(struct device *dev) -{ - struct sysc *ddata; - int error; - - ddata = sysc_child_to_parent(dev); - - dev_dbg(ddata->dev, "%s %s\n", __func__, - ddata->name ? ddata->name : ""); - - error = pm_generic_suspend_noirq(dev); - if (error) { - dev_err(dev, "%s error at %i: %i\n", - __func__, __LINE__, error); - - return error; - } - - if (!pm_runtime_status_suspended(dev)) { - error = pm_generic_runtime_suspend(dev); - if (error) { - dev_dbg(dev, "%s busy at %i: %i\n", - __func__, __LINE__, error); - - return 0; - } - - error = sysc_runtime_suspend(ddata->dev); - if (error) { - dev_err(dev, "%s error at %i: %i\n", - __func__, __LINE__, error); - - return error; - } - - ddata->child_needs_resume = true; - } - - return 0; -} - -static int sysc_child_resume_noirq(struct device *dev) -{ - struct sysc *ddata; - int error; - - ddata = sysc_child_to_parent(dev); - - dev_dbg(ddata->dev, "%s %s\n", __func__, - ddata->name ? ddata->name : ""); - - if (ddata->child_needs_resume) { - ddata->child_needs_resume = false; - - error = sysc_runtime_resume(ddata->dev); - if (error) - dev_err(ddata->dev, - "%s runtime resume error: %i\n", - __func__, error); - - error = pm_generic_runtime_resume(dev); - if (error) - dev_err(ddata->dev, - "%s generic runtime resume: %i\n", - __func__, error); - } - - return pm_generic_resume_noirq(dev); -} -#endif - -static struct dev_pm_domain sysc_child_pm_domain = { - .ops = { - SET_RUNTIME_PM_OPS(sysc_child_runtime_suspend, - sysc_child_runtime_resume, - NULL) - USE_PLATFORM_PM_SLEEP_OPS - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sysc_child_suspend_noirq, - sysc_child_resume_noirq) - } -}; - /* Caller needs to take list_lock if ever used outside of cpu_pm */ static void sysc_reinit_modules(struct sysc_soc_info *soc) { @@ -2610,25 +2525,6 @@ static void sysc_add_restored(struct sysc *ddata) mutex_unlock(&sysc_soc->list_lock); } -/** - * sysc_legacy_idle_quirk - handle children in omap_device compatible way - * @ddata: device driver data - * @child: child device driver - * - * Allow idle for child devices as done with _od_runtime_suspend(). - * Otherwise many child devices will not idle because of the permanent - * parent usecount set in pm_runtime_irq_safe(). - * - * Note that the long term solution is to just modify the child device - * drivers to not set pm_runtime_irq_safe() and then this can be just - * dropped. - */ -static void sysc_legacy_idle_quirk(struct sysc *ddata, struct device *child) -{ - if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE) - dev_pm_domain_set(child, &sysc_child_pm_domain); -} - static int sysc_notifier_call(struct notifier_block *nb, unsigned long event, void *device) { @@ -2645,7 +2541,6 @@ static int sysc_notifier_call(struct notifier_block *nb, error = sysc_child_add_clocks(ddata, dev); if (error) return error; - sysc_legacy_idle_quirk(ddata, dev); break; default: break; diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h @@ -71,7 +71,6 @@ struct sysc_regbits { #define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12) #define SYSC_QUIRK_SWSUP_SIDLE BIT(11) #define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10) -#define SYSC_QUIRK_LEGACY_IDLE BIT(9) #define SYSC_QUIRK_RESET_STATUS BIT(8) #define SYSC_QUIRK_NO_IDLE BIT(7) #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)