Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp554697ybv; Fri, 7 Feb 2020 04:27:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxAxP3dy9tG9RN/Cms1X1POAorXvQSHvhMjQtlqNhT0TfOEMP1vMIZ6ZFfGGvUzZI457AYC X-Received: by 2002:aca:5fc6:: with SMTP id t189mr1992573oib.166.1581078435740; Fri, 07 Feb 2020 04:27:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581078435; cv=none; d=google.com; s=arc-20160816; b=e2Y7Nlzf32YBZ/m8X+0UM24loit4mScBDNXShTfXyI0jLUwNR8+LA/JIIkAG+GdWrh 1eLDQa/cdkpUy0FROPEKfPLmgvqrIAGEtCuvg582o5OHHuauMRL/4mbS+1epF27RJVgC 8zhBmUszaFggaMyhwtV6UdWYYOr89g4zbSyjH/gMuXhOteh+QUiQue3lA0jpR+Iq62Oy BgUiYdR0z0vZeA/s7ZICOaGR2GAEREjqY4D868oZcSx7GTneE5aB9gLKL+899zfa7ECi 39YdNmLyG+AnIg58GhOuvV9HCzBMmbBaEFrIQj/oaFoy04GRWlBFIAgAUCQ2mq5aADNC 26HA== 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=GQrac6F0Dupv+XjaGAsmcyPf0uFJgAIw1tbIEuBJjrM=; b=nVfqkP7wr6100ok0uosk11/U3PFhgycm08QSg7LsatoO/Qqsc1XaioYiZGPam2LJaN 7pgMgKgk4yXF7FfVR+dq7wX2eWGx0exRoXSYjGzn+xy60CGzquOR4d5tGFreKCEOSVvE G0G3O5TXMvcfvzZE37lVwj0PfsIxXRBi3cVU3NbP+JJIJxdUy3KkMaU09ZMEPB7fT9i4 0BCutmpJ3LsxDySISZcfVSHXiRzKGcYJ3fRH3Hwh/Vds7/cOmrFlVT3D4R9anAVqbouM sLUoyUJMFoyEJdATC2UvTnGSiuA3s3rwg4+JuFReq/jv2NXW6mO4cCM/Us8z3WKsgtXe S9yg== 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 c144si4028713oig.263.2020.02.07.04.27.03; Fri, 07 Feb 2020 04:27:15 -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 S1727018AbgBGM0C (ORCPT + 99 others); Fri, 7 Feb 2020 07:26:02 -0500 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]:44680 "EHLO smtp2207-205.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbgBGM0C (ORCPT ); Fri, 7 Feb 2020 07:26:02 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.06713034|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.243597-0.0807567-0.675647;DS=CONTINUE|ham_system_inform|0.0554339-0.00117818-0.943388;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03299;MF=liaoweixiong@allwinnertech.com;NM=1;PH=DS;RN=17;RT=17;SR=0;TI=SMTPD_---.GlaQplc_1581078351; Received: from PC-liaoweixiong.allwinnertech.com(mailfrom:liaoweixiong@allwinnertech.com fp:SMTPD_---.GlaQplc_1581078351) by smtp.aliyun-inc.com(10.147.41.137); Fri, 07 Feb 2020 20:25:57 +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 v2 00/11] pstore: mtd: support crash log to block and mtd device Date: Fri, 7 Feb 2020 20:25:44 +0800 Message-Id: <1581078355-19647-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 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/blk: new support logger for block devices blkoops: add blkoops, a warpper for pstore/blk pstore/blk: blkoops: 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 | 306 +++++++ MAINTAINERS | 3 +- drivers/mtd/Kconfig | 10 + drivers/mtd/Makefile | 1 + drivers/mtd/mtdpstore.c | 564 ++++++++++++ fs/pstore/Kconfig | 109 +++ fs/pstore/Makefile | 5 + fs/pstore/blkoops.c | 475 ++++++++++ fs/pstore/blkzone.c | 1328 ++++++++++++++++++++++++++++ include/linux/blkoops.h | 94 ++ include/linux/pstore_blk.h | 91 ++ 11 files changed, 2985 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