mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
To: Bart Van Assche <Bart.VanAssche@sandisk.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"gerald.schaefer@de.ibm.com" <gerald.schaefer@de.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: IB on s390 broken with commit 99db94940 "IB/core: Remove ib_device.dma_device"
Date: Tue, 28 Feb 2017 10:20:00 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.20.1702281011220.2045@schleppi.fritz.box> (raw)
In-Reply-To: <alpine.LFD.2.20.1702280950380.2045@schleppi.fritz.box>

On Tue, 28 Feb 2017, Sebastian Ott wrote:
> On Mon, 27 Feb 2017, Bart Van Assche wrote:
> > On Mon, 2017-02-27 at 21:17 +0100, Sebastian Ott wrote:
> > > commit 99db94940 "IB/core: Remove ib_device.dma_device"
> > > breaks infiniband on s390 (and I think also other archs that do something
> > > like to_pci_dev(dev) in one of their dma_ops callbacks).
> > > 
> > > With this commit you use the dma_ops of the device that called
> > > ib_register_device but you call e.g. dma_map with ib_device->dev
> > > as an argument.
> > > 
> > > S390's (pci specific) dma_map uses to_pci_dev(dev) to look into the
> > > pci device (and its arch specific data) and oopses.
> > > 
> > > Calling dma_map with ib_device->dev.parent would work but then it
> > > wouldn't make sense to copy dma_ops and mask from ib_device->dev.parent
> > > to ib_device->dev..
> > 
> > How about something like the untested patch below?
> 
> It works but it doesn't feel right (why should all pci devices have this
> duplicated data).
> 
> Frankly I don't get the usecase of infiniband (sometimes) using
> device->dev.dma_ops instead of parent->dma_ops.

Ok, some drivers in drivers/infiniband/sw/ set dma_ops to &dma_virt_ops .

So instead of copying the dma_ops you could do

if (!device->dev.dma_ops) /*or use some new flag for ib_register_device*/
	device->dma_device = parent;
else
	device->dma_device = &device->dev;

Sebastian

  reply	other threads:[~2017-02-28 10:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 20:17 Sebastian Ott
2017-02-27 22:04 ` Bart Van Assche
2017-02-28  8:53   ` Sebastian Ott
2017-02-28  9:20     ` Sebastian Ott [this message]
2017-02-28 16:50     ` Bart Van Assche
2017-02-28 19:53       ` Parav Pandit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.1702281011220.2045@schleppi.fritz.box \
    --to=sebott@linux.vnet.ibm.com \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=dledford@redhat.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®