From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794274613; b=g27LHZoaLkHL/YVPxhfxEq6K9TSyLtPKIOnP3kyvJDrvMFIl+hfABTl3wnoeeeoflIlD mIHe3bemvVGMgtxoXaxhp7CjIzBjfoU7nCY6/iMZBcCuilgy1U9+M09gNZZZ2z7pMv5Jo CMOaiOi3ERPtk24Qqib4wEVDbXDL/eMH8+FL64Oh0VbgGsbLpK2R5fRQ+dfKI2qAuRAkL jAbgBWzAv2/1VnKXWw9fwN7z1nynwfom2KI8t8h89FpuJQLFyvA57BbEfeFCODMoE3su7 tU6vVc9NeEAuOVgBHLsK1eKTfgIs0fue6rqx4oPuDU5crjA1G1TqHErbhtJPvT/V3Ng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794274613; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=KBXunWp616box3X7V9vV93MSQlhAq0/quw4oecuKOn4=; b=iC9ssZasbUY0nUI3+1YX2eKOUSwY7EGY6ArvU05Rc1odCv01Vy2m6FZ+JjFyRlyc7Gyl fIY8+UGJwlktpWyRslEjp1wC5uBw9h7biMY6vd+SxiV8oZdUg3rBkPv49aANifCfuV75Y o7o99XY1Dyr8pqowSxunvgNYiHZtlh5zIfX/ux9yePjJBc2fk6R+pDDsIRwmwOUGIGJcz m5WHte64s/YvA0Ac6K09VoTDcGLG8vSIQyQgovsEZD/o/k8cTM8FdIn67LZIpdbTIIAo4 MtdqYsLosdBWNPDBke0ood9hBSzp0MOT12ysoeAYQJxceeajzhwVkZYJGKCxkUEIMEA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YXmwP+KM; arc=none smtp.remote-ip=209.85.214.180 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76DE0606A32A for ; Tue, 10 Nov 2026 01:36:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 76DE0606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YXmwP+KM Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2ed1e9ae5a8so4868435ad.1 for ; Mon, 09 Nov 2026 17:36:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794274613; x=1794879413; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KBXunWp616box3X7V9vV93MSQlhAq0/quw4oecuKOn4=; b=YXmwP+KMjfg8Y+ppgBOIkepUy5vUlFl0hR8P/EkAHp47RMYvYcnIPP1cYSzJUvfFaG fa6vOok7/0ZKJ7oxI9jLyyGCaTbdn3xjgBjwuSpA0K2Vwj4MkX4/zee9AQquncJeaNjM PgDhHsxojGiStVqXSXYk+hhAFTLwXQeJ1ZOOIrcX2k1O7Xw6mS0tAUXDyUByid89Ciie 34PGtCLgF4xuojkI1iBeWFhx4pHn9M6gyI5QkwFv+u69AaYpH/cZqgW9gL8Wj9DL/5BZ ZCbidCDfgtiBcS2sPxHdmbQfJbgvCpk2sQlRvfPJq1V6q+FOzU0+/MhB2y+FUsslk20R 5yhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794274613; x=1794879413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=KBXunWp616box3X7V9vV93MSQlhAq0/quw4oecuKOn4=; b=DoXIjdWy6HXYFoR6Ab4ZcWy/Ug3E1Ey0lfpsSAvHignrumczhKChqAS0hKtUu8PxEb BbsKSmcgsOzmYZhQ+AHchxPh2TaAgN5/lpuVLyMrrQIAQsW7D2/mQS7/lkPCZb1YOV2I CzEUrLfyJxEaVrC+LjZz1Ikabu0+QU27AnYK2fkrHeHqiuWj65eIb6RVkszJnh6Yun3O aFRnHVtn/pN8WfhI6gl97FDx9B06PXf3axD7qPjD7uVoQxU3B8Z7FdbzvozKkYhtuAkD +eztPNx5o8pQ0fI5FcXcWlB3XalRQV1crFIBkQAJImIXM297Vt/0F9B8THJRyf9dchRB yR0g== X-Forwarded-Encrypted: i=1; AL+hErG01weowQHOC71Qc6ASH4Wbgrhbk0HJz/a3DeRrw7HUziGRsDbV4TF7i5m2p1amT8vjIsZmNHAPnHoX@vger.kernel.org X-Gm-Message-State: APuU4Z/sVDZT8IquDS36vpF1po2D4eTERiLpLnpWAEdp24IwSfkLCyuh GLuaoGIC72oQCdxN6T/fqS1Wbp/soD2EMyiuHOt/ifo/5g7+jVwwnQgS X-Gm-Gg: AYBFou3/4cl3jAQOnAzRyrrGjgjEhTWKnqKLTzxjrc0Ym/Mw48kBOAJXc/p1KljX97N hgy/7kmgn5HIPO76WEpB8yyUGX+zoj1xfyAYmQ2CrN46dL18HmKJRasOJ6wuxkVdFEHqS+0Qsdy lsCY0Jc+36iGtkVDrH1auUaFd8+YosodNp3GZE4h/13pocu1Q5nGGm/TmWPygfMqrDm0WnVD4VX 9ReCLQFw9B8MpbVtgOMDZ9aJ4/kll0ZcI8BP0nLlp1/ngLJZ6bdOomR8b1J/5Aj++FVFXSfS+tw 8KyvOjmsAv0UftJo6WyojkjPYOpqPwaznl+STAQVC6lF5wIIVuioEuxpc279MD5VbzGrikdEu8F 1JfV3JIqVSDWs5Kz5FPLG2YfP4nfY0vSHlzSaUE/har1A2RjNbyXjAb0vxrVXW4q7aAAaa5VUns nP89g+8A5pjEjYAUyQaGrPrTVQ5NHcJth6LHUvKrb6PlR+PNw5G/L9w27hz095OLGMUV/zOGPN1 W4zFib6VnUFrY42cGY09JSU0ptmITM5cBn/EILGMgHNJbtqGbZWqbA5q+uoPSN7tb8WQvUtEZT0 6D3zLOY3UxWmS3879EZPc1pptq9iRxReUshHWfhQl0G3gGL3czG8Ye0Xs5B9z+iiv6fK4itbehV QsgxUjOx2tPUuqYpY1DlES7pYZI47gPtGjOAiNbu2c8GkLU6ZRuBen0AgspnZpL1w4fe7rNp97z JwzQ== X-Received: by 2002:a17:903:4683:b0:2e6:2868:e576 with SMTP id d9443c01a7336-2edb91c7094mr9718735ad.31.1794274612794; Mon, 09 Nov 2026 17:36:52 -0800 (PST) Received: from ryzen.lan ([2601:644:8000:37f::e34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2edb6d9efd6sm3399055ad.50.2026.11.09.17.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 17:36:51 -0800 (PST) From: Rosen Penev To: Thomas Bogendoerfer , Stephen Boyd , Brian Masney , Jerome Brunet , Alban Bedel , Antony Pavlov , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/6] MIPS: ath79: apply the QCA956x timer workaround in setup Date: Mon, 9 Nov 2026 17:36:41 -0800 Message-ID: <20261110013646.1582970-2-rosenp@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261110013646.1582970-1-rosenp@gmail.com> References: <20261110013646.1582970-1-rosenp@gmail.com> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit qca956x_clocks_init() enables the MIPS timer interrupt in the misc interrupt controller, which QCA956x needs before the clocks are set up, or there are no jiffies. That has nothing to do with the clocks, and it ties the clock code to ath79_reset_base. Do it in plat_time_init() right before of_clk_init() instead, which runs the clock setup. The order is the same. TP9343 boards use the QCA956x PLL and took this path too, so check for both. Signed-off-by: Rosen Penev --- arch/mips/ath79/clock.c | 10 ---------- arch/mips/ath79/setup.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index 050f6553f398..8c5eaa4ab6e0 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -523,16 +523,6 @@ static void __init qca956x_clocks_init(void __iomem *pll_base) u32 cpu_pll, ddr_pll; u32 bootstrap; - /* - * QCA956x timer init workaround has to be applied right before setting - * up the clock. Else, there will be no jiffies - */ - u32 misc; - - misc = ath79_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE); - misc |= MISC_INT_MIPS_SI_TIMERINT_MASK; - ath79_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, misc); - bootstrap = ath79_reset_rr(QCA956X_RESET_REG_BOOTSTRAP); if (bootstrap & QCA956X_BOOTSTRAP_REF_CLK_40) ref_rate = 40 * 1000 * 1000; diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c index 4e18cdcf65a0..d9e1cc77ad04 100644 --- a/arch/mips/ath79/setup.c +++ b/arch/mips/ath79/setup.c @@ -241,6 +241,19 @@ void __init plat_time_init(void) struct clk *clk; unsigned long cpu_clk_rate; + /* + * QCA956x needs the MIPS timer interrupt enabled in the misc + * interrupt controller before the clocks are set up, or there are + * no jiffies. + */ + if (soc_is_qca956x() || soc_is_tp9343()) { + u32 misc; + + misc = ath79_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE); + misc |= MISC_INT_MIPS_SI_TIMERINT_MASK; + ath79_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, misc); + } + of_clk_init(NULL); np = of_get_cpu_node(0, NULL); -- 2.56.0