Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2220114ybb; Mon, 30 Mar 2020 01:45:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuunh5XZ07ZJeJ1fdzQto5o8RntIkahAuEQAREorzHe/yTkA1wbYEWMlH0txctBFV1YhcYG X-Received: by 2002:a05:6830:1aee:: with SMTP id c14mr7972289otd.141.1585557955963; Mon, 30 Mar 2020 01:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585557955; cv=none; d=google.com; s=arc-20160816; b=WaPwZQ958yBGxPxpJ9OGclGYTjPVZ7mIfAXIFJOnpl2/V//1tizlzEtU+Lnypf26Nm E1QkdMVRK4HXsfDIuqUsgEqodjoPxQdK5vy0Bh0nVQ3XjxFJssSBys2BsaHMTiGbldF3 c9c1S0DweQpRnIbr801Tl2o8DkU2xiaUjeJemRYvf8nwcm1za8f6L2NKXb3fde9zjSAB S9NYlWjUpe12+6e5Z0R91NDkt7aEweGaW1hfBTUXvJ+p5kvIqAsFF3g1hidWP688bz6B YAafLRyEg8f7k39LDIbsi+m37ts05ZITmvgqz7MpxG7d/Zmjr7H9+eioWi99f+zbNVgX vXeQ== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=XTbf1hQqvyJcCofyphg/JKtibgfYWMqvgBpI/eNFU+w=; b=nIuTcIJYlyRTm9hCcayCA7gJvy1Nmz2lBCr8QoI3p37Ic9rTVJQkHSXTwxhyoN18kY HvCH+gekQEpTvDNlToff/XP5AGDi9cMlKyjzDlontIqc2tldxwBBP/dk2jCwq9nSaPiU 7tcPcqf3he1FqZxEH0lDBRSfRAP+7rYYIHPQuOUXCDWZfWSt6suB/wm9vJX8O4WvMu4T vK2gh8/ahXdZEaBdWo6rR8+X9bEhBTfJZdx6uV7+f8RWLfIwD5sA6/b5YD5h5fnU13Tl rsP9vwLfERTECVaQWBxuvjrpba0ZPjtZMh1qA1ERxo42SfWAJ9PDqE6aS2WAT/yJApZO KOUA== 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 z14si6233092oom.72.2020.03.30.01.45.43; Mon, 30 Mar 2020 01:45:55 -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 S1729745AbgC3Iow (ORCPT + 99 others); Mon, 30 Mar 2020 04:44:52 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42578 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728759AbgC3Iow (ORCPT ); Mon, 30 Mar 2020 04:44:52 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 75258CA3697BEB96955C; Mon, 30 Mar 2020 16:44:45 +0800 (CST) Received: from [127.0.0.1] (10.67.102.197) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Mon, 30 Mar 2020 16:44:34 +0800 Subject: Re: [PATCH] mtd:clear cache_state to avoid writing to bad clocks repeatedly To: Miquel Raynal CC: , , , , , , , References: <1585400477-65705-1-git-send-email-nixiaoming@huawei.com> <20200330095341.284048c3@xps13> From: Xiaoming Ni Message-ID: Date: Mon, 30 Mar 2020 16:44:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20200330095341.284048c3@xps13> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.102.197] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> + return ret; >> } >> >> > > Otherwise looks good to me. > > With the above addressed: > > Reviewed-by: Miquel Raynal > > > Thanks, > Miquèl > > . Thanks for your advice, I will send v2 patch later Thanks, Xiaoming Ni