Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1796405lqm; Fri, 3 May 2024 06:56:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIpDmfJs+FGYAJBuEGEoTTmFV9G8vm/5F1JCvYxr0NUhVpb+7ARJ9NqFpk8cAZqLhDjPjxFkeYBmGk7TgYc89rhgkaADFqBhGrT1z70w== X-Google-Smtp-Source: AGHT+IGkaX5+Kf6pqDLYpi6MOef/8LO5b54aQyQ96U54eR5HnLc51QVYRlwGMwP72HftF2Fc61Qj X-Received: by 2002:a05:6359:a3aa:b0:17e:89bb:e545 with SMTP id ky42-20020a056359a3aa00b0017e89bbe545mr2659580rwc.19.1714744615135; Fri, 03 May 2024 06:56:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714744615; cv=pass; d=google.com; s=arc-20160816; b=Xgctk4m8q1yEJsv9sbwFuJ4uk1pYkTiPcXEicyiq1PeErhe7dcWACD+X7cy/5lK02N E3w5mNBfgXvtW1wVAHA/mjdSaFQSUXXdMOYG6g3LJqjyQQJQwgN4e0qI5KQamqbMCuMQ yJ3PaSEt6HOrMOVHVmoyb5hzEOTk1JQm5WrQZXfqB8I/xdYKwdp/Kbx1IzSCnIZt7AaH kPNPwatJC3Pc2UNWPPt7ovBYLlJBrTRGEn7eBgaWyLaa7rlg6Axqe7jJ9+LHVJSC6XiF EVehfWSYXaTGAQFdsVYv/8WMUAEb+Oc3on5mXMfQxPm+EUQ7Od6eF9VaBIbzbDjaW4P6 VBgg== 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:to:from:dkim-signature; bh=ORf4L+Kc1pyBC8fE9YC0FQfG86LMRHTWb3C7SJM7A84=; fh=8CyT2LT2qKEFatPO/1LUij5jYLLJHzVnSg7WZQe4T0g=; b=zfjovt270LjnzdZl9KuF5k0GnyoQPiQ038s2EP22wOuM5KReyyF95ceUzxpp48ED1T uM0UulXfL4xrMWlkfTY6+6FtdFY7venIMNhXRm9pJtPIm49McRkqwbrXIvvWX6tVQ70T z4Zw1CtBumKaGTJCq4CiJnrqsyC6+HFzOA33BvTbl5C3v/N2LZ1tTvgdtZ3M4mIQ1qO3 mUtiBTnKmtwaHZ3GdgWE4Cfih8EEqhgkdZCN6yQFlIAg18oxZHzNyyEscdH7HI5SupCF fb2lFombz/uwABjaNs37xAAgl3rsRwdDlVpAIVW6xPBQoiLQ33nNwymEE/qgg/xc0W2Q 5NtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WxBbyXU3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-167733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q10-20020a63bc0a000000b0061f0118d27esi376363pge.743.2024.05.03.06.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 06:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WxBbyXU3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-167733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 B52262810D2 for ; Fri, 3 May 2024 13:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AEF8156649; Fri, 3 May 2024 13:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WxBbyXU3" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E224155348; Fri, 3 May 2024 13:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714744519; cv=none; b=MVqxoXfQetx1cLubukjfIkUn1kDQmNpUlLnGX6vafDJ1Znn4ejgXPNMUgksLvlj4+czOHxwMTtERZWBBeR9I4xd/WlTHmpAVJy2xkzOg9SDDcb1muDrTpJylRA881M4A1O/La0oN0RvShImhbvRsefeup8cebUqEpARPtlv5vps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714744519; c=relaxed/simple; bh=sv3bHJPSIAzAatSQs/bKdLt9FMtfOseslXyoRcccdI4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eolUDSrU3A7h0uT9BnwS2h3t8INp1PkfnEbSV2KNtnOSZpGk1zJj51V43HEIA0avPfPxamBTtUGQoBWjxJhTjWt3N48T5TqCxvZ3izRczQ944TcVPy/Vwzm72r3uPtYLbIt5RYBtRxmNLkxsRYqpOvShDBD1u+S/w/7VliidDPo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WxBbyXU3; arc=none smtp.client-ip=209.85.167.52 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 Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-51f300b318cso2189440e87.3; Fri, 03 May 2024 06:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714744516; x=1715349316; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ORf4L+Kc1pyBC8fE9YC0FQfG86LMRHTWb3C7SJM7A84=; b=WxBbyXU30hDbBrK4+XsGK7kl5XkJsHGLFWLrgLFfhiIuzrztIorEMiBPnYQ8FqJIwN 28ey8tqZvfBezT1urhrUK3/YK6oxecPc+9lzsnhhJHV+zHGxqKlnDGkW3uqI6TyELCAu U4UEs6kb9sgF0ys7t3LvFWOqqwXfMC2weTfLJiVcp9vM+6Hir6JznYy6IVURKMMh7vfW zcu/EIWa7HmlczyFOHtTBrmroWgYgNlY8cExlRtknrhtCHfe2vYynNIS4H1+Mn7NgwcH V1XWVokztOyjrOaNbJBsuECTugkQhxJZ1t1SQ0jZhRD+sKgYl34ysi3pZUPa4iBHzTnM vw1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714744516; x=1715349316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ORf4L+Kc1pyBC8fE9YC0FQfG86LMRHTWb3C7SJM7A84=; b=cxALVQF+TW+o6o8/M2B68Du+YBkMyovqh1+IXO4c6qDiLy/L02hykDWO6xUAM8A94H k7KxzDfelTLl+QqfAluWIX7dKb983EhmxMWnHkoyUz9l2V/SYszZPyeQFHeHflZ5CN6c pKJybIuvfHt4mgfCVZWd/f2KalxDRceuQesA0OjJbhqkX0rchlvRO2ngExg0KqJev12/ iyxXlrNWN8imm9wvnWDgNL5MEf9V2vsnpUsgVze/Th3eF0w+8NVCTiFsjju9L3qrknOv 6S2EzEbb8IP+WKpxppB77vUi0DWVE9//50MK/yn9EN3x5Ut1unNxCSACRP0QzkkpspNw mJbQ== X-Forwarded-Encrypted: i=1; AJvYcCXJHOm6BlgQakxsP/6F7dgxCsyyeC988Fen8puG32wG59f+xpa9IpjaVa8c/FgBWPGav0PENC6gPxRrSGR6kec3bTWRecOL99YTe6La3lwmzWKWYwVnE+Qfm8//5fWW3Rbzs3QPfYZGWFhEsHTBimwwMf5cAPsKxOsW8wbpmvIQDFZaYaY= X-Gm-Message-State: AOJu0YwwsismQJYl6r3G17j7G8rLmqjlk0TkyRYnfSwPdSobjRi7uhdY 04swak0Fj3dJyZ5gGi4gFT4qK4nt3a54e1DSjsk2PTW8eELIEaPV X-Received: by 2002:a05:6512:3c9b:b0:51d:b7fc:29a6 with SMTP id h27-20020a0565123c9b00b0051db7fc29a6mr2456632lfv.7.1714744516178; Fri, 03 May 2024 06:55:16 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id k8-20020a05600c1c8800b00418a6d62ad0sm9537339wms.34.2024.05.03.06.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 06:55:15 -0700 (PDT) From: Christian Marangi To: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Thomas Bogendoerfer , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Christian Marangi , =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Subject: [PATCH 6/6] mips: bmips: dma: drop redundant boot_cpu_type in arch_dma_sync Date: Fri, 3 May 2024 15:54:07 +0200 Message-ID: <20240503135455.966-8-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240503135455.966-1-ansuelsmth@gmail.com> References: <20240503135455.966-1-ansuelsmth@gmail.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 Drop redundant boot_cpu_type in arch_sync_dma_for_cpu_all. These needs to be parsed only once and we can make use of bmips_rac_flush_disable to disable RAC flush on unsupported CPU. Set this value in bmips_cpu_setup for unsupported CPU to skip this redundant check every time DMA needs to be synced. Signed-off-by: Christian Marangi --- arch/mips/bmips/dma.c | 5 ----- arch/mips/bmips/setup.c | 1 - arch/mips/include/asm/bmips.h | 1 + arch/mips/kernel/smp-bmips.c | 7 +++++++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/mips/bmips/dma.c b/arch/mips/bmips/dma.c index 799cc3e12fc3..e9af34f82dcd 100644 --- a/arch/mips/bmips/dma.c +++ b/arch/mips/bmips/dma.c @@ -11,11 +11,6 @@ void arch_sync_dma_for_cpu_all(void) { u32 cfg; - if (boot_cpu_type() != CPU_BMIPS3300 && - boot_cpu_type() != CPU_BMIPS4350 && - boot_cpu_type() != CPU_BMIPS4380) - return; - if (unlikely(bmips_rac_flush_disable)) return; diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c index bef84677248e..d27043b10405 100644 --- a/arch/mips/bmips/setup.c +++ b/arch/mips/bmips/setup.c @@ -40,7 +40,6 @@ * with "mips-cbr-reg" in the "cpus" node. */ void __iomem *bmips_cbr_addr; -extern bool bmips_rac_flush_disable; static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000; diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h index 3a1cdfddb987..4a48c8f1077e 100644 --- a/arch/mips/include/asm/bmips.h +++ b/arch/mips/include/asm/bmips.h @@ -82,6 +82,7 @@ extern char bmips_smp_int_vec[]; extern char bmips_smp_int_vec_end[]; extern void __iomem *bmips_cbr_addr; +extern bool bmips_rac_flush_disable; extern int bmips_smp_enabled; extern int bmips_cpu_offset; extern cpumask_t bmips_booted_mask; diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index 7bde6bbaa41f..63534af367c7 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c @@ -681,6 +681,13 @@ void bmips_cpu_setup(void) " or $8, $9\n" " .word 0x4088b008\n" /* mtc0 $8, $22, 8 */ : : : "$8", "$9"); + + /* Disable RAC flush as not supported */ + bmips_rac_flush_disable = true; break; + + default: + /* Disable RAC flush as not supported */ + bmips_rac_flush_disable = true; } } -- 2.43.0