From patchwork Wed Jun 13 21:23:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 929101 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KTJ9RKai"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415fzB3C4wz9s01 for ; Thu, 14 Jun 2018 07:29:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6bLg6oxLAlbce/Z2Aw3iac6v2V3yZLajZAHnpXYXJdY=; b=KTJ9RKaiCqtwEA7AvzT9Izs87C jBPlyAyE3GPDVKzbUJfk/6djgXDe86QXIHGhdfTg132tA+zMD5FraOfzbc6gJsi8q0zWi/3g5FpWY K9+tDtJvJkcAXrm6kglFLmy3OzqEHsz6BRRRS6fT3ucb3yfrBlcDbCIF/0H8IZz/gUjji9TnRw+yY NArx6NR+E3dzukgZAeALJkPNtS6dj1sXJeiueAU35qaOZ0A2qhLrohKwcIAyEMYrP+/YEgGerfqv3 dptIkBx2SpxRlFS44UJyF9YDBd8X8gFXp6hLscKIIT0wy49SlrfcwiNeL633+rIYlh5DDy7VZMj5R fia1PYKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTDKa-0000rz-AL; Wed, 13 Jun 2018 21:29:28 +0000 Received: from lilium.sigma-star.at ([109.75.188.150]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTDFi-0004uh-O4 for linux-mtd@lists.infradead.org; Wed, 13 Jun 2018 21:24:43 +0000 Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 1993418198DC8; Wed, 13 Jun 2018 23:24:08 +0200 (CEST) From: Richard Weinberger To: linux-mtd@lists.infradead.org Subject: [PATCH 12/14] ubi: uapi: Add mode selector to attach request Date: Wed, 13 Jun 2018 23:23:42 +0200 Message-Id: <20180613212344.11608-13-richard@nod.at> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180613212344.11608-1-richard@nod.at> References: <20180613212344.11608-1-richard@nod.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180613_142426_993003_CC7736FC X-CRM114-Status: GOOD ( 14.56 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This allows userspace, ubiattach, to force a full scan. Signed-off-by: Richard Weinberger --- include/uapi/mtd/ubi-user.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/uapi/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h index 5b04a494d139..cc0e54cfa7f9 100644 --- a/include/uapi/mtd/ubi-user.h +++ b/include/uapi/mtd/ubi-user.h @@ -235,12 +235,19 @@ enum { UBI_VOL_PROP_DIRECT_WRITE = 1, }; +enum { + UBI_ATTACH_MODE_AUTO = 0x0, + UBI_ATTACH_MODE_SCAN = 0x1, + UBI_ATTACH_MODE_MAX = UBI_ATTACH_MODE_SCAN, +}; + /** * struct ubi_attach_req - attach MTD device request. * @ubi_num: UBI device number to create * @mtd_num: MTD device number to attach * @vid_hdr_offset: VID header offset (use defaults if %0) * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs + * @attach_mode: selects the attach mode * @padding: reserved for future, not used, has to be zeroed * * This data structure is used to specify MTD device UBI has to attach and the @@ -276,13 +283,18 @@ enum { * eraseblocks for new bad eraseblocks, but attempts to use available * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. + * + * @attach_mode is %UBI_ATTACH_MODE_AUTO by default, and let's the UBI + * implementation decide how to attach. If %UBI_ATTACH_MODE_SCAN is selected + * a full scan is forced. */ struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; __s16 max_beb_per1024; - __s8 padding[10]; + __s8 attach_mode; + __s8 padding[9]; }; /**