From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 764DAC433DF for ; Fri, 5 Jun 2020 07:18:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 50435206E6 for ; Fri, 5 Jun 2020 07:18:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50435206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E9256E84A; Fri, 5 Jun 2020 07:18:56 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id E146F6E415 for ; Thu, 4 Jun 2020 15:05:53 +0000 (UTC) IronPort-SDR: RK4RX5jZsoomiX6r1h+uegO/us3FW8hiNB+5PUzCjgiKmzn72vWsHfaw7tq/zbwY5GKo5H3X54 02xEvU7jw4rw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 08:05:53 -0700 IronPort-SDR: HRM8jDe7P+G5Zgjy1TnzJJucuXEQ6HMKMi2ROvIfC1Ge6bv3mBEk82cX2giJaqO78Bj1A8U/4M iiy7oSN/LwuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,472,1583222400"; d="scan'208";a="257754021" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga007.fm.intel.com with ESMTP; 04 Jun 2020 08:05:40 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jgrR1-00ArEa-5g; Thu, 04 Jun 2020 18:05:35 +0300 Date: Thu, 4 Jun 2020 18:05:35 +0300 From: Andy Shevchenko To: Jim Quinlan Subject: Re: [PATCH v3 09/13] device core: Introduce multiple dma pfn offsets Message-ID: <20200604150535.GB2428291@smile.fi.intel.com> References: <20200603192058.35296-1-james.quinlan@broadcom.com> <20200603192058.35296-10-james.quinlan@broadcom.com> <09c451e24f62e226e1ceaa0fe5d0a81109cace74.camel@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Fri, 05 Jun 2020 07:18:56 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Rich Felker , "open list:SUPERH" , David Airlie , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , Hanjun Guo , "open list:REMOTE PROCESSOR \(REMOTEPROC\) SUBSYSTEM" , "open list:DRM DRIVERS FOR ALLWINNER A10" , Bjorn Andersson , Julien Grall , "H. Peter Anvin" , Will Deacon , Christoph Hellwig , Marek Szyprowski , "open list:STAGING SUBSYSTEM" , Wolfram Sang , Lorenzo Pieralisi , Yoshinori Sato , Frank Rowand , Joerg Roedel , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , Russell King , "open list:ACPI FOR ARM64 \(ACPI/arm64\)" , Chen-Yu Tsai , Ingo Molnar , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Alan Stern , David Kershner , Len Brown , Ohad Ben-Cohen , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Arnd Bergmann , Suzuki K Poulose , Dan Williams , Rob Herring , Borislav Petkov , Yong Deng , Santosh Shilimkar , Bjorn Helgaas , Thomas Gleixner , Mauro Carvalho Chehab , "moderated list:ARM PORT" , Saravana Kannan , Greg Kroah-Hartman , Oliver Neukum , "Rafael J. Wysocki" , open list , Paul Kocialkowski , "open list:IOMMU DRIVERS" , Mark Brown , Stefano Stabellini , Sudeep Holla , "open list:ALLWINNER A10 CSI DRIVER" , Robin Murphy , "open list:USB SUBSYSTEM" , Nicolas Saenz Julienne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jun 04, 2020 at 10:35:12AM -0400, Jim Quinlan wrote: > On Thu, Jun 4, 2020 at 9:53 AM Nicolas Saenz Julienne > wrote: > > On Wed, 2020-06-03 at 15:20 -0400, Jim Quinlan wrote: ... > > > + phys = virt_to_phys(ret); > > > + pfn = phys >> PAGE_SHIFT; > > > > nit: not sure it really pays off to have a pfn variable here. > Did it for readability; the compiler's optimization should take care > of any extra variables. But I can switch if you insist. One side note: please, try to get familiar with existing helpers in the kernel. For example, above line is like pfn = PFN_DOWN(phys); ... > > > + if (!WARN_ON(!dev) && dev->dma_pfn_offset_map) > > > + *dma_handle -= PFN_PHYS( > > > + dma_pfn_offset_from_phys_addr(dev, phys)); Don't do such indentation, esp. we have now 100! :-) -- With Best Regards, Andy Shevchenko _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel