Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3974942yba; Tue, 7 May 2019 10:01:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlKKGZ+Y9jPHW9rVUNVHrFV3y8Zo4ju86YhAqfUpL50bjQYIll2DUafPZuwPYtoshzcZUw X-Received: by 2002:a65:6554:: with SMTP id a20mr41418210pgw.284.1557248469472; Tue, 07 May 2019 10:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557248469; cv=none; d=google.com; s=arc-20160816; b=gfF1Y4c7x2CQWyiPASXflqDcIXXCC06Z8wGsAhJN1MvKWqMcU/ZvjYXfTczEaky9mk L9ZDMMxeTdum/C7BWwEIwoGGZ1DjqzHsZkb4yhLTf316c+uY0pZBPG9mhnQn/2GQMJ/o 56aOUy6cj46VHqkRtFhOdG++vAOTZSp2RJMJqUGgfY/1LqqHPvsCASr0aUGy4ctdHfui XBpZ3uIiOXpPsYwlNYAxEsYJ8ICfaXbpsX+Gt7ICQ1DwfEns8xN8QUEY6eG4ujrab8BJ +Nr/AqRKhp1Sy7vzvtybedrXVYw1U4QKwU5mkPonfqZn3pJvn77qoJYYZHYEYNS1bIuk nDYw== 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 :dkim-signature; bh=F24W/VQdFijjB1XGiNkd+uOp8FfAnZYn7ACk/HniCPU=; b=Dmn3hbD2y+rL8dr2BqLyBGslf5fGQrzYdVCCnZ6XTtbJ/Znjbcg/plXV0P1o73519S psylTkc9PD+4Ctn1JjiLZvFynk6NYLTBzkh/gix1nYSc0Uvju+OKlwgX0ldEly/Rjn9r t0eFmbEv6OkPFJcpfqQB5jvdYA75LXzII+yLpq8V26tJU1i5W+CgKwUgFqLLxKgrLuEV rx5OTmoJLWbJPuIiy3hVx1kG0mQwBGorbazd8/AACRulOiEUDrsPFDMzWGGLAA7HsKun XEWK3JRVxlts9TEH6NiPgZ94mCOf2iQ/68o7pWuY3ec+0mhnz2yxd6104x0GyWzSqY37 RvEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y3Zmc4Ma; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d40si20893611pla.87.2019.05.07.10.00.53; Tue, 07 May 2019 10:01:09 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y3Zmc4Ma; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727178AbfEGQ6u (ORCPT + 99 others); Tue, 7 May 2019 12:58:50 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44914 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726378AbfEGQ6u (ORCPT ); Tue, 7 May 2019 12:58:50 -0400 Received: by mail-pf1-f194.google.com with SMTP id y13so8951789pfm.11 for ; Tue, 07 May 2019 09:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=F24W/VQdFijjB1XGiNkd+uOp8FfAnZYn7ACk/HniCPU=; b=Y3Zmc4Ma29TBsmGOUgwg/jPSIzCpH5JEVkNVRIChv+DGVQRwMrPtv4fU/OV5Zdqg9f FcehhvuCbJIP6W7xn1UQf2RtbFurlNLSOfo3waSOoI+iEzAhS4wVBuUDBGw6EE1qs1s9 npyy0aEHaXXEASHaz9KQnjcDzqfp/6zt7R3RfSmuCrWlT1/jxrf5HKdPj6xkST6pOWeG SBc2d/bOIDuYHF0tItNJenK6BszLfEBCVBmMIP0prNNeLj9FBjlKD9wO+j/teKWtt7ko 4KdClyUwrPURGOmeyinrZyvb1wTKNHdl4XLw5WynCm/dfPtgQ+dLTLXsrGA3xN5D/eaD zfVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=F24W/VQdFijjB1XGiNkd+uOp8FfAnZYn7ACk/HniCPU=; b=LgR4saq/1aLUJVsfTmporExJJQUQBCU8OBcm4TWTMPb749LViVLDOpPO06JkGVC7l8 kfesGyBPfZ+M+TaFXayKt8Nr+0HVPBnEKRmW1tyTeDn2Wnzq3Q5V3ML/iert+SQo2bPK MpDcD1cytT5UGtDoN2iUnx1be4xtM/VQh4BBocqJ0QhkPx2pM6BtXGJ4ZyrPvLIjLIaL 22frhSzsy1m6Ovf4OpXgrphTG8Di/PkqkjMzMpRNr/okMDnfoTPe/z5hh7teT6g0kCDn bPapkoDOLymH+A/twFbNvGzahd+sb+J9yPifsh1Zf0rAfNXT89OJsTNZCRXw/+rTA8gW MOXA== X-Gm-Message-State: APjAAAWNDUb8sOXGSBXDGJy9/fk5WC5B8iKrgyMUF5VTQao12fe5kZ+q 7b3OuoajEIX5+sDx+ibxqh0= X-Received: by 2002:a63:fe0a:: with SMTP id p10mr39874187pgh.86.1557248329585; Tue, 07 May 2019 09:58:49 -0700 (PDT) Received: from mita-MS-7A45.lan ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id r12sm18140093pfn.144.2019.05.07.09.58.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 May 2019 09:58:48 -0700 (PDT) From: Akinobu Mita To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Akinobu Mita , Johannes Berg , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Minwoo Im Subject: [PATCH v2 0/7] nvme-pci: support device coredump Date: Wed, 8 May 2019 01:58:27 +0900 Message-Id: <1557248314-4238-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This enables to capture snapshot of controller information via device coredump machanism, and it helps diagnose and debug issues. The nvme device coredump is triggered when command timeout occurs, and creates the following coredump files. - regs: NVMe controller registers (00h to 4Fh) - sq: Submission queue - cq: Completion queue - telemetry-ctrl-log: Telemetry controller-initiated log (if available) - data: Empty (I don't have the NVMe device that supports telemetry log page for now, so capturing telemetry log is untested.) The device coredump mechanism currently allows drivers to create only a single coredump file, so this also provides a new function that allows drivers to create several device coredump files in one crashed device. * v2 - Add Reviewed-by tag. - Add patch to fix typo in comment - Remove unneeded braces. - Allocate device_entry followed by an array of devcd_file elements. - Add telemetry log page definisions - Add facility to check log page attributes - Exclude the doorbell registers from register dump. - Save controller registers in a binary format instead of a text format. - Create an empty 'data' file in the device coredump. - Save telemetry controller-initiated log if available - Make coredump procedure into two phases (before resetting controller and after resetting as soon as admin queue is available). Akinobu Mita (7): devcoredump: use memory_read_from_buffer devcoredump: fix typo in comment devcoredump: allow to create several coredump files in one device nvme.h: add telemetry log page definisions nvme: add facility to check log page attributes nvme-pci: add device coredump support nvme-pci: trigger device coredump on command timeout drivers/base/devcoredump.c | 168 ++++++++++------ drivers/nvme/host/Kconfig | 1 + drivers/nvme/host/core.c | 2 + drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c | 460 ++++++++++++++++++++++++++++++++++++++++++-- include/linux/devcoredump.h | 33 ++++ include/linux/nvme.h | 25 +++ 7 files changed, 617 insertions(+), 73 deletions(-) Cc: Johannes Berg Cc: Keith Busch Cc: Jens Axboe Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Minwoo Im -- 2.7.4