Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593910

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

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev
Date 2017-03-07 06:00 +0100
Message-ID <tifo5-27k-9@gated-at.bofh.it> (permalink)
References <tidmi-DY-5@gated-at.bofh.it> <tidmi-DY-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 macro assumes that struct
> device is embedded in struct pci_dev. However, that is not the
> case for the device structure in struct ib_device.

Then don't blindly cast it backwards!  Fix that up, an ib device should
have access to the dma structures that the PCI device it depends on has.
If not, you need to set that up properly in the IB core, don't mess with
the driver core for this at all.

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 :)

greg k-h

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] device: Stop requiring that struct device is  embedded in struct pci_dev Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-07 06:00 +0100
  RE: [PATCH 1/2] device: Stop requiring that struct device is embedded  in struct pci_dev Parav Pandit <parav@mellanox.com> - 2017-03-07 06:20 +0100
    RE: [PATCH 1/2] device: Stop requiring that struct device is embedded  in struct pci_dev Parav Pandit <parav@mellanox.com> - 2017-03-07 09:00 +0100
  RE: [PATCH 1/2] device: Stop requiring that struct device is embedded  in struct pci_dev Parav Pandit <parav@mellanox.com> - 2017-03-07 19:30 +0100
  Re: [PATCH 1/2] device: Stop requiring that struct device is  embedded in struct pci_dev "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org> - 2017-03-07 20:30 +0100
  Re: [PATCH 1/2] device: Stop requiring that struct device is  embedded in struct pci_dev Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2017-03-08 04:50 +0100

csiph-web