Received: by 10.213.65.68 with SMTP id h4csp114092imn; Sat, 24 Mar 2018 15:29:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELu4GwnPt5YCGBrf2TctXyDr2WOx5+XKxlSTYyZEqJ/i8Quo+fIJmeTq1b/1HVirvUEQFs5d X-Received: by 2002:a17:902:322:: with SMTP id 31-v6mr34957910pld.122.1521930576475; Sat, 24 Mar 2018 15:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521930576; cv=none; d=google.com; s=arc-20160816; b=EdDI0PDMWfSlvysJlV3yKy9zM8JyN6v1bspajHT1resUitFL2cVmgF3ZVh3D6BqwRR PP4lwbR+t64Xwzs9jpgSIBWxuPvtzIlKHn7WjKLGlwHjyXFY7uFyZB73GKV7KSoD9MrE FK88XjbTCXQL6jhIl4JhTc13rNrPfJyG+TkF4whMO/OP1mRmlgScxB6IgFnXi9o/TRNZ LaVJIBkf4zr/4+5+JiocB0fode0ZQ8p4LMXwRpasHSVx31Veum0XaxS71E67ehjxa5vi oqKShVNpiU8nPs5/4i5WIoau09Ca/R3Wgra6Y7TIAuZwpMVtInd4zwX/CTwXmfXJP29I UsLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=EDFz6MexvllI/EbBBInJ94B7vHZ+IrH9QTuzpEktqys=; b=CJrIo9LxhGGCN7PJ46IlUgE6/CGeRGYVBkd0JYwZxRQizqwjF9wRJ8dkaCmcHEFlMJ G22cJzKHHOKDWvS43Ta6NWbpXHhObfbJxdDmQuiJgPZMM+alRywtrUpo65iThfLTBaZ5 Rfq26QhDVmNhUnH7yHzNzO+TMIwAa6+zgdw5q3WbsLSwN8E9I3OEKTmeaCZXY5XcCGUD TAJR3vPrgRMkE+kFfJA/EAnm+pzU7jVGKSO9XR/8pUQHAN2j36xiI8TVd98NU0rXbr5W 0SSBKQgWRATFEix+MWjLTNJVD/rjFu4NZLeHkl/doi54Tjnrv7mSCVDPD+riIFGxCpg+ 5ZGw== 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 l30-v6si11686161plg.541.2018.03.24.15.29.10; Sat, 24 Mar 2018 15:29:36 -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 S1752686AbeCXW1x convert rfc822-to-8bit (ORCPT + 99 others); Sat, 24 Mar 2018 18:27:53 -0400 Received: from trem.minaslivre.org ([148.251.208.85]:51614 "EHLO grilo.cascardo.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbeCXW1v (ORCPT ); Sat, 24 Mar 2018 18:27:51 -0400 X-Greylist: delayed 530 seconds by postgrey-1.27 at vger.kernel.org; Sat, 24 Mar 2018 18:27:51 EDT Received: from siri.cascardo.eti.br (unknown [IPv6:2804:431:b734:227:6a17:29ff:fe00:4f38]) by grilo.cascardo.info (Postfix) with ESMTPSA id 7A86C66EA; Sat, 24 Mar 2018 22:18:21 +0000 (UTC) Date: Sat, 24 Mar 2018 19:18:50 -0300 From: Thadeu Lima de Souza Cascardo To: Rahul Lakkireddy Cc: netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, indranil@chelsio.com, nirranjan@chelsio.com, stephen@networkplumber.org, ganeshgr@chelsio.com, ebiederm@xmission.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, davem@davemloft.net, viro@zeniv.linux.org.uk Subject: Re: [PATCH net-next v2 2/2] cxgb4: collect hardware dump in second kernel Message-ID: <20180324221849.GW14312@siri.cascardo.eti.br> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 24, 2018 at 04:26:34PM +0530, Rahul Lakkireddy wrote: > Register callback to collect hardware/firmware dumps in second kernel > before hardware/firmware is initialized. The dumps for each device > will be available under /sys/kernel/crashdd/cxgb4/ directory in second > kernel. > > Signed-off-by: Rahul Lakkireddy > Signed-off-by: Ganesh Goudar > --- > v2: > - No Changes. > > Changes since rfc v2: > - Update comments and commit message for sysfs change. > > rfc v2: > - Updated dump registration to the new API in patch 1. [...] > diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c > index e880be8e3c45..265cb026f868 100644 > --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c > +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c > @@ -5527,6 +5527,18 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) > if (err) > goto out_free_adapter; > > + if (is_kdump_kernel()) { > + /* Collect hardware state and append to > + * /sys/kernel/crashdd/cxgb4/ directory > + */ > + err = cxgb4_cudbg_crashdd_add_dump(adapter); > + if (err) { > + dev_warn(adapter->pdev_dev, > + "Fail collecting crash device dump, err: %d. Continuing\n", > + err); > + err = 0; > + } > + } > The problem I see with this approach is that you require that the driver is built into the kdump kernel (or present as a module in the kdump initramfs), and that you will probe the device during the collection of the dumps. IMHO, if you are going to require the device to be probed by the same driver during kdump, you might just as well use the device object itself to present the crash data. I think that's what Stephen Hemminger meant when he said to use sysfs. No need at all for any special crashdd. Just add an attribute or attribute group to the device object. Otherwise, as Eric Biederman pointed out, you should just add that data into the vmcore before you kexec, so you don't even need to look at a different file, and the driver does not even need to be present in the kdump kernel. Cascardo. > if (!is_t4(adapter->params.chip)) { > s_qpp = (QUEUESPERPAGEPF0_S + > -- > 2.14.1