From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23D4635957 for ; Thu, 23 Jul 2026 03:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.222 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784775675; cv=none; b=ZfFnHACkofxpKVvT0sE42XdBlNX4LIBxfy7+FoEb/t7GAO8EhXHiVneOL118fDRDnrpwjyJBIMTIZcYqlFiG2/DJ8wlQRia5c/kX7pfqO7C6LdiaX7AZ3Yo34VNamvd4BiZDO3v98RTQWTS9NGM1ON3l/u5Mr/WXPIqaqHSYke8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784775675; c=relaxed/simple; bh=FhYvPRgoijz0pYj2BAEIraewkvZR7OlAdAiNUTWzy3Q=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=UeW7RHGXhvoeD5jxSmcouEVNSULfX0TythSLrXhychLK21uf9ugtBtddRcLkSmspNlfdmysSFhfqhl77MtJ7kHhSPmrlra5f+VT0iDboaL3MDg+PCzyOdOxhPVn/3s3Oi3/nDhhSOSVCooryjreph76ySMYTpGC3nX7fchBEpe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=WX4J53/4; arc=none smtp.client-ip=113.46.200.222 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="WX4J53/4" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=uIWdmlpVm7JjDhegqPdb1O7R9OzIm+ndXeUpsXZfUhI=; b=WX4J53/4t6DDohMUZHN6frK/TDJ0FV8/fxCS1fftvmmEncY70sihguIwU7E9kidQqvZquYEN5 FB2dxrFNNQd21DHRnI3yGLIP2jclX6lWuNlLurDIbEIa6go1Ltp6boBWGt3E4HCgnUgdDjzFaY2 Wl/Wi4lAkKP/d/KCyHi3wsI= Received: from mail.maildlp.com (unknown [172.19.163.214]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4h5Fy900YyzLlTk; Thu, 23 Jul 2026 10:51:44 +0800 (CST) Received: from whupemo200011.china.huawei.com (unknown [7.152.185.179]) by mail.maildlp.com (Postfix) with ESMTPS id 158B04056C; Thu, 23 Jul 2026 11:01:08 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by whupemo200011.china.huawei.com (7.152.185.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 23 Jul 2026 11:01:06 +0800 Subject: Re: [PATCH 2/2] UBI: support per-device wear-leveling threshold To: Ran Hongyun , , , , , CC: , , , References: <20260723020233.3079997-1-ranhongyun1@huawei.com> <20260723020233.3079997-3-ranhongyun1@huawei.com> From: Zhihao Cheng Message-ID: <7971d65d-ae24-d508-23ff-52afdc0b8d09@huawei.com> Date: Thu, 23 Jul 2026 11:01:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260723020233.3079997-3-ranhongyun1@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To whupemo200011.china.huawei.com (7.152.185.179) ÔÚ 2026/7/23 10:02, Ran Hongyun дµÀ: > The UBI wear-leveling threshold (CONFIG_MTD_UBI_WL_THRESHOLD) is > currently a compile-time constant shared by all UBI devices. When a > single kernel image must support multiple NAND flashes with different > erase lifetimes, one global threshold cannot suit all devices. > > Add a per-device configurable wl_threshold parameter: > > - UAPI: add __s32 wl_threshold to struct ubi_attach_req, carved > from the existing padding. > > - Module parameter: ubi.mtd gains a new optional token > "wl_threshold": > ubi.mtd=0,0,0,0,0,0,256 ubi.mtd=1,0,0,0,0,0,4096 > > 0 means "use the kernel default", the accepted range is > 2-65536. > > Signed-off-by: Ran Hongyun > --- > drivers/mtd/ubi/build.c | 43 ++++++++++++++++++++++++++++++------ > drivers/mtd/ubi/cdev.c | 2 +- > drivers/mtd/ubi/fastmap-wl.c | 8 +++---- > drivers/mtd/ubi/ubi.h | 21 +++++++++++++++++- > drivers/mtd/ubi/wl.c | 39 ++++++++------------------------ > include/uapi/mtd/ubi-user.h | 10 ++++++++- > 6 files changed, 79 insertions(+), 44 deletions(-) > Reviewed-by: Zhihao Cheng