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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 221B2C47088 for ; Wed, 26 May 2021 16:46:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EADF8610A8 for ; Wed, 26 May 2021 16:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234155AbhEZQry convert rfc822-to-8bit (ORCPT ); Wed, 26 May 2021 12:47:54 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43969 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231843AbhEZQrr (ORCPT ); Wed, 26 May 2021 12:47:47 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id B2DD620002; Wed, 26 May 2021 16:46:13 +0000 (UTC) Date: Wed, 26 May 2021 18:46:12 +0200 From: Miquel Raynal To: Linus Torvalds Cc: linux-mtd , Richard Weinberger , Tudor Ambarus , Vignesh Raghavendra , Frieder Schrempf , Linux Kernel Mailing List Subject: Re: [GIT PULL] mtd: Changes for v5.13-rc4 Message-ID: <20210526184612.751e7e5c@xps13> In-Reply-To: References: <20210526175924.4f9ab124@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, Linus Torvalds wrote on Wed, 26 May 2021 06:20:35 -1000: > On Wed, May 26, 2021 at 5:59 AM Miquel Raynal wrote: > > > > Raw NAND: > > * txx9ndfmc, tmio, sharpsl, ndfc, lpc32xx_slc, fsmc, cs553x: > > - Fix external use of SW Hamming ECC helper > > Why are these guys all pointlessly duplicating the ecc wrapper > functions for their ecc 'correct' functions? > > The whole "the Hamming software ECC engine has been updated to become > a proper and independent ECC engine" excuse makes no sense. If > multiple chips just want a basic sw hamming helper, then they should > have one. Not have to be forced to each write their own pointless > wrapper like this. > > These chip drivers just want 'ecc_sw_hamming_correct()' with the > proper arguments, and it seems entirely wrong to duplicate the helper > five times or whatever. There should just be a generic helper - the > way there used to be. > > In fact, I would generally strongly recommend that if there used to be > a generic helper that different chip drivers used (ie the old > rawnand_sw_hamming_correct()), then such a helper should be left alone > and not change the semantics of it. I am not happy neither with the fix (which I wrote myself) as my first goal was to uniformize the way the Hamming helpers are being called (as part of a much bigger work). I assumed that all drivers either used the Hamming software engine or simply didn't, without thinking about the "intermediate" situations where a particular driver would just want to call a particular Hamming helper to workaround its "missing" hardware capabilities. Unfortunately when I spotted that many drivers were broken by my rework I decided to provide per-driver fixes, while, as you suggest, I should probably have declared a generic 'hamming correct' core helper and use that directly instead of duplicating the logic in each broken driver. > The new "proper independent ECC engine" that had new semantics should > have been the one that got a new name, rather than breaking an old and > existing helper function and then making the chip drivers pointlessly > write their own new helper functions. > > I've pulled this, but under protest. The patch honestly just looks > like mindless duplication. Thanks. Miquèl