From patchwork Thu Oct 10 08:42:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youwan Wang X-Patchwork-Id: 13829881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26D4ECF11CA for ; Thu, 10 Oct 2024 10:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9pZ1Sz2m0MDylXSWSpuMt3QHUewUu8aJzPVm5fb8aoI=; b=ZA8b1LlN3q0N3rZIuL9jGWwG9k IoIHoPfIdBnNxFJXYOGoR6fZAeFjzEpfcK1yCx4P0h8aH+kEIJuIePj44uWhwDH4kr+gmteDQKapa NQ3mujwdKkxlpNHD6vUmBXGgZ9tgtnqcBAxHzZY+We4V/2tVmG2ijdWtVA8cpaSc67TI7EnvrnHQ5 nwMEa6kuWdPrmysi65DB/slu6aH5PtnrKkXtAiVyyiw+GhwTb1UE7fxQ2/jb/Wbl09NGa/4kU/ZcK 8gpG08Aq2mRehJC6/3hpnaVmHHblvDIwH4rAWzGKHEIlNj2hFmuyjokRSsLwC9+OzdOiTbwKabJ1X jRfoDyhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syq1c-0000000CKNa-41cI; Thu, 10 Oct 2024 10:04:04 +0000 Received: from [42.101.60.213] (helo=mail.nfschina.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syon8-0000000C3su-1XDe for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 08:45:04 +0000 Received: from localhost.localdomain (unknown [103.163.180.3]) by mail.nfschina.com (MailData Gateway V2.8.8) with ESMTPA id CD6F760573D92; Thu, 10 Oct 2024 16:42:27 +0800 (CST) X-MD-Sfrom: youwan@nfschina.com X-MD-SrcIP: 103.163.180.3 From: Youwan Wang To: jonathan.cameron@huawei.com Cc: yangyicong@hisilicon.com, will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Youwan Wang Subject: [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck Date: Thu, 10 Oct 2024 16:42:17 +0800 Message-Id: <20241010084217.37540-1-youwan@nfschina.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_014503_150954_1CB19AA0 X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The CPU of the device I am using is kunpeng 920, which can start normally with version 5.4 kernel. However, when installing version 6.6 kernel, the kernel gets stuck when loading the "hisi_dddrc_pmu" driver. I went to debug and found that it gets stuck when "readl (ddrc_pmu ->base+DDRC_VERSION)". I suspect that the hardware does not support it. My modification is: for the "HISI0233" device, according to the implementation of version 5.4 kernel, the identity is not obtained from the register. For "identifier" sysfs, identifier: 0 Signed-off-by: Youwan Wang --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index b804e3738113..3cecad46b01f 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -321,6 +321,9 @@ static int hisi_ddrc_pmu_init_data(struct platform_device *pdev, return PTR_ERR(ddrc_pmu->base); } + if (strstr(pdev->name, "HISI0233")) + return 0; + ddrc_pmu->identifier = readl(ddrc_pmu->base + DDRC_VERSION); if (ddrc_pmu->identifier >= HISI_PMU_V2) { if (device_property_read_u32(&pdev->dev, "hisilicon,sub-id",