Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4506956ybb; Mon, 23 Mar 2020 23:25:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtxPpyJJnPwh+gUyE7dTfk9YPAS8kE3hr5Or+e34zc8vxz4J+AQMwepw3xW0GKSJRXGoUax X-Received: by 2002:a9d:6a97:: with SMTP id l23mr8366979otq.69.1585031139720; Mon, 23 Mar 2020 23:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585031139; cv=none; d=google.com; s=arc-20160816; b=tKy74CklHOQ/ca79q5gd5oIY88ULZ//WEfebvHpU2bWurQq4yZQpUN3qHdMB48Rxn9 +NtqJ3cvUFfqb4J3mXrU7M4t4dNkrChgalHdawWMTMMYfIjatiBFTq3n6uNRp2zm8vBD e4xy5gsYdFK2/fESp7EP0jN/STAVULZGT0RPtUrRP2iM7JgHPooHpExWlmYDEh+uD5HU GVM4Nrk9Y0r50eCOI/9cEU4vaSnYAvq5pUm/c/xEKof1j2/nhCmvXmjoydEUNTvtChoK z+SrOSPpio1I7VZV59+Y7e+wfVDODzXnnHlXVxY6ZC9NHKuch+JVVrcdoKV4BbwkHHHg 0SKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5+hrl4LH4eTfNuFTuKmKUx1kckKdmwzIjAo3nlF9kKE=; b=f7YuP33SusPTQfvt0ApLZ4oZPKdCVkXE5nUI0Pzjlmqp5yF6S7nRznT7HTreDkBIvY EyAxDpluyutHPpCSm2bXu/rZbuNukJbFyHzS3UpVoa5hn8ZVT7yG1XOQ9XXiHXJ4nE/y IQCkPrWub2HzDWZS9m9GPJsHOz5pi4B7rCN/eKzYH0DdYwX3eLde1+LPoSyKYJtGumc7 u4XwJs1sIVV71rUkbEFXn1ojhCUUQywUVeSuGHkWKxWjUDVNT7TU+qd9Ip2P343c+5dj YkDVTWdI5II/DtC3y3nZKHWu3hM3077/q45pGV5w77m8FgloO2RGaZQ555B3FoO/D/xg ZIzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eK2jNhJ6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d75si8680404oib.22.2020.03.23.23.25.26; Mon, 23 Mar 2020 23:25:39 -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=@kernel.org header.s=default header.b=eK2jNhJ6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727313AbgCXGY0 (ORCPT + 99 others); Tue, 24 Mar 2020 02:24:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:47646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgCXGYZ (ORCPT ); Tue, 24 Mar 2020 02:24:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D6B9D20663; Tue, 24 Mar 2020 06:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585031064; bh=JWBbZp/FZwETgxZHD80t5s+4NDrNkBwhJtrwKMbbg3s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eK2jNhJ6cQ944Zk0r8aRAj6KRP/foNFXYue74cZLZx4Pv3PZib0FakK/jHS0q+T/d BRKmtMetxRDLl6Luhg/jDu+UilJYjd0R0loy3VzxgNhljfLyglKz64W8ZGK318sML8 d38xT2SSaQ+tY5Nxb1sM5F2D8u5TnFNV+taC3Usk= Date: Tue, 24 Mar 2020 07:24:22 +0100 From: Greg Kroah-Hartman To: Kelsey 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 Subject: Re: [PATCH v3 1/4] PCI: sysfs: Define device attributes with DEVICE_ATTR* Message-ID: <20200324062422.GA1977781@kroah.com> References: <20190813204513.4790-1-skunberg.kelsey@gmail.com> <20190815153352.86143-2-skunberg.kelsey@gmail.com> <20200314112022.GA53794@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: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