Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2216899pxf; Sat, 20 Mar 2021 08:03:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5/2YRkDF1XFKP/jykCm7L6dOVdvKssLeopALHTXHb6zlh0NV84uhXn2jnRXXDA2E8vOcp X-Received: by 2002:a17:906:c1d7:: with SMTP id bw23mr9835125ejb.554.1616252598242; Sat, 20 Mar 2021 08:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616252598; cv=none; d=google.com; s=arc-20160816; b=Xh2VPuRHcY9OImlr8MjZYlnds3xIppp0ZSBU7nbAb9nCqEPigrPhnPKS7dDW5v+TDx zur1AVLSBy85RBJ+ln+hu7LoX4vwxAZsdtmRblBlA1sbSUIuapWwQr+AM3/j6W5DUvgk ImphzJBTCLAdjzkyvWn2ZSEsyNgtX7B87aTT97j2p/4n+/k1Pr3kT5GinOjaL0KcwpDF 8UbUsoZ5CYM6p0pwnVLzciaJQL3XRifIho3vwjdUfmcuJHlHDV9EGJrPB8QvOm/V4LYS pc6CzIVPkYYChss5UP5K28EJRTFGC44VfysRSG7wTX2R2FIlqzAG1/Bym7RRMtSF8NiS P43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=YLVzrWQgbgfLtaL/xiaXF4nkjYeSkIQsVEf8ccE5VFE=; b=JMl0b/jt5PZrVzh+AJKRlgHeaccRyIxEPBbfjcGvlnUBT6EbjPbfKnF3xzYoi4bUGW EffCLERAgJw0yXZ5fRvbB3GK6YDTcZXNxaXLp9tEYh3fLJ8PCidr4Lh8OSsPhDTpm/RR 66IF2FAdUqpeRcWfHEmLeRO0+pQIqd/SyYQs9hn1fn9x7E8pSVbpOgEKOqCxNPbKe/9f 52Zw6Ffu5B0Jr9nz63rxcRJ1xicak4eyvAtsbh6tDlHPvs+E/KE0y6GGx1D38NRhk4vZ bd+1m/yk3fgtLXJ/5V8EVfPMJYGIYsIu+N0GfVbJ+Q7Ees/VQP6vsiCJLPTq1+6f3vhZ KiZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L6ycEbdy; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gn20si6964880ejc.122.2021.03.20.08.02.55; Sat, 20 Mar 2021 08:03:18 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L6ycEbdy; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbhCTO7x (ORCPT + 99 others); Sat, 20 Mar 2021 10:59:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26522 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbhCTO7u (ORCPT ); Sat, 20 Mar 2021 10:59:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616252389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLVzrWQgbgfLtaL/xiaXF4nkjYeSkIQsVEf8ccE5VFE=; b=L6ycEbdywJ5+X/qJ2CtAwq2t56TjEbgTZQSg9CO8hS8v6dz54quZbmHBS7rsapxcMkNI5W hRnN40QF1J1WikIppwUT3mZZPm76iy/vdhULz73VFS59Ft1+QuDrLVA422I+VugDsrGdSB RqPHTN7uqFNOa00AW9wOGKm6QTvDkjA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-5nMUD_74MNyvTTgOkMkBAg-1; Sat, 20 Mar 2021 10:59:45 -0400 X-MC-Unique: 5nMUD_74MNyvTTgOkMkBAg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0A9A593A0; Sat, 20 Mar 2021 14:59:43 +0000 (UTC) Received: from x1.home.shazbot.org (ovpn-112-120.phx2.redhat.com [10.3.112.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EA581A86B; Sat, 20 Mar 2021 14:59:43 +0000 (UTC) Date: Sat, 20 Mar 2021 08:59:42 -0600 From: Alex Williamson To: Leon Romanovsky Cc: "Enrico Weigelt, metux IT consult" , Amey Narkhede , raphael.norwitz@nutanix.com, linux-pci@vger.kernel.org, bhelgaas@google.com, linux-kernel@vger.kernel.org, alay.shah@nutanix.com, suresh.gumpula@nutanix.com, shyam.rajendran@nutanix.com, felipe@nutanix.com Subject: Re: [PATCH 4/4] PCI/sysfs: Allow userspace to query and set device reset mechanism Message-ID: <20210320085942.3cefcc48@x1.home.shazbot.org> In-Reply-To: References: <20210317131718.3uz7zxnvoofpunng@archlinux> <20210317113140.3de56d6c@omen.home.shazbot.org> <20210318103935.2ec32302@omen.home.shazbot.org> <20210319102313.179e9969@omen.home.shazbot.org> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 20 Mar 2021 11:10:08 +0200 Leon Romanovsky wrote: > On Fri, Mar 19, 2021 at 10:23:13AM -0600, Alex Williamson wrote: > > > > What if we taint the kernel or pci_warn() for cases where either all > > the reset methods are disabled, ie. 'echo none > reset_method', or any > > time a device specific method is disabled? > > What does it mean "none"? Does it mean nothing supported? If yes, I think that > pci_warn() will be enough. At least for me, taint is usable during debug stages, > probably if device doesn't crash no one will look to see /proc/sys/kernel/tainted. "none" as implemented in this patch, clearing the enabled function reset methods. > > I'd almost go so far as to prevent disabling a device specific reset > > altogether, but for example should a device specific reset that fixes > > an aspect of FLR behavior prevent using a bus reset? I'd prefer in that > > case if direct FLR were disabled via a device flag introduced with the > > quirk and the remaining resets can still be selected by preference. > > I don't know enough to discuss the PCI details, but you raised good point. > This sysfs is user visible API that is presented as is from device point > of view. It can be easily run into problems if PCI/core doesn't work with > user's choice. > > > > > Theoretically all the other reset methods work and are available, it's > > only a policy decision which to use, right? > > But this patch was presented as a way to overcome situations where > supported != working and user magically knows which reset type to set. It's not magic, the new sysfs attributes expose which resets are enabled and the order that they're used, the user can simply select the next one. Being able to bypass a broken reset method is a helpful side effect of getting to select a preferred reset method. > If you want to take this patch to be policy decision tool, > it will need to accept "reset_type1,reset_type2,..." sort of input, > so fallback will work natively. I don't see that as a requirement. We have fall-through support in the kernel, but for a given device we're really only ever going to make use of one of those methods. If a user knows enough about a device to have a preference, I think it can be singular. That also significantly simplifies the interface and supporting code. Thanks, Alex