Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4273324yba; Sun, 12 May 2019 08:56:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoQiBoWKnx+TrAgLxe8XZe8Qkl348GtKWANz3fstEOVtSOcsK2JGj9zcsCtFHqUeIP06H8 X-Received: by 2002:a17:902:108a:: with SMTP id c10mr26098373pla.48.1557676564088; Sun, 12 May 2019 08:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557676564; cv=none; d=google.com; s=arc-20160816; b=WctEYKMWi5rUEzuafjCWEXk6Eqy4JIuHM2N/5JZbLC2tt1VWhxhte1ugqobb84LvO7 buUmykoDg1Stj7K/NR1IYWAOcS/LcdIfuZ7IR2F48/D8YvgP8FPj9X+LHF5DbH3oRXcf 85TjfKSw25Nc3cG0JUg87r76+XlEbjhPCEmq5NBB3EkLcsnehpfxzkRYtNsYeh0q/95j k1hgPS6UX6XDWEIrNjBwrKrIFy4bZuQ+HBSoEMQLDG5RCPf6g/7z3mogsb3yGr37hQ4M dX9HZcbfymPUrdS621QpUE0i9UyiFvrvlMWcAN8zZcCfC5/ToBaPfK9V3P2tGysSFA7d +dCQ== 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=pp9hsv0U6RxBmNm7s8k4z5FRyT/Bo1Secwg5CSD+HCY=; b=nQo9WX+7QWv9ZgDGrsrn5e7pqCxPrsmaPaVAKPf9a8m5B/BlH56mYvR5xEmVmlALre 88xK668hDi5PFXqW1OfBilcwd7ztBH3XQy6lxpY2+J/mpS5cAutuVSqTGTSh8DKYVJTS ST7+iXoW/7UnKhfWJvNOV8zYcCVgMeeajkizw1drbM0l7t8o33tMI7cc0JWnLRQv15QG TwCGgbLdabj3ECZm2TuA9I6BdH09NRkG4HKeKLbXwKv2vjcREfAFa0/YaSngktFeuMBF imGJuYA1o5DIqCgrnDUXPFiH4exTmg6Xy21qryseVwq9/xGA92PDqPC4MAYc6N3Lg1C3 BV6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qFnAxCk8; 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 u5si14630804plq.118.2019.05.12.08.55.32; Sun, 12 May 2019 08:56:04 -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=qFnAxCk8; 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 S1726787AbfELPyj (ORCPT + 99 others); Sun, 12 May 2019 11:54:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45819 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726478AbfELPyj (ORCPT ); Sun, 12 May 2019 11:54:39 -0400 Received: by mail-pf1-f193.google.com with SMTP id s11so5785282pfm.12 for ; Sun, 12 May 2019 08:54:38 -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=pp9hsv0U6RxBmNm7s8k4z5FRyT/Bo1Secwg5CSD+HCY=; b=qFnAxCk8el7x5LzVJiG7j6Ye5s2U3iuY59le4mkghTmIBcLuHu3dJUbLKdXXnMX77l DNHC0OpLZdQXvzWmQxX9bvc7a27ssW6jYKEx/W0IyIMAZDTNnGroevcIUW1NYJ5rIffG wBgbkPkkhajuxczSoCJaFNLBmU55SUtjk8xL89MsWBoTVWFqUZ45Dd51gLPpR9dhdPH7 l5o/ATm2Et2M9ccM5F8hdejoMnv+O9njMsZygQSCjp3zpzhR4ZY/RU3dkCO2KXs3A4yh rxX7v1JFDPKhdFXtZCgv68lokwJYrqnqKI99p4N/rVd04vBnM8xQtL3JhGVGJdvhczS9 9x4g== 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=pp9hsv0U6RxBmNm7s8k4z5FRyT/Bo1Secwg5CSD+HCY=; b=Y+VgcxUmJGYTcM8GCEE1wUZzzq45+OZbOex/DJCN/lDSi/4FGLgzhL6WNMF2VPWURS D4kzHcW0tjsdpyrxbbFe6H86V6Y7G82dYkjC1kdmCBi8uvAn5BSAPZGotFxZMo8l+spQ jtGxS+c3eT8oOlDMMgykic+f9OqsxcZWu13WbYIYkiOX6c+wE12USEEtyC9GFyFQQEMJ 4O4wkgqdZcXSuj2o2WWRt9hl6P7GSSUDOIBmoAoZla+b5mOF96p2bd1JdrZ7ZyIlH1aM O4Gvig+WuFjlD4rmUDaDQRUwAJ86jdfqw8M5rzds64HVxuUbnV+YVfA3aYdRHhBiTCWX CcPw== X-Gm-Message-State: APjAAAUFGTlmlDlN4aYEx6XVYYWX4fyY5f8T4JaWI+yKwn8pQX1u05le 6XycUdv+bl4GLAR+hQP3Xb0= X-Received: by 2002:a65:62c3:: with SMTP id m3mr26367134pgv.159.1557676478249; Sun, 12 May 2019 08:54:38 -0700 (PDT) Received: from mita-MS-7A45.lan ([240f:34:212d:1:918e:f7e4:1728:3f45]) by smtp.gmail.com with ESMTPSA id v2sm4470058pgr.2.2019.05.12.08.54.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 May 2019 08:54:36 -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 , Kenneth Heitke Subject: [PATCH v3 0/7] nvme-pci: support device coredump Date: Mon, 13 May 2019 00:54:10 +0900 Message-Id: <1557676457-4195-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 collect snapshot of controller information via device coredump mechanism. The nvme device coredump is triggered when command timeout occurs, and can also be triggered by writing sysfs attribute. After finishing the nvme device coredump, the following files are created. - regs: NVMe controller registers (00h to 4Fh) - sq: Submission queue - cq: Completion queue - telemetry-ctrl-log: Telemetry controller-initiated log (if available) - data: Empty 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. * v3 - Merge 'add telemetry log page definisions' patch and 'add facility to check log page attributes' patch - Copy struct nvme_telemetry_log_page_hdr from the latest nvme-cli - Add BUILD_BUG_ON for the size of struct nvme_telemetry_log_page_hdr - Fix typo s/machanism/mechanism/ in commit log - Fix max transfer size calculation for get log page - Add function comments - Extract 'enable to trigger device coredump by hand' patch - Don't try to get telemetry log when admin queue is not available - Avoid deadlock in .coredump callback * 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: add basic facility to get telemetry log page nvme-pci: add device coredump infrastructure nvme-pci: trigger device coredump on command timeout nvme-pci: enable to trigger device coredump by hand drivers/base/devcoredump.c | 168 +++++++++------ drivers/nvme/host/Kconfig | 1 + drivers/nvme/host/core.c | 3 + drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c | 494 ++++++++++++++++++++++++++++++++++++++++++-- include/linux/devcoredump.h | 33 +++ include/linux/nvme.h | 17 ++ 7 files changed, 644 insertions(+), 73 deletions(-) Cc: Johannes Berg Cc: Keith Busch Cc: Jens Axboe Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Minwoo Im Cc: Kenneth Heitke -- 2.7.4