From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbdB1K5c (ORCPT ); Tue, 28 Feb 2017 05:57:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47744 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750957AbdB1K50 (ORCPT ); Tue, 28 Feb 2017 05:57:26 -0500 Date: Tue, 28 Feb 2017 10:20:00 +0100 (CET) From: Sebastian Ott X-X-Sender: sebott@schleppi.fritz.box To: Bart Van Assche cc: "dledford@redhat.com" , "gerald.schaefer@de.ibm.com" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" Subject: Re: IB on s390 broken with commit 99db94940 "IB/core: Remove ib_device.dma_device" In-Reply-To: References: <1488233058.2597.1.camel@sandisk.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) Organization: =?ISO-8859-15?Q?=22IBM_Deutschland_Research_&_Development_GmbH_=2F_Vorsitzende_des_Aufsichtsrats=3A_Martina_Koederitz_Gesch=E4ftsf=FChrung=3A_Dirk_Wittkopp_Sitz_der_Gesellschaft=3A_B=F6blingen_=2F_Registergericht?= =?ISO-8859-15?Q?=3A_Amtsgericht_Stuttgart=2C_HRB_243294=22?= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022809-0040-0000-0000-00000333BF78 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022809-0041-0000-0000-0000245060D0 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-28_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702280087 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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