Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1257445rbb; Mon, 26 Feb 2024 04:05:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNtMgT5ZksUBpiIAKeECnKZmvqdIh3QgCoVDdb8NnZ6S/MEnRgJTQD10eX/KIVmgD1FL4LVnZUYMC6YSHtKg4EIUVHebEjRqS4djxWrg== X-Google-Smtp-Source: AGHT+IGnaij2GRt2IFG5NjcwffFt9otNBG2712FPPrtci5Uw0ikIbsaBVlMviWPSjwP27XtBFS9o X-Received: by 2002:a05:6359:4c0b:b0:17a:ed6c:3f0f with SMTP id kj11-20020a0563594c0b00b0017aed6c3f0fmr9905190rwc.22.1708949104640; Mon, 26 Feb 2024 04:05:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708949104; cv=pass; d=google.com; s=arc-20160816; b=TVWtJGK6emZ/sqMzuH1hbhiQMLwYzwPRSbBKUolqZG7F/w87TBETIEP6NnQGyK7TTv k3LcUdmZufI3dZwqvF+iDe2N/WCzp5MD72N+eoHVqm4St+Z9+EyrT+HL8blUNAgeUkJ2 HkiGy4DnYv9cth5KmF7weK9SS5XuBR1sqO/XOzgjsJMIRj2lGmsSiEb5UuqeMW02yyhX U2eXS6I2ZeplJBS+fHlPnj4hGohv9ReSByBlmmF2f5LQ6dV0pOlUVb850x6VJop7FibM /VgoJYCsGFI1+0lb3MebBKs0v6V6c1fjHpqE87b7qpHdtPFU9K8jEB3kmX5MOcct5A6o jGYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=iemZvmTeFOK/omKnZsMGajImy7MZ2HwWu9q1V6U7FW8=; fh=IjCbJ2F+SG9YtnnVheeljG8xyabDp5YvNLY+W8ykOwA=; b=CGSOyUXT1WGXMVGQ8+rqJy/kqO8zI7JZ0CP2ltI9E7j+1v8xcHwaXWAcPPnfpjf7a6 HSmpZV9MafkBApO2/iUYKAAg77Imvaa9CRdaIp4rUVLqx/BlGGybL9T+nryvT6zEgupp mrnkgtD58CnTh+Los3aaR5vfswL2BjtlsCzxDCvMlHf/59ICViBldC5UV8uwNkz2a8FJ 9ZSWAXDNqfMn8zG+WqiwjdZkPH6r/pK99ZdFIA2YENCsb+2UbZfkp1AZPL2f6VLwMso9 k51tqlUPiwQ8RJKndSm3wnWtPR3ysUSZZdw/8tI4ACTf8wRE1guq8yzqdiV2Cr9xzHSs IyGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=uYMfSRXI; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=e7cYhdDr; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-81327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i4-20020a6561a4000000b005dc7c05e470si3502310pgv.590.2024.02.26.04.05.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:05:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81327-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=@arndb.de header.s=fm3 header.b=uYMfSRXI; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=e7cYhdDr; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-81327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 5131229088F for ; Mon, 26 Feb 2024 12:05:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4F9F5FBBC; Mon, 26 Feb 2024 12:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="uYMfSRXI"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="e7cYhdDr" Received: from fhigh6-smtp.messagingengine.com (fhigh6-smtp.messagingengine.com [103.168.172.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88505A7A6; Mon, 26 Feb 2024 12:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949098; cv=none; b=E+4gBCiPYUvYnbNfBcTnk1drr62lM8QVI0+SPhFbwWwOh51r/O+D79ldkA65qgtcuQvHT6W6klLq40mBLtKi2Lqscj6OkJbpUbHBMF+XU1X+pzbvPoorupD0bzTETOacBpUWQlvqB3uv/Z7Vx0+MNvvnNP3AG/yrNEgoGcF6VRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949098; c=relaxed/simple; bh=R2QaRajn7czQBQ1//3E8ZkjjMlx/gkcIwN6HI0iR8+U=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=l6Rqp4nh+lhizIZho+6Byyh45O5GCETsN9oHgPueAOK0gEeMMATM+flIS4QNGBpsUsOgV5v+r7qghKksd8rPlWxXiwE3P6giy/xHyKBHS9FCveLMQLP9DlfVYA22wFyvq8N5iisyp5cypCqiyhuOdIHLsl9kj8Qfmi/5jK/zYhQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=uYMfSRXI; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=e7cYhdDr; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id AE2A011400B9; Mon, 26 Feb 2024 07:04:55 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 26 Feb 2024 07:04:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1708949095; x=1709035495; bh=iemZvmTeFO K/omKnZsMGajImy7MZ2HwWu9q1V6U7FW8=; b=uYMfSRXITmoj9ocsfHzxm8aKti PqRTPqdrgGR5ZDmVoXAkr6w/gNFOsm0t6+HzaLzKot2mBJSVylLDXzE3EspKwzXE 7ub/IGcb2GDao7VbHPqrMFfBcsDrV3WLUWDwnszWCaKYUibsILKPyzEpGnzjUE/d vridN4WPdTAFBHgvvVts7KKQfrpA+YNjchBKUohoSbYPzkhV7Hj42c0jYDgp8qf0 nnZ2wLUR/aa9rZmvB/yXpSni6jS/7rGpwYQ7cQFAtGIe6Ia+0gi9kiTN4JOONbgX 8kL0qAt7ICFDRcrpSTKOlBOKBOWCcSwltaHV0brTCzD1p+dsmLItR4/uCOOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1708949095; x=1709035495; bh=iemZvmTeFOK/omKnZsMGajImy7MZ 2HwWu9q1V6U7FW8=; b=e7cYhdDrh6puewqelVJean/lsK9sBAVvf+yk1LTLsr/3 uBgw3UuCMMV09+Erwt+SBcxjR4njxxI8udc3JJzsqIjNYz4io/t7f+RvYltJSop4 qk8Tp/s+Adh3egqyo+uKLLRlpGZs8jU3u2G+xgfhpAHPUA+H00xsrgbGIs4HgLQl wBpbIlMIo2ff77wtAbhAQ5GAzo85Iq+Deriapxj9e+DStDJxaOmfCA6wWQYKubg1 1+sZalcqKKqeCUYVSc+LSgGiC1xyb9+PmJkdGFth9GOmn3MCg15UP2xL0i1hBLZT DNqJ+hgn/IFhf0LQ4TdsI9x8fkUzIpGChziEkCpRXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgedvgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeevhfffledtgeehfeffhfdtgedvheejtdfgkeeuvefgudffteettdekkeeufeeh udenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 32952B6008D; Mon, 26 Feb 2024 07:04:54 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-153-g7e3bb84806-fm-20240215.007-g7e3bb848 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20240226105427.7191-1-fancer.lancer@gmail.com> <20240226105427.7191-2-fancer.lancer@gmail.com> <34af21b5-a878-418e-a70b-299cab61b37e@app.fastmail.com> Date: Mon, 26 Feb 2024 13:04:33 +0100 From: "Arnd Bergmann" To: "Serge Semin" Cc: "Thomas Bogendoerfer" , "Jiaxun Yang" , "Andrew Morton" , "Alexey Malahov" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mips: cm: Convert __mips_cm_l2sync_phys_base() to weak function Content-Type: text/plain On Mon, Feb 26, 2024, at 12:27, Serge Semin wrote: > On Mon, Feb 26, 2024 at 12:04:06PM +0100, Arnd Bergmann wrote: >> On Mon, Feb 26, 2024, at 11:54, Serge Semin wrote: s to. >> >> Since the resolution of the alias is all done at link time >> anyway, could you just convert these to an #ifdef check >> that documents exactly when each of the versions is used? > > Not sure I've completely understood what you meant. Do you suggest to > add a mips_cm_l2sync_phys_base macro which would be defined if a > "strong" version of the method is defined (and surround the > underscored function by it)? > > Please note after this patch is applied no aliases will > be left, but only a single weakly defined method: > mips_cm_l2sync_phys_base() > This is what we agreed to do with Thomas: > https://lore.kernel.org/linux-mips/pf6cvzper4g5364nqhd4wd2pmlkyygoymobeqduulpslcjhyy6@kf66z7chjbl3 > Thus there will be no need in the macro you suggest since the > weak-version of the method will be discarded by the linker as it will > have been replaced with the "strong" one. I meant that instead of having both a weak and an optional strong version that get linked together, always define exactly one of the two, such as: #ifndef CONFIG_MIPS_CM_xxx static phys_addr_t mips_cm_l2sync_phys_base(void) { /* current implementation ... */ } #endif where CONFIG_MIPS_CM_xxx is the Kconfig symbol that decides whether the file with the strong version is built or not. This way you always get exactly one of the two versions of the function built, the local version can be inlined if the compiler thinks that is better, and the #ifdef documents exactly whether the function is used or not for a given configuration, rather than a reader having to track down how many other definitions exist and whether a config includes them. Arnd