Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6297864imb; Fri, 8 Mar 2019 14:11:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyHjSlqZCm7oTbuP+BxFczOtpheVn8+3TZYPZzoaOzjyo0UwaNAWiG5qaDIo7qr1Zl1WYjO X-Received: by 2002:a65:52c3:: with SMTP id z3mr18949805pgp.395.1552083084452; Fri, 08 Mar 2019 14:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552083084; cv=none; d=google.com; s=arc-20160816; b=cSUZoKG+ssgf7GfNzFESgTjKXx4AQFdt0leH7kPodni/2I3HOYGlye+0jFdeG9zV1b LRva6tAQCtZXBxsVE5TNSRDEXC5M8azLIIV5hSOVP30/zdrxk21ZGGq5wFXyme+Ctyaw OdcxD/COxvDPFB9eH5RsuRimgmwL5hTDoggtL7Jn7j6l7XFvSC50mzfguolTRPpCVxdM PtbH+u1JPP3YvdyUSpxbxzHvL4PoJosWdKxLogcETI/oAyXaQ8HKkpjptTJtJcKsi8mc 9CoxTy5YOCDqsGshfrsitoamIvTcgi6H1nafWz2UfYSv/M8d0oR/OAUkYQk9NbV9twdH 0lZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=POqsCVJqYR1dcrKazxI2r2QlXZ5U1Xo+3bfg6ZRfOh0=; b=wyirwRWNriByiL0ZPi5aLkbtc9OiwSjbSdxgvhPuqWd6dbPO05J75y6BZCLM4GCUIM SjGQRoEsDPYI8llVUKPxrb+VIENyR0IEotDyjUHMjsu4uuEwub95FaxezkdLbJWvTJ1f luzjE9JR19h1217yqzYpNQBOmjKwhOOrYcy/FUZQgUWXhEn1z872D9myfO8BTzmcjuZk 8rNh4sLhoJ/crSTGU4sge6B7xrABehQ2Jb0TdHGwN3BKAk5vUk67zrrMxF6FA5yBiXil j998ASPRkjQaWPMSSWBUm0GtTUWAtG3Fz2aFVRE2ma9D7gLxNTFz0i8VWOrsbLRb3NY6 ry/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si8173798pfb.100.2019.03.08.14.11.08; Fri, 08 Mar 2019 14:11:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbfCHWIN (ORCPT + 99 others); Fri, 8 Mar 2019 17:08:13 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42805 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726319AbfCHWIN (ORCPT ); Fri, 8 Mar 2019 17:08:13 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Mar 2019 00:08:09 +0200 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x28M83SV002296; Sat, 9 Mar 2019 00:08:07 +0200 From: Parav Pandit To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.lkml@markovi.net, davem@davemloft.net, gregkh@linuxfoundation.org, jiri@mellanox.com, kwankhede@nvidia.com Cc: parav@mellanox.com, alex.williamson@redhat.com, vuhuong@mellanox.com, yuvalav@mellanox.com, jakub.kicinski@netronome.com, kvm@vger.kernel.org Subject: [RFC net-next v1 1/3] vfio/mdev: Inherit dma masks of parent device Date: Fri, 8 Mar 2019 16:07:54 -0600 Message-Id: <1552082876-60228-2-git-send-email-parav@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552082876-60228-1-git-send-email-parav@mellanox.com> References: <1552082876-60228-1-git-send-email-parav@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Inherit dma mask of parent device in child mdev devices, so that protocol stack can use right dma mask while doing dma mappings. Signed-off-by: Parav Pandit --- drivers/vfio/mdev/mdev_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c index 0212f0e..9b8bdc9 100644 --- a/drivers/vfio/mdev/mdev_core.c +++ b/drivers/vfio/mdev/mdev_core.c @@ -315,6 +315,10 @@ int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid) mdev->dev.parent = dev; mdev->dev.bus = &mdev_bus_type; mdev->dev.release = mdev_device_release; + mdev->dev.dma_mask = dev->dma_mask; + mdev->dev.dma_parms = dev->dma_parms; + mdev->dev.coherent_dma_mask = dev->coherent_dma_mask; + dev_set_name(&mdev->dev, "%pUl", uuid.b); ret = device_register(&mdev->dev); -- 1.8.3.1