Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4459298pxb; Tue, 5 Oct 2021 03:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXfsnVW2XZwPwnAEWb/a4IU2Q5rVaRnV5iLVhhJL/mNg57nVs08dLfYiLdxfpfXwFgAPMu X-Received: by 2002:aa7:dcc5:: with SMTP id w5mr8085439edu.169.1633430331206; Tue, 05 Oct 2021 03:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633430331; cv=none; d=google.com; s=arc-20160816; b=JnSas3pq9A9eHk/iZZrY3ZgqcepdLzrrjNCYOuEjXQUiq2+KH3Iooa0nak5g3YjVTI dZ2p7r71/eOwUUstKfaaMw3SnYKF2gxcX1GWs1cpKvUorRg1jbhmzqfoXzPE6/O5mIOo MnUgwTgoF4RS9hD3KWXUgegG/aZk2IF89eETBR6LYSLPxM9Rr3H8C/ilC5BQzj9tmwnt UI/LDte1Ss4epvoWTZ8FXS/ZiEkCJSJ8Kqg5CmRmnEQvwtjzz3Y5Hh4FfrIRi4VkHQ13 EG/QzDxQh+bCZcKAKDPhtRvhlAZpTvWRiVCe+nyAENQJRbD4ws0Sy/P9oltUdN+NMFzC QozQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rMvuZcJm8vMClLWSzOyz6Ji+slKQN2xb9NdRpkMucaY=; b=jTkIMdfBWPFOk4eqIGJQR/HAPOb4BNVCGIfEHsfs0N0sCKADZxa7X+mHKPu2K/tpJV ZWdKCCgkI2PmcMqCMFrD+CCmvBjya2kX70/s3ba4rwMM1zdociWT4vQ9RtCzWnpJNFN5 rRfFYPcJ8zszlr4S45Wl3gqMULqhZm/gxxoISm1pkxWq3O3L8UgsKo+EJg3e7Pt1kKOv BeadS1xQpYV8rRTiLXdnwbKG8GtY4N/nQlCqiEBHkFbO5h0N06o/1E08qwnW5Jq1IVLM 5PSdgjO01qKpLuJiWSTIjkepNeerPRImBijsw+JyFXRGD86muHygQGDXPphO6pRR1BrD P0CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wy1SczWq; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si35106586edd.384.2021.10.05.03.38.26; Tue, 05 Oct 2021 03:38: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=@linuxfoundation.org header.s=korg header.b=wy1SczWq; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234043AbhJEKiZ (ORCPT + 99 others); Tue, 5 Oct 2021 06:38:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:34586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233855AbhJEKiM (ORCPT ); Tue, 5 Oct 2021 06:38:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A34D6124F; Tue, 5 Oct 2021 10:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633430181; bh=7IHAoNDtwUnipee3OL2fgVGFmswEGIi2rXrg8IrZjYM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wy1SczWqqBOs6aGrPN1HEcDd0Z4f4m/TkPixhpjvStyx3RtLMBBIU9kHFaiOa3zsX fQVQOUCfPRSXe03Zm6un0AZm4MjMWddCdCVqo21CWqnG64uL2y107/eRQV5sPk2NdI B69ckeATvm4tpoALz5gyUkWR2SkpZd23sOAh9JN8= Date: Tue, 5 Oct 2021 12:36:20 +0200 From: Greg KH To: Sergio Paracuellos Cc: Thomas Bogendoerfer , Rob Herring , Arnd Bergmann , Catalin Marinas , Liviu Dudau , Bjorn Helgaas , Matthias Brugger , "open list:MIPS" , linux-pci , linux-staging@lists.linux.dev, NeilBrown , linux-kernel Subject: Re: [PATCH v3 0/6] MIPS: ralink: fix PCI IO resources Message-ID: References: <20210925203224.10419-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 03, 2021 at 06:21:21PM +0200, Sergio Paracuellos wrote: > Hi Greg, > > On Sat, Sep 25, 2021 at 10:32 PM Sergio Paracuellos > wrote: > > > > MIPs ralink need a special tratement regarding the way it handles PCI IO > > resources. On MIPS I/O ports are memory mapped, so we access them using normal > > load/store instructions. MIPS 'plat_mem_setup()' function does a call to > > 'set_io_port_base(KSEG1)'. There, variable 'mips_io_port_base' > > is set then using this address which is a virtual address to which all > > ports are being mapped. Ralink I/O space has a mapping of bus address > > equal to the window into the mmio space, with an offset of IO start range > > cpu address. This means that to have this working we need: > > - linux port numbers in the range 0-0xffff. > > - pci port numbers in the range 0-0xffff. > > - io_offset being zero. > > > > These means at the end to have bus address 0 mapped to IO range cpu address. > > We need a way of properly set 'mips_io_port_base' with a virtually mapped > > value of the IO cpu address. > > > > This series do the following approach: > > 1) Revert two bad commit from a previous attempt of make this work [0]. > > 2) Set PCI_IOBASE to mips 'mips_io_port_base'. > > 3) Allow architecture dependent 'pci_remap_iospace'. > > 4) Implement 'pci_remap_iospace' for MIPS. > > 5) Be sure IOBASE address for IO window is set with correct value. > > > > More context about this series appoach in this mail thread [1]. > > > > Patches related with reverts are from this merge cycle so they are only > > added to the staging git tree. So to have all stuff together I'd like to > > get everybody Ack's to get all of this series through staging tree if > > possible :). > > > > Thanks in advance for your time. > > > > Changes in v3: > > - Collect Arnd's Acked-by for the patches. > > - Be sure IO resource start address is zero and WARN_ONCE if it is not > > on MIPS pci_remap_iospace() patch. Also make use of 'resource_size' > > instead of do the logic explicitly again. > > I think nothing is missing to get this added through the staging tree. Great, thanks for sticking with this, will go queue it up now. greg k-h