From patchwork Fri Mar 10 13:37:33 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: 13169288 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 8DFD9C64EC4 for ; Fri, 10 Mar 2023 13:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D93B56B0072; Fri, 10 Mar 2023 08:57:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D43546B0074; Fri, 10 Mar 2023 08:57:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C33AD8E0001; Fri, 10 Mar 2023 08:57:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B41D76B0072 for ; Fri, 10 Mar 2023 08:57:32 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 889DB1416DC for ; Fri, 10 Mar 2023 13:57:32 +0000 (UTC) X-FDA: 80553141144.25.1CAB721 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf19.hostedemail.com (Postfix) with ESMTP id B232F1A0007 for ; Fri, 10 Mar 2023 13:57:29 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=K9mE1dVn; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf19.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 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=1678456649; 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=s3IzaT5Jp+16PalTtrf27WrHR8FU+ivQNeA9qub2gYI=; b=XIPTMVB/D5ojPJek1jZaYrBWOC6pxRa6zNKU6Dtsaozv6/ypgZwCKA0MojU41It54Gw2U3 bN88XqaPaydnlhZgajJFY0ch73JxJqzRv/xP2kASqr20opU1Jaicz4MWTJ1k1PBG4jlBgp PRmuAABN1xpAPIQzfDchAdtySVmhkPY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=K9mE1dVn; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf19.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678456649; a=rsa-sha256; cv=none; b=uAqRiEydMKpupbySBXim0ug8LCO9+6/gXRagRUICiT4bEzeGpfNxAgLItRmZXRvchqjGpa g7tgZsZhGp9xsJq/aATHNe7i/VZFAaXjDWNDCudJHcLvV0O6ah8GsCXdr8wCvl4ovarSii /gIuyR1G0sYFxvG8FIb+CYwVhK/pIx0= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EEC9AB822BF; Fri, 10 Mar 2023 13:57:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ADC2C433EF; Fri, 10 Mar 2023 13:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678456646; bh=sycv6iu5K5F3S5Tr2gJLFuQPxHuazObeqeVF4t+R/m4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K9mE1dVnmEvfMoyBn/cg5CdMdRAX/akaDpQwafzRM4KKYx5cjwEemUE8+BZTkax6C bUCGp+iKc+54aLqZ98AGvwHxI0X7P8BYWTZFFM6mhVCixfM3LRJeYYzy/qko8RB6aL cQrhalVASLsNeosdM/hUyqiowu85KXdPX08Z2EB8= 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, Sasha Levin Subject: [PATCH 6.2 073/211] swiotlb: mark swiotlb_memblock_alloc() as __init Date: Fri, 10 Mar 2023 14:37:33 +0100 Message-Id: <20230310133721.005935440@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133718.689332661@linuxfoundation.org> References: <20230310133718.689332661@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B232F1A0007 X-Stat-Signature: 3esi5tjxb58qhoaot61ec7i88hpyq5o1 X-HE-Tag: 1678456649-142835 X-HE-Meta: U2FsdGVkX1+ofe0DCAqHqnEaIzoZm5uUO3H7JJw0Y22XmO+Om7zPq2OalUj5wOGSDkg+Rb8G4BQh8UeX3rmwn70tf/qfU1g1nE7AXtOBpqMAAjTbl6+HHX/viKr+d7AAD1cqBGXUSFtn9q1pNl/5aBZBRyJvWYyb+g6BBq616W9vrPft9kBUy6UBMlbDyAJ6RKyiDlrpHklUozwugHo02yrL2EcV+RpoPbcH0Swdq1cJUbRWoN3f5TTz9DtXX4p/q05Qe2WJyXevnsfAPh0REUvDimuWo8uExkUbDM3OCYNrcL2Fv42RHo+lDt2ivO2V0os+rtj4BKOAMnwBjnH7Yl5biqeyTnC8eGUCSXKn8WsFHz75CcXO2e90a3Jk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kDccCvw5BbvBxm6wMa1RsAUGViB1VAyzKuCxEVf3QvxFn++V4Ou4IfKT8qO6lJOL9ecHY46Zkc6A2WpM844h80ZaBqiy7kZew7vKw8JUKfODm 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 [ Upstream commit 9b07d27d0fbb7f7441aa986859a0f53ec93a0335 ] 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: Sasha Levin --- kernel/dma/swiotlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index a34c38bbe28f1..ef3bc3a5bbed3 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -300,7 +300,8 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start, 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);