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-19 Thread Keith Busch
On Sat, Dec 17, 2016 at 10:09:22AM -0700, Logan Gunthorpe wrote: > Microsemi's "Switchtec" line of PCI switch devices is already > supported by the kernel with standard PCI switch drivers. However, the > Switchtec device advertises a special management endpoint which > enables some additional funct

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

2016-12-18 Thread Greg Kroah-Hartman
On Sun, Dec 18, 2016 at 10:20:47AM -0700, Logan Gunthorpe wrote: > 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; > > > +

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;

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

2016-12-18 Thread Greg Kroah-Hartman
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; Why do you have a pointer to a device, yet a kref as well? Just have this structure embed

[RFC 1/1] MicroSemi Switchtec management interface driver

2016-12-17 Thread Logan Gunthorpe
Microsemi's "Switchtec" line of PCI switch devices is already supported by the kernel with standard PCI switch drivers. However, the Switchtec device advertises a special management endpoint which enables some additional functionality. This includes: * Packet and Byte Counters * Firmware Upgrade