Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Benjamin Herrenschmidt
On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > On Mon, Mar 06, 2017 at 04:35:48PM -0800, Bart Van Assche wrote: > > The dma mapping operations of several architectures and also of > > several I/O MMU implementations need to translate a struct > > device pointer into a struct

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Benjamin Herrenschmidt
On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > On Mon, Mar 06, 2017 at 04:35:48PM -0800, Bart Van Assche wrote: > > The dma mapping operations of several architectures and also of > > several I/O MMU implementations need to translate a struct > > device pointer into a struct

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Bart Van Assche
On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > Somehow all other subsystems work just fine, don't instantly think that > the driver core needs to bend to the will of the IB code, because you > are somehow "special". Hint, you aren't :) Hi Greg, In another e-mail Parav compared

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Bart Van Assche
On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > Somehow all other subsystems work just fine, don't instantly think that > the driver core needs to bend to the will of the IB code, because you > are somehow "special". Hint, you aren't :) Hi Greg, In another e-mail Parav compared

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread gre...@linuxfoundation.org
On Tue, Mar 07, 2017 at 04:54:58PM +, Bart Van Assche wrote: > On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > > Somehow all other subsystems work just fine, don't instantly think that > > the driver core needs to bend to the will of the IB code, because you > > are somehow

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread gre...@linuxfoundation.org
On Tue, Mar 07, 2017 at 04:54:58PM +, Bart Van Assche wrote: > On Tue, 2017-03-07 at 05:52 +0100, Greg Kroah-Hartman wrote: > > Somehow all other subsystems work just fine, don't instantly think that > > the driver core needs to bend to the will of the IB code, because you > > are somehow

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Parav Pandit
> -Original Message- > From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, March 7, 2017 11:14 AM > To: Bart Van Assche > Cc: linux-kernel@vger.kernel.org; linux-r...@vger.kernel.org; Parav Pandit > ;

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Parav Pandit
> -Original Message- > From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, March 7, 2017 11:14 AM > To: Bart Van Assche > Cc: linux-kernel@vger.kernel.org; linux-r...@vger.kernel.org; Parav Pandit > ; seb...@linux.vnet.ibm.com; > li...@armlinux.org.uk;

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread gre...@linuxfoundation.org
On Tue, Mar 07, 2017 at 02:44:28AM +, Bart Van Assche wrote: > On Tue, 2017-03-07 at 02:41 +, Parav Pandit wrote: > > Compilation would break when CONFIG_PCI is not defined for some embedded > > platforms. > > More than that, including specific pci_dev structure pointer in generic > >

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread gre...@linuxfoundation.org
On Tue, Mar 07, 2017 at 02:44:28AM +, Bart Van Assche wrote: > On Tue, 2017-03-07 at 02:41 +, Parav Pandit wrote: > > Compilation would break when CONFIG_PCI is not defined for some embedded > > platforms. > > More than that, including specific pci_dev structure pointer in generic > >

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 11:13 PM > To: Parav Pandit ; gre...@linuxfoundation.org > Cc: linux-kernel@vger.kernel.org;

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-07 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 11:13 PM > To: Parav Pandit ; gre...@linuxfoundation.org > Cc: linux-kernel@vger.kernel.org;

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
On Tue, 2017-03-07 at 05:08 +, Parav Pandit wrote: > I replied with pseudo code in previous reply to Bart to bring back dma_device > member in the ib_device. > dma_device member was already present in near past of few weeks. > It should be able to work using it without performance impact and

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
On Tue, 2017-03-07 at 05:08 +, Parav Pandit wrote: > I replied with pseudo code in previous reply to Bart to bring back dma_device > member in the ib_device. > dma_device member was already present in near past of few weeks. > It should be able to work using it without performance impact and

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Greg, > -Original Message- > From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org] > Sent: Monday, March 6, 2017 10:53 PM > To: Bart Van Assche > Cc: Doug Ledford ; Sebastian Ott > ; Parav Pandit

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Greg, > -Original Message- > From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org] > Sent: Monday, March 6, 2017 10:53 PM > To: Bart Van Assche > Cc: Doug Ledford ; Sebastian Ott > ; Parav Pandit ; linux- > r...@vger.kernel.org; linux-kernel@vger.kernel.org; Bjorn Helgaas > ;

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Greg Kroah-Hartman
On Mon, Mar 06, 2017 at 04:35:48PM -0800, Bart Van Assche wrote: > The dma mapping operations of several architectures and also of > several I/O MMU implementations need to translate a struct > device pointer into a struct pci_dev pointer. This translation > is performed by to_pci_dev(). That

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Greg Kroah-Hartman
On Mon, Mar 06, 2017 at 04:35:48PM -0800, Bart Van Assche wrote: > The dma mapping operations of several architectures and also of > several I/O MMU implementations need to translate a struct > device pointer into a struct pci_dev pointer. This translation > is performed by to_pci_dev(). That

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 6:36 PM > To: Doug Ledford > Cc: Greg Kroah-Hartman ; Sebastian

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 6:36 PM > To: Doug Ledford > Cc: Greg Kroah-Hartman ; Sebastian Ott > ; Parav Pandit ; linux- >

[PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
The dma mapping operations of several architectures and also of several I/O MMU implementations need to translate a struct device pointer into a struct pci_dev pointer. This translation is performed by to_pci_dev(). That macro assumes that struct device is embedded in struct pci_dev. However, that

[PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
The dma mapping operations of several architectures and also of several I/O MMU implementations need to translate a struct device pointer into a struct pci_dev pointer. This translation is performed by to_pci_dev(). That macro assumes that struct device is embedded in struct pci_dev. However, that

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
On Tue, 2017-03-07 at 02:41 +, Parav Pandit wrote: > Compilation would break when CONFIG_PCI is not defined for some embedded > platforms. > More than that, including specific pci_dev structure pointer in generic > structure such as device just doesn't sound right. > I tested equivalent

Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Bart Van Assche
On Tue, 2017-03-07 at 02:41 +, Parav Pandit wrote: > Compilation would break when CONFIG_PCI is not defined for some embedded > platforms. > More than that, including specific pci_dev structure pointer in generic > structure such as device just doesn't sound right. > I tested equivalent

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 6:36 PM > To: Doug Ledford > Cc: Greg Kroah-Hartman ; Sebastian

RE: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev

2017-03-06 Thread Parav Pandit
Hi Bart, > -Original Message- > From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma- > ow...@vger.kernel.org] On Behalf Of Bart Van Assche > Sent: Monday, March 6, 2017 6:36 PM > To: Doug Ledford > Cc: Greg Kroah-Hartman ; Sebastian Ott > ; Parav Pandit ; linux- >