Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp161187pxv; Thu, 24 Jun 2021 05:17:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcbPdhbVMwA/EMTZQV7+81OinAaYaHkXhLDYbRNKhyIyBQs7vJv754TWY+iURvoglOOSCG X-Received: by 2002:a05:6402:120b:: with SMTP id c11mr6765083edw.209.1624537068220; Thu, 24 Jun 2021 05:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624537068; cv=none; d=google.com; s=arc-20160816; b=J5FOFUNiYNlb+YOuuPJ0j8P05AfeeE86MKgauuBn6SxKBFma31iiOyuHD6XRaynfU+ oYloBgolKlN+tjqVBjbh6BaJqZACXYRWE3fr5dTfQFDbqsY0bR3Pc7DYf6UtI9+5MBoU M8kQjygAxANmBXzuRm3O/1IGm7syyGGwxpeXIubTmhHilico+vWaYnModunYSGfOrfPh 0r2P4OlDh3TuCad4GmvUuFsFRqwi69TYFGoQusvEbz6QkIYttE7oOXpO2FgKhL2w20QF KrZdo+bzP671sE7I8ODj6qnuVxdj4kxl4KZIzv/5aEekyzePeFJ6vtrjOT0L0TpcJhaF ENJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=+VWO5fD0CClXq0txtDClGaIP0DW500OMTUG38fY45Ek=; b=C6RXJ02ANC08qANdb0kmqGpzs53GIXuSDHJAdXfr5tjeFeKFlh7IOvCevNvVCgfnpD PO4cxziTpfAQ7VVu1EKzmHvAtugTagnsWRnNsw9KD0v8w82DXDQjL6UJnu+EYtjHbtWD 3aXjLO/a73C1MRECHHqk6McexPSGQ66WgD5/zbdgv+lflb+VMd5r/26gDNwQH4HHY5cC 507k53m/n2OPOt5IFHfao+/CuioYsgJouTUfpn1a5DJK5oEXm6ZtZMCZXqoikuWNfZZC qSeyDBIF1akwCBLsxqae69g9EPBvLn54Oa4gfqz5VJi+h+EbxP+KDmhOJW/ki2afK6EI d4Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OkEO8VfZ; 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 n16si2779857edw.182.2021.06.24.05.17.22; Thu, 24 Jun 2021 05:17:48 -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=@kernel.org header.s=k20201202 header.b=OkEO8VfZ; 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 S230028AbhFXMRm (ORCPT + 99 others); Thu, 24 Jun 2021 08:17:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:59892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbhFXMRm (ORCPT ); Thu, 24 Jun 2021 08:17:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18170613EA; Thu, 24 Jun 2021 12:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624536923; bh=NZ5IzRqUG/3+NiojVo4uhV8g9Xk/X69iZ3olJw6qMn0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=OkEO8VfZnYW0izJii9OKiU4HJfJlT46JCgY0X7sN7KXx6LkSdDHA6Z8I9kw8BRdkB mxbXuLulFUxHe56AMid49tc9kiMfsHRRsa+VK/kt6LXSVjMYmM3lVhYKduNWqO000D 66T4ieQe4dPuD83Y8C+JTL7IvDMhLQU0figPgWyOy7q/lsn2Zhj5dJ7VInD8oXhzpO wl1FeGyj0Mq3j3skIa9wcqgu1XlkyL1hWkbOZKSdS0SLME1F4dfVnigAsenymwqDRC 3gn0qv8PW5bRYALr/4KUmESr35lQ5DlSvKk5k59oRnLLgvcnslFxiJSxBADZkIBf3M K89beqViMpmBg== Date: Thu, 24 Jun 2021 07:15:21 -0500 From: Bjorn Helgaas To: Amey Narkhede Cc: Bjorn Helgaas , alex.williamson@redhat.com, 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: <20210624121521.GA3518338@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210608054857.18963-5-ameynarkhede03@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 11:18:53AM +0530, Amey Narkhede wrote: > Add reset_method sysfs attribute to enable user to > query and set user preferred device reset methods and > their ordering. > + Writing the name or comma separated list of names of any of > + the device supported reset methods to this file will set the > + reset methods and their ordering to be used when resetting > + the device. > + 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; > + } > + } Asking again since we didn't get this clarified before. The above tells me that "reset_methods" allows the user to control the *order* in which we try reset methods. Consider the following two uses: (1) # echo bus,flr > reset_methods (2) # echo flr,bus > reset_methods Do these have the same effect or not? If "reset_methods" allows control over the order, I expect them to be different: (1) would try a bus reset and, if the bus reset failed, an FLR, while (2) would try an FLR and, if the FLR failed, a bus reset.