Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5858783pxj; Wed, 23 Jun 2021 10:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+dW0ujUkltSXDI6GHQUhhVxoNVN8zNJaGOZROHG2I65DUocsfDCKCm++Uqhv410TQxynW X-Received: by 2002:a6b:d001:: with SMTP id x1mr457482ioa.171.1624468971649; Wed, 23 Jun 2021 10:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624468971; cv=none; d=google.com; s=arc-20160816; b=YXIohDefmruUb7SVqgAHR5d1ZN4YQts6fEzmW0vhpYXKxLRgG4R+D1TbtK0pvRZFzu osSkPU2pS3eZeQPnwAFPULbHa6limqc6pHhS+gg/CcM8ORvTurf4JF7pNSZISUIpwYZp y8P2VRj0QXQo7+eu7xKGlsG5d7F8bkTmXtkqHUmxFUt22YEl3A9a5g6Gw+UPU/HWiC0I cOqrfIMuLAO66gDmoDMWzj/YqFk6iHUK7f9/nGw4EIwm4X1ItdgWbfzs5W8MCJvY4Apd qVsApKcl4PKE7SvCLEB9g1I3ri5kFNhfp1C5XG1XMMsVdo1htxw14zuPfN25f2Zt27Ag vH7Q== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Nec/3bsypUO59txQs+sPa2kgEe/qKYIU32oYciVKOCA=; b=EENaPIAh1RmrmHvjxU1afW2TmatsMqVA4Zlus/EvASCn1f2r2Y8+N2dM075pUwwoq1 dkuJDPWCBESa/ms/i58+xqXQTX/R9finhwLRCKH8e4XQ7uD2+E13MjWDjUEQtYqKjgsg hIiJp2g/ngBLqn6TMbeJm970AgvHcb/kN/Z6Yc8R84N9z9P5ldVi+E/ZCEhthW3Gsd1o nR9fHizCUzRXkSkmvZpoXKdqgP2peQdSJ0TZ/xMdgamXgvP+ErQp4DZebEQ5lkbOR8iJ YMq2qlhQU+FdY3jKGmvAZo6OMLplQox9JtCr1sLLZj1UpFhWxYBfFB8LeK14qAeSjakT lpiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NaQ9wJs0; 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 p15si139208ilp.35.2021.06.23.10.22.37; Wed, 23 Jun 2021 10:22:51 -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=NaQ9wJs0; 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 S229774AbhFWRXe (ORCPT + 99 others); Wed, 23 Jun 2021 13:23:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32185 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhFWRXd (ORCPT ); Wed, 23 Jun 2021 13:23:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624468875; 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=Nec/3bsypUO59txQs+sPa2kgEe/qKYIU32oYciVKOCA=; b=NaQ9wJs0OCzkMbuk5qi+giTzJgy6gU2YrG63PJzST2Vdj8b1fWXnnq84QNQR7E+cykql9J pDgaDEAe5tDQVveN6ScF/5k4wnVT3z87NycE3ZMuGYaWhaZxqSzX3YMLjo1Ji8589ch6LX 3k1abDPKro2M5/iAKm3iDmA/WahQSdo= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-O1j8Cc-bPIegMFMuCIO24g-1; Wed, 23 Jun 2021 13:21:12 -0400 X-MC-Unique: O1j8Cc-bPIegMFMuCIO24g-1 Received: by mail-oi1-f200.google.com with SMTP id z199-20020aca4cd00000b0290220fcefa8f1so2133891oia.9 for ; Wed, 23 Jun 2021 10:21:11 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nec/3bsypUO59txQs+sPa2kgEe/qKYIU32oYciVKOCA=; b=Ti4hK//orh7UmQQdZoqAn67IG7UxoMTr2lwo1aBojApfRzJnixlSMYa5vOLp8TAzkR erdVqBc4aH3BuT5nJCzEd9cr2I/8yPJ1Qt06rcztRzi+JSTREELtPsNX6plfbbQyXBF0 mVEP685D4okQuo/i3Ihlyf5QVSxat7AFRfXQw6Y6sS/l2woP0ZruOI3xLMgxni28QPhp OtFrlsxrytbB7aKYRJQvB/7uLW9+s5ZqGxcy0fW4sjwHoEYDh590gHCdaUuv25GLw5UV L450kDmlAW1Ka4ih9rrWvUFUp/Rzw98YaND2Y9tcPlW8poaYxT7HpoxuA3dEi81RXt6n b42g== X-Gm-Message-State: AOAM53377Fwm8V57v3uf1vUSbFCab56xmfPYf9sZdLAhmfzH7kCTs1+p LUXzphn0oTHC/NYQndEghc+CLPvdOhbDSDOclOOxNxkJlwqV/9ahMBgWctmSVXDqfV81aZajvpc leaEVlDMEtjueusTgJ1A6/Ovo X-Received: by 2002:aca:5ad4:: with SMTP id o203mr744117oib.87.1624468871286; Wed, 23 Jun 2021 10:21:11 -0700 (PDT) X-Received: by 2002:aca:5ad4:: with SMTP id o203mr744099oib.87.1624468871047; Wed, 23 Jun 2021 10:21:11 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id f36sm109629otf.12.2021.06.23.10.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 10:21:10 -0700 (PDT) Date: Wed, 23 Jun 2021 11:21:09 -0600 From: Alex Williamson To: Bjorn Helgaas Cc: Amey Narkhede , Raphael Norwitz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kw@linux.com, Shanker Donthineni , Sinan Kaya , Len Brown , "Rafael J . Wysocki" Subject: Re: [PATCH v7 4/8] PCI/sysfs: Allow userspace to query and set device reset mechanism Message-ID: <20210623112109.361604bd.alex.williamson@redhat.com> In-Reply-To: <20210621130135.GA3288360@bjorn-Precision-5520> References: <20210619135920.h42gp5ie5c2eutfq@archlinux> <20210621130135.GA3288360@bjorn-Precision-5520> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jun 2021 08:01:35 -0500 Bjorn Helgaas wrote: > On Sat, Jun 19, 2021 at 07:29:20PM +0530, Amey Narkhede wrote: > > On 21/06/18 03:00PM, Bjorn Helgaas wrote: > > > On Tue, Jun 08, 2021 at 11:18:53AM +0530, Amey Narkhede wrote: > > > > + while ((name = strsep(&options, ",")) != NULL) { > > > > + if (sysfs_streq(name, "")) > > > > + continue; > > > > + > > > > + name = strim(name); > > > > + > > > > + for (i = 0; i < PCI_RESET_METHODS_NUM; i++) { > > > > + if (reset_methods[i] && > > > > + sysfs_streq(name, pci_reset_fn_methods[i].name)) { > > > > + reset_methods[i] = prio--; > > > > + break; > > > > + } > > > > + } > > > > + > > > > + if (i == PCI_RESET_METHODS_NUM) { > > > > + kfree(options); > > > > + return -EINVAL; > > > > + } > > > > + } > > > > + > > > > + if (reset_methods[0] && > > > > + reset_methods[0] != PCI_RESET_METHODS_NUM) > > > > + pci_warn(pdev, "Device specific reset disabled/de-prioritized by user"); > > > > > > Is there a specific reason for this warning? Is it just telling the > > > user that he might have shot himself in the foot? Not sure that's > > > necessary. > > > > > I think generally presence of device specific reset method means other > > methods are potentially broken. Is it okay to skip this? > > We might want a warning at reset-time if all the methods failed, > because that means we may leak state between users. Maybe we also > want one here, if *all* reset methods are disabled. I don't really > like special treatment of device-specific methods here because it > depends on the assumption that "device-specific means all other resets > are broken." That's hard to maintain. I'd say the device specific reset is special. The device itself can support a number of resets and they're theoretically all equivalent, it's a policy decision which to use. But the device specific reset is a software provided reset. Someone has specifically gone to the trouble to create a reset mechanism that is in some way better than the other methods. Not using that one by default sure feels like something worthy of leaving a breadcrumb in dmesg for debugging. Thanks, Alex