{"id":2228628,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228628/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/dd48da7aa5d821b56528824bfd4b57e014947a03.1777272283.git.weijie.gao@mediatek.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<dd48da7aa5d821b56528824bfd4b57e014947a03.1777272283.git.weijie.gao@mediatek.com>","date":"2026-04-27T07:09:37","name":"[v3,09/10] ubi: add comments for exported ubi API functions","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9682ca090235de49a07c2675a946d0793049a53b","submitter":{"id":75269,"url":"http://patchwork.ozlabs.org/api/1.1/people/75269/?format=json","name":"Weijie Gao","email":"weijie.gao@mediatek.com"},"delegate":{"id":1691,"url":"http://patchwork.ozlabs.org/api/1.1/users/1691/?format=json","username":"hs","first_name":"Heiko","last_name":"Schocher","email":"hs@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/dd48da7aa5d821b56528824bfd4b57e014947a03.1777272283.git.weijie.gao@mediatek.com/mbox/","series":[{"id":501588,"url":"http://patchwork.ozlabs.org/api/1.1/series/501588/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501588","date":"2026-04-27T07:09:11","name":"Add support for ubi environment to create volumes (v3)","version":3,"mbox":"http://patchwork.ozlabs.org/series/501588/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228628/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228628/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256\n header.s=dk header.b=SNeyV3mb;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=mediatek.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=mediatek.com header.i=@mediatek.com\n header.b=\"SNeyV3mb\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=quarantine dis=none)\n header.from=mediatek.com","phobos.denx.de;\n spf=pass smtp.mailfrom=weijie.gao@mediatek.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3vqD1Pkkz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 17:10:48 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 7BE0184277;\n\tMon, 27 Apr 2026 09:09:48 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 7BA0984277; Mon, 27 Apr 2026 09:09:47 +0200 (CEST)","from mailgw02.mediatek.com (unknown [210.61.82.184])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 0E598842CE\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 09:09:44 +0200 (CEST)","from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by\n mailgw02.mediatek.com (envelope-from <weijie.gao@mediatek.com>)\n (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256)\n with ESMTP id 1941246627; Mon, 27 Apr 2026 15:09:40 +0800","from mtkmbs11n2.mediatek.inc (172.21.101.187) by\n MTKMBS09N1.mediatek.inc (172.21.101.35) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.29; Mon, 27 Apr 2026 15:09:39 +0800","from mcddlt001.gcn.mediatek.inc (10.19.240.15) by\n mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id\n 15.2.2562.29 via Frontend Transport; Mon, 27 Apr 2026 15:09:38 +0800"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS,\n UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2","X-UUID":["0f328e8e420811f19a16598d5ca7f8ec-20260427","0f328e8e420811f19a16598d5ca7f8ec-20260427"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n d=mediatek.com;\n s=dk;\n h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From;\n bh=yX0nsLzNVHpylOhfWa0NxbWXIBSya3SxZxsin8XWULQ=;\n b=SNeyV3mbz9F2oUMfgTE4eJOpqwp8ybwkpUquCpfMN4hGQR4bp6NKS5TMXUuDaWZ9KxosddsK7jqXSJx4mXlhqD53aQgumrYtwoNPAWBRl0RUel2ajCuPRZ8HeDoI25Ot0iky99dS1yfqyCZ61elUvFnEpdfys0iSZOhm5RE8bXo=;","X-CID-P-RULE":"Release_Ham","X-CID-O-INFO":"VERSION:1.3.12, REQID:9e4b361b-7855-46c3-8851-458ce499f9f9,\n IP:0,\n U\n RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:\n release,TS:0","X-CID-META":"VersionHash:e7bac3a, CLOUDID:b2cda764-469e-4eb6-aeb8-4b21454b0f32,\n B\n ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|836|865|888|898,TC:-5,Cont\n ent:0|15|50,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL:0\n ,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0","X-CID-BVR":"2,SSN|SDN","X-CID-BAS":"2,SSN|SDN,0,_","X-CID-FACTOR":"TF_CID_SPAM_SNR","X-CID-RHF":"D41D8CD98F00B204E9800998ECF8427E","From":"Weijie Gao <weijie.gao@mediatek.com>","To":"<u-boot@lists.denx.de>","CC":"GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>, Tom Rini\n <trini@konsulko.com>, Marek Vasut <marek.vasut+renesas@mailbox.org>, Simon\n Glass <sjg@chromium.org>, Weijie Gao <weijie.gao@mediatek.com>","Subject":"[PATCH v3 09/10] ubi: add comments for exported ubi API functions","Date":"Mon, 27 Apr 2026 15:09:37 +0800","Message-ID":"\n <dd48da7aa5d821b56528824bfd4b57e014947a03.1777272283.git.weijie.gao@mediatek.com>","X-Mailer":"git-send-email 2.17.0","In-Reply-To":"<cover.1777272283.git.weijie.gao@mediatek.com>","References":"<cover.1777272283.git.weijie.gao@mediatek.com>","MIME-Version":"1.0","Content-Type":"text/plain","X-MTK":"N","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"This patch adds comments for exported ubi command API functions.\n\nSigned-off-by: Weijie Gao <weijie.gao@mediatek.com>\n---\nv3: new\n---\n include/ubi_uboot.h | 86 +++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 86 insertions(+)","diff":"diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h\nindex ee78f02ae94..0769f089e6b 100644\n--- a/include/ubi_uboot.h\n+++ b/include/ubi_uboot.h\n@@ -47,14 +47,100 @@\n int ubi_mtd_param_parse(const char *val, struct kernel_param *kp);\n int ubi_init(void);\n void ubi_exit(void);\n+\n+/**\n+ * ubi_detach() - detach UBI from MTD partition\n+ *\n+ * This function performs the cleanup of the UBI subsystem to make sure the\n+ * MTD partition can be safely used by other purpose, or be attached again\n+ * with ubi_part().\n+ *\n+ * Any mounted UBIFS will be unmounted automatically.\n+ *\n+ * Return: 0 on success.\n+ */\n int ubi_detach(void);\n+\n+/**\n+ * ubi_part() - attach UBI to MTD partition\n+ * @part_name: name of the MTD partition to attach\n+ * @vid_header_offset: VID header offset (string)\n+ *\n+ * This function detaches any existing UBI device, then probes for the\n+ * specified MTD partition, and then scans it to initialize UBI.\n+ *\n+ * @vid_header_offset is optional and is usually set to NULL.\n+ *\n+ * Return: 0 on success, 1 if partition not found, or -ve on error.\n+ */\n int ubi_part(const char *part_name, const char *vid_header_offset);\n+\n+/**\n+ * ubi_volume_write() - write data to UBI volume\n+ * @volume: name of the volume to write to\n+ * @buf: data buffer to be written\n+ * @offset: start offset for writing\n+ * @size: number of bytes to write\n+ *\n+ * This function writes data to the specific UBI volume. If the offset is zero,\n+ * it initiates a full volume update. Otherwise, it performs an offset-based\n+ * write using LEB changes.\n+ *\n+ * Return: 0 on success, or -ve on error.\n+ */\n int ubi_volume_write(const char *volume, const void *buf, loff_t offset,\n \t\t     size_t size);\n+\n+/**\n+ * ubi_volume_read() - read data from UBI volume\n+ * @volume: name of the volume to read from\n+ * @buf: buffer to hold the read data\n+ * @offset: start offset for reading\n+ * @size: number of bytes to read\n+ *\n+ * This function reads data from the specified UBI volume. If @size is zero,\n+ * the function reads the entire volume content starting from @offset.\n+ *\n+ * Return: 0 on success, or -ve on error.\n+ */\n int ubi_volume_read(const char *volume, void *buf, loff_t offset, size_t size);\n+\n+/**\n+ * ubi_create_vol() - create UBI volume\n+ * @volume: name of the volume to create\n+ * @size: size of the volume in bytes\n+ * @dynamic: create dynamic volume if set to true\n+ * @vol_id: volume ID\n+ * @skipcheck: skip CRC check on this volume if set to true\n+ *\n+ * This function creates a new UBI volume with the specified parameters.\n+ * If @size is negative, all available spaces will be used.\n+ * if @vol_id is negative, volume ID will be selected and assigned by UBI.\n+ *\n+ * Return: 0 on success, or -ve on error.\n+ */\n int ubi_create_vol(const char *volume, int64_t size, bool dynamic, int vol_id,\n \t\t   bool skipcheck);\n+\n+/**\n+ * ubi_find_volume() - find UBI volume by name\n+ * @volume: name of the volume to find\n+ *\n+ * This function searches for a UBI volume with the specified name in the\n+ * current UBI device.\n+ *\n+ * Return: pointer to the UBI volume structure, or %NULL if not found.\n+ */\n struct ubi_volume *ubi_find_volume(const char *volume);\n+\n+/**\n+ * ubi_remove_vol() - remove UBI volume\n+ * @volume: name of the volume to remove\n+ *\n+ * This function removes an existing UBI volume from the current UBI device.\n+ *\n+ * Return: 0 on success, or a positive error code on failure.\n+ */\n int ubi_remove_vol(const char *volume);\n \n extern struct ubi_device *ubi_devices[];\n","prefixes":["v3","09/10"]}