From mboxrd@z Thu Jan 1 00:00:00 1970 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 A7967C61DF0 for ; Mon, 31 Aug 2026 05:44:30 +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:References:In-Reply-To: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:List-Owner; bh=KntaQece5KLPwg54O9DJOAVj9nRdl5PrfkBK4M6L750=; b=QvHGIgDWrvpOpd7VGjmbenHBEl 9KNKhTrPJR1c6YlbPeYDhfkl0TRsKCGpIPW8B06KcBy65yW9abf/A/xlnCONA1MkMVHWzUvrD7uq8 PWln4SKSlnzcCELfGaXkKphy0ricf2v7jjEp2bZ3F7dgkhAS0tbTzgPCTeXinM2g5sn46zvI+2b9N 9F7Vq8zToaKgCQWa5xywQSFjdpwMYDvEpSW07ftoCDkPv9e+7QIBkA0ZvdcXFC7LvR7aGOsaYzSDf kYjOCUx/LUJ/aliIbrpHQXpN7ADNjViUnMajLRKfAJIUSQdusob4KNAxxBihpJDlw4aQxupDIHBEo XYuZwI5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0uod-00000008Xyj-2j0H; Mon, 31 Aug 2026 05:44:19 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0uoM-00000008Xbf-0ffu; Mon, 31 Aug 2026 05:44:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=KntaQece5KLPwg54O9DJOAVj9nRdl5PrfkBK4M6L750=; b=kl7Eq12Z3ZC6QNpA9gW3uFEJDu 2rVPALPyjMwqMKSEqbGDyhpE0BzVq2uqbcXpOymSeB++67YqE+VgXXQlbW6jxZBIEOP8zt+mAWuhl gVu0oIQMy0vlKJ70q+EkxiPgiTBYl5hqqh06whqxbOWvQk9YzcuM3s4oI6qb/U09PSvVvT4bmdE0k aAz1f5mnbD38cvxLE84aC2dEXv7wLLJS3QTCwYLQQlhTuQFx39gPGGC5FNVAzc2irZ+tNXJ3gm6Vd 7QQB3qSlgYQaL4UYNsxXLKwD+GQsLtSul2pQBMnqgpgfh7yNPcWmlXwSB60EaH5ecC1QF/nin5FPT FTkDFJfw==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.99.2 #2 (Red Hat Linux)) id 1x0uoG-00000009XOx-1r47; Mon, 31 Aug 2026 05:44:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 394E31A00; Sun, 30 Aug 2026 22:43:49 -0700 (PDT) Received: from localhost (a085714.arm.com [10.164.19.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4094F3F85F; Sun, 30 Aug 2026 22:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1788155033; bh=bACj7yeD3kQHNtaEo3qPM/7pYVMQxld/GWsQ0raGU14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jTd9KjtSO47ZSa6Eegu9Jg3Egpfu6bTxJIeCEbbBs9lqVrJh/QwBdWqQGOEmVP0OA hcTTxkZT6fAeEx8haq4FYbspEuUlfOA+P6q6eaBD4749BBYDUsR3ASLkC8OBZT5DoQ 0XYYCcDmZkZUnHFkXTJfrC1qadu+n2mdWf7vuxCU= From: Anshuman Khandual To: linux-mm@kvack.org Cc: samuel.holland@sifive.com, Anshuman Khandual , David Hildenbrand , Mike Rapoport , Andrew Morton , Lorenzo Stoakes , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "James E.J. Bottomley" , Helge Deller , Huacai Chen , WANG Xuerui , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] sh/mm: Stop using pte_ERROR() Date: Mon, 31 Aug 2026 11:13:27 +0530 Message-ID: <20260831054331.625505-6-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260831054331.625505-1-anshuman.khandual@arm.com> References: <20260831054331.625505-1-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260831_064357_632733_BE7ABEC8 X-CRM114-Status: GOOD ( 10.24 ) 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 Directly use pr_err() in set_pte_phys() and drop pte_ERROR() which helps in eventually dropping pte_ERROR() macro across the tree. In this new printing __FILE__ and __LINE__ has been dropped because they are always the same and don't really add any value. Besides ptrval_to_str() has been able to handle different PTE representation with and without CONFIG_X2TLB, which helped in unifying error message printing. Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: linux-sh@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Signed-off-by: Anshuman Khandual --- arch/sh/include/asm/pgtable_32.h | 5 ----- arch/sh/mm/init.c | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h index 5f51af18997b..c8eb9a7a4c4c 100644 --- a/arch/sh/include/asm/pgtable_32.h +++ b/arch/sh/include/asm/pgtable_32.h @@ -401,14 +401,9 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) #define pmd_page(pmd) (virt_to_page(pmd_val(pmd))) #ifdef CONFIG_X2TLB -#define pte_ERROR(e) \ - printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, \ - &(e), (e).pte_high, (e).pte_low) #define pgd_ERROR(e) \ printk("%s:%d: bad pgd %016llx.\n", __FILE__, __LINE__, pgd_val(e)) #else -#define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) #define pgd_ERROR(e) \ printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) #endif diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 110308bdef01..9466ae6f9f16 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c @@ -84,7 +84,11 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) pte = __get_pte_phys(addr); if (!pte_none(*pte)) { - pte_ERROR(*pte); + char str[PTVAL_STR_MAX]; + + ptval_to_str(str, pte_val(*pte)); + pr_err("unexpected set PTE at %lx in %s: bad pte %p(%s).\n", + addr, __func__, pte, str); return; } -- 2.43.0