2022-09-12 15:23:04

by Yaliang Wang

[permalink] [raw]
Subject: [PATCH] mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt

From: Yaliang Wang <[email protected]>

When utilizing PARSE_SFDP to initialize the flash parameter, the
deprecated initializing method spi_nor_init_params_deprecated() and the
function spi_nor_manufacturer_init_params() within it will never be
executed, which results in the default_init hook function will also never
be executed. As we do have quad enable function defined in BFPT, the
post_bfpt hook will be the right place to tweak the function.

Cc: [email protected]
Fixes: 047275f7de18 ("mtd: spi-nor: gigadevice: gd25q256: Init flash based on SFDP")
Signed-off-by: Yaliang Wang <[email protected]>
---
drivers/mtd/spi-nor/gigadevice.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi-nor/gigadevice.c b/drivers/mtd/spi-nor/gigadevice.c
index 119b38e6fc2a..d9b2e36971ea 100644
--- a/drivers/mtd/spi-nor/gigadevice.c
+++ b/drivers/mtd/spi-nor/gigadevice.c
@@ -8,19 +8,22 @@

#include "core.h"

-static void gd25q256_default_init(struct spi_nor *nor)
+static int
+gd25q256_post_bfpt(struct spi_nor *nor,
+ const struct sfdp_parameter_header *bfpt_header,
+ const struct sfdp_bfpt *bfpt)
{
/*
* Some manufacturer like GigaDevice may use different
* bit to set QE on different memories, so the MFR can't
* indicate the quad_enable method for this case, we need
- * to set it in the default_init fixup hook.
+ * to set it in the post_bfpt fixup hook.
*/
nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable;
}

static const struct spi_nor_fixups gd25q256_fixups = {
- .default_init = gd25q256_default_init,
+ .post_bfpt = gd25q256_post_bfpt,
};

static const struct flash_info gigadevice_nor_parts[] = {
--
2.34.1


2022-09-12 23:41:14

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.0-rc5 next-20220912]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/yaliang-wang-windriver-com/mtd-spi-nor-gigadevice-gd25q256-replace-gd25q256_default_init-with-gd25q256_post_bfpt/20220912-223028
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 80e78fcce86de0288793a0ef0f6acf37656ee4cf
config: i386-randconfig-a016-20220912 (https://download.01.org/0day-ci/archive/20220913/[email protected]/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/0238f8172a76ee5a84dda79b45911a2b63d59721
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review yaliang-wang-windriver-com/mtd-spi-nor-gigadevice-gd25q256-replace-gd25q256_default_init-with-gd25q256_post_bfpt/20220912-223028
git checkout 0238f8172a76ee5a84dda79b45911a2b63d59721
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mtd/spi-nor/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/mtd/spi-nor/gigadevice.c:23:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
^
1 error generated.


vim +23 drivers/mtd/spi-nor/gigadevice.c

acb96ecd59f7fd Boris Brezillon 2020-03-13 10
0238f8172a76ee Yaliang Wang 2022-09-12 11 static int
0238f8172a76ee Yaliang Wang 2022-09-12 12 gd25q256_post_bfpt(struct spi_nor *nor,
0238f8172a76ee Yaliang Wang 2022-09-12 13 const struct sfdp_parameter_header *bfpt_header,
0238f8172a76ee Yaliang Wang 2022-09-12 14 const struct sfdp_bfpt *bfpt)
acb96ecd59f7fd Boris Brezillon 2020-03-13 15 {
acb96ecd59f7fd Boris Brezillon 2020-03-13 16 /*
acb96ecd59f7fd Boris Brezillon 2020-03-13 17 * Some manufacturer like GigaDevice may use different
acb96ecd59f7fd Boris Brezillon 2020-03-13 18 * bit to set QE on different memories, so the MFR can't
acb96ecd59f7fd Boris Brezillon 2020-03-13 19 * indicate the quad_enable method for this case, we need
0238f8172a76ee Yaliang Wang 2022-09-12 20 * to set it in the post_bfpt fixup hook.
acb96ecd59f7fd Boris Brezillon 2020-03-13 21 */
829ec6408dc58d Tudor Ambarus 2020-03-13 22 nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable;
acb96ecd59f7fd Boris Brezillon 2020-03-13 @23 }
acb96ecd59f7fd Boris Brezillon 2020-03-13 24

--
0-DAY CI Kernel Test Service
https://01.org/lkp

2022-09-13 02:17:48

by Yaliang Wang

[permalink] [raw]
Subject: Re: [PATCH] mtd: spi-nor: gigadevice: gd25q256: replace gd25q256_default_init with gd25q256_post_bfpt

Sorry for the error, I'll make another patch to fix the error.

Regards, Yaliang.

On 9/13/22 07:18, kernel test robot wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> Hi,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.0-rc5 next-20220912]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/yaliang-wang-windriver-com/mtd-spi-nor-gigadevice-gd25q256-replace-gd25q256_default_init-with-gd25q256_post_bfpt/20220912-223028
> base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 80e78fcce86de0288793a0ef0f6acf37656ee4cf
> config: i386-randconfig-a016-20220912 (https://download.01.org/0day-ci/archive/20220913/[email protected]/config)
> compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/0238f8172a76ee5a84dda79b45911a2b63d59721
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review yaliang-wang-windriver-com/mtd-spi-nor-gigadevice-gd25q256-replace-gd25q256_default_init-with-gd25q256_post_bfpt/20220912-223028
> git checkout 0238f8172a76ee5a84dda79b45911a2b63d59721
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/mtd/spi-nor/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
>>> drivers/mtd/spi-nor/gigadevice.c:23:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
> }
> ^
> 1 error generated.
>
>
> vim +23 drivers/mtd/spi-nor/gigadevice.c
>
> acb96ecd59f7fd Boris Brezillon 2020-03-13 10
> 0238f8172a76ee Yaliang Wang 2022-09-12 11 static int
> 0238f8172a76ee Yaliang Wang 2022-09-12 12 gd25q256_post_bfpt(struct spi_nor *nor,
> 0238f8172a76ee Yaliang Wang 2022-09-12 13 const struct sfdp_parameter_header *bfpt_header,
> 0238f8172a76ee Yaliang Wang 2022-09-12 14 const struct sfdp_bfpt *bfpt)
> acb96ecd59f7fd Boris Brezillon 2020-03-13 15 {
> acb96ecd59f7fd Boris Brezillon 2020-03-13 16 /*
> acb96ecd59f7fd Boris Brezillon 2020-03-13 17 * Some manufacturer like GigaDevice may use different
> acb96ecd59f7fd Boris Brezillon 2020-03-13 18 * bit to set QE on different memories, so the MFR can't
> acb96ecd59f7fd Boris Brezillon 2020-03-13 19 * indicate the quad_enable method for this case, we need
> 0238f8172a76ee Yaliang Wang 2022-09-12 20 * to set it in the post_bfpt fixup hook.
> acb96ecd59f7fd Boris Brezillon 2020-03-13 21 */
> 829ec6408dc58d Tudor Ambarus 2020-03-13 22 nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable;
> acb96ecd59f7fd Boris Brezillon 2020-03-13 @23 }
> acb96ecd59f7fd Boris Brezillon 2020-03-13 24
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp