Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1376083pxj; Fri, 4 Jun 2021 12:45:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnXug2OPs/TfVLgV5hhuaOk+Zwx7aPrrVhfc8RFHanEbmt5Zhqe6RJMahTL3ApUBKlFMEF X-Received: by 2002:a17:906:c14c:: with SMTP id dp12mr5786882ejc.312.1622835951040; Fri, 04 Jun 2021 12:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622835951; cv=none; d=google.com; s=arc-20160816; b=d+KfT6nPQKOLaPSJk/l4gdNJAZyV1zTPfkkSPdduGVVF1qVR523XR37sylgm9arUgA WIHJL8+xY/MNjTPSrgW+84HtPu6BI564mTXStu+gtal/S23opo3V5Jysr05HVjD4VMB0 BYltrJa35GGVIbkaRfR0Z35vSr8CLa7cIj3NWe62pjFdBEcLk4Hux4ORvJIukXTDvDXg mRlAbQPwncPBmVxLCh/Ll+sFiH7H0+60vMwguL+LV29OTbkAZUgZUg0GazVNMz5FEIuO ZPPQYCynD0c2ID97NZb1Y4SgGGf+wD9VoW5JCTJycHF4X27Eed0PQXjsdVmpzRJlb83A bDIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=ngwtqdbeNPT+iThFPhPb3OFOktX2/he4fPEhMj2fVOI=; b=v4DEEfKrvzivUTDq2brWgTdhsAMcDg86XkIpjrAGyuODNMn1O0Kn30oQy2lTVV7cGP HGb77S6AXD+cBFAlaueiTzB3B7gGhgcmqXI8DZY+QpmavCLjFwMB3GuCAP82y2knoE8V z+gkQRWNyF5RJDEummRpj8n2kfmdSz82PQCK61rJOeW7H4d/KYgmP/0vH1ep0Sl6vp1K qKxUcPTExt2potyzRj4Efv/uj80KLcv2dpsnQPgAXsaX709oNKiYbAxzFNqZy7fFBQ9P ahMymffZu7MBmiLqt21rf+6BxOYo+YLAMJGcqghEi7wZTRttjGPl6VDwUjeR2WnlGu6k AHVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpcuS6j9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si5303433ejj.463.2021.06.04.12.45.27; Fri, 04 Jun 2021 12:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JpcuS6j9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbhFDTpR (ORCPT + 99 others); Fri, 4 Jun 2021 15:45:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbhFDTpQ (ORCPT ); Fri, 4 Jun 2021 15:45:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 88530613D2; Fri, 4 Jun 2021 19:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622835809; bh=6eGo5rHKLjQ67SvpFQQsRXcsLLxfc4LSt/MOWbd0qt8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JpcuS6j9YKSAlhMZI2GCfaRaNAQF9Ch151havxRNdXums29UbPIaqlU0XpMPwo5Ke SMFxDGbk/QHoUG/RAEdC3mSGoKP+j+6WrZYQn0fLL0jzoVHYGgRm1NYXZfSc5LKJqm TrtcnyfLJQFvRidOGf4XZKBfucdEEA4o4+YuWALgWf9q4uyGrn1k8BiQVLr6ImRtfp 9rwt6iFKoizqAuQKwpSXRc92H1W6NVkx619Ord6ifnilwkmK2Qtpmlp/1ALXMFX3Hd usukST4Ozi8GgspPzbSZi+IlvGj2RuV9Td1ou0gd3rqKfrB42lELUBUGvA3cLVGo+5 GMhSvAE4/y5+w== Date: Fri, 4 Jun 2021 14:43:28 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Thomas Bogendoerfer , Sergio Paracuellos , lorenzo.pieralisi@arm.com, "open list:MIPS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Matthias Brugger , John Crispin , Bjorn Helgaas , Rob Herring , linux-staging@lists.linux.dev, Greg KH , NeilBrown , Ilya Lipnitskiy , linux-kernel , linux-pci@vger.kernel.org Subject: Re: [PATCH 0/4] MIPS: ralink: pci: driver for Pcie controller in MT7621 SoCs Message-ID: <20210604194328.GA2230062@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210531131845.ookvz7njj6yrkaeh@pali> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 31, 2021 at 03:18:45PM +0200, Pali Roh?r wrote: > On Friday 21 May 2021 12:23:38 Thomas Bogendoerfer wrote: > > On Wed, May 19, 2021 at 11:18:36PM +0200, Sergio Paracuellos wrote: > > > On Wed, May 19, 2021 at 10:36 PM Bjorn Helgaas wrote: > > > > But most of the similar drivers are in drivers/pci/controller/, where > > > > I think it's easier to keep them up to date with changes in the PCI > > > > core. Have you considered putting this one there? > > > > > > Most pci drivers in 'arch/mips/pci' are still using PCI_LEGACY stuff. > > > In contrast mt7621-pci is using current pci generic apis but even most > > > of the code is generic enough, there is one remaining thing which > > > depends on mips architecture which is the iocu region configuration > > > which must be done in the driver itself. This is the only reason to > > > move this driver into 'arch/mips/pci' instead of > > > 'drivers/pci/controller/'. So... I am all ears to listen to > > > suggestions for the proper place for this driver. Thomas, do you have > > > any thoughts on this? > > > > I tried to put a pci-xtalk driver into drivers/pci/controller, but > > Lorenzo didn't want it there for being MIPS and not DT based. So this > > one is DT based, but still MIPS. I'm perfectly fine putting this > > driver into drivers/pci/controller/ > > In my personal opinion this driver could go into drivers/pci/controller/ I'm not sure exactly what "PCI_LEGACY" above refers to. I don't see any direct #includes of arch/mips in the driver. I do see that it uses mips_cps_numiocu(), which is certainly MIPS-specific. But we do have some things in drivers/pci/controller/ that only build on certain arches, enforced mostly by Kconfig rules, so I think you could do that. We try to make so things can at least be *compiled* on any arch, but I know that's not always possible. So I think it would be useful to put this in drivers/pci/controller/ somewhere because it will make it easier to see common patterns and refactoring opportunities. Bjorn