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=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 2E19FC31E44 for ; Fri, 14 Jun 2019 11:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0069420850 for ; Fri, 14 Jun 2019 11:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560513061; bh=uMLCxfgCikGdC+QC7VrDvh04xE8Slxir3W8oO9YHF+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=sGK1ko53iHrd3XFJHdR4J80dNIRGuoo6V5FpWCDhTPcRsphvb27TE8TB44FVR81zl EffQll/s/LMSs2WDd5LPx8MDx2fL9J012WNfDwvVBlpNy46ytzVe3oGZlXR5nUSbmn 9XjijzCrV5h7L/RyDDU0o14JGnFuTTrb3SHVezAA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727662AbfFNLvA (ORCPT ); Fri, 14 Jun 2019 07:51:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:60770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbfFNLu6 (ORCPT ); Fri, 14 Jun 2019 07:50:58 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B5F32168B; Fri, 14 Jun 2019 11:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560513058; bh=uMLCxfgCikGdC+QC7VrDvh04xE8Slxir3W8oO9YHF+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nCk2pYF4Yk+dVb3EOoGZy1Nzord7PDDyF8WuKXGqkFjwO7KYjTDQGUyKUVhj6Lzri C3/zEhik78cxTA7iaBE8s7ThRfSUtdxaZZaz9FnUwjhYC0ivWoL1zDXlWtdFKJsoMG u3tGG3e6A7cxIZ+5Gp9hiEBJpTV+KaTaMAofQUuU= Date: Fri, 14 Jun 2019 06:50:56 -0500 From: Bjorn Helgaas To: John Garry Cc: lorenzo.pieralisi@arm.com, arnd@arndb.de, linux-pci@vger.kernel.org, rjw@rjwysocki.net, linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, wangkefeng.wang@huawei.com, linuxarm@huawei.com, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, catalin.marinas@arm.com Subject: Re: [PATCH v4 1/3] lib: logic_pio: Use logical PIO low-level accessors for !CONFIG_INDIRECT_PIO Message-ID: <20190614115056.GP13533@google.com> References: <1560262374-67875-1-git-send-email-john.garry@huawei.com> <1560262374-67875-2-git-send-email-john.garry@huawei.com> <20190613023947.GD13533@google.com> <8ef228f8-97cb-e40e-ea6b-410b80a845cf@huawei.com> <20190613200932.GJ13533@google.com> <7495dcab-f293-4b2a-4740-2249f61351f7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7495dcab-f293-4b2a-4740-2249f61351f7@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 14, 2019 at 10:02:52AM +0100, John Garry wrote: > On 13/06/2019 21:09, Bjorn Helgaas wrote: > > On Thu, Jun 13, 2019 at 10:39:12AM +0100, John Garry wrote: > > > On 13/06/2019 03:39, Bjorn Helgaas wrote: > > > > I'm not sure it's even safe, because CONFIG_INDIRECT_PIO depends on > > > > ARM64, but PCI_IOBASE is defined on most arches via asm-generic/io.h, > > > > so this potentially affects arches other than ARM64. > > > > > > It would do. It would affect any arch which defines PCI_IOBASE and > > > does not have arch-specific definition of inb et all. > > > What's the reason for testing PCI_IOBASE instead of > > CONFIG_INDIRECT_PIO? If there's a reason it's needed, that's fine, > > but it does make this much more complicated to review. > > For ARM64, we have PCI_IOBASE defined but may not have > CONFIG_INDIRECT_PIO defined. Currently CONFIG_INDIRECT_PIO is only > selected by CONFIG_HISILICON_LPC. > > As such, we should make this change also for when > CONFIG_INDIRECT_PIO is not defined. OK. This is all very important for the commit log -- we need to understand what arches are affected and the reason they need it. Since the goal of this series is to fix an ARM64-specific issue, and the typical port I/O model is for each arch to #define its own inb(), maybe it would make sense to move the "#define inb logic_inb" from linux/logic_pio.h to arm64/include/asm/io.h? The "#ifndef inb" arrangement gets pretty complicated when it occurs more than one place (asm-generic/io.h and logic_pio.h) and we have to start worrying about the ordering of #includes. Bjorn 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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham 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 4E031C31E4D for ; Fri, 14 Jun 2019 11:51:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 232E520850 for ; Fri, 14 Jun 2019 11:51:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ff2M//K8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="nCk2pYF4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 232E520850 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fDlXTGqxbVsbV1dQAQZqKzaXsoNYlcsnFvBbKRXsgvU=; b=Ff2M//K82jI8j1 dcYQPuQtJ+aR9Hkfb+jnf5MJWOogTCgpgZfCGl6MXLe1LK2brAeoqVEQGbNJegTiaabI1vvYEMyij GAvz7OKBpE6fe83IuoMprTRTmX0XjndxS3oZW56mMkah1yEtYuYOsHGgF2kCVPcj46wPuEbwIaHaU f8a0ZjAhgKo9rZvd/Ta5Je6Ivvnp/Bq0zqGbS4eYryCJaR9z+J6G4gxsz0mJ26JjLr/CjC+OUz73B DD9S+A7DWRAVqA5i7hhTN4Xts95a3BVj5XFTWRaZjqmWNbPyvXvp6oNJndBBWExwGOqeTD7z5ZuJX pQHPfgA90ZZ31ENP8Qlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbkjW-0001eB-0v; Fri, 14 Jun 2019 11:51:02 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbkjT-0001dW-Ak for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2019 11:51:00 +0000 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B5F32168B; Fri, 14 Jun 2019 11:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560513058; bh=uMLCxfgCikGdC+QC7VrDvh04xE8Slxir3W8oO9YHF+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nCk2pYF4Yk+dVb3EOoGZy1Nzord7PDDyF8WuKXGqkFjwO7KYjTDQGUyKUVhj6Lzri C3/zEhik78cxTA7iaBE8s7ThRfSUtdxaZZaz9FnUwjhYC0ivWoL1zDXlWtdFKJsoMG u3tGG3e6A7cxIZ+5Gp9hiEBJpTV+KaTaMAofQUuU= Date: Fri, 14 Jun 2019 06:50:56 -0500 From: Bjorn Helgaas To: John Garry Subject: Re: [PATCH v4 1/3] lib: logic_pio: Use logical PIO low-level accessors for !CONFIG_INDIRECT_PIO Message-ID: <20190614115056.GP13533@google.com> References: <1560262374-67875-1-git-send-email-john.garry@huawei.com> <1560262374-67875-2-git-send-email-john.garry@huawei.com> <20190613023947.GD13533@google.com> <8ef228f8-97cb-e40e-ea6b-410b80a845cf@huawei.com> <20190613200932.GJ13533@google.com> <7495dcab-f293-4b2a-4740-2249f61351f7@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7495dcab-f293-4b2a-4740-2249f61351f7@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190614_045059_392017_353DBD80 X-CRM114-Status: GOOD ( 16.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rjw@rjwysocki.net, wangkefeng.wang@huawei.com, lorenzo.pieralisi@arm.com, arnd@arndb.de, linux-pci@vger.kernel.org, will.deacon@arm.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 14, 2019 at 10:02:52AM +0100, John Garry wrote: > On 13/06/2019 21:09, Bjorn Helgaas wrote: > > On Thu, Jun 13, 2019 at 10:39:12AM +0100, John Garry wrote: > > > On 13/06/2019 03:39, Bjorn Helgaas wrote: > > > > I'm not sure it's even safe, because CONFIG_INDIRECT_PIO depends on > > > > ARM64, but PCI_IOBASE is defined on most arches via asm-generic/io.h, > > > > so this potentially affects arches other than ARM64. > > > > > > It would do. It would affect any arch which defines PCI_IOBASE and > > > does not have arch-specific definition of inb et all. > > > What's the reason for testing PCI_IOBASE instead of > > CONFIG_INDIRECT_PIO? If there's a reason it's needed, that's fine, > > but it does make this much more complicated to review. > > For ARM64, we have PCI_IOBASE defined but may not have > CONFIG_INDIRECT_PIO defined. Currently CONFIG_INDIRECT_PIO is only > selected by CONFIG_HISILICON_LPC. > > As such, we should make this change also for when > CONFIG_INDIRECT_PIO is not defined. OK. This is all very important for the commit log -- we need to understand what arches are affected and the reason they need it. Since the goal of this series is to fix an ARM64-specific issue, and the typical port I/O model is for each arch to #define its own inb(), maybe it would make sense to move the "#define inb logic_inb" from linux/logic_pio.h to arm64/include/asm/io.h? The "#ifndef inb" arrangement gets pretty complicated when it occurs more than one place (asm-generic/io.h and logic_pio.h) and we have to start worrying about the ordering of #includes. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel