Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp553673ybg; Wed, 23 Oct 2019 02:13:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEZUYIkIji5yjeGovLkqM+hA3qJt3EckPmNlrJnG0mZkb9AQuqzyeG7f7h9GJXIuXcG1hM X-Received: by 2002:aa7:d1ca:: with SMTP id g10mr36352890edp.156.1571822001182; Wed, 23 Oct 2019 02:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571822001; cv=none; d=google.com; s=arc-20160816; b=lq2uiZ7A1ShrIMCVX4jPU8ZQvIkKdysxl1G9Z6ejs90vSxn1xPE9LSaPh5o0jKiQXu f+yC3mQxxX4XeS3P7LZ7QtYDCEjY/8yUPIRBFMpve0a87RiZeYxIV8qCZ+O5FHfacPub tmn5FtCvthR4Qzax8vxpWZ8Yy3DWCuOHUIrQTe2MCX+JZkoPrxkwBvpdU/bquIEjlfJI sz7RnqhrDbyA656v5PE88AW2OdQ196AHajDlWhyng+6JIYO4ktilh1ASJuIG2dtGRTtU EtrmQVb2bPsUtrRMEcfd8wPhEgbahCZDFY6jk4lic3vQAQUcq44p4l13mXRZnZzwEhDV zD2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1f42zfMzC/XPxaWBvlC6irZ5oJlB9jXAiMyWCO25MDg=; b=pbekrNZqzhUdrScpxmkslhgZW11qBi1TUQudY5pPNRZHAhGRW+voNNlvqcl7Rsshvl L3RA2DMDbDVSkf+drTHyqVj8KQzCGLLPpul0055sIs0ZxmmQhtzfKbM8Llnp/+vPmdHI a+pcvmhztpqWGk9GM8/rKDDDuVa8zF8MkZk0gnTa9VnYY1ex6Evo2d+c8Xj+8RwhnvAO JwNpYyR/LzNffPiXAoNYMk00OmnB7WTQuoetZeKbFj1i2wu4NROsUe46x02932soeY0q U5pC29Utcm4M8cpW31nCqOc0QviC9/aQR5gtcOW6a3ooUZlHOePeezb/FjDPJ3Itl3Vx W3Xg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 35si3166835edl.409.2019.10.23.02.12.57; Wed, 23 Oct 2019 02:13:21 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403752AbfJWJKm (ORCPT + 99 others); Wed, 23 Oct 2019 05:10:42 -0400 Received: from verein.lst.de ([213.95.11.211]:39233 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390530AbfJWJKm (ORCPT ); Wed, 23 Oct 2019 05:10:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id DAB3A68BE1; Wed, 23 Oct 2019 11:10:37 +0200 (CEST) Date: Wed, 23 Oct 2019 11:10:37 +0200 From: "hch@lst.de" To: Wei Hu Cc: "b.zolnierkie@samsung.com" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "sashal@kernel.org" , "hch@lst.de" , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "mchehab+samsung@kernel.org" , "sam@ravnborg.org" , "gregkh@linuxfoundation.org" , "alexandre.belloni@bootlin.com" , "info@metux.net" , "arnd@arndb.de" , "dri-devel@lists.freedesktop.org" , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "dcui@microsoft.com" , Michael Kelley Subject: Re: [PATCH] video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs. Message-ID: <20191023091037.GB21910@lst.de> References: <20191022110905.4032-1-weh@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191022110905.4032-1-weh@microsoft.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + select DMA_CMA Thіs needs to be select DMA_CMA if HAVE_DMA_CONTIGUOUS > +#include > + /* Allocate from CMA */ > + // request_pages = (request_size >> PAGE_SHIFT) + 1; > + request_pages = (round_up(request_size, PAGE_SIZE) >> PAGE_SHIFT); > + page = dma_alloc_from_contiguous(NULL, request_pages, 0, false); dma_alloc_from_contiguous is an internal helper, you must use it through dma_alloc_coherent and pass a struct device to that function. > + if (!gen2vm) { > + pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT, > + PCI_DEVICE_ID_HYPERV_VIDEO, NULL); > + if (!pdev) { > + pr_err("Unable to find PCI Hyper-V video\n"); > + return -ENODEV; > + } > + } Please actually implement a pci_driver instead of hacks like this. > + par->need_docopy = false; > + goto getmem1; > + } else { No need for an else after a goto.