lkml.org 
[lkml]   [2021]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 4/8] PCI/sysfs: Allow userspace to query and set device reset mechanism
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.

\
 
 \ /
  Last update: 2021-06-24 14:16    [W:0.262 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site