Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp399279ybb; Wed, 25 Mar 2020 01:56:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu9koPL9/iGEwlHtmngtI1n4Dj4pAgG4vxA3pBh7XuD0QGkLfIaqpKJvYWDaN6VW+vZnsBs X-Received: by 2002:a05:6830:1c7:: with SMTP id r7mr1765204ota.58.1585126607969; Wed, 25 Mar 2020 01:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585126607; cv=none; d=google.com; s=arc-20160816; b=DF4+BDxkTQ8DtmCo4LLW0TuS7hBzpMO8qXa91TaqVXmcaqWQfoQve54CthkQdLR3ZH a4NO28eTQXDFHzn3iejlCUuD05Gx8EIiDE2d8DZjmbBBkqAOjf5BrpCMMYR6OOREkNqm UttSSJRzWckE6q3UXP7+OVwfaeMv7p8cE66yfFTcJx8twPDKC3zpWpzZdgkKaLCCrgY4 IwVieUs/rhKvFnd/wNsDKvxB7R33EasT0N3b27KqnpZT0R2hip3tb2+ZZanT7sx9WGfk 39LE2hyQdr6M9gi4jj7wkcO/WUV8fm+P8HCiGhmtqTtTIpp1B1R0vM/Z3WFD5TL8sGPU 4yfg== 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=tjjDQjeve2MeZlQA3bRo12OylWPBqDOCjJLS1BN6g3Q=; b=toUmYlPcbsGyUY6Zf1UCIpkU+WHn2+Tj690X9GFakpYtfbf0x+VUI8BZJHHwoMafaN ZEEY+vfSjDKmjd3iuEQ7fJPQNLw7/bx5j2F0KmY2O1UNBInRF01Xnucn5UT6nvCSzfDZ tg7cs7bvaQU1hk7PcyYTtvtTX+H071ofBA9FWj2ctK1eu2pvvESOpzvME4YRKS+33Bhr Nrx31EA6IOx5ktqyzEH5mQzW0tY8pjraBrH0Zj1QNq97+A8MoJkXMXSI/0WpIfPmUUDq a8bgyRwuQy8wgQxeewxdxxtsYDjKC/HfOFlIv4Lp8DkYPUqrYLemKR9WPpVs+PmMburz c9sQ== 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 l24si10412801otk.286.2020.03.25.01.56.36; Wed, 25 Mar 2020 01:56:47 -0700 (PDT) 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 S1727690AbgCYI4I (ORCPT + 99 others); Wed, 25 Mar 2020 04:56:08 -0400 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]:45550 "EHLO smtp2207-205.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbgCYI4F (ORCPT ); Wed, 25 Mar 2020 04:56:05 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07436284|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0720342-0.000775372-0.92719;FP=0|0|0|0|0|-1|-1|-1;HT=e01a16370;MF=liaoweixiong@allwinnertech.com;NM=1;PH=DS;RN=17;RT=17;SR=0;TI=SMTPD_---.H50xpyL_1585126516; Received: from PC-liaoweixiong.allwinnertech.com(mailfrom:liaoweixiong@allwinnertech.com fp:SMTPD_---.H50xpyL_1585126516) by smtp.aliyun-inc.com(10.147.42.241); Wed, 25 Mar 2020 16:55:25 +0800 From: WeiXiong Liao To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mauro Carvalho Chehab , Rob Herring , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, WeiXiong Liao Subject: [PATCH v3 00/11] pstore: mtd: support crash log to block and mtd device Date: Wed, 25 Mar 2020 16:54:55 +0800 Message-Id: <1585126506-18635-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 v3]: 1. patch 1~10: a lot of improvements according to Kees Cook including rename module, typo, reorder, rewrite document, bugs and so on. 2. patch 11: rename funtions of pstore/blk and update document. [PATCH v2]: 1. fix syntax error in documents. Thank Randy Dunlap 2. replace pr_* with dev_* for mtdpstore. Thank Vignesh Raghavendra 3. improve mtdpstore. Thank Miquel Raynal [PATCH v1]: 1. fix errors and warnings reported by kbuild test robot. WeiXiong Liao (11): pstore/zone: a common layer to manage storage as zones pstore/blk: new support logger for block devices pstore/blk: respect for driver to pick pstore front-ends pstore/blk: pstore/zone: support pmsg recorder pstore/blk: blkoops: support console recorder pstore/blk: blkoops: support ftrace recorder Documentation: create document for pstore/blk pstore/zone: skip broken zone for MTD device pstore/blk: a way to get user configure about pstore front-ends. pstore/zone: pstore/blk: support non-block devices mtd: new support oops logger based on pstore/blk Documentation/admin-guide/pstore-block.rst | 237 +++++ MAINTAINERS | 1 + drivers/mtd/Kconfig | 10 + drivers/mtd/Makefile | 1 + drivers/mtd/mtdpstore.c | 564 +++++++++++ fs/pstore/Kconfig | 107 ++ fs/pstore/Makefile | 4 + fs/pstore/platform.c | 3 +- fs/pstore/pstore_blk.c | 480 +++++++++ fs/pstore/pstore_zone.c | 1511 ++++++++++++++++++++++++++++ include/linux/pstore.h | 1 + include/linux/pstore_blk.h | 77 ++ include/linux/pstore_zone.h | 60 ++ 13 files changed, 3055 insertions(+), 1 deletion(-) create mode 100644 Documentation/admin-guide/pstore-block.rst create mode 100644 drivers/mtd/mtdpstore.c create mode 100644 fs/pstore/pstore_blk.c create mode 100644 fs/pstore/pstore_zone.c create mode 100644 include/linux/pstore_blk.h create mode 100644 include/linux/pstore_zone.h -- 1.9.1