Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1904612ybk; Mon, 11 May 2020 07:13:21 -0700 (PDT) X-Google-Smtp-Source: APiQypKfBKFv8hjcnPKY+xwN7vq6XoXlTi2wTITc14DoEwKTsmLpH5LQo0xB2CAueuxcRxWlMmry X-Received: by 2002:a17:906:35cd:: with SMTP id p13mr14170287ejb.206.1589206401300; Mon, 11 May 2020 07:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589206401; cv=none; d=google.com; s=arc-20160816; b=ROlgx3qotS59ky962KGLy6U7r5mGlRO7vnQsHrNCTROH0qlIWH60frfL26ClQDHUnO h9YstEfvaNlfmLfH1unG608EPjCOFeLGwMzOn9GAO9PanDzexXg4sjKTKO+yLGaMWi/W GBg5iX4R+WGJoWQm66piFP6DuS5NPZI3hoi8UF/FOvoc2toRmYiI+PUUkCmlL6wuo2kv EtYs8cm1MkzjbT2SseuQ5ft1BQ1iYxjvJxwTXSyhko1uePgB8mTdrrZN/44OQ1LzSghu DnL4omYTKPXACUsDfdUuEv6+CEX6V8pm/ptqnc8DR/OGbqRvw0W8lkG5o6lJYAY68GsI hgfA== 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; bh=AWgg7qj1bkym/xNblxQzDHT3If2HCewLrF/zJm6gRzY=; b=gu430rNNEtF/9lxEzjmJAYb6+c4yy1Z3amGkJK1c94AwAQypOqUTv84828zqREMWjl B4RFthY6wz69WKVSmnFwAxJz2si5eka6JL8xOlyT8J4CTATz9y5LJPZ2gNbf3r6BRGqq DI8gSXRA+W7A1wbcxNSY6z4LXpYJStu5vB9geXVpmW0Z6LsKQJIMJ6zF6yl0Ew1dmidi NZaaWDebPE/qUMKdrpRn01bqfZ/bH9x9ZeJxLL0EMhzDJcr124/RG350G7hhRtcFhu4h k6e+Jb6EhXAJck9MP0X5z+ofn23dyQYEbKLy6Cahut911eT110iF4vYmN02qfwZn1TJ8 L7rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si6054864ejx.279.2020.05.11.07.12.49; Mon, 11 May 2020 07:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730387AbgEKOLT (ORCPT + 99 others); Mon, 11 May 2020 10:11:19 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33648 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730180AbgEKOLR (ORCPT ); Mon, 11 May 2020 10:11:17 -0400 Received: by mail-pf1-f193.google.com with SMTP id x77so4804466pfc.0; Mon, 11 May 2020 07:11:17 -0700 (PDT) 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=AWgg7qj1bkym/xNblxQzDHT3If2HCewLrF/zJm6gRzY=; b=npawjWnwtbK/fg8Yq6Frejo0kpo7h9WnRz/l1yBtBW482mr4oFAS2C7X0dURs0p6k2 U6DNLUs3t5YFi8ACItK//MfI6SHmvRKtppysbN0pUCF/WxwSJsXzbInb6fueD6Msd2wA uvkSa6Lei/iaZD0Q1OhKTAwHdlTdymrx0ZG7dKMDzuLMuyEiVOSPzaOynprs9YL19c53 3lRzWst6p/AnKXPaLTnWLo0om7oEvHFcz1POEnWNgeRoNbvpE4Wb4OH1huufn7VatB30 aE10OimdCe2wOc9Fz8SqLLeohUa9IJbgXHPcE945j3AQdbRv7sFKe71xJN8xYFDU+VLT f3aA== X-Gm-Message-State: AGi0PuZ4m4Y09i2VXVACgSMVGQow72zG2Yl9xPyXfKr7zVVxVjLVc/6F 5e2dOxfAPKAmwPGUrmIvnnA= X-Received: by 2002:a63:ee4f:: with SMTP id n15mr14981159pgk.149.1589206276809; Mon, 11 May 2020 07:11:16 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id g40sm10650446pje.38.2020.05.11.07.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 07:11:14 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id C270E40605; Mon, 11 May 2020 14:11:13 +0000 (UTC) Date: Mon, 11 May 2020 14:11:13 +0000 From: Luis Chamberlain To: Jakub Kicinski Cc: Jiri Pirko , jeyu@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, rostedt@goodmis.org, mingo@redhat.com, aquini@redhat.com, cai@lca.pw, dyoung@redhat.com, bhe@redhat.com, peterz@infradead.org, tglx@linutronix.de, gpiccoli@canonical.com, pmladek@suse.com, tiwai@suse.de, schlad@suse.de, andriy.shevchenko@linux.intel.com, keescook@chromium.org, daniel.vetter@ffwll.ch, will@kernel.org, mchehab+samsung@kernel.org, kvalo@codeaurora.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/15] net: taint when the device driver firmware crashes Message-ID: <20200511141113.GP11244@42.do-not-panic.com> References: <20200509043552.8745-1-mcgrof@kernel.org> <20200509113546.7dcd1599@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200509113546.7dcd1599@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 09, 2020 at 11:35:46AM -0700, Jakub Kicinski wrote: > On Sat, 9 May 2020 04:35:37 +0000 Luis Chamberlain wrote: > > Device driver firmware can crash, and sometimes, this can leave your > > system in a state which makes the device or subsystem completely > > useless. Detecting this by inspecting /proc/sys/kernel/tainted instead > > of scraping some magical words from the kernel log, which is driver > > specific, is much easier. So instead this series provides a helper which > > lets drivers annotate this and shows how to use this on networking > > drivers. > > > > My methodology for finding when firmware crashes is to git grep for > > "crash" and then doing some study of the code to see if this indeed > > a place where the firmware crashes. In some places this is quite > > obvious. > > > > I'm starting off with networking first, if this gets merged later on I > > can focus on the other drivers, but I already have some work done on > > other subsytems. > > > > Review, flames, etc are greatly appreciated. > > Tainting itself may be useful, but that's just the first step. I'd much > rather see folks start using the devlink health infrastructure. Devlink > is netlink based, but it's _not_ networking specific (many of its > optional features obviously are, but don't let that mislead you). > > With devlink health we get (a) a standard notification on the failure; > (b) information/state dump in a (somewhat) structured form, which can be > collected & shared with vendors; (c) automatic remediation (usually > device reset of some scope). It indeed sounds very useful! > Now regarding the tainting - as I said it may be useful, but don't we > have to define what constitutes a "firmware crash"? Yes indeed, I missed clarifying this in the documentation. I'll do so in my next respin. > There are many > failure modes, some perfectly recoverable (e.g. processing queue hang), > some mere bugs (e.g. device fails to initialize some functions). All of > them may impact the functioning of the system. How do we choose those > that taint? Its up to the maintainers of the device driver, what I was aiming for were those firmware crashes which indeed *can* have an impact on user experience, and can *even* potentially require a driver removal / addition to to get things back in order again. Luis