lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c89f11c0-e0f3-4a28-9de4-341d0238f8cb@gmail.com>
Date: Mon, 21 Oct 2024 10:09:38 +0800
From: Hui-Ping Chen <hpchen0nvt@...il.com>
To: Sascha Hauer <s.hauer@...gutronix.de>
Cc: miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
 robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
 nikita.shubin@...uefel.me, arnd@...db.de, vkoul@...nel.org,
 esben@...nix.com, linux-arm-kernel@...ts.infradead.org,
 linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 2/2] mtd: rawnand: nuvoton: add new driver for the
 Nuvoton MA35 SoC

Dear Sascha,


Thank you for your reply.


On 2024/10/18 下午 05:40, Sascha Hauer wrote:
> On Fri, Oct 18, 2024 at 02:25:19AM +0000, Hui-Ping Chen wrote:
>> +static int ma35_nfi_ecc_check(struct nand_chip *chip, u8 *addr)
>> +{
>> +	struct ma35_nand_info *nand = nand_get_controller_data(chip);
>> +	struct mtd_info *mtd = nand_to_mtd(chip);
>> +	int i, j, nchunks = 0;
>> +	int report_err = 0;
>> +	int err_cnt = 0;
>> +	u32 status;
>> +
>> +	nchunks = mtd->writesize / chip->ecc.steps;
>> +	if (nchunks < 4)
>> +		nchunks = 1;
>> +	else
>> +		nchunks /= 4;
>> +
>> +	for (j = 0; j < nchunks; j++) {
>> +		status = readl(nand->regs + MA35_NFI_REG_NANDECCES0 + j * 4);
>> +		if (!status)
>> +			continue;
>> +
>> +		for (i = 0; i < 4; i++) {
>> +			if ((status & ECC_STATUS_MASK) == 0x01) {
>> +				/* Correctable error */
>> +				err_cnt = (status >> 2) & ECC_ERR_CNT_MASK;
>> +				ma35_nfi_correct(chip, j * 4 + i, err_cnt, addr);
>> +				report_err += err_cnt;
> This is still wrong. This should be
>
> 				report_err = max(report_err, err_cnt);
>
> You have to search for the subpage that has the most bitflips and return
> the number of bitflips on that subpage, *not* the total amount of errors
> on the whole page.
>
> That said, the statistic counter should still count the total number of
> bitflips occurred.

I re-examined the return value of read_page, and it indeed needs to 
return the

maximum bitflips for the subpage. I will correct this return value.

Thank you.


> Sascha
>
>> +			} else {
>> +				/* Uncorrectable error */
>> +				dev_warn(nand->dev, "uncorrectable error! 0x%4x\n", status);
>> +				return -EBADMSG;
>> +			}
>> +			status >>= 8;
>> +		}
>> +	}
>> +	return report_err;
>> +}
>> +

Best regards,

Hui-Ping Chen



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ