Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp281733lqp; Tue, 11 Jun 2024 04:38:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5kJexB6C1bwewr8zvVO8KhuuGL4aDkQkOB3vi4FbEMgRWyeXEKh+vXNzAWWNQsqUAw5SG5rV5mEA4/MxnQ/sc/7x8he6G0941hccBOA== X-Google-Smtp-Source: AGHT+IG+IgX/e8tDKvYjkmnEOBTFmSim5gbDOrmARpBuMPRNiujw4C8ZQQI3IM+rv8D8sNJYVE11 X-Received: by 2002:a2e:8496:0:b0:2ea:e3b4:d50d with SMTP id 38308e7fff4ca-2eae3b4d6a6mr67334121fa.27.1718105916253; Tue, 11 Jun 2024 04:38:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718105916; cv=pass; d=google.com; s=arc-20160816; b=z3YYEbsdA3eDWrnRxAybgG5R52YEarUUfsRKtFvBC8/7+hLedjDWtMg8alrgiP2H9N eIIwjTCzwFThw1Pon/XqA8kRrbXAG1p9rm9Zw1koZtXtl7fL2DRMezpPR63yyMmXk3R4 mYyN1Fz5atjk1i3M13dSfwCU0MwWO3mvMd5gJvbkAvyiF6WlTIMtTd0K8EZg6vtm0Il5 7Fni9SmI+oJWWeVi+RyK/uTRP1V8kpLvhvfUQmWz0JWjBwhlUFtk/gTx/OprQ70RRJ1I +wHddmnrsi5D7NrTVgapecNyMlYStyHfbQ7/cbTYAQPhtFSEy11rz6LnBl34ZtiWd52Y 9uQA== 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=clrALCvP0Lnnrc9ChxXlKIuUYraQmBIpiwyzFSMJ4E0=; fh=4NcaKd5OgAljsPyjBULo/3nLdg2FyuyaL2KqGz+n4OU=; b=H9evRaWvbZE1Eb9mL3rUM9nn7K9ynTy/GGxLG6iQnM8atWOiFlv5Hg9gyOJrj4IYGT ZlfnAGdqg5diwUM0j+yoiGXg8UBhQzbrd8fKTdgknkIxMkE7dXs6YbSqxtkKAaomUQON mtePT4nllgm/6uwXbtnCPsKWSjnfSc+D+Omk6GRjP9ytNiX4w5ocMlvvQqKqy91a9kP7 1Mkx1ePiFTVfnk+htcuDBmDuyTn/rWGt2TKWhALk+kgZH0VLDaFgJmSgiDZ2i3MmoDpU Cm3KQgq16Rrn8iHp+VUkt/+iVsvM+G1JeHT7ymOf/ac0sFcSwhbd4VqGA0o/wMlQnC6w 5XxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mc9S6Vtr; 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-209767-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c6c57905dsi3725375a12.190.2024.06.11.04.38.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 04:38:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209767-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=@gmail.com header.s=20230601 header.b=mc9S6Vtr; 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-209767-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209767-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EE79A1F21AB3 for ; Tue, 11 Jun 2024 11:38:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A730717C9F1; Tue, 11 Jun 2024 11:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mc9S6Vtr" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 7F84517C228; Tue, 11 Jun 2024 11:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718105761; cv=none; b=ePigo5K71TE5Kw3pe6/c8DnLdbok1JeNSlgYcL0fi5BeeCWjEr5g+zeWQWLYDjxbcROKFycGS6o5qRcHKqKox65ZzDbjS1O6ioN4pQM6g7Z/GyBO7Oyu+zZLF1CS6q37IFIT2d4X0uldfGQrnDNzu+EjJfIgyb7bugdAnR8P/6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718105761; c=relaxed/simple; bh=KYM3RpgXB+bRDfX9kBzzB6kmbYZ7NlFFZJ/83yFFCno=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kd0bQw1wm1A3l5bbRP2jZOpVhsEbcsdk7wOuqvjRfQkPJPECsvHbnVL8avkdAc49ESkJQ9WViTzgV1vl5Xvc8HDFDvbYKyajEVQt5WqbbIunSjTEB6D4Nj8pKWtbapsyEuCnxvUf1UyNlsfxMJZi1duAXjzru0FokKYgdV38DvA= 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=mc9S6Vtr; arc=none smtp.client-ip=209.85.210.180 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-pf1-f180.google.com with SMTP id d2e1a72fcca58-70436ac8882so880027b3a.2; Tue, 11 Jun 2024 04:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718105760; x=1718710560; 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=clrALCvP0Lnnrc9ChxXlKIuUYraQmBIpiwyzFSMJ4E0=; b=mc9S6VtrDphZhvkHJOgiYj4CWHwDb3Y3IM0nnFJxCDaeie3RwLNTZMULiORuHQMBuq p6xb0StMQuy9gcwmH/xZm0+rkZSWtgBgW/M/VY+vDPoArZbgkDZ3V7oDyOkBajn65T3O H/qPFEJOXMvTIaN9hasQBZ1YmLsrqnnvEkE/0MpQnarH3FvxkLPw4MT5ZoBpgu9aVcvh JstlA771ZCpwna7vNp53TWUMSzZO7TrcVzx5+w1pkvveumASLClF4/EL1vPVhxl6eG61 v+ObjDNWWe49t9Tec2KHwnpQ1ARc80KGmSghNs7/btBuXJmEurT8UZmQNKbS3uIfFCud 4sEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718105760; x=1718710560; 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=clrALCvP0Lnnrc9ChxXlKIuUYraQmBIpiwyzFSMJ4E0=; b=lKiYQBPSJuSJi8Om791zys2rzQs2CRSXHLQztWy5WN9eSDriXD+Fe5ensbiJZlN+zN HxTRnPI/nhzjk8mE7pkmuiNPOlLsH7r+qsyoDTmv17GID/1GdvvYASR1YDsLgg5NTco7 1GOtq5mzOWFYzUqfGDZSkSVPy87maUXDnKgR3MT41mJ++Wi8gpV5zT9UYNdMKK708XYM 8KR+gWA1yTFaNkSjL6r7ZFjz4+EJbBJB2T7jcfiev1EpyHocs0PX5VBjzNcH0ODRuLkk yve8zJan2NDXgwiYhEnR6uvykMrEky3eZu1qdSmCJjZYdbSbgy1EYpoY5Gyho87MTLo1 sweA== X-Forwarded-Encrypted: i=1; AJvYcCVsMdJ43Z+YGMDQC11cNECqoR6//1QL3N3cgtzHQDNbxN7LpazObasyOR6nYKMBxNtZaqzsC3BpJZnTh7qyUj5UG6cdSziqXrl8sd5ywZetL9xIYKJjHWx84cWmfqtT2gvoODX3v6LKnropKVBkBcpHXZ/ob7O5yB+60V+Qb5ptNAcmI3s= X-Gm-Message-State: AOJu0YwC+2vbKi01+Ng6ang6ViVOMkKY5FX/ydEVJruyepCss0x8kq1w dGAMsEdmCV747htJT4s3dVCqUHZF0JelSJH01Tqpsdgt7TtXFd2KR3u8uw== X-Received: by 2002:a05:6a20:9151:b0:1b5:fd58:30e8 with SMTP id adf61e73a8af0-1b5fd586289mr7258770637.18.1718105759749; Tue, 11 Jun 2024 04:35:59 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2c2dd785762sm6705086a91.37.2024.06.11.04.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 04:35:59 -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 Subject: [PATCH v7 1/5] mips: bmips: BCM6358: make sure CBR is correctly set Date: Tue, 11 Jun 2024 13:35:33 +0200 Message-ID: <20240611113538.9004-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611113538.9004-1-ansuelsmth@gmail.com> References: <20240611113538.9004-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 It was discovered that some device have CBR address set to 0 causing kernel panic when arch_sync_dma_for_cpu_all is called. This was notice in situation where the system is booted from TP1 and BMIPS_GET_CBR() returns 0 instead of a valid address and !!(read_c0_brcm_cmt_local() & (1 << 31)); not failing. The current check whether RAC flush should be disabled or not are not enough hence lets check if CBR is a valid address or not. Fixes: ab327f8acdf8 ("mips: bmips: BCM6358: disable RAC flush for TP1") Signed-off-by: Christian Marangi Acked-by: Florian Fainelli --- arch/mips/bmips/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c index ec180ab92eaa..66a8ba19c287 100644 --- a/arch/mips/bmips/setup.c +++ b/arch/mips/bmips/setup.c @@ -110,7 +110,8 @@ static void bcm6358_quirks(void) * RAC flush causes kernel panics on BCM6358 when booting from TP1 * because the bootloader is not initializing it properly. */ - bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)); + bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) || + !!BMIPS_GET_CBR(); } static void bcm6368_quirks(void) -- 2.43.0