From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbdBWW4h (ORCPT ); Thu, 23 Feb 2017 17:56:37 -0500 Received: from ale.deltatee.com ([207.54.116.67]:35523 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbdBWW4f (ORCPT ); Thu, 23 Feb 2017 17:56:35 -0500 To: Bjorn Helgaas References: <1486058763-7730-1-git-send-email-logang@deltatee.com> <1486058763-7730-4-git-send-email-logang@deltatee.com> <20170223224317.GA21548@bhelgaas-glaptop.roam.corp.google.com> Cc: Keith Busch , Myron Stowe , Greg Kroah-Hartman , Bjorn Helgaas , Geert Uytterhoeven , Jonathan Corbet , "David S. Miller" , Andrew Morton , Emil Velikov , Mauro Carvalho Chehab , Guenter Roeck , Jarkko Sakkinen , Linus Walleij , Ryusuke Konishi , Stefan Berger , Wei Zhang , Kurt Schwemmer , Stephen Bates , linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org From: Logan Gunthorpe Message-ID: <7c981c0d-e7ff-bf28-ec55-cf5c39290437@deltatee.com> Date: Thu, 23 Feb 2017 15:56:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170223224317.GA21548@bhelgaas-glaptop.roam.corp.google.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, stephen.bates@microsemi.com, kurt.schwemmer@microsemi.com, wzhang@fb.com, stefanb@linux.vnet.ibm.com, konishi.ryusuke@lab.ntt.co.jp, linus.walleij@linaro.org, jarkko.sakkinen@linux.intel.com, linux@roeck-us.net, mchehab@kernel.org, emil.l.velikov@gmail.com, akpm@linux-foundation.org, davem@davemloft.net, corbet@lwn.net, geert+renesas@glider.be, bhelgaas@google.com, gregkh@linuxfoundation.org, myron.stowe@gmail.com, keith.busch@intel.com, helgaas@kernel.org X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/17 03:43 PM, Bjorn Helgaas wrote: > This path seems a little generic. I don't see other cases where a > product brand name ("Switchtec") appears at the top level of > /sys/class/... Ok, well we are certainly open to suggestions, but there isn't really a generic version of this device available so I'm not sure how we would change that. Per device-type classes aren't that uncommon though, a quick grep shows things like: platform/chrome/cros_ec_dev.c:40:static struct class cros_class s390/char/raw3270.h:94:extern struct class *class3270; net/ethernet/hisilicon/hns/hnae.c:19:static struct class *hnae_class; mfd/ucb1x00-core.c:490:static struct class ucb1x00_class > My question is based on "ls Documentation/ABI/testing/sysfs-class*", > not on any great knowledge of sysfs, and I see Greg has already given > a Reviewed-by for this, so maybe this is the right approach. > > It does seem like the path could include a clue that this is related > to PCI. I mean, we could change it to pci-switchtec or something if you think that would be better..?? But I'm not sure how else to accommodate this. > Is there a link to the switch PCI device itself, e.g., to > /sys/devices/pci*? Should these attributes simply be put in a > subdirectory there, e.g., in > > /sys/devices/pci0000:00/0000:00:00.0/stats/... Well our device shows up here in the tree: /sys/devices/pci0000:00/0000:00:03.0/0000:03:00.1/switchtec/switchtec0 (Which userspace can get to by following the link at /sys/class/switchtec/switchtec0) The switch is then always: /sys/devices/pci0000:00/0000:00:03.0 Thanks, Logan