Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2204771iof; Tue, 7 Jun 2022 23:08:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+bGejoPdwsYnoSGPzcg9KRVokUIAOHtahI0gNOCxX0yu67TCJ62Wu3dYfWsvhwhhycEQo X-Received: by 2002:a63:3184:0:b0:3fc:5893:c866 with SMTP id x126-20020a633184000000b003fc5893c866mr28987980pgx.56.1654668534475; Tue, 07 Jun 2022 23:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668534; cv=none; d=google.com; s=arc-20160816; b=G4t4wjQBYiu3HPQw6QWWr5MSSwxkXzxVeL3qoa3QSxNIhHFqa7jtGuFQP8jwXd08Ji /O4MJbInJrCdyEQu2Xw6pmHenUPIfIsi7i8shFWQx0U/GJl0hMfOWsrAenion0ARB0Vi 3lEsaaKIu9zM4dnvHPaxzkg7WTKhA7NQqB+kxiQq1JeyoYLeWceXnEzArKvW6I3LXD/m cVhtWoFMrkJNpBQaTOZJxx5Z9l1T9Pg2Ca6q2e/wgvJck39uPaCKjwquC8rGTtUtDaBw YoL0Xd/lWLHDDf5jfbdFzhXOJDxHE/4HvPVWFDM+op6raXjRWFhdb1S+o9p321OK7pa/ M7ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PjMMRwT9i3+7HRSc2nw3/41UqY2Ulw+WEbMqeMYy+XA=; b=lKz+41Wq74PQ7lreqc5kdv/k/ReUoiNDmD3QbtEGWze8vS6NV6kBPgfXlNCmsejWLX KKyW2mVr7vlBtvEPLp+Ify3iT5mLDKlA9YxG9EyQnuLY0mvjcRAleWVOdpzFtKYdVvm5 FYEFy7KeoRTMKZBmN659BvX0wUSSfLS7veuRv24KiOqphXDd/Bp0FozOFwQfCLW/I5ey VbcLdlcd2zwOC0B3MEMGvq1BUrasUpb33tigsYkWt5GRwF6j/Q/R4HiAIhvLqduHBpLa 1qpjC8QLgFLnbvqBVSClfLoR/TvjpmG2Gd4YTdH3y4mRtfylSxZwkP9GZwmrDYTye4dB Gu/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2koyuUb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s2-20020a056a0008c200b0050e0a5aa240si28552333pfu.6.2022.06.07.23.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:08:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h2koyuUb; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 83E94212C9A; Tue, 7 Jun 2022 22:31:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239039AbiFHBcO (ORCPT + 99 others); Tue, 7 Jun 2022 21:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383880AbiFGWGo (ORCPT ); Tue, 7 Jun 2022 18:06:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DA6D195976; Tue, 7 Jun 2022 12:17:31 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9D3EB6192F; Tue, 7 Jun 2022 19:17:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9D84C385A2; Tue, 7 Jun 2022 19:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629450; bh=+7xftkGjyf+e5zg4DgvqH+lSjN974cPn3Aj+rSWqdhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2koyuUbLehMc2Vhtb15rsQ/cp9RuRj91HP6wLbK5f0kT3q7ND3raPaAtGur13NEp JUx4N1ESdCUTFvS7htmWWikgvRFee05IeNCx3ioa242eoKclYbQKcjhFXCp1dzvg+m +nHmGFYvjk5Ckhm6BoHvgsD+orSzymY+xtko0wuE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Tiezhu Yang , Sergio Paracuellos , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.18 695/879] MIPS: RALINK: Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC Date: Tue, 7 Jun 2022 19:03:33 +0200 Message-Id: <20220607165023.019728967@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tiezhu Yang [ Upstream commit 7e4fd16b38923028b01d3dbadf4ca973d885c53e ] kernel test robot reports a build error used with clang compiler and mips-randconfig [1]: ld.lld: error: undefined symbol: pci_remap_iospace we can see the following configs in the mips-randconfig file: CONFIG_RALINK=y CONFIG_SOC_MT7620=y CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PCI=y CONFIG_RALINK is set, so pci_remap_iospace is defined in the related arch/mips/include/asm/mach-ralink/spaces.h header file: #define pci_remap_iospace pci_remap_iospace CONFIG_PCI is set, so pci_remap_iospace() in drivers/pci/pci.c is not built due to pci_remap_iospace is defined under CONFIG_RALINK. #ifndef pci_remap_iospace int pci_remap_iospace(const struct resource *res, ...) $ objdump -d drivers/pci/pci.o | grep pci_remap_iospace 00004cc8 : 4d18: 10400008 beqz v0,4d3c 4d2c: 1040000c beqz v0,4d60 4d70: 1000fff3 b 4d40 In addition, CONFIG_PCI_DRIVERS_GENERIC is not set, so pci_remap_iospace() in arch/mips/pci/pci-generic.c is not built too. #ifdef pci_remap_iospace int pci_remap_iospace(const struct resource *res, ...) For the above reasons, undefined reference pci_remap_iospace() looks like reasonable. Here are simple steps to reproduce used with gcc and defconfig: cd mips.git make vocore2_defconfig # set RALINK, SOC_MT7620, PCI_DRIVERS_LEGACY make menuconfig # set PCI make there exists the following build error: LD vmlinux.o MODPOST vmlinux.symvers MODINFO modules.builtin.modinfo GEN modules.builtin LD .tmp_vmlinux.kallsyms1 drivers/pci/pci.o: In function `devm_pci_remap_iospace': pci.c:(.text+0x4d24): undefined reference to `pci_remap_iospace' Makefile:1158: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC can fix the build error, with this patch, no build error remains. This patch is similar with commit e538e8649892 ("MIPS: asm: pci: define arch-specific 'pci_remap_iospace()' dependent on 'CONFIG_PCI_DRIVERS_GENERIC'"). [1] https://lore.kernel.org/lkml/202205251247.nQ5cxSV6-lkp@intel.com/ Fixes: 09d97da660ff ("MIPS: Only define pci_remap_iospace() for Ralink") Reported-by: kernel test robot Signed-off-by: Tiezhu Yang Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/include/asm/mach-ralink/spaces.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/mach-ralink/spaces.h b/arch/mips/include/asm/mach-ralink/spaces.h index f7af11ea2d61..a9f0570d0f04 100644 --- a/arch/mips/include/asm/mach-ralink/spaces.h +++ b/arch/mips/include/asm/mach-ralink/spaces.h @@ -6,7 +6,9 @@ #define PCI_IOSIZE SZ_64K #define IO_SPACE_LIMIT (PCI_IOSIZE - 1) +#ifdef CONFIG_PCI_DRIVERS_GENERIC #define pci_remap_iospace pci_remap_iospace +#endif #include #endif -- 2.35.1