Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp597633rdb; Thu, 15 Feb 2024 09:18:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUglsJTxSmkb8TlVmFrkBreyH6+qXXzY9GZob+BDQ4W27J1vcZAmRSsi+ABOoQEuPAvv6H8cxO2/l5S4MWWSODy1WqJQKJz/o2KnQmlvQ== X-Google-Smtp-Source: AGHT+IFoCDNT53LP+x2BGUG2b8X6itkcErpqiY8Rq6DSU51hMapG8UaZ6NURYLzyYL1tkHLIVcKz X-Received: by 2002:a0c:e1d1:0:b0:68c:8ebd:6593 with SMTP id v17-20020a0ce1d1000000b0068c8ebd6593mr2503533qvl.14.1708017489064; Thu, 15 Feb 2024 09:18:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708017489; cv=pass; d=google.com; s=arc-20160816; b=gx3mhUov/LLJSTBsOYc5UK62P2wSsbhCb68iLeI7JTP3mQeGPues4YEbMSLcLvTiRO ibiq5zG9j7JwH6cF9wfaYGEm89u1MhyZMFJNsna9lIeCsXaO52tPrZxYXK1fEU/MT1Fg lgnBX9lschQ9K1QBI8jEJjbR1lcQqBzOG6SjOQKsk4PGOoyigEn0cNF4KNA9h2GINchV Uy7DDsgDymJmNtbbt9P+EU4/hXpudWAbYhd6Cd8QlYUde6WkSSyufa9fncectZCTmSSE j0m9oKuXGqzUftfAcBaMOC8ofasLybGAa3QRAK5hpv5SqixCjzaPupZC76Cg/54rqBRD duDw== 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:cc:to:from:dkim-signature; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; fh=p3G15TSjAvwP8sriy8HIHw31EGqLRsuWdLokmQJygKY=; b=XAMWV5pyFcgR8fMoynb7OlvCUE3odACfwvuPurdbxafWpp7+BVl30ZfKN8B4DEnl0d b8fiKEIbfkTDpgevr0GdrcE8DzT5c0TkoWnGDQkeN9DT8lx7LhuW8iA1mcaY9osML/Ht 5qZG9MJHoMLCc+FiUXxwwRVq9b8kWR6p+tdhmnACxH+YvytOhvz2b0Xe6vsNdnyQdPbh V6sqguBLQLoF0gMkEBTk5J9sdS3jQMoB537mkEPZRtCgZoI6u8d1ZDjXOjR4gZXz5DZK 4kGSwdDBvWy98TI6swaDGDD0WTYthnfvfB4Xvv/PdJIuwmNgJdQDc6H1vQcczrEGkoz0 novw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a0EBncya; 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-67386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iu1-20020ad45cc1000000b0068c842261efsi1858826qvb.240.2024.02.15.09.18.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:18:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a0EBncya; 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-67386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67386-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 525021C233C9 for ; Thu, 15 Feb 2024 17:18:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41E7F1369A2; Thu, 15 Feb 2024 17:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a0EBncya" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 9EEA8136659; Thu, 15 Feb 2024 17:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017476; cv=none; b=XwWo1+DZW86qe33pX5qgizyiNu0jP5lQ0oZB0LEUA3Ob6JGqREfe+gb46ENRAzjBipq75ZsCOkkOVuhgmrCTAt0JDf+pBfwjHcJOLjGXE3f8mtDbhiCygNtZV94X0lBvs/vkqvOpVpXJGnMBgb80C4s50XX3l2sIWD5wpjf/ax4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017476; c=relaxed/simple; bh=eFdJHcujAkNakHE9cboLrLydtuz4OsYv+UTx701ru4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q8f3lf1sZtcnqJ5f5x/sD+a9t89nOL7ILCFlbSb25AfXsKqk0AtAPIcxQ2WdQKTHe66Qu6BLzWpRQgDbOSDjWKVWbP4w+ens0xHvJc9QFfwXtyi93hk2UdsMLIccjLlcws5Lm8FwvIwOghPbhQbZ4FnDT9apHxGqPZfq9tQ9pMY= 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=a0EBncya; arc=none smtp.client-ip=209.85.167.46 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-f46.google.com with SMTP id 2adb3069b0e04-51187830d6dso1340345e87.3; Thu, 15 Feb 2024 09:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708017473; x=1708622273; 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; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; b=a0EBncya+Mb5Ju/G75yymiTprr0j1f/yzhsXiAI+NFeo4QjVtioXb5qSH/f3BoDE+p 6bM51BG5IdYXtfQrtjKnPdfm39T581DAUt1UySOc6pRW1dsViJxueeZtbltg/3xTV8gh 1oG7TA9AA81/geIgfq8L9YCWiIqxYQTBUhu34FUC3KArBAV6cqcN57epCzskA45HQ8L2 We9l6S4oRNGkCk3srBN/VmdS/T7pUKi5s4rYj8qgXt0rZtTf5hrr2cbHQ/T7/U8LsOXb GTz7it5ggjhWYvbnSuP2NCcLaNGWAOuTnISz4ZkanS+FgT4Xm5rWTb2EZ7RT5AnyXnHg yVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708017473; x=1708622273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; b=plbjCFxbEbpdmHIHiqkIMbnoV+bvGvjICdPc8lUQpRsAVTFGEyOfDzUD3TPvpur+GG eERxHGpxf4rWYgF5ZN2mv3Ouy9cmgsnbM4fE5jT8z8mqfzFAvt4fiWIXHlv0v9wqQr61 PwF2H0edP8B61lVhXWIQ/3doyOH7mOM2V50rccScO64Y7R6nUFAU6GISDBdBUy/8o8nm FDrlKYXnCUVwpkTOZMiyS84LCnTrlQR6q3QcMpRDfdPf6EVm7NYZci7qK2jFx85ayjqB DP9XR55TYuWWymN5BkOOO7S6uQm2leUdF77YYclu1aF5gNCjGxlg55vNl50FIuCi7KDc 86xQ== X-Forwarded-Encrypted: i=1; AJvYcCVRY1xF37tyTAHkTc+iAH2sDJrRgrJY7uMlDwGZyX63zIpXD1RO/10/iKmJfno8HCCS9XkVswxsBUdCEt3oCIdyTr74T1sQ34NAYag8ZHo2KXEhxhsYhimoxJ8xRsVtcxw++LJO8QOXXKcRtjGrTt33puC3iFmBBzFuJOQUalooZZmJ/CgJaA== X-Gm-Message-State: AOJu0YyzQyCYKzSA+dk2kOHUqVLM1CppO4E3/B5qJ/enHioeyrIzqehq A2mG4bLmxB0fW8o/J3LDsRiPpbfR/geBS3BRF4jZwb14USvLtNys X-Received: by 2002:a05:6512:1152:b0:511:7ebe:b160 with SMTP id m18-20020a056512115200b005117ebeb160mr2239460lfg.45.1708017472483; Thu, 15 Feb 2024 09:17:52 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id p17-20020a19f011000000b005118f61ffb3sm309458lfc.233.2024.02.15.09.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:17:52 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Jiaxun Yang , Andrew Morton Cc: Serge Semin , Alexey Malahov , Stephen Rothwell , linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] mips: cm: Add __mips_cm_l2sync_phys_base prototype declaration Date: Thu, 15 Feb 2024 20:17:26 +0300 Message-ID: <20240215171740.14550-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215171740.14550-1-fancer.lancer@gmail.com> References: <20240215171740.14550-1-fancer.lancer@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 The __mips_cm_l2sync_phys_base() and mips_cm_l2sync_phys_base() couple was introduced in commit 9f98f3dd0c51 ("MIPS: Add generic CM probe & access code") where the former method was a weak implementation of the later function. Such design pattern permitted to re-define the original method and use the weak implementation in the new function. A similar approach was introduced in the framework of another arch-specific programmable interface: mips_cm_phys_base() and __mips_cm_phys_base(). The only difference is that the underscored method of the later couple was declared in the "asm/mips-cm.h" header file, but it wasn't done for the CM L2-sync methods in the subject. Due to the missing the global function declaration the "missing prototype" warning was spotted in the framework of the commit 9a2036724cd6 ("mips: mark local function static if possible") and fixed just be re-qualifying the weak method as static. Doing that broke what was originally implied by having the weak implementation globally defined. Fix that by dropping the static qualifier and adding the __mips_cm_l2sync_phys_base() prototype declared in the "asm/mips-cm.h" header file. Fixes: 9a2036724cd6 ("mips: mark local function static if possible") Signed-off-by: Serge Semin --- Note seeing there is no user of the pattern described above we can convert it to having just weakly defined methods. Let me know if that would be a better alternative. --- arch/mips/include/asm/mips-cm.h | 14 ++++++++++++++ arch/mips/kernel/mips-cm.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 23c67c0871b1..1f143dfad7a2 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -33,6 +33,20 @@ extern void __iomem *mips_cm_l2sync_base; */ extern phys_addr_t __mips_cm_phys_base(void); +/** + * __mips_cm_l2sync_phys_base - retrieve the physical base address of the CM + * L2-sync region + * + * This function returns the physical base address of the Coherence Manager + * L2-cache only region. It provides a default implementation which reads the + * CMGCRL2OnlySyncBase register where available or returns a 4K region just + * behind the CM GCR base address. It may be overridden by platforms which + * determine this address in a different way by defining a function with the + * same prototype except for the name mips_cm_l2sync_phys_base (without + * underscores). + */ +extern phys_addr_t __mips_cm_l2sync_phys_base(void); + /* * mips_cm_is64 - determine CM register width * diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c index 84b3affb9de8..3f00788b0871 100644 --- a/arch/mips/kernel/mips-cm.c +++ b/arch/mips/kernel/mips-cm.c @@ -201,7 +201,7 @@ phys_addr_t __mips_cm_phys_base(void) phys_addr_t mips_cm_phys_base(void) __attribute__((weak, alias("__mips_cm_phys_base"))); -static phys_addr_t __mips_cm_l2sync_phys_base(void) +phys_addr_t __mips_cm_l2sync_phys_base(void) { u32 base_reg; -- 2.43.0