Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp75700ybb; Tue, 24 Mar 2020 16:54:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsvBo4r0XAa853Vj3vS2kwn5FCj3QOeL24UcbH4DmhilmjoxR4HTuQXUlchWW50GkyK98C X-Received: by 2002:a9d:6b85:: with SMTP id b5mr481328otq.101.1585094097139; Tue, 24 Mar 2020 16:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585094097; cv=none; d=google.com; s=arc-20160816; b=zU/Qdu6Yv+HhhJH2JPuHlTJ1nDcnoRK3bKxkDskGFximheATm26Bb4MORmziPCI5Fl a9VnyyN1i/FGQNiqDEAnd9Upg6ouV2RlAS7q4uzeASjOwb6N4nQw8yd5JY3KXze8+AL/ 2U9EtvQAvhnDNStpMtjl3Dk29+7aoDdMuYzV59xDXlbROi+eM0tmupoOuYsACp9MqsVA 1ID93bXZgMNK9aznVQsWxVsFljdSHX7QosKeyHcgLHvXHOvnffIs7lhIGzx7yE+K/VBA VXiS8j1wSgv5NOKeVuW6/YjvuT95qiI2gG1dy8ogZ67xybaajFy3urW2QA4cDUpdwJQK WlaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bWdQrSC8E4qph62LTErgxscMGGiPy7reC5vJ9ah9h8k=; b=sHqxMdMQbC5zAameqAV9x0EhvocLBUa3TyhVzIVmRdCR0iZ/vHM5ba0nH2cUL0CTkQ EM8NutN0FWZTijHb35b3GesWPds+svvVcTfgXBxf/u/r2Py84afoEQ4Qm1T1qMwwgNxR kmK5F/hRc0sVHyeFmNWFMxUtlzNMxUKoVaFjfFsrJr7xY7K4VQVM0eRxpIfrYR3SYaGx BEnDqMN7TO75sjpLCv6Qir6unZGZPPRAuo6i/etQjeEUrIWVkmV67yEE3vLhoAUciXgf fiC9E4x4jXuFkyOko6iFoJ5KSMOp5QGtjDXGqSSE5FQuiradLvYmidbzYn/+l5pjEjdN KSgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nNAICxcB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l25si10247375otk.119.2020.03.24.16.54.43; Tue, 24 Mar 2020 16:54:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nNAICxcB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgCXXyN (ORCPT + 99 others); Tue, 24 Mar 2020 19:54:13 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41492 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726968AbgCXXyN (ORCPT ); Tue, 24 Mar 2020 19:54:13 -0400 Received: by mail-qk1-f193.google.com with SMTP id q188so593043qke.8; Tue, 24 Mar 2020 16:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bWdQrSC8E4qph62LTErgxscMGGiPy7reC5vJ9ah9h8k=; b=nNAICxcBx0Pd+m7pJ2cu767ivyvG+BJBZ7CnmIRNMGl1+j5Qv4Hioi0DGMhn0udMwC 0Sj+v2o4t2wmAjP4WNZr8YjuKF1Rq0hxXvGvKD6ZGXd3QbJ9okgMYT1FwxIUeRJFSXdS i4d9ZDEUQ7jrRM371rEkYhxGU655fTzy1yJ2aOcv4/wlSL3m8g6ARfwOz++ZSbRJIHr/ 9hR8rmjizVcSSdAncaxPMSx6ERntT2iXWLX3bpMk+OjPExyiTGAXjg0QeUibDEy5V7js H2VvNMBkK3akQBiiot6BhL7noTLbdljNVc/SORkSDu9mXccRtM7u8/ogVMZ48YmqCETs eptQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bWdQrSC8E4qph62LTErgxscMGGiPy7reC5vJ9ah9h8k=; b=HeYIaUgSKBj9WoGDUy6dmgSXvfXAU5T2+hunSDj5MdaBe5AMkO+Vv1leLBufb1FfLP bQWGUQRpHBp4di0cEmDetjrbqYuAsbXqGmjyJUFYdjIGuClD89EDlMvZswUNykG53dnP H1c3tIFGPt6j9o8Plm/zdl40J0oC/66WDRPI0Q2dJob1VofCEQqIHMa4v7yyZwG5FS1g 7e9n/2zopgvtc9hXfqO6ENpDJGu1Mh/FUyWEyFjgtn3JyqsYS3SQ9p3HPel18t90+h/d Gd/tV+yXltHQFXQ0YuUxyRAr7IdvooQr83YWBephPdw4pQvjIhsf9utb6IkxJL8ybLfP 43eg== X-Gm-Message-State: ANhLgQ3CKM5FEB1zRlo6viAdYgr84QQ/X1hgM3H+PJQXc53fmQZTeRrG 1aTW/31Ji1xAlRJHMGKKLGGBQ6ZKWRWJlwTQIX8= X-Received: by 2002:a37:4015:: with SMTP id n21mr447066qka.76.1585094051677; Tue, 24 Mar 2020 16:54:11 -0700 (PDT) MIME-Version: 1.0 References: <20190813204513.4790-1-skunberg.kelsey@gmail.com> <20190815153352.86143-2-skunberg.kelsey@gmail.com> <20200314112022.GA53794@kroah.com> <20200324062422.GA1977781@kroah.com> In-Reply-To: <20200324062422.GA1977781@kroah.com> From: Kelsey Date: Tue, 24 Mar 2020 17:53:59 -0600 Message-ID: Subject: Re: [PATCH v3 1/4] PCI: sysfs: Define device attributes with DEVICE_ATTR* To: Greg Kroah-Hartman Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Ruslan Bilovol , Linux Kernel Mailing List , Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org, Bodong Wang , Don Dutile , rbilovol@cisco.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 12:24 AM Greg Kroah-Hartman wrote: > > On Tue, Mar 24, 2020 at 12:10:33AM -0600, Kelsey wrote: > > On Sat, Mar 14, 2020 at 5:20 AM Greg Kroah-Hartman > > wrote: > > > > > > On Sat, Mar 14, 2020 at 12:51:47PM +0200, Ruslan Bilovol wrote: > > > > On Thu, Aug 15, 2019 at 7:01 PM Kelsey Skunberg > > > > wrote: > > > > > > > > > > Defining device attributes should be done through the helper > > > > > DEVICE_ATTR_RO(), DEVICE_ATTR_WO(), or similar. Change all instances using > > > > > __ATTR* to now use its equivalent DEVICE_ATTR*. > > > > > > > > > > Example of old: > > > > > > > > > > static struct device_attribute dev_name_##_attr=__ATTR_RO(_name); > > > > > > > > > > Example of new: > > > > > > > > > > static DEVICE_ATTR_RO(_name); > > > > > > > > > > Signed-off-by: Kelsey Skunberg > > > > > --- > > > > > drivers/pci/pci-sysfs.c | 59 +++++++++++++++++++---------------------- > > > > > 1 file changed, 27 insertions(+), 32 deletions(-) > > > > > > > > > > diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c > > > > > index 965c72104150..8af7944fdccb 100644 > > > > > --- a/drivers/pci/pci-sysfs.c > > > > > +++ b/drivers/pci/pci-sysfs.c > > > > > @@ -464,9 +464,7 @@ static ssize_t dev_rescan_store(struct device *dev, > > > > > } > > > > > return count; > > > > > } > > > > > -static struct device_attribute dev_rescan_attr = __ATTR(rescan, > > > > > - (S_IWUSR|S_IWGRP), > > > > > - NULL, dev_rescan_store); > > > > > +static DEVICE_ATTR(rescan, (S_IWUSR | S_IWGRP), NULL, dev_rescan_store); > > > > > > > > > > static ssize_t remove_store(struct device *dev, struct device_attribute *attr, > > > > > const char *buf, size_t count) > > > > > @@ -480,9 +478,8 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr, > > > > > pci_stop_and_remove_bus_device_locked(to_pci_dev(dev)); > > > > > return count; > > > > > } > > > > > -static struct device_attribute dev_remove_attr = __ATTR_IGNORE_LOCKDEP(remove, > > > > > - (S_IWUSR|S_IWGRP), > > > > > - NULL, remove_store); > > > > > +static DEVICE_ATTR_IGNORE_LOCKDEP(remove, (S_IWUSR | S_IWGRP), NULL, > > > > > + remove_store); > > > > > > > > > > static ssize_t dev_bus_rescan_store(struct device *dev, > > > > > struct device_attribute *attr, > > > > > @@ -504,7 +501,7 @@ static ssize_t dev_bus_rescan_store(struct device *dev, > > > > > } > > > > > return count; > > > > > } > > > > > -static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store); > > > > > +static DEVICE_ATTR(bus_rescan, (S_IWUSR | S_IWGRP), NULL, dev_bus_rescan_store); > > > > > > > > This patch renamed 'rescan' to 'bus_rescan' and broke my userspace application. > > > > There is also mismatch now between real functionality and documentation > > > > Documentation/ABI/testing/sysfs-bus-pci which still contains old "rescan" > > > > descriptions. > > > > > > > > Another patch from this patch series also renamed 'rescan' to 'dev_rescan' > > > > > > > > Here is a comparison between two stable kernels (with and without this > > > > patch series): > > > > > > > > v5.4 > > > > # find /sys -name '*rescan' > > > > /sys/devices/pci0000:00/0000:00:01.2/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:01.0/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:04.0/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:00.0/dev_rescan > > > > /sys/devices/pci0000:00/pci_bus/0000:00/bus_rescan > > > > /sys/devices/pci0000:00/0000:00:01.3/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:03.0/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:01.1/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:02.0/dev_rescan > > > > /sys/devices/pci0000:00/0000:00:05.0/dev_rescan > > > > /sys/bus/pci/rescan > > > > > > > > v4.19 > > > > # find /sys -name '*rescan' > > > > /sys/devices/pci0000:00/0000:00:01.2/rescan > > > > /sys/devices/pci0000:00/0000:00:01.0/rescan > > > > /sys/devices/pci0000:00/0000:00:04.0/rescan > > > > /sys/devices/pci0000:00/0000:00:00.0/rescan > > > > /sys/devices/pci0000:00/pci_bus/0000:00/rescan > > > > /sys/devices/pci0000:00/0000:00:01.3/rescan > > > > /sys/devices/pci0000:00/0000:00:03.0/rescan > > > > /sys/devices/pci0000:00/0000:00:01.1/rescan > > > > /sys/devices/pci0000:00/0000:00:02.0/rescan > > > > /sys/devices/pci0000:00/0000:00:05.0/rescan > > > > /sys/bus/pci/rescan > > > > > > > > Do we maintain this kind of API as non-changeable? > > > > > > Yeah, that's a bug and should be fixed, sorry for missing that on > > > review. > > > > > > Kelsey, can you fix this up? > > > > > > thanks, > > > > > > greg k-h > > > > I'd be happy to help get this fixed up. > > > > Would it be proper to go back to using DEVICE_ATTR() for 'bus_rescan' > > and 'dev_rescan' in order to change their names back to 'rescan'? > > Yes. > > thanks, > > greg k-h Ack. Sent a patch out. Will stay posted in case any updates need to be made. commit 4cb9e42d3226 ("PCI: sysfs: Change bus_rescan and dev_rescan to rescan") Thanks! - Kelsey