Re: [PATCH 02/12] pci/p2pdma: Don't initialise page refcount to one

2024-09-10 Thread Logan Gunthorpe
On 2024-09-09 22:14, Alistair Popple wrote: > The reference counts for ZONE_DEVICE private pages should be > initialised by the driver when the page is actually allocated by the > driver allocator, not when they are first created. This is currently > the case for MEMORY_DEVICE_PRIVATE and MEMORY

Re: [PATCH v2 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-05-14 Thread Logan Gunthorpe
On 2019-05-14 6:14 p.m., Frank Rowand wrote: > The high level issue is to provide reviewers with enough context to be > able to evaluate the patch series. That is probably not very obvious > at this point in the thread. At this point I was responding to Logan's > response to me that I should b

Re: [PATCH v3] NTB: switchtec_ntb: Update switchtec documentation with pre-requisites for NTB

2018-10-12 Thread Logan Gunthorpe
On 2018-10-12 11:30 a.m., Jonathan Corbet wrote: > On Wed, 10 Oct 2018 20:33:08 +0800 > Wesley Sheng wrote: > >> The ntb_hw_switchtec driver has requirements on kernel configuration >> so we add these notes to the documentation and also clean up a few >> other sentences in the documentation.

Re: [PATCH v3] NTB: switchtec_ntb: Update switchtec documentation with pre-requisites for NTB

2018-10-11 Thread Logan Gunthorpe
On 2018-10-11 10:27 a.m., Bjorn Helgaas wrote: > I'm not sure who should really own this file: > > $ ./scripts/get_maintainer.pl -f Documentation/switchtec.txt > Kurt Schwemmer (maintainer:PCI DRIVER FOR > MICROSEMI SWITCHTEC) > Logan Gunthorpe (maintainer:P

Re: [PATCH v3] NTB: switchtec_ntb: Update switchtec documentation with pre-requisites for NTB

2018-10-10 Thread Logan Gunthorpe
ey Yung > Signed-off-by: Kelvin Cao > Signed-off-by: Wesley Sheng Reviewed-by: Logan Gunthorpe

Re: [PATCH v2] NTB: switchtec_ntb: Update switchtec documentation with pre-requisites for NTB

2018-09-27 Thread Logan Gunthorpe
On 2018-09-27 12:36 a.m., wesley.sh...@microchip.com wrote: > Update switchtec documentation > 1.add pre-requisites for NTB driver > 2.misc updates > change NTB hardware driver name to ntb_hw_switchtec > update the description of 2 partitions limit > add reference to Linux Documentation/ntb.t

[PATCH 2/3] PCI: Allow specifying devices using a base bus and path of devfns

2018-05-24 Thread Logan Gunthorpe
ng device. Signed-off-by: Logan Gunthorpe Reviewed-by: Stephen Bates --- Documentation/admin-guide/kernel-parameters.txt | 12 ++- drivers/pci/pci.c | 106 +++- 2 files changed, 112 insertions(+), 6 deletions(-) diff --git a/Documen

[PATCH 0/3] Add parameter for disabling ACS redirection for P2P

2018-05-24 Thread Logan Gunthorpe
disable the ACS P2P Request Redirect, ACS P2P Completion Redirect and ACS P2P Egress Control bits for the selected devices. This allows P2P traffic between selected bridges and seeing it's done at boot, before IOMMU group creating the IOMMU groups will be created correctly based on the bits. Th

[PATCH 3/3] PCI: Introduce the disable_acs_redir parameter

2018-05-24 Thread Logan Gunthorpe
n boot. Signed-off-by: Logan Gunthorpe Reviewed-by: Stephen Bates --- Documentation/admin-guide/kernel-parameters.txt | 9 +++ drivers/pci/pci.c | 103 +++- 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/Documentation/adm

[PATCH 1/3] PCI: Make specifying PCI devices in kernel parameters reusable

2018-05-24 Thread Logan Gunthorpe
extra parentheses). Additionally, make the analogous change to the kernel parameter documentation: Separating the description of how to specify a PCI device into it's own section at the head of the pci= parameter. Signed-off-by: Logan Gunthorpe Reviewed-by: Stephen Bates --- Documentation/

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-14 Thread Logan Gunthorpe
Hi Linus, On 14/06/17 03:59 AM, Linus Walleij wrote: > I started to take a stab at it at one point and incorporated some feedback > from Torvalds etc, it's here: > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=chrdev-warn&id=65e5b1e9eb3f777ab7535b74b490e882eeec79d

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-13 Thread Logan Gunthorpe
On 13/06/17 11:00 PM, Greg Kroah-Hartman wrote: > No, don't modify any drivers, do this in the core chardev code. Ok, well then maybe I misunderstood what you originally asked for because I don't see how you can change a fixed allocation to a dynamic one without touching the driver code which ne

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-13 Thread Logan Gunthorpe
On 13/06/17 10:35 AM, Greg Kroah-Hartman wrote: > For char devices, I doubt it, but we can't take the chance, which is why > you make it an option. Then, it's enabled for 'allmodconfig' builds, > which helps testers out. Well I took a look at this and it looks like a lot of work to modify all t

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-13 Thread Logan Gunthorpe
On 12/06/17 10:35 PM, Greg Kroah-Hartman wrote: > Or better yet, just turn all char major allocations into dynamic, which > would be really good for test systems. I thought someone proposed > patches for that a long time ago, but I can't find them anymore. That > would be the simplest solution

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-13 Thread Logan Gunthorpe
On 13/06/17 05:48 AM, Alan Cox wrote: > If you dump the list of majors and drivers do they all look valid or is > there any corruption or repetition that looks odd (wondering if we've > got too many devices or a leak) ? They look valid to me. Logan Character devices: 1 mem 4 /dev/vc/0 4

Re: [Merge tag 'pci-v4.12-changes' of git] 857f864014: BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8

2017-06-12 Thread Logan Gunthorpe
On 12/06/17 10:18 PM, Greg Kroah-Hartman wrote: > What test causes so many major numbers to be allocated? Is this > in-kernel test code? Do you really have a system that requires so many > different drivers that all want a dynamic char major? This is a 0day kernel robot test. I'm not sure the

Re: [PATCH v7 0/4] New Microsemi PCI Switch Management Driver

2017-03-09 Thread Logan Gunthorpe
On 09/03/17 12:55 PM, Bjorn Helgaas wrote: > Applied to pci/switchtec for v4.12, thanks! Great! Thanks so much! Logan -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/maj

[PATCH v6 2/4] switchtec: Add user interface documentation

2017-03-02 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

[PATCH v6 0/4] New Microsemi PCI Switch Management Driver

2017-03-02 Thread Logan Gunthorpe
this work included in either 4.11 or 4.12 assuming a smooth review process. The patch is based off of the v4.10-rc6 release. Thanks for your review, Logan [1] https://www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec-user Logan Gunthorpe (4): MicroSemi

[PATCH v7 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-03-02 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v7 1/4] MicroSemi Switchtec management interface driver

2017-03-02 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Tested-by: Krishna Dhulipala Reviewed-by: Wei Zhang Reviewed-by: Jens Axboe Reviewed-by: Gre

[PATCH v6 1/4] MicroSemi Switchtec management interface driver

2017-03-02 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Tested-by: Krishna Dhulipala Reviewed-by: Wei Zhang Reviewed-by: Jens Axboe Reviewed-by: Gre

[PATCH v6 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-03-02 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

Re: [PATCH v6 0/4] New Microsemi PCI Switch Management Driver

2017-03-02 Thread Logan Gunthorpe
Hey, Ah, sorry, sorry. I noticed another minor mistake. I'll send a v7 in a second. Thanks, Logan On 02/03/17 04:07 PM, Logan Gunthorpe wrote: > Hi, > > Hopefully this is the last change necessary. The new code to handle > unbind follows Jason's suggestions and is a lot

[PATCH v6 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-03-02 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v7 2/4] switchtec: Add user interface documentation

2017-03-02 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

[PATCH v7 0/4] New Microsemi PCI Switch Management Driver

2017-03-02 Thread Logan Gunthorpe
the v4.10-rc6 release. Thanks for your review, Logan [1] https://www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec-user Logan Gunthorpe (4): MicroSemi Switchtec management interface driver switchtec: Add user interface documentation switchtec: Add sysfs

[PATCH v7 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-03-02 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 05:23 PM, Logan Gunthorpe wrote: > Because of how poll works, I don't see how I can just hold a semaphore > inside every fops call like the tpm code does. On 01/03/17 04:58 PM, Jason Gunthorpe wrote: > Both infiniband and TPM have the 'detach' flavour of un

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 04:58 PM, Jason Gunthorpe wrote: > On Wed, Mar 01, 2017 at 03:49:04PM -0700, Logan Gunthorpe wrote: > >> Seems to me like an elegant solution would be to implement a 'cdev_kill' >> function which could kill all the processes using a cdev. Thus, during

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 05:32 PM, Bjorn Helgaas wrote: > It's not a perfect fit in drivers/pci because it's not bus > infrastructure and I don't want to be the default maintainer of it, > but I agree there's not really an alternative that's clearly better, > so let's leave it where it is for now. Sounds goo

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 03:59 PM, Keith Busch wrote: > Okay, I see. Was mistakenliy looking at v4. The v5 looks right. Great! Thanks for reviewing that for me. Logan -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
ally when compared to other drivers) and unless someone can describe how it's wrong or a better solution I'd rather see it merged as is. If and when a better approach arrives I'd happily patch it to improve the situation. Logan On 01/03/17 03:24 PM, Logan Gunthorpe wrote: > >

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 03:26 PM, Keith Busch wrote: > I think this is from using the managed device resource API to request the > irq actions. The scope of the resource used to be tied to the pci_dev's > dev, but now it's the new switchec class dev, which has a different > lifetime while open references exi

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-03-01 Thread Logan Gunthorpe
On 01/03/17 02:41 PM, Bjorn Helgaas wrote: > I don't think this is indicating a bug in the PCI core (although I do > think a BUG_ON() here is an excessive response). I think it's an > indication that the driver didn't disconnect its ISR. Without more > details of the failure it's hard to tell i

Re: [PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-02-28 Thread Logan Gunthorpe
> This driver doesn't have anything to do with the PCI core, other than > using the pci_register_driver() interface (just like all other drivers > for PCI-connected devices), so drivers/pci doesn't really feel like > the right place for it. Putting it in drivers/pci leads to the sort > of confusi

[PATCH v5 2/4] switchtec: Add user interface documentation

2017-02-25 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

[PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-02-25 Thread Logan Gunthorpe
www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec-user Logan Gunthorpe (4): MicroSemi Switchtec management interface driver switchtec: Add user interface documentation switchtec: Add sysfs attributes to the Switchtec driver switchtec: Add IOCTL

[PATCH v5 1/4] MicroSemi Switchtec management interface driver

2017-02-25 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Tested-by: Krishna Dhulipala Reviewed-by: Wei Zhang Reviewed-by: Jens Axboe Reviewed-by: Gre

[PATCH v5 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v5 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v4 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-24 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v4 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-24 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v4 0/4] New Microsemi PCI Switch Management Driver

2017-02-24 Thread Logan Gunthorpe
erested parties. We hope to see this work included in either 4.11 or 4.12 assuming a smooth review process. The patch is based off of the v4.10-rc6 release. Thanks for your review, Logan [1] https://www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec

[PATCH v4 1/4] MicroSemi Switchtec management interface driver

2017-02-24 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Tested-by: Krishna Dhulipala Reviewed-by: Wei Zhang Reviewed-by: Jens Axboe Reviewed-by: Gre

[PATCH v4 2/4] switchtec: Add user interface documentation

2017-02-24 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver

2017-02-24 Thread Logan Gunthorpe
Hey Bjorn, Thanks for the thorough review. It definitely helped a lot to make the code as good as it can be. I've made all of the changes you suggested. I'm just going to do a bit more testing and then post a v4. See my responses to all of your feedback bellow. Logan On 23/02/17 05:35 PM, Bjorn

[PATCH v3 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-23 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v3 2/4] switchtec: Add user interface documentation

2017-02-23 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

[PATCH v3 0/4] New Microsemi PCI Switch Management Driver

2017-02-23 Thread Logan Gunthorpe
r 4.11 or 4.12 assuming a smooth review process. The patch is based off of the v4.10-rc6 release. Thanks for your review, Logan [1] https://www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec-user -- Logan Gunthorpe (4): MicroSemi Switchtec management int

[PATCH v3 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-23 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v3 1/4] MicroSemi Switchtec management interface driver

2017-02-23 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Tested-by: Krishna Dhulipala Reviewed-by: Wei Zhang Reviewed-by: Jens Axboe Reviewed-by: Gre

Re: [PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-23 Thread Logan Gunthorpe
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 a

Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver

2017-02-23 Thread Logan Gunthorpe
n 23/02/17 03:14 PM, Bjorn Helgaas wrote: > On Thu, Feb 23, 2017 at 01:36:51PM -0700, Logan Gunthorpe wrote: >> Hello, >> >> We're still waiting on any kind of response from Bjorn. (If you're >> listening please say something!) >> >> Does a

Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver

2017-02-23 Thread Logan Gunthorpe
On 23/02/17 01:51 PM, Sinan Kaya wrote: > You'll want to be careful during the merge window (these days) as the > maintainer is usually busy with code delivery. You can't rush your code in at > the last minute. Thanks for the advice, we will continue to wait. However, I would say we've been ver

Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver

2017-02-23 Thread Logan Gunthorpe
up through another route? In the end, it's just a fairly basic driver and doesn't touch any core PCI functionality and we've had a fair amount of review from other kernel contributors, all of which we've addressed. Thanks, Logan On 17/02/17 01:36 PM, Logan Gunthorpe wrote:

Re: [PATCH] switchtec: cleanup cdev init

2017-02-19 Thread Logan Gunthorpe
On 19/02/17 02:43 PM, Dan Williams wrote: > Is this race present for all file operations? I've only seen it with > mmap() and late faults. So if these other drivers do not support mmap > it's not clear they can trigger the failure. I don't see how it's related to mmap only. I think there's a num

Re: [PATCH] switchtec: cleanup cdev init

2017-02-18 Thread Logan Gunthorpe
up when/if the above numerous examples are fixed up. Thanks, Logan [1] https://lkml.org/lkml/2017/2/10/589 [2] https://lkml.org/lkml/2017/2/13/700 On 10/02/17 10:57 AM, Logan Gunthorpe wrote: > Per a suggestion from Greg Kroah-Hartman [1], don't set the cdev's > k

Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver

2017-02-17 Thread Logan Gunthorpe
ddress any concerns you may have, just please let us know. Thanks, Logan On 02/02/17 11:05 AM, Logan Gunthorpe wrote: > Changes since v1: > > * Rebased onto 4.10-rc6 (cleanly) > * Split the patch into a few more easily digestible patches (as > suggested by Greg Kroah-Hartman) &g

Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver

2017-02-10 Thread Logan Gunthorpe
On 10/02/17 10:09 AM, Greg Kroah-Hartman wrote: > Sure, or just wait for these to be applied to the PCI tree and then send > a follow-on patch. It's up to Bjorn really, as to what he wants. Ok, I sent a working follow-on patch to this thread. @Bjorn: I'm happy to send the patches however you l

[PATCH] switchtec: cleanup cdev init

2017-02-10 Thread Logan Gunthorpe
Per a suggestion from Greg Kroah-Hartman [1], don't set the cdev's kobject parent. This allows us to use device_register instead of init and add. [1] https://lkml.org/lkml/2017/2/10/370 --- drivers/pci/switch/switchtec.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff

Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver

2017-02-10 Thread Logan Gunthorpe
On 10/02/17 09:55 AM, Greg Kroah-Hartman wrote: > Yes, but try it yourself to verify it really is correct :) Yes, of course... turns out it wasn't. I accidentally refereed to dev before I assigned it. I had mainly just wanted your feedback to ensure that switching to device_register made sense.

Re: [PATCH v2 1/4] MicroSemi Switchtec management interface driver

2017-02-10 Thread Logan Gunthorpe
Hey Greg, Thanks so much for the review. On 10/02/17 07:51 AM, Greg Kroah-Hartman wrote: > On Thu, Feb 02, 2017 at 11:06:00AM -0700, Logan Gunthorpe wrote: >> +cdev = &stdev->cdev; >> +cdev_init(cdev, &switchtec_fops); >> +cdev->owner = THIS_MODUL

[PATCH v2 2/4] switchtec: Add user interface documentation

2017-02-02 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and a RST formatted text file which documents the char device interface. Jonathan Corbet has indicated he will move this to a new user-space developer documentation book once it's created. Signed-off-by: Logan Gunthorpe S

[PATCH v2 0/4] New Microsemi PCI Switch Management Driver

2017-02-02 Thread Logan Gunthorpe
review, Logan [1] https://www.spinics.net/lists/linux-pci/msg56897.html [2] https://github.com/sbates130272/switchtec-user -- Logan Gunthorpe (4): MicroSemi Switchtec management interface driver switchtec: Add user interface documentation switchtec: Add sysfs attributes to the Switchtec drive

[PATCH v2 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-02 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide some device information that is exposed from the devices. Primarily component and device names and versions. These are documented in Documentation/ABI/testing/sysfs-class-switchtec. Signed-off-by: Logan Gunthorpe Signed-off-by

[PATCH v2 1/4] MicroSemi Switchtec management interface driver

2017-02-02 Thread Logan Gunthorpe
features may be added in the future. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates --- MAINTAINERS|8 + drivers/pci/Kconfig|1 + drive

[PATCH v2 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-02 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to: * Inform userspace of firmware partition locations * Pass event counts and allow userspace to wait on events * Translate between PFF numbers used by the switch to port numbers. Signed-off-by: Logan Gunthorpe Signed-off-by

Re: [PATCH 1/1] MicroSemi Switchtec management interface driver

2017-02-02 Thread Logan Gunthorpe
On 01/02/17 05:10 AM, Emil Velikov wrote: > You can keep it roughly as-is if you're ~reasonably certain one won't > change it in the future. I've made the change anyway. I think it's better now. > Some teams frown upon adding new IOCTL(s) where existing ones can be > made backward/forward compa

Re: [PATCH 1/1] MicroSemi Switchtec management interface driver

2017-01-31 Thread Logan Gunthorpe
Hi Emil, Thanks for the feedback. On 31/01/17 01:48 PM, Emil Velikov wrote: >> +struct switchtec_ioctl_fw_info { >> + __u32 flash_length; >> + >> + struct { >> + __u32 address; >> + __u32 length; >> + __u32 active; > Something to keep in mind,

Re: [PATCH 1/1] MicroSemi Switchtec management interface driver

2017-01-31 Thread Logan Gunthorpe
On 31/01/17 11:57 AM, Greg Kroah-Hartman wrote: > Sorry, it was probably me :) Nope, it was Christoph Hellwig. I don't mind changing it. It's just hard to know what's expected all the time. > Why do you need this? Wherever you put it, it should be built as part > of the online kernel documenta

Re: [PATCH 1/1] MicroSemi Switchtec management interface driver

2017-01-31 Thread Logan Gunthorpe
On 31/01/17 10:49 AM, Jonathan Corbet wrote: > The good news is that your switchtec.txt file is already 99% in the RST > format, so there is little or nothing to do there. > > The bad news is that we don't quite have a place for it yet. This is > really user-space developer documentation, and w

[PATCH 0/1] DRAFT: New Microsemi PCI Switch Management Driver

2017-01-31 Thread Logan Gunthorpe
c class * Added a handful of IOCTLs to the switchtec device * A number of miscelaneous bug fixes -- Logan Gunthorpe (1): MicroSemi Switchtec management interface driver Documentation/ABI/testing/sysfs-class-switchtec | 96 ++ Documentation/ioctl/ioctl-number.txt|1 + Do

Re: [PATCH 1/1] MicroSemi Switchtec management interface driver

2017-01-31 Thread Logan Gunthorpe
On 31/01/17 10:26 AM, Greg Kroah-Hartman wrote: > That's one big patch to review, would you want to do that? Sorry, will do. > Can you break it up into smaller parts? At least put the documentation > separately, right? Ha, funny. Last time I sent a patch someone asked for the documentation to

[PATCH 1/1] MicroSemi Switchtec management interface driver

2017-01-31 Thread Logan Gunthorpe
30272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates --- Documentation/ABI/testing/sysfs-class-switchtec | 96 ++ Documentation/ioctl/ioctl-number.txt|1 + Documentation/switchtec.txt

Re: [RFC 0/1] New PCI Switch Management Driver

2016-12-19 Thread Logan Gunthorpe
On 19/12/16 10:29 AM, Keith Busch wrote: > Since the in-kernel driver binds to the device, won't this driver > conflict with the initialization the in-kernel one already does? Bus > master, MSI setup, etc? No. The management interface is on a completely separate PCI endpoint. So from the kernels

Re: [RFC 0/1] New PCI Switch Management Driver

2016-12-19 Thread Logan Gunthorpe
akes the advanced features available to the user. Does that make sense? Thanks, Logan > On Sat, Dec 17, 2016 at 10:09 AM, Logan Gunthorpe wrote: >> Hi, >> >> [Appologies: this is a resend for some people. Due to a configuration >> error the original email was rejec

Re: [RFC 1/1] MicroSemi Switchtec management interface driver

2016-12-19 Thread Logan Gunthorpe
On 19/12/16 10:02 AM, Keith Busch wrote: > Some of this would be simplified if you use the managed device API's: > devm_request_irq, pcim_enable_device, pcim_iomap, etc... Thanks Keith, I'll look into using those. Logan -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in

Re: [RFC 1/1] MicroSemi Switchtec management interface driver

2016-12-18 Thread Logan Gunthorpe
Hi Greg, Thanks for the quick review! On 18/12/16 12:51 AM, Greg Kroah-Hartman wrote: On Sat, Dec 17, 2016 at 10:09:22AM -0700, Logan Gunthorpe wrote: +struct switchtec_dev { + struct pci_dev *pdev; + struct msix_entry *msix; + struct device *dev; + struct kref kref

[RFC 1/1] MicroSemi Switchtec management interface driver

2016-12-17 Thread Logan Gunthorpe
[1]. This tool takes inspiration (and borrows some code) from nvme-cli [2]. [1] https://github.com/sbates130272/switchtec-user [2] https://github.com/linux-nvme/nvme-cli Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates --- Documentation/switchtec.txt| 54 +++ MAINTAINERS

[RFC 0/1] New PCI Switch Management Driver

2016-12-17 Thread Logan Gunthorpe
n and will be fleshed out assuming there are no serious objections to our userspace interface. In the end, the tool will be released with a GPL license. The patch is based off of the v4.9 release. Thanks for your review, Logan [1] https://github.com/sbates130272/switchtec-user Logan Gu