Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4907143yba; Wed, 10 Apr 2019 07:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1EK5pl3DItLWr3HLWWBgViul38h+bP4vBmIdHYBd8l6mR6UzfLejyMnV3LkiM+4JnfLvG X-Received: by 2002:a63:6907:: with SMTP id e7mr33681249pgc.209.1554906253668; Wed, 10 Apr 2019 07:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554906253; cv=none; d=google.com; s=arc-20160816; b=zlQnRHFQ3YNy1fMl2Bcs7Dz+FKhq9QYnB8GYvnmIqSucRgCH1ObhLlM8XePXzGkEX1 Pi5txCXRW8DPbWA3/elWXnIZZ2WyeCaW1ofg4LOQXu2LddnWgftATW5c7UzX8iwPlQp5 sjBSKBFDIk8Vs/LWrURDtsNDhNwQwlmGy7+M24+sCjlySC+xlsCDe9ujCnHMLBemmQFN 3X9fJ8kZddaY9nRXE5L3+PyZCT+03qHKAIvIVcYNAA2X/b1Ur0hENJEc+K1nYoH5CYZj L0tO26sIUv92HNjnANVEmvU9qUF63kTNgPxuJLBacwW7AmStWriVAD4pPLSVZpnLZaYy IK8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=fX+egYT2yWhnTnI7k8dmF+oOTNrG9+GP6PsvuYKt038=; b=tJWNd2QL/zmyZZ887MHb1ujTvoAqi0yGOOp2iDXtku0XPPlK43CroSV7MrVcHL0tqE GIYUjbzB7bRN79KWW5wA+qpTJxKNOfl0VHdUvEFIdtAicwFC4ZM24sDrZYOhwWBet75A fboso4j9xTAWZsDlaPafO8oit0jcrIxjjSYj/bAdqMLIVCgZ28TC5Tl+OvJLRnJv2KiS zYNbklFtCIV59s3iZNqwsIQ1w90kOl/FS/fwEyCov8YjOugdv3Is08R9Ykbfk4/tYa7r lQFkf8URPjiUz+7X4v9PBPxSC5it6dP8sBA/jCngumfNqFVVzF1clRm71Bt07YioaxG5 7QTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f191si31638501pgc.570.2019.04.10.07.23.57; Wed, 10 Apr 2019 07:24:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732698AbfDJOW1 (ORCPT + 99 others); Wed, 10 Apr 2019 10:22:27 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6145 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732666AbfDJOW0 (ORCPT ); Wed, 10 Apr 2019 10:22:26 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 625F7610C5ADFCE39524; Wed, 10 Apr 2019 22:22:20 +0800 (CST) Received: from [127.0.0.1] (10.177.31.96) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Wed, 10 Apr 2019 22:22:17 +0800 Subject: Re: [PATCH] mtd: nand: Fix build error while CONFIG_MTD_NAND_ECC_SW_BCH is set to module To: Boris Brezillon References: <20190410130747.35692-1-yuehaibing@huawei.com> <20190410153920.68267a1a@collabora.com> <20190410155856.655122c8@collabora.com> CC: , , , , , , , From: YueHaibing Message-ID: <8b020124-4008-6081-c04c-eaefb7875878@huawei.com> Date: Wed, 10 Apr 2019 22:22:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20190410155856.655122c8@collabora.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/4/10 21:58, Boris Brezillon wrote: > On Wed, 10 Apr 2019 15:39:28 +0200 > Boris Brezillon wrote: > >> On Wed, 10 Apr 2019 21:07:47 +0800 >> Yue Haibing wrote: >> >>> From: YueHaibing >>> >>> Fix gcc build error while CONFIG_MTD_NAND_ECC_SW_BCH >>> is set to module: >>> >>> drivers/mtd/nand/raw/nand_base.o: In function `nand_cleanup': >>> (.text+0xef6): undefined reference to `nand_bch_free' >>> drivers/mtd/nand/raw/nand_base.o: In function `nand_scan_tail': >>> nand_base.c:(.text+0xa101): undefined reference to `nand_bch_calculate_ecc' >>> nand_base.c:(.text+0xa120): undefined reference to `nand_bch_correct_data' >>> nand_base.c:(.text+0xa269): undefined reference to `nand_bch_init' >>> >>> CONFIG_MTD_NAND_ECC_SW_BCH should not be set to M, >>> because MTD_RAW_NAND need it while linked. >>> >>> Reported-by: Hulk Robot >>> Fixes: 193bd4002644 ("mtd: nand: add software BCH ECC support" >> >> Nope, it's not this one that introduced the regression. >> >> >> >>> Signed-off-by: YueHaibing >>> --- >>> drivers/mtd/nand/raw/Kconfig | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig >>> index 615d738..0500c42 100644 >>> --- a/drivers/mtd/nand/raw/Kconfig >>> +++ b/drivers/mtd/nand/raw/Kconfig >>> @@ -22,7 +22,7 @@ menuconfig MTD_RAW_NAND >>> if MTD_RAW_NAND >>> >>> config MTD_NAND_ECC_SW_BCH >>> - tristate "Support software BCH ECC" >>> + bool "Support software BCH ECC" >>> select BCH >>> default n >>> help >> >> Should be fixed with the following diff squashed into: >> >> 51ef1d0b2095 ("mtd: nand: Clarify Kconfig entry for software BCH ECC algorithm") >> >> --->8--- >> diff --git a/include/linux/mtd/nand_bch.h b/include/linux/mtd/nand_bch.h >> index b8106651f807..06ce2b655c13 100644 >> --- a/include/linux/mtd/nand_bch.h >> +++ b/include/linux/mtd/nand_bch.h >> @@ -15,7 +15,7 @@ struct mtd_info; >> struct nand_chip; >> struct nand_bch_control; >> >> -#if defined(CONFIG_MTD_NAND_ECC_BCH) >> +#if defined(CONFIG_MTD_NAND_ECC_SW_BCH) >> >> static inline int mtd_nand_has_bch(void) { return 1; } >> >> @@ -39,7 +39,7 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd); >> */ >> void nand_bch_free(struct nand_bch_control *nbc); >> >> -#else /* !CONFIG_MTD_NAND_ECC_BCH */ >> +#else /* !CONFIG_MTD_NAND_ECC_SW_BCH */ >> >> static inline int mtd_nand_has_bch(void) { return 0; } >> >> @@ -64,6 +64,6 @@ static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd) >> >> static inline void nand_bch_free(struct nand_bch_control *nbc) {} >> >> -#endif /* CONFIG_MTD_NAND_ECC_BCH */ >> +#endif /* CONFIG_MTD_NAND_ECC_SW_BCH */ >> >> #endif /* __MTD_NAND_BCH_H__ */ > > Sorry, I didn't look at the right branch, this part of the code was > correct, but we still have a problem to express the RAW_NAND(y) -> > SW_BCH(y) dependency. It seems this dependency is not always need, case MTD_RAW_NAND set to y works well while CONFIG_MTD_NAND_ECC_SW_BCH is not set. > > . >