diff mbox series

[2/2] SPI Nand Patch code for SkyHigh Momory

Message ID 20240306041532.16985-1-kr.kim@skyhighmemory.com
State New
Headers show
Series None | expand

Commit Message

KR Kim March 6, 2024, 4:15 a.m. UTC
---
 drivers/mtd/nand/spi/Makefile  |  2 +-
 drivers/mtd/nand/spi/skyhigh.c | 57 ++++++----------------------------
 2 files changed, 11 insertions(+), 48 deletions(-)

Comments

Miquel Raynal March 6, 2024, 8:07 a.m. UTC | #1
Hello,

The subject tag is wrong (v2), the prefix is wrong, you are missing
the commit message, there is no Signed-off-by, and you sent a diff with
your v1 rather than a full patch.

You should probably try sending these using --dry-run and
--suppress-cc=all while you are working on your series :)

Thanks,
Miquèl

kr.kim@skyhighmemory.com wrote on Wed,  6 Mar 2024 13:15:32 +0900:

> ---
>  drivers/mtd/nand/spi/Makefile  |  2 +-
>  drivers/mtd/nand/spi/skyhigh.c | 57 ++++++----------------------------
>  2 files changed, 11 insertions(+), 48 deletions(-)
> 
> diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile
> index 48b429d90460..1e61ab21893a 100755
> --- a/drivers/mtd/nand/spi/Makefile
> +++ b/drivers/mtd/nand/spi/Makefile
> @@ -1,4 +1,4 @@
>  # SPDX-License-Identifier: GPL-2.0
>  spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o
> -spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o skyhigh.o
> +spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
>  obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
> diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
> index 71de4fa34406..dd348849216d 100644
> --- a/drivers/mtd/nand/spi/skyhigh.c
> +++ b/drivers/mtd/nand/spi/skyhigh.c
> @@ -12,8 +12,8 @@
>  #define SPINAND_MFR_SKYHIGH		0x01
>  
>  #define SKYHIGH_STATUS_ECC_1TO2_BITFLIPS	(1 << 4)
> -#define SKYHIGH_STATUS_ECC_3TO4_BITFLIPS	(2 << 4)
> -#define SKYHIGH_STATUS_ECC_5TO6_BITFLIPS	(3 << 4)
> +#define SKYHIGH_STATUS_ECC_3TO6_BITFLIPS	(2 << 4)
> +#define SKYHIGH_STATUS_ECC_UNCOR_ERROR  	(3 << 4)
>  
>  #define SKYHIGH_CONFIG_PROTECT_EN	BIT(1)
>  
> @@ -62,49 +62,15 @@ static const struct mtd_ooblayout_ops skyhigh_spinand_ooblayout = {
>  	.free = skyhigh_spinand_ooblayout_free,
>  };
>  
> -#if 0
> -bool skyhigh_spinand_isbad(struct spinand_device *spinand,
> -			   const struct nand_pos *pos)
> -{
> -	u8 marker;
> -	struct nand_page_io_req req = {
> -		.pos = *pos,
> -		.ooblen = 1,
> -		.ooboffs = 0,
> -		.oobbuf.in = &marker,
> -		.mode = MTD_OPS_RAW,
> -	};
> -
> -	req.pos.page = 0;
> -	spinand_read_page(spinand, &req);
> -	if (marker != 0xff)
> -		return true;
> -
> -#if 0
> -	req.pos.page = 1;
> -	spinand_read_page(spinand, &req);
> -	if (marker != 0xff)
> -		return true;
> -
> -	req.pos.page = 63;
> -	spinand_read_page(spinand, &req);
> -	if (marker != 0xff)
> -		return true;
> -#endif
> -
> -	return false;
> -}
> -#endif
> -
>  static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand,
>  				  u8 status)
>  {
>  	/* SHM
> -	00 : No bit-flip
> -	01 : 1-2 errors corrected
> -	10 : 3-6 errors corrected         
> -	11 : uncorrectable
> -	*/
> +	 * 00 : No bit-flip
> +	 * 01 : 1-2 errors corrected
> +	 * 10 : 3-6 errors corrected         
> +	 * 11 : uncorrectable
> +	 */
>  
>  	switch (status & STATUS_ECC_MASK) {
>  	case STATUS_ECC_NO_BITFLIPS:
> @@ -113,12 +79,10 @@ static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand,
>  	case SKYHIGH_STATUS_ECC_1TO2_BITFLIPS:
>  		return 2;
>  
> -	/* change from 4 to 6 */
> -	case SKYHIGH_STATUS_ECC_3TO4_BITFLIPS:
> + 	case SKYHIGH_STATUS_ECC_3TO6_BITFLIPS:
>  		return 6; 
>  
> -	/* uncorrectable for '11' */
> -	case SKYHIGH_STATUS_ECC_5TO6_BITFLIPS:
> + 	case SKYHIGH_STATUS_ECC_UNCOR_ERROR:
>  		return -EBADMSG;;
>  
>  	default:
> @@ -179,8 +143,7 @@ static int skyhigh_spinand_init(struct spinand_device *spinand)
>  
>  static const struct spinand_manufacturer_ops skyhigh_spinand_manuf_ops = {
>  	.init = skyhigh_spinand_init,
> -/*	.isbad = skyhigh_spinand_isbad,*/
> -};
> + };
>  
>  const struct spinand_manufacturer skyhigh_spinand_manufacturer = {
>  	.id = SPINAND_MFR_SKYHIGH,
Chuanhong Guo March 6, 2024, 8:10 a.m. UTC | #2
Hello!

On Wed, Mar 6, 2024 at 12:16 PM KR Kim <kr.kim@skyhighmemory.com> wrote:
>
> ---
>  drivers/mtd/nand/spi/Makefile  |  2 +-
>  drivers/mtd/nand/spi/skyhigh.c | 57 ++++++----------------------------
>  2 files changed, 11 insertions(+), 48 deletions(-)

You should send an updated version of your original patch with
requested changes, not a new patch on top of your original one.
And your current patch is missing a proper title and commit message.

I believe there are multiple docs and tutorials online for submitting
patches to the Linux kernel, for example this one:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Read through the docs first before submitting your changes.
diff mbox series

Patch

diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile
index 48b429d90460..1e61ab21893a 100755
--- a/drivers/mtd/nand/spi/Makefile
+++ b/drivers/mtd/nand/spi/Makefile
@@ -1,4 +1,4 @@ 
 # SPDX-License-Identifier: GPL-2.0
 spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o
-spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o skyhigh.o
+spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
 obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index 71de4fa34406..dd348849216d 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -12,8 +12,8 @@ 
 #define SPINAND_MFR_SKYHIGH		0x01
 
 #define SKYHIGH_STATUS_ECC_1TO2_BITFLIPS	(1 << 4)
-#define SKYHIGH_STATUS_ECC_3TO4_BITFLIPS	(2 << 4)
-#define SKYHIGH_STATUS_ECC_5TO6_BITFLIPS	(3 << 4)
+#define SKYHIGH_STATUS_ECC_3TO6_BITFLIPS	(2 << 4)
+#define SKYHIGH_STATUS_ECC_UNCOR_ERROR  	(3 << 4)
 
 #define SKYHIGH_CONFIG_PROTECT_EN	BIT(1)
 
@@ -62,49 +62,15 @@  static const struct mtd_ooblayout_ops skyhigh_spinand_ooblayout = {
 	.free = skyhigh_spinand_ooblayout_free,
 };
 
-#if 0
-bool skyhigh_spinand_isbad(struct spinand_device *spinand,
-			   const struct nand_pos *pos)
-{
-	u8 marker;
-	struct nand_page_io_req req = {
-		.pos = *pos,
-		.ooblen = 1,
-		.ooboffs = 0,
-		.oobbuf.in = &marker,
-		.mode = MTD_OPS_RAW,
-	};
-
-	req.pos.page = 0;
-	spinand_read_page(spinand, &req);
-	if (marker != 0xff)
-		return true;
-
-#if 0
-	req.pos.page = 1;
-	spinand_read_page(spinand, &req);
-	if (marker != 0xff)
-		return true;
-
-	req.pos.page = 63;
-	spinand_read_page(spinand, &req);
-	if (marker != 0xff)
-		return true;
-#endif
-
-	return false;
-}
-#endif
-
 static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand,
 				  u8 status)
 {
 	/* SHM
-	00 : No bit-flip
-	01 : 1-2 errors corrected
-	10 : 3-6 errors corrected         
-	11 : uncorrectable
-	*/
+	 * 00 : No bit-flip
+	 * 01 : 1-2 errors corrected
+	 * 10 : 3-6 errors corrected         
+	 * 11 : uncorrectable
+	 */
 
 	switch (status & STATUS_ECC_MASK) {
 	case STATUS_ECC_NO_BITFLIPS:
@@ -113,12 +79,10 @@  static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand,
 	case SKYHIGH_STATUS_ECC_1TO2_BITFLIPS:
 		return 2;
 
-	/* change from 4 to 6 */
-	case SKYHIGH_STATUS_ECC_3TO4_BITFLIPS:
+ 	case SKYHIGH_STATUS_ECC_3TO6_BITFLIPS:
 		return 6; 
 
-	/* uncorrectable for '11' */
-	case SKYHIGH_STATUS_ECC_5TO6_BITFLIPS:
+ 	case SKYHIGH_STATUS_ECC_UNCOR_ERROR:
 		return -EBADMSG;;
 
 	default:
@@ -179,8 +143,7 @@  static int skyhigh_spinand_init(struct spinand_device *spinand)
 
 static const struct spinand_manufacturer_ops skyhigh_spinand_manuf_ops = {
 	.init = skyhigh_spinand_init,
-/*	.isbad = skyhigh_spinand_isbad,*/
-};
+ };
 
 const struct spinand_manufacturer skyhigh_spinand_manufacturer = {
 	.id = SPINAND_MFR_SKYHIGH,