From patchwork Mon Apr 12 08:36:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 49954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 39184B7D1A for ; Mon, 12 Apr 2010 18:41:08 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O1FAO-0005Vj-3a; Mon, 12 Apr 2010 08:38:48 +0000 Received: from mail-pw0-f49.google.com ([209.85.160.49]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O1F8C-0005GV-6l for linux-mtd@lists.infradead.org; Mon, 12 Apr 2010 08:36:33 +0000 Received: by mail-pw0-f49.google.com with SMTP id 4so487987pwj.36 for ; Mon, 12 Apr 2010 01:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:cc:content-type; bh=y1phxzCx5HeaR6gBJM8Gh8xi3iPlAeD6lWvnxpaNzp8=; b=qPxecZMrfUTLGe4oTs2YytGCwlI5RO8FntcVYshEcnpIVfb+T1Go/RUYR4iKntrMFM eWP4iG8dxhuStZWYYRA9tcE+jyKGP5MYZw8JQuvo7yPFFfaLHL3D3KmSvwI6nZgf7ayo vwXAyaxAab0UiMy4+am0UDsLaxIfbW7Rmd+J8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=Fmzeak8DBqJmVnMywjpuw9KYPlBJ9Boi3m4GDWptJyesuYzXKXdovyPQMg3D3MzFmS AymLTeQrFAt+2O1B0VPqIS/kAGo0M0vxFSAYagfPFvJAYgas3jcjCcTdPvldeCoD0vtU Qv9qfxR3HvfCyhzmPhiIt9Y6vO+7M49eOUbU4= MIME-Version: 1.0 Received: by 10.143.9.13 with HTTP; Mon, 12 Apr 2010 01:36:22 -0700 (PDT) Date: Mon, 12 Apr 2010 14:06:22 +0530 Received: by 10.143.87.1 with SMTP id p1mr1349160wfl.342.1271061382863; Mon, 12 Apr 2010 01:36:22 -0700 (PDT) Message-ID: Subject: PATCH 5/7] ubi: logging feature for ubi From: Brijesh Singh To: Artem.Bityutskiy@nokia.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100412_043632_385858_9D557DC4 X-CRM114-Status: UNSURE ( 6.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (brijesh.s.singh[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: linux-mtd@lists.infradead.org, rohitvdongre@gmail.com, David Woodhouse , rohit.dongre@samsung.com, brijesh.s.singh@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Note: debug functions for logging feature Signed-off-by: Rohit Dongre --- ubi_old/drivers/mtd/ubi/debug.h 2010-04-09 21:54:13.955581334 +0530 +++ ubi_new/drivers/mtd/ubi/debug.h 2010-04-09 21:54:02.635580892 +0530 @@ -94,6 +94,28 @@ #define UBI_IO_DEBUG 0 #endif + +#ifdef CONFIG_MTD_UBI_DEBUG_MSG_SB +/* Messages from sb module of UBI with log */ +#define dbg_sb(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) +#else +#define dbg_sb(fmt, ...) ({}) +#endif + +#ifdef CONFIG_MTD_UBI_DEBUG_MSG_CMT +/* Messages from commit module of UBI with log */ +#define dbg_cmt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) +#else +#define dbg_cmt(fmt, ...) ({}) +#endif + +#ifdef CONFIG_MTD_UBI_DEBUG_MSG_EL +/* Messages from el module of UBI with log */ +#define dbg_el(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) +#else +#define dbg_el(fmt, ...) ({}) +#endif + #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len); int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum, @@ -163,6 +185,9 @@ #define dbg_wl(fmt, ...) ({}) #define dbg_io(fmt, ...) ({}) #define dbg_bld(fmt, ...) ({}) +#define dbg_sb(fmt, ...) ({}) +#define dbg_cmt(fmt, ...) ({}) +#define dbg_el(fmt, ...) ({}) #define ubi_dbg_dump_stack() ({}) #define ubi_dbg_dump_ec_hdr(ec_hdr) ({}) #define ubi_dbg_dump_vid_hdr(vid_hdr) ({}) --- ubi_old/drivers/mtd/ubi/scan.h 2010-04-09 21:54:13.955581334 +0530 +++ ubi_new/drivers/mtd/ubi/scan.h 2010-04-09 21:54:02.645580870 +0530 @@ -89,6 +89,7 @@ * @corr: list of corrupted physical eraseblocks * @free: list of free physical eraseblocks * @erase: list of physical eraseblocks which have to be erased + * @resvd: list of physical eraseblocks which are resrvd for special use * @alien: list of physical eraseblocks which should not be used by UBI (e.g., * those belonging to "preserve"-compatible internal volumes) * @bad_peb_count: count of bad physical eraseblocks @@ -113,6 +114,9 @@ struct list_head corr; struct list_head free; struct list_head erase; +#ifdef CONFIG_MTD_UBI_LOGGED + struct list_head resvd; +#endif struct list_head alien; int bad_peb_count; int vols_found;