From patchwork Fri Jul 21 16:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 13322461 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B6EEB64DD for ; Fri, 21 Jul 2023 19:26:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8EA98D0005; Fri, 21 Jul 2023 15:26:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B406A8D0001; Fri, 21 Jul 2023 15:26:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A06CB8D0005; Fri, 21 Jul 2023 15:26:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 908448D0001 for ; Fri, 21 Jul 2023 15:26:53 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5B183A03C9 for ; Fri, 21 Jul 2023 19:26:53 +0000 (UTC) X-FDA: 81036601506.19.1DF2BFE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 97268A0008 for ; Fri, 21 Jul 2023 19:26:50 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=tBvFsCsZ; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf25.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689967610; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ISXuMkqvZayBcveTjzWwDCrO2FpWUSxpHc5ReWgAirY=; b=YInHoBtuZZwewT4mo/qEpw1fEy5awLvMkTBYbVsYgu1r6cBjeAtR8h76FKVFi0Bov//iuU 7z0QPyB/IqJMp/GeGrrL+vF74K1RYjkTmE2DW7GpiUnV+U0gPOjvCAhSRYdD9bRLivjRFM c3z+ExZpFaq3lN+PTHHIm/fhVc5IEsc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=tBvFsCsZ; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf25.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689967610; a=rsa-sha256; cv=none; b=ao32S2PpmC21DZ2g9RenDLQg6bo/fthgh1ZCtirH+ytH1t8oEtH8VkAZsdeqDVx72AnWfQ 1C+Q+zDtC8DbwsBiwa5xlidE3jxj81B0omv/UnbKr4QFN39b0ybB0lDgXrntDDzRHIBFpD QKu9nmF6aIM/MOWXx2mURob14rq/ajg= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9CFFD61D94; Fri, 21 Jul 2023 19:26:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0000C433C9; Fri, 21 Jul 2023 19:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689967609; bh=yCtRCcKJvemSyJ7Qpgn3h+W1BSH1bLS7t//DEQ3eAmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBvFsCsZ34HS+D9KMDmthRPCtkpRRBLk6DSd87iNZdD5Mvg7PLLvwHEL3Pp3+MUBZ w0CoiDzF08qQjDedXDFqs9GzGBAU4P7mEqcmh5Z0KnNNa8t/dyP4bUH4pa0gcdJajz cZX4r2Hqp9CjLW+aW2a4qMdHCjD+QgdKS1FvZbC8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Randy Dunlap , Alexey Kardashevskiy , Christoph Hellwig , iommu@lists.linux.dev, Mike Rapoport , linux-mm@kvack.org Subject: [PATCH 6.1 222/223] swiotlb: mark swiotlb_memblock_alloc() as __init Date: Fri, 21 Jul 2023 18:07:55 +0200 Message-ID: <20230721160530.333242277@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230721160520.865493356@linuxfoundation.org> References: <20230721160520.865493356@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Rspamd-Queue-Id: 97268A0008 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: xgp4efzcg6hq81xz39dhcbxebuyrurzi X-HE-Tag: 1689967610-468727 X-HE-Meta: U2FsdGVkX1+r1E37sROkSFltQqUAL+g2iGdSTFA18RzKnistcc/NrSEKDZXZwvut1D2SXiDK9IStWz4qzARBJvpehLrs2xqjQUtG2+68M1DKawp0C+IxEkk7K7K3HTFo4YC+PiiVXlO04dp8qvRnb3UWQsHC12npn86p9efy+dOFEfjYw8iP5hTI69L2/pOdmpboSVTUhRNrGbU52nSMNVPrakazTp32lGb8W2u5hPUXvU0KFxEGSmQKbukHwaumcHp2+3FAOQhV6Qt8qzi3PXNZH76RvBw6b+YZjsPVmt9FuNoE4NJxhOhQWyog0bTuHsQ50oeeWx4ROXf24c7PFi7qVknVfyh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Hoigd/aWF4XKNFVg4zdEZC7hd867ZoX2wZE6tFursoTC6UTfEzd6HAQT74qWogOpVbMSebBXOpzjUyy8sWzVuwZG+Oh+KsuNpndpZcOs46x52vki5wHIklh0RbNA7hzP64JRgiQCtyg1hSsgXX2xGUXTJaa4gXT5iy9vEuuPeVYzc24toTkF6D8GwVRtdzIPOMkhZE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Randy Dunlap commit 9b07d27d0fbb7f7441aa986859a0f53ec93a0335 upstream. swiotlb_memblock_alloc() calls memblock_alloc(), which calls (__init) memblock_alloc_try_nid(). However, swiotlb_membloc_alloc() can be marked as __init since it is only called by swiotlb_init_remap(), which is already marked as __init. This prevents a modpost build warning/error: WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: swiotlb_memblock_alloc (section: .text) -> memblock_alloc_try_nid (section: .init.text) This fixes the build warning/error seen on ARM64, PPC64, S390, i386, and x86_64. Fixes: 8d58aa484920 ("swiotlb: reduce the swiotlb buffer size on allocation failure") Signed-off-by: Randy Dunlap Cc: Alexey Kardashevskiy Cc: Christoph Hellwig Cc: iommu@lists.linux.dev Cc: Mike Rapoport Cc: linux-mm@kvack.org Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- kernel/dma/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -324,7 +324,8 @@ static void swiotlb_init_io_tlb_mem(stru return; } -static void *swiotlb_memblock_alloc(unsigned long nslabs, unsigned int flags, +static void __init *swiotlb_memblock_alloc(unsigned long nslabs, + unsigned int flags, int (*remap)(void *tlb, unsigned long nslabs)) { size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT);