From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756955AbcEDBZh (ORCPT ); Tue, 3 May 2016 21:25:37 -0400 Received: from mail.kernel.org ([198.145.29.136]:38582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756884AbcEDBZf (ORCPT ); Tue, 3 May 2016 21:25:35 -0400 Date: Tue, 3 May 2016 20:25:31 -0500 From: Bjorn Helgaas To: Benjamin Herrenschmidt Cc: Yinghai Lu , Bjorn Helgaas , David Miller , Linus Torvalds , Wei Yang , TJ , Yijing Wang , Khalid Aziz , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List , Michael Ellerman Subject: Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource Message-ID: <20160504012531.GB17170@localhost> References: <1460074573-7481-1-git-send-email-yinghai@kernel.org> <1460074573-7481-5-git-send-email-yinghai@kernel.org> <20160422204920.GA17215@localhost> <20160428135607.GA12470@localhost> <1462322260.30470.76.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462322260.30470.76.camel@kernel.crashing.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 04, 2016 at 10:37:40AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2016-05-03 at 15:52 -0700, Yinghai Lu wrote: > > BenH and DavidM, > > Are you ok to let /proc/bus/pci/devices to expose resource value > > instead of > > BAR value? > > powerpc already expose MMIO as resource value, but still keep IO as > > BAR value? > > > > Or can we just dump /proc/bus/pci support from now? > > The problem tends to be old Xserver expectations... > > That stuff has been a can of worms over the years and we did things in > the kernel to work around X limitations. I'm not that keen on touching > /proc at all in that regard. Leave it there do what it does today, it's > a user visible ABI, don't change it. I did not propose changing any user-visible ABI. To recap what I did propose: - The sysfs path uses offsets between 0 and BAR size on all arches. It uses pci_resource_to_user() today, but I think it should not. - The procfs path uses offsets of resource values (CPU physical addresses) on most architectures, but uses something else, e.g., BAR values, on others. pci_resource_to_user() does this translation. The procfs path does not use pci_resource_to_user() today, but I think it should. - This implies that pci_mmap_page_range() should deal with resource values (CPU physical addresses), and proc_bus_pci_mmap() should do any necessary arch-specific translation from BAR values to resource values.