Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2023520ybl; Sun, 19 Jan 2020 17:06:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyEyHCkqthx2VodcTOm6WBE3zcv1oPyiWe028r5qd/pOEbZxwvYwwQkMCc6xS0F2uAYxCSn X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr14697495otc.186.1579482379496; Sun, 19 Jan 2020 17:06:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579482379; cv=none; d=google.com; s=arc-20160816; b=M1K2CND13fzXxmNATQRha8PW6yVB1Z6TCHL88UX08065slDDUjfOJ2a2Auui2QbO/J 7WFGXmdW2+BPmD/GYeWlGJB1vBWtSseJTo4peG67gSY781EvasvQdRq/3rEQ4V0UTjtn 6CkY+dcxa4KPORyEe60C2cizFVsuD8O9tK5GQY/fKt0YwayX6i/+MS3WEXxbHwim6GeX Sab70f63t2BzQ8YtfHkBbh2QqevJB9kb07pSekZtC1JHnAnwVdF1oFxs1LY0p53GZY7q g621QXwj2oFZJIL6t84L1Xcpvc+k2kVnQd/syiGiLFcteoqxdWeNApVyRVaKIVBT0uUt Wxhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=/rRGYLUOoEaqokK9fpA7/tCNkMLqxcoJntLn+/0SWew=; b=FWeetc3X4ebNuV9rLwmWfTpNdpap0BdmhPg/QaMaLwi2lf3gWLmE/9PbuEDu3AiRDX qCNzLihf58RseM1SftApzKUwQR1pn3Cc4s6dYr9+5vEIPbz+Jltopgk+Sp4dERRmC02y 0SEWrQzmUzsHN0HNXyBde80ReH9HKwYKjmm1bxpOl+QqmmmLDO1JiAI6e/RVAyiGI1bw ZOgIs75Gg3qAxxidavUtymhn5YY13zZRcXY/JJCDofQBOIUnsSI1+rFTygiZU/bscg6h J7IeArxKFms0cJTVgL/C0iKTVlyezuYR/HwGpUMbUPdgT7ISXeGRmm+DFV/TeDGKMgEk IyJw== 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 f18si18826943otl.29.2020.01.19.17.05.54; Sun, 19 Jan 2020 17:06:19 -0800 (PST) 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 S1729017AbgATBEG (ORCPT + 99 others); Sun, 19 Jan 2020 20:04:06 -0500 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]:57921 "EHLO smtp2207-205.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728895AbgATBEF (ORCPT ); Sun, 19 Jan 2020 20:04:05 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.06713192|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.253924-0.0783178-0.667759;DS=CONTINUE|ham_system_inform|0.0651482-0.00102876-0.933823;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03307;MF=liaoweixiong@allwinnertech.com;NM=1;PH=DS;RN=17;RT=17;SR=0;TI=SMTPD_---.Gf.OYKf_1579482234; Received: from PC-liaoweixiong.allwinnertech.com(mailfrom:liaoweixiong@allwinnertech.com fp:SMTPD_---.Gf.OYKf_1579482234) by smtp.aliyun-inc.com(10.147.42.16); Mon, 20 Jan 2020 09:03:59 +0800 From: WeiXiong Liao To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Greg Kroah-Hartman , Jonathan Cameron , WeiXiong Liao Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v1 00/11] pstore: support crash log to block and mtd device Date: Mon, 20 Jan 2020 09:03:42 +0800 Message-Id: <1579482233-2672-1-git-send-email-liaoweixiong@allwinnertech.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Why do we need to log to block (mtd) device? 1. Most embedded intelligent equipment have no persistent ram, which increases costs. We perfer to cheaper solutions, like block devices. 2. Do not any equipment have battery, which means that it lost all data on general ram if power failure. Pstore has little to do for these equipments. Why do we need mtdpstore instead of mtdoops? 1. repetitive jobs between pstore and mtdoops Both of pstore and mtdoops do the same jobs that store panic/oops log. 2. do what a driver should do To me, a driver should provide methods instead of policies. What MTD should do is to provide read/write/erase operations, geting rid of codes about chunk management, kmsg dumper and configuration. 3. enhanced feature Not only store log, but also show it as files. Not only log, but also trigger time and trigger count. Not only panic/oops log, but also log recorder for pmsg, console and ftrace in the future. Before upstream submission, pstore/blk is tested on arch ARM and x84_64, block device and mtd device, built as modules and in kernel. Here are the details: https://github.com/gmpy/articles/blob/master/pstore/Test-Pstore-Block.md [PATCH v1]: 1. fix errors and warnings reported by kbuild test robot. WeiXiong Liao (11): pstore/blk: new support logger for block devices blkoops: add blkoops, a warpper for pstore/blk pstore/blk: support pmsg recorder pstore/blk: blkoops: support console recorder pstore/blk: blkoops: support ftrace recorder Documentation: pstore/blk: blkoops: create document for pstore_blk pstore/blk: skip broken zone for mtd device blkoops: respect for device to pick recorders pstore/blk: blkoops: support special removing jobs for dmesg. blkoops: add interface for dirver to get information of blkoops mtd: new support oops logger based on pstore/blk Documentation/admin-guide/pstore-block.rst | 297 ++++++ MAINTAINERS | 3 +- drivers/mtd/Kconfig | 10 + drivers/mtd/Makefile | 1 + drivers/mtd/mtdpstore.c | 530 +++++++++++ fs/pstore/Kconfig | 109 +++ fs/pstore/Makefile | 5 + fs/pstore/blkoops.c | 490 ++++++++++ fs/pstore/blkzone.c | 1344 ++++++++++++++++++++++++++++ include/linux/blkoops.h | 94 ++ include/linux/pstore_blk.h | 91 ++ 11 files changed, 2973 insertions(+), 1 deletion(-) create mode 100644 Documentation/admin-guide/pstore-block.rst create mode 100644 drivers/mtd/mtdpstore.c create mode 100644 fs/pstore/blkoops.c create mode 100644 fs/pstore/blkzone.c create mode 100644 include/linux/blkoops.h create mode 100644 include/linux/pstore_blk.h -- 1.9.1