Received: by 10.213.65.68 with SMTP id h4csp186975imn; Fri, 30 Mar 2018 03:40:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Jh5PRfjoUEV+Pn5kHV745Xzx/luvYNZypq6hoHRH2vaTORAKmd/xUmYTIprx0136WZVbe X-Received: by 10.98.236.220 with SMTP id e89mr9371486pfm.173.1522406451450; Fri, 30 Mar 2018 03:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522406451; cv=none; d=google.com; s=arc-20160816; b=qPged3QEE9agKFH3CZxaOHYV7hEfXjsnGABVe8yFa9tYE4Czkxelj85H+BHpK+6Cd8 8EyCdvWb74Lvo+SZbnuvFSJ7H6FZ4WrkKa9x60H5FaSbejJYflvt36PXkAD+nXKROBsD f2CV8nAUBzM0g3AHMHEa/55esot8UgAqRpyYP3dHp/wYuwUJ6OKMS0cCfYSWd74WTv0x Oasae3U3jTwDrmsy+ZmiQNlqWt617gkHKf7akikFvhqqkJjGohpwHj0+YQGlgd45YxUP qau2FnzqBI/PhXgkNW5ZN1MlNM6yBDXmFV5+4N6/p4FT/hBaJhFOYlPmalINprl4+gLl jaTw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=BbbLNv658A4Dg1bYp2rIFfAq+wUp5aEyTD9NOxPkRIs=; b=zjCCle11N4faEkcqhYMmH8JJc6o359LF8uLHSX8lzwnWVL+lHhIkyr2p3F7vvH9n/Q T6PtDtO7Qa14qmr08NyMpABxODSQpPCOG73oNC+9exerPLpsUkqhyZyNa7e0ZsJxaik7 GTcxcH8Wf00hfX14Ph1rdSsl2Cbl8VhJ8UTXHQimW3cupbi9cO6gz6z6rRMs/SbKC6th q0c2DtUjknR7mVVBuzKLXU1wnEjr2FAr+j1RK0AQfdTxm9+NmAgP6oPjSq/TDXaUk9Z/ 7Co5FHGt0aG0bB97SjJbkp151Q3QPBQPi73As0iuPmBoBrDvVqUO3C7ohdtXMo/HcL/i gj6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=Tgle9cNh; 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 w12si5334330pgs.511.2018.03.30.03.40.36; Fri, 30 Mar 2018 03:40:51 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=Tgle9cNh; 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 S1751384AbeC3KjM (ORCPT + 99 others); Fri, 30 Mar 2018 06:39:12 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55724 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeC3KjJ (ORCPT ); Fri, 30 Mar 2018 06:39:09 -0400 Received: by mail-wm0-f65.google.com with SMTP id b127so14227244wmf.5 for ; Fri, 30 Mar 2018 03:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BbbLNv658A4Dg1bYp2rIFfAq+wUp5aEyTD9NOxPkRIs=; b=Tgle9cNheIeMcnZnCmDxc36UjEhMRwusE21mrD7X2LGP8x/Uv59nu5mNwx1AICFRWg LtTRiZqPzIbmjQqyqh+18garBqnKITFFDgrCzdc5dSoVK89amJN0vcxleUrO2JBFtaW1 VC2cH/51m/569ViVIefFhSvaOHAnCbJIwZWM5o6/PJ+Q9t9vcwbBcAwJwqNDfrMgT499 QjkWL3zyVsj7b88JgYvsHAlC23AAoPbEStwPhGZVcaSn1LP+kne8zutrqpVPDdRLYnJq MGtg2iz6efLViwJr+1B+afKhJVbmFe++wXbzIDjf6dnmh+eQuAeZ4OHG0EYpD8aNNwy2 GndQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BbbLNv658A4Dg1bYp2rIFfAq+wUp5aEyTD9NOxPkRIs=; b=ZuwYEiG5yvvfmK/H3SdMWtzUxLuIM7t17ZRRMmf7P23GL6kl7L6QLbweIJ2DevvXRA Ov+5xfG7RXJODLBamKspeOJccFPqTfiP8pnVonjnefKEYckeueBS88vROUI4Yp6Pz/Fb VJRoDqSexK8wbFxgaVc0bK1ey5Mw9NGk1OWqxZVyHff6D7QCfRnUopSxbSfGcDuXAnZJ WF4iCUsCtHr25GlnUdPBGMc/g45NrcRWfBMVP6La/HtV/18ifITrbrn/W4hzxm4N0e+J C3vS64FkmMv+OBiHMU2gkYcS/grzzsxUI6z7NAGH7JYQVniR7ih6gvmgUEDyVBG5NK0J fvTw== X-Gm-Message-State: AElRT7F30Itzw1UIIa6hPAHN+UdEhyV64qChD68rrNDYR8Hneg6ytVbN fJ+b/yzrtzIbd8wu4QkF6UMShA== X-Received: by 10.28.134.138 with SMTP id i132mr1820873wmd.101.1522406348167; Fri, 30 Mar 2018 03:39:08 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id c141sm6233418wmh.21.2018.03.30.03.39.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Mar 2018 03:39:07 -0700 (PDT) Date: Fri, 30 Mar 2018 12:39:07 +0200 From: Jiri Pirko To: Rahul Lakkireddy Cc: netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, davem@davemloft.net, viro@zeniv.linux.org.uk, ebiederm@xmission.com, stephen@networkplumber.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, ganeshgr@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com Subject: Re: [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel Message-ID: <20180330103907.GC3313@nanopsycho> References: <296ffbd47fd4f30238689e636bd2480683224227.1521888444.git.rahul.lakkireddy@chelsio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <296ffbd47fd4f30238689e636bd2480683224227.1521888444.git.rahul.lakkireddy@chelsio.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sat, Mar 24, 2018 at 11:56:33AM CET, rahul.lakkireddy@chelsio.com wrote: >Add a new module crashdd that exports the /sys/kernel/crashdd/ >directory in second kernel, containing collected hardware/firmware >dumps. > >The sequence of actions done by device drivers to append their device >specific hardware/firmware logs to /sys/kernel/crashdd/ directory are >as follows: > >1. During probe (before hardware is initialized), device drivers >register to the crashdd module (via crashdd_add_dump()), with >callback function, along with buffer size and log name needed for >firmware/hardware log collection. > >2. Crashdd creates a driver's directory under >/sys/kernel/crashdd/. Then, it allocates the buffer with This smells. I need to identify the exact ASIC instance that produced the dump. To identify by driver name does not help me if I have multiple instances of the same driver. This looks wrong to me. This looks like a job for devlink where you have 1 devlink instance per 1 ASIC instance. Please see: http://patchwork.ozlabs.org/project/netdev/list/?series=36524 I bevieve that the solution in the patchset could be used for your usecase too. >requested size and invokes the device driver's registered callback >function. > >3. Device driver collects all hardware/firmware logs into the buffer >and returns control back to crashdd. > >4. Crashdd exposes the buffer as a binary file via >/sys/kernel/crashdd//. >