From patchwork Mon Jun 10 14:19:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10985033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 301086C5 for ; Mon, 10 Jun 2019 14:19:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DDF51FF13 for ; Mon, 10 Jun 2019 14:19:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 107DE268AE; Mon, 10 Jun 2019 14:19:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEB391FF13 for ; Mon, 10 Jun 2019 14:19:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AAD689137; Mon, 10 Jun 2019 14:19:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680059.outbound.protection.outlook.com [40.107.68.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 038F689137 for ; Mon, 10 Jun 2019 14:19:12 +0000 (UTC) Received: from MN2PR05MB6141.namprd05.prod.outlook.com (20.178.241.217) by MN2PR05MB6031.namprd05.prod.outlook.com (20.178.243.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.5; Mon, 10 Jun 2019 14:19:08 +0000 Received: from MN2PR05MB6141.namprd05.prod.outlook.com ([fe80::5088:14e2:252d:98d0]) by MN2PR05MB6141.namprd05.prod.outlook.com ([fe80::5088:14e2:252d:98d0%6]) with mapi id 15.20.1987.008; Mon, 10 Jun 2019 14:19:08 +0000 From: Thomas Hellstrom To: "dri-devel@lists.freedesktop.org" Subject: [PATCH v3] drm/vmwgfx: fix a warning due to missing dma_parms Thread-Topic: [PATCH v3] drm/vmwgfx: fix a warning due to missing dma_parms Thread-Index: AQHVH5d38LG+xo4FWUO9Rk24fF+76A== Date: Mon, 10 Jun 2019 14:19:08 +0000 Message-ID: <20190610141835.2849-1-thellstrom@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0202CA0016.eurprd02.prod.outlook.com (2603:10a6:803:14::29) To MN2PR05MB6141.namprd05.prod.outlook.com (2603:10b6:208:c7::25) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [155.4.205.35] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9f9068c6-8b1b-4d78-9952-08d6edae99a4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR05MB6031; x-ms-traffictypediagnostic: MN2PR05MB6031: x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0064B3273C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(136003)(396003)(366004)(199004)(189003)(6512007)(8676002)(73956011)(386003)(6506007)(2906002)(81156014)(86362001)(5640700003)(1076003)(50226002)(476003)(25786009)(6916009)(26005)(486006)(2351001)(66946007)(66446008)(64756008)(66556008)(66476007)(2616005)(53936002)(186003)(6486002)(54906003)(7736002)(6436002)(81166006)(66066001)(71190400001)(36756003)(305945005)(5660300002)(316002)(2501003)(52116002)(14444005)(5024004)(256004)(107886003)(3846002)(6116002)(99286004)(478600001)(14454004)(8936002)(68736007)(71200400001)(4326008)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR05MB6031; H:MN2PR05MB6141.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pcSjJFm83gY65kUPplTzq2PMpleHkJIxIU2DadzwKXza+5OT8jeLiqKC76WvN8g50CLfCRnzSH+sJM99ZIZC+ErqvPQ5GfZKT7ouQYuuhlXhlhvmxLxRI18xk9PgR1NPEsQYiEueqqJ23HAzslEAckRK2aqmjZ8nGmCGJvDqqZ7eE5TK8oaEqFsyBlm3i6SAjg5brf5bb0/mH5Lk+J6pnmKSnZZ3jHPf13Y7loBp2Us6AnaqPPuNs9dhz1XsDpdLHDtkBi5cyc6rp0TKNzSERKl9XSb2LDISS9nn2mpRDMUHX+f0CktXTHK09jbWWo2omKDcuF8K6jb5SDJilH1PBprovvy8Ei2BEwI5JR5PnOWM5w7uezcXTkPKU2Til1JqhGcg/xzlw+dJl+92XWxIXJMvlYm+oWZmFfKEJ4z1xH8= MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f9068c6-8b1b-4d78-9952-08d6edae99a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2019 14:19:08.3144 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: thellstrom@vmware.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR05MB6031 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tf6QK3T/QOTnyOdaVMxWSs6ohjKlJSgm+6wmLJ2tC3M=; b=Kg+XIEEy3GCBgTr/byVEImBA2h+kdAhNdKFiJ78vWmqjxrIAVgraxK3x8+c4zny6YHYbrL/Z5TRS3FwSTGaFkgnKfF8UH9q26uOqhu/MrJ8YxA3blFyv2p8+8euziDYcAXwVzHWzXV5DfLu9gLZmcFs4/4ah/S5YK4AF1P489qY= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Qian Cai , Thomas Hellstrom , Linux-graphics-maintainer , "linux-kernel@vger.kernel.org" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Qian Cai Booting up with DMA_API_DEBUG_SG=y generates a warning due to the driver forgot to set dma_parms appropriately. Set it just after vmw_dma_masks() in vmw_driver_load(). DMA-API: vmwgfx 0000:00:0f.0: mapping sg segment longer than device claims to support [len=2097152] [max=65536] WARNING: CPU: 2 PID: 261 at kernel/dma/debug.c:1232 debug_dma_map_sg+0x360/0x480 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/13/2018 RIP: 0010:debug_dma_map_sg+0x360/0x480 Call Trace: vmw_ttm_map_dma+0x3b1/0x5b0 [vmwgfx] vmw_bo_map_dma+0x25/0x30 [vmwgfx] vmw_otables_setup+0x2a8/0x750 [vmwgfx] vmw_request_device_late+0x78/0xc0 [vmwgfx] vmw_request_device+0xee/0x4e0 [vmwgfx] vmw_driver_load.cold+0x757/0xd84 [vmwgfx] drm_dev_register+0x1ff/0x340 [drm] drm_get_pci_dev+0x110/0x290 [drm] vmw_probe+0x15/0x20 [vmwgfx] local_pci_probe+0x7a/0xc0 pci_device_probe+0x1b9/0x290 really_probe+0x1b5/0x630 driver_probe_device+0xa3/0x1a0 device_driver_attach+0x94/0xa0 __driver_attach+0xdd/0x1c0 bus_for_each_dev+0xfe/0x150 driver_attach+0x2d/0x40 bus_add_driver+0x290/0x350 driver_register+0xdc/0x1d0 __pci_register_driver+0xda/0xf0 vmwgfx_init+0x34/0x1000 [vmwgfx] do_one_initcall+0xe5/0x40a do_init_module+0x10f/0x3a0 load_module+0x16a5/0x1a40 __se_sys_finit_module+0x183/0x1c0 __x64_sys_finit_module+0x43/0x50 do_syscall_64+0xc8/0x606 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Co-developed-by: Thomas Hellstrom Signed-off-by: Qian Cai Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 6d417e29bcec..447b49d6ade1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -745,6 +745,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) if (unlikely(ret != 0)) goto out_err0; + dma_set_max_seg_size(dev->dev, min_t(unsigned int, U32_MAX & PAGE_MASK, + SCATTERLIST_MAX_SEGMENT)); + if (dev_priv->capabilities & SVGA_CAP_GMR2) { DRM_INFO("Max GMR ids is %u\n", (unsigned)dev_priv->max_gmr_ids);