Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3030563imw; Mon, 18 Jul 2022 00:07:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1shAmbr98vfIrqLvv16qc6HPb9slw5XK/yYyQuV8nB2qxg7xRZeuo5mv32cH1HAfrWETAz9 X-Received: by 2002:a05:6402:149:b0:431:7dde:9b59 with SMTP id s9-20020a056402014900b004317dde9b59mr35204980edu.339.1658128056025; Mon, 18 Jul 2022 00:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658128056; cv=none; d=google.com; s=arc-20160816; b=M/cVa7Kl6ORchghtPywGMfCzpTqyaJ/xysYmdIuBpbKmJGr6koaDVoffFyew3CeAqU hbTDjl8C905SWAPBZ4a8uH0L247elQgsbHbBQbzuzLVIyJ5JLx9UmRtk0uoUuw1iCL/3 0yQNNxw6gZSYQQ18rgeIMSZdB7t8wBvVcbKlkbz4Mht74GlzxwOVJrvtIQpunLxSa81J UEP2cPahhEAlHMG4rBhWL+crRCmDid7QZFYyfH185tDGFBgMJSa7iWXxiklwA9+HUW/t YtF0mG4b/pF7KCz/Y8bISZhwjKg32fDHkz5TivghDhPeWnvdiDrzTFTQu6EKNjDehM2k uhHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=W85xXHsndeDNVTU32Wc/bsVqbmbp1secBprm8o55E7o=; b=vIccZbBLtkNBjSLBHHM0y3Xpc/ho0zuRUF5hhpql1wtK2ZUHQg3mfXOqBaW3fMC2jL 3B32oWBrr8TqJbtNF1oXOypgcM4RqLqGWssSRSm51tvoflAG/YytKkxJ/4T+MbI6U2/O Zyf2WUx04viS1gUlwlPdMZJPXz2t2qwOY/mNFeu7HEe3Qx+zNFz7jej8lrnDacn5ta1I lRUy8Qo6Ghm7N+PllNqNwcaaNLMAfpmqhd2EYYckSJd0UupRQU2skY2rmprhwbQEhQ94 fCjecqmmFokwDIgAwStrGfvGraFVtmfee6zsLwI/xVNHCPPDsHEr4TcQbvTMo+uAyhL8 8VKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fw8-20020a170907500800b007156fc5217bsi12224333ejc.899.2022.07.18.00.07.10; Mon, 18 Jul 2022 00:07:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233640AbiGRG4n (ORCPT + 99 others); Mon, 18 Jul 2022 02:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233632AbiGRG4m (ORCPT ); Mon, 18 Jul 2022 02:56:42 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72B4167ED; Sun, 17 Jul 2022 23:56:41 -0700 (PDT) Received: from mail-yb1-f181.google.com ([209.85.219.181]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MJVU0-1ny0kx1c2y-00JtPU; Mon, 18 Jul 2022 08:56:39 +0200 Received: by mail-yb1-f181.google.com with SMTP id 64so19199713ybt.12; Sun, 17 Jul 2022 23:56:38 -0700 (PDT) X-Gm-Message-State: AJIora9HVQWJxMWMQxYurz08T/RZee33V+Rzik4Y3m4GWR097cREk59G q2DzhZtA576lUzZDJxcesy+WwJnxcFjRvjkCDpQ= X-Received: by 2002:a25:8b8b:0:b0:669:b37d:f9cd with SMTP id j11-20020a258b8b000000b00669b37df9cdmr25660893ybl.394.1658127396964; Sun, 17 Jul 2022 23:56:36 -0700 (PDT) MIME-Version: 1.0 References: <20220717033453.2896843-1-shorne@gmail.com> <20220717033453.2896843-3-shorne@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Mon, 18 Jul 2022 08:56:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] asm-generic: Add new pci.h and use it To: Christoph Hellwig Cc: Stafford Horne , LKML , Arnd Bergmann , Catalin Marinas , Will Deacon , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Richard Weinberger , Anton Ivanov , Johannes Berg , Bjorn Helgaas , Linux ARM , linux-csky@vger.kernel.org, linux-riscv , linux-um , linux-pci , linux-arch Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:yqxuXYN5hsqI4Jrcm3MxCIxnyETp/QVuLD+vjesiAIS0qH/8hQz 5wDiRSw4jI5IIsbK4+C/ZkbLYBdtFYzU6gGPaS2swuSkkoKXxLv5VlIBN67KobtL7RQU7b2 neJvGjrHOx4o4e7t6PsF477MNh8zLG9Xv309BWwIMxGbJqKAbEtB0wz4wimtP+5AY/YiKJi Iocz/maKXRSIfMcy46jMQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:554zXko6Moo=:W8M9bXbKy1v1ICCR4iz8jo 08fbRJNHG7vMU69bXST/L+XMwknWa3JYFUomCfUMbs94on9CpMPplRMw9EFOzJDXFQEPdXGgA u1ooO0dlwb4LG/jk7T3eJRd0XWA4jtIRQjIL8smzVn8L2vcj9aYkMRYYWV5GHavH4/EDxZHr1 PkiZTxML9la/7IcZCiO2zfTzr1VRV3IInOj9Lzcslc+aFtcll3kbL1d7z2f++FBNcYl6yUsCr vsULRpiswI/MuJnliOmmI5zXc6mOC6TaBb+Qywhxx2QjDBkkVTy9cAYeEAD32nh8VQ2BZPPkP 2ngHuUut0rPXNzH6lO6NrqGuiDzi9iL4G4TJnnwY37YPbh1PdtR8UFkgM160uI6Wk52oFfgCV p8xVOU044fVLAU0XpTNUkVFia8tty2NHuEmwS3jgpBW0oD7jETzSCvR+FKn9Y4n3jwlWv/Ej3 tnnYOpcFVRm//Wzf27bBqlzBGiFVGZr1afy9mSZo9wn1a83VUB/g+qu2DHLMw1MGJxtkt4o2j hVBba7pUrxNfwIiL5ihqNEVzp6pHhWrDLF9ra5grRYSN+fxmGCJ1CN1b5VjEaGP4olh9syqZ4 P79cc+Wtkt55+waqLpMw5d0RacE7a9mKKxzdM+7oIHASznsDJqDnfM48P5LrBaEG80TCk46RB Ci7lCXHxPOPJUywDPRK8J88AdK5/xeAISGKTl1Pxoe7LG+pERr4aXOJo/214Ihr9MrJyp/PkS 8cDXOy0/JnF4Mz1C+YS+ZvfnlzEJ2PJNIVckfg== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2022 at 6:37 AM Christoph Hellwig wrote: > > On Sun, Jul 17, 2022 at 12:34:53PM +0900, Stafford Horne wrote: > > Two things to note are: > > > > - isa_dma_bridge_buggy, traditionally this is defined in asm/dma.h but > > these architectures avoid creating that file and add the definition > > to asm/pci.h. > > This doesn't have anyting to do with PCI support. I think adding a > separate header just for this that always stubs it out unless a config > option is set (which x86 then selects) is the besy idea here. I also > think the isa_dma_bridge_buggy needs to move out of the PCI code as > well. Most architectures have it in asm/dma.h, which is probably the right place (if we end up keeping it), since this is for the ISA DMA API. I would copy this declaration from x86 #ifdef CONFIG_PCI extern int isa_dma_bridge_buggy; #else #define isa_dma_bridge_buggy (0) #endif to asm-generic/dma.h and remove it from arch/sh to avoid the one duplicate definition. The architectures that have the declaration in asm/pci.h (arm64, csky, riscv) already get the asm-generic version of asm/dma.h. As mentioned before, it would be even better to just remove it entirely from everything except x86, and enclose the four references in an explicit "#ifdef X86_32". The variable declaration only exists because drivers/pci/quirks.c is compiled on all architecture, but the individual quirk is only active based on the PCI device ID of certain early PCI-ISA bridges. Arnd