Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2221544ybb; Mon, 30 Mar 2020 01:48:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsoRYRRcEoZpWb8bjuh5dda2rj6mPn/8KcOYqtmRzXsfAkGTbwv/vROe5na2J/ar4LkEZg9 X-Received: by 2002:a05:6830:19ee:: with SMTP id t14mr8865559ott.287.1585558122296; Mon, 30 Mar 2020 01:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585558122; cv=none; d=google.com; s=arc-20160816; b=h+AmhQ2TD83xFM8PndSo5aMGS4GQmL2Cw44fKKnRZjzzl0+HtcT4r2gfD3eb2Zc0fa hnlFZS1IQ1lzxI6Q0RGQnma+epoCZFS27AG8AP1rQypegkR8O4Ptyvr57b2DvEkrRt+a B56fzsYqTGackWIToSXbq1B02DHqWfazlTOWjSWSF4kcOV3VKrRZub2D53s1WQ1IUWLM gLwEL1wTQqgD5D3XuWPZUwledRMD+mBgx+98w8M4bRecGREvrkqaOwwLWEv5NcKivfAJ 5UIirjZedz8HDhu5ncDbybF81m2ZvKfXimmFT/ffB1MH3N9b6YzPWKMVGhO6ZtiqwFdw Nd+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=nACmkA66jCDsay1h3yWsjQg6QIHcYOEexPR/zTtWKnM=; b=trrOp8ouJdGJkiqXP7oj6ntj8ZH9KRg/Yh4h4JGVOwS3UEAu8aE43Gnh5AS9/B2+Yb Kn+hn1gAJAi0kB/Jp9PrMCTSXva0r++NmE8pV7VwbuThC4ZYxGQGBJzRQnjBiguP0VHa SXYi/wxnBLIFdETzKkhlytwgt1R823gbv1boWns8LkZEPk+6zIb9+WY6k0Su1htk33yi zW2UReIE1Js+dpV9IC6JJhyiAl/mdPcbgDlZvbGeIrbc8UpxLefWOn2xl6bp51pEwZZq ZREM70VVa1ojoJ6H7kMHN/BJ56PHA85oiPB3c/W+77JZ+UfBRjlT2uqLSbFAyzc19AX/ EUSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si6183155oif.30.2020.03.30.01.48.29; Mon, 30 Mar 2020 01:48:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729710AbgC3Irr convert rfc822-to-8bit (ORCPT + 99 others); Mon, 30 Mar 2020 04:47:47 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:53475 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729538AbgC3Irr (ORCPT ); Mon, 30 Mar 2020 04:47:47 -0400 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 682A6240008; Mon, 30 Mar 2020 08:47:42 +0000 (UTC) Date: Mon, 30 Mar 2020 10:47:41 +0200 From: Miquel Raynal To: Xiaoming Ni Cc: , , , , , , , Subject: Re: [PATCH] mtd:clear cache_state to avoid writing to bad clocks repeatedly Message-ID: <20200330104741.2f48378d@xps13> In-Reply-To: References: <1585400477-65705-1-git-send-email-nixiaoming@huawei.com> <20200330095341.284048c3@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xiaoming, Xiaoming Ni wrote on Mon, 30 Mar 2020 16:44:29 +0800: > On 2020/3/30 15:53, Miquel Raynal wrote: > > Hi Xiaoming, > > > > Xiaoming Ni wrote on Sat, 28 Mar 2020 21:01:17 > > +0800: > > > >> The function call process is as follows: > >> mtd_blktrans_work() > >> while (1) > .... > > >> + * > >> + * if this cache_offset points to a bad block > > > > Can you start your sentences with a capital letter please? > > > > * If > > > >> + * data cannot be written to the device. > >> + * clear cache_state to avoid writing to bad clocks repeatedly > > > > * Clear > > > > And also please break your lines à 80, not 70. > > > >> */ > >> - mtdblk->cache_state = STATE_EMPTY; > >> - return 0; > >> + if (ret == 0 || ret == -EIO) > >> + mtdblk->cache_state = STATE_EMPTY; > Should I add a warning print for EIO here I don't think so. Thanks, Miquèl