From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5EFBC433F5 for ; Fri, 15 Oct 2021 10:33:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92B5261220 for ; Fri, 15 Oct 2021 10:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238082AbhJOKfM (ORCPT ); Fri, 15 Oct 2021 06:35:12 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:44267 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238144AbhJOKe7 (ORCPT ); Fri, 15 Oct 2021 06:34:59 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D1ABE240011; Fri, 15 Oct 2021 10:32:51 +0000 (UTC) From: Miquel Raynal To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vladimir Zapolskiy Subject: Re: [PATCH 6/8] Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper" Date: Fri, 15 Oct 2021 12:32:51 +0200 Message-Id: <20211015103251.950095-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210928221507.199198-7-miquel.raynal@bootlin.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'8d1e4218a63e96acd593395d6a8a4cf6095d7457' Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-09-28 at 22:15:05 UTC, Miquel Raynal wrote: > This reverts commit 3e09c0252501829b14b10f14e1982aaab77d0b80. > > Before the introduction of the ECC framework infrastructure, many > drivers used the ->calculate/correct() Hamming helpers directly. The > point of this framework was to avoid this kind of hackish calls and use a > proper and generic API but it is true that in certain cases, drivers > still need to use these helpers in order to do ECC computations on > behalf of their limited hardware. > > Right after the introduction of the ECC engine core introduction, it was > spotted that it was not possible to use the shiny rawnand software ECC > helpers so easily because an ECC engine object should have been > allocated and initialized first. While this works well in most cases, > for these drivers just leveraging the power of a single helper in > conjunction with some pretty old and limited hardware, it did not fit. > > The idea back then was to declare intermediate helpers which would make > use of the exported software ECC engine bare functions while keeping the > rawnand layer compatibility. As there was already functions with the > rawnand_sw_hamming_ prefix it was decided to declare new local helpers > for this purpose in each driver needing one. > > Besides being far from optimal, this design choice was blamed by Linus > when he pulled the "fixes" pull request [1] so that is why now it is > time to clean this mess up. > > The implementation of the rawnand_ecc_sw_* helpers has now been enhanced > to support both cases, when the ECC object is instantiated and when it is > not. This way, we can still use the existing and exported rawnand > helpers while avoiding the need for each driver to declare its own > helper, thus this fix from [2] can now be safely reverted. > > [1] https://lore.kernel.org/lkml/CAHk-=wh_ZHF685Fni8V9is17mj=pFisUaZ_0=gq6nbK+ZcyQmg@mail.gmail.com/ > [2] https://lore.kernel.org/linux-mtd/20210413161840.345208-1-miquel.raynal@bootlin.com > > Signed-off-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next. Miquel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 036A7C433EF for ; Fri, 15 Oct 2021 11:01:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E18861056 for ; Fri, 15 Oct 2021 11:01:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E18861056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LvE/G8QD+ur+kb4PV1gZReH1ftYfQADcVVVEDsYpCEM=; b=vYC2iMgdzhq7t1 3y9Nx8poV/2t/PB7aApOFJ47z/I+AAqkMJuhR1A/NdMJdnWmR7NAEklmbrZXAapudtm4F8xD2xUcR 5dA7eGYGEvgHD+s4Gia/fPEzVRLgajCrQt4Mae8Wx1AgkTcDYKDYTAKebdKEuT++01Wu/0XK0lims xP5GISvhnomUMFVCWOMmNWVle9ZSjgwK4iUwppmctc3tC4EoDsysxhhw6pq7JYaI0CvxNun6uVrNO /Qu1DbF/2eX8amxvTRE5XMQQdE54KavSFH0cGUS+PLJs24xDPr9SjrknXFtKHTq+U0h0IYUoWWB03 OxHvni1/dHw4E9Rohd+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbKxg-006c2z-PD; Fri, 15 Oct 2021 11:01:17 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbKWE-006V2p-AI; Fri, 15 Oct 2021 10:32:55 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D1ABE240011; Fri, 15 Oct 2021 10:32:51 +0000 (UTC) From: Miquel Raynal To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vladimir Zapolskiy Subject: Re: [PATCH 6/8] Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper" Date: Fri, 15 Oct 2021 12:32:51 +0200 Message-Id: <20211015103251.950095-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210928221507.199198-7-miquel.raynal@bootlin.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'8d1e4218a63e96acd593395d6a8a4cf6095d7457' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_033254_538954_0F436B04 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Tue, 2021-09-28 at 22:15:05 UTC, Miquel Raynal wrote: > This reverts commit 3e09c0252501829b14b10f14e1982aaab77d0b80. > > Before the introduction of the ECC framework infrastructure, many > drivers used the ->calculate/correct() Hamming helpers directly. The > point of this framework was to avoid this kind of hackish calls and use a > proper and generic API but it is true that in certain cases, drivers > still need to use these helpers in order to do ECC computations on > behalf of their limited hardware. > > Right after the introduction of the ECC engine core introduction, it was > spotted that it was not possible to use the shiny rawnand software ECC > helpers so easily because an ECC engine object should have been > allocated and initialized first. While this works well in most cases, > for these drivers just leveraging the power of a single helper in > conjunction with some pretty old and limited hardware, it did not fit. > > The idea back then was to declare intermediate helpers which would make > use of the exported software ECC engine bare functions while keeping the > rawnand layer compatibility. As there was already functions with the > rawnand_sw_hamming_ prefix it was decided to declare new local helpers > for this purpose in each driver needing one. > > Besides being far from optimal, this design choice was blamed by Linus > when he pulled the "fixes" pull request [1] so that is why now it is > time to clean this mess up. > > The implementation of the rawnand_ecc_sw_* helpers has now been enhanced > to support both cases, when the ECC object is instantiated and when it is > not. This way, we can still use the existing and exported rawnand > helpers while avoiding the need for each driver to declare its own > helper, thus this fix from [2] can now be safely reverted. > > [1] https://lore.kernel.org/lkml/CAHk-=wh_ZHF685Fni8V9is17mj=pFisUaZ_0=gq6nbK+ZcyQmg@mail.gmail.com/ > [2] https://lore.kernel.org/linux-mtd/20210413161840.345208-1-miquel.raynal@bootlin.com > > Signed-off-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next. Miquel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2C56C433FE for ; Fri, 15 Oct 2021 11:01:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82B5361040 for ; Fri, 15 Oct 2021 11:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 82B5361040 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SeHEqinAqsSpxG8R0qYd2SVXtexrwtEkEatSowDxvgo=; b=yg6GvxtmfsoLv1 aPbFDJ3PpDxXJUJ8/ZvkyVDZyRqUzDJlagKffOLdVdxeq2DvVSGgUHA0WIXmcrQPM6XxZ/CEUi9eO NCs2nqbLpktb9MKcqdoiBiRyzWVfkTN2ZQeMc598Fnw8fMH0n09ejIDPcnTFVEtbcXf0wcqVtlfyq vLAs/ZRKpdMPCADI9ZfjN2s5n6lywWi/VlbPgL9oqIbIBNhfk27c82cAQuYkKKRV8hAK1SQRlIaK3 dP73foTKGcL0kevUqvTU68jFj3hbfLL2S1jP0mTne1u+F0dY1rape9yVrszGIg5ZfZ9ZlcrIvQanH zUh18AUWOOcDawyxz8dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbKw5-006bff-V2; Fri, 15 Oct 2021 10:59:38 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbKWE-006V2p-AI; Fri, 15 Oct 2021 10:32:55 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D1ABE240011; Fri, 15 Oct 2021 10:32:51 +0000 (UTC) From: Miquel Raynal To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vladimir Zapolskiy Subject: Re: [PATCH 6/8] Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper" Date: Fri, 15 Oct 2021 12:32:51 +0200 Message-Id: <20211015103251.950095-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210928221507.199198-7-miquel.raynal@bootlin.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'8d1e4218a63e96acd593395d6a8a4cf6095d7457' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_033254_538954_0F436B04 X-CRM114-Status: GOOD ( 19.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 2021-09-28 at 22:15:05 UTC, Miquel Raynal wrote: > This reverts commit 3e09c0252501829b14b10f14e1982aaab77d0b80. > > Before the introduction of the ECC framework infrastructure, many > drivers used the ->calculate/correct() Hamming helpers directly. The > point of this framework was to avoid this kind of hackish calls and use a > proper and generic API but it is true that in certain cases, drivers > still need to use these helpers in order to do ECC computations on > behalf of their limited hardware. > > Right after the introduction of the ECC engine core introduction, it was > spotted that it was not possible to use the shiny rawnand software ECC > helpers so easily because an ECC engine object should have been > allocated and initialized first. While this works well in most cases, > for these drivers just leveraging the power of a single helper in > conjunction with some pretty old and limited hardware, it did not fit. > > The idea back then was to declare intermediate helpers which would make > use of the exported software ECC engine bare functions while keeping the > rawnand layer compatibility. As there was already functions with the > rawnand_sw_hamming_ prefix it was decided to declare new local helpers > for this purpose in each driver needing one. > > Besides being far from optimal, this design choice was blamed by Linus > when he pulled the "fixes" pull request [1] so that is why now it is > time to clean this mess up. > > The implementation of the rawnand_ecc_sw_* helpers has now been enhanced > to support both cases, when the ECC object is instantiated and when it is > not. This way, we can still use the existing and exported rawnand > helpers while avoiding the need for each driver to declare its own > helper, thus this fix from [2] can now be safely reverted. > > [1] https://lore.kernel.org/lkml/CAHk-=wh_ZHF685Fni8V9is17mj=pFisUaZ_0=gq6nbK+ZcyQmg@mail.gmail.com/ > [2] https://lore.kernel.org/linux-mtd/20210413161840.345208-1-miquel.raynal@bootlin.com > > Signed-off-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next. Miquel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel