Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932389AbdCGExW (ORCPT ); Mon, 6 Mar 2017 23:53:22 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42922 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754483AbdCGExO (ORCPT ); Mon, 6 Mar 2017 23:53:14 -0500 Date: Tue, 7 Mar 2017 05:52:36 +0100 From: Greg Kroah-Hartman To: Bart Van Assche Cc: Doug Ledford , Sebastian Ott , Parav Pandit , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Benjamin Herrenschmidt , David Woodhouse , "H . Peter Anvin" , Ingo Molnar , Russell King Subject: Re: [PATCH 1/2] device: Stop requiring that struct device is embedded in struct pci_dev Message-ID: <20170307045236.GC3913@kroah.com> References: <20170307003549.3872-1-bart.vanassche@sandisk.com> <20170307003549.3872-2-bart.vanassche@sandisk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170307003549.3872-2-bart.vanassche@sandisk.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 887 Lines: 18 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