Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp188744pxf; Wed, 10 Mar 2021 04:05:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqzdaK6fYPVXEY7niDusuzHydMcXaPDUC4rGUCRVVwpVBwABA+ry9iFpDVV87/4uR9xx1A X-Received: by 2002:a17:906:2dc1:: with SMTP id h1mr3284562eji.460.1615377935862; Wed, 10 Mar 2021 04:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615377935; cv=none; d=google.com; s=arc-20160816; b=OjSTI5RxGag4ucag2OpxtaNxRjoTlW2Hx69q8NC0nWy1cB7CxJcTJ+0303uBH8exAY Kk/UumeOAMWlSd/2AssV6Fv3KUsr4dE4FaVWMC0rHdxOaVqkRIP3rojOMj8wTxUFbpt3 eEmwikHuND+VZQs2Frr1rYnNwkt7cWn9W+PEEDCaScag6AmRMk9y8rm3AhRgvt+yICbA q6jCNqjdvJfClwBcrFsuwTDrwPv2gUI3EJyilnKqpTa1mDoUvnjAz9pZRSPKGGS3zjs+ nfyVR4OALYxGCA/Vj0sgD7+NMjuhjRsAVCEmR2GAa4seSZ7QrV2D/BZh2g8BcFz1tSph v3VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:subject:cc:to :from:date; bh=I2qdsLktCtqMPO6w1MMK++feY3QZcnFAFHOeKqVUj+E=; b=Ht5QAhoqTuH0O2UsUFjuadbREZfMenfeUw2OuyqKaV8d8IHUGw6jYrwiI90Taly9E0 TRYpRIotEt2QDZQQs+ZLBghurUUJAiOjzMElrZITHPg77n2mSYAPjliHOaH+wsmqdy38 oqKfgh6Qj0ZEa2a0q/J8Hp8YlxE3CUNBxPKvSgLqCZdP+8Dp1GzfUjDFNyfGgbcBxDnF oGWq/LpQLSvI70UQC94V7DICA+wCt1FlJt0U/4T2WZozAsrNYEGEeWLVdQpTDss09yx4 Uz8BXHL9fp/j1fSH29eCtB4X0jcVsR9Vrd4o/zYha5iTzsSGNKO2x9dijMhjbuCANjMZ mzGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si11059315ejt.544.2021.03.10.04.05.05; Wed, 10 Mar 2021 04:05:35 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232873AbhCJMDY (ORCPT + 99 others); Wed, 10 Mar 2021 07:03:24 -0500 Received: from angie.orcam.me.uk ([157.25.102.26]:37588 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232787AbhCJMDF (ORCPT ); Wed, 10 Mar 2021 07:03:05 -0500 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 18E9A92009D; Wed, 10 Mar 2021 13:03:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 12E2692009B; Wed, 10 Mar 2021 13:03:04 +0100 (CET) Date: Wed, 10 Mar 2021 13:03:03 +0100 (CET) From: "Maciej W. Rozycki" To: netdev@vger.kernel.org cc: linux-kernel@vger.kernel.org Subject: [PATCH 0/4] FDDI: defxx: CSR access fixes and improvements Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, As a lab upgrade I have recently replaced a dated 32-bit x86 server with a new POWER9 system. One of the purposes of the system has been providing network based resources to clients over my FDDI network. As such the new server has also received a new DEFPA FDDI network adapter. As it turned out the interface did not work with the driver as shipped by the most recent stable Debian release (Linux version 5.9.15) for ppc64el. Symptoms were inconclusive, and the DEFPA adapter turned out to have a manufacturing defect as well, however eventually I have figured out the PCIe host bridge used with the system, Power Systems Host Bridge 4 (PHB4), does not (anymore) implement PCI I/O transactions, while the binary defxx driver as shipped by Debian comes configured for port I/O, and then a bug in resource handling causes the driver to try and use an unassigned port I/O range for adapter's PDQ main ASIC's CSR access. Fortunately the PFI PCI interface ASIC used with the DEFPA adapter has been designed such as to provide for both PCI I/O and PCI memory accesses to be used for PDQ CSR access, via a pair of BARs to be alternatively used. Originally the defxx driver only supported port I/O access, but in the course of interfacing it to the TURBOchannel bus I had to implement MMIO access too, and while at it I have added a kernel configuration option to globally switch between port I/O and MMIO at compilation time, however conservatively defaulting to port I/O for EISA bus support where the use of MMIO currently requires the adapter to have been suitably configured via ECU (EISA Configuration Utility), supplied externally. With the kernel configuration option set to MMIO the DEFPA interface works correctly with my POWER9 system. Therefore I have prepared this small patch series consisting of a pair of conservative bug fixes, to be backported to stable branches, and then a pair of improvements for the robustness of the driver. So changes 1/4 and 2/4 apply both to net and net-next, and then changes 3/4 and 4/4 apply on top of them to net-next only. In particular there are diff context dependencies going like this: 1/4 -> 3/4 -> 4/4. Let me know if this submission needs to be sorted differently. See individual change descriptions for further details as to the actual changes made. NB the ESIC interface chip used for slave address decoding with the DEFEA EISA adapter has decoding implemented for address bits 31:10 and therefore supports full 32-bit range for the allocation of the CSR decoding window. For DOS compatibility reasons ECU however only allows allocations between 0x000c0000 and 0x000effff. Given that for other compatibility reasons EISA is subtractively decoded on mixed PCI/EISA systems we could allocate an MMIO region from arbitrary unoccupied memory space and program the ESIC suitably without regard for that compatibility limitation. In fact I have a proof-of-concept change and it seems to work reliably. However with these patches applied the driver continues supporting port I/O as fallback and the EISA product ID register is located in the EISA slot-specific port I/O address space, so any EISA system however modern (sounds like a joke, eh?) also has to support port I/O access somehow. So while I think such a dynamic MMIO allocation would be an example of good engineering, but it would require changes to our EISA core and therefore it may have had sense 25 years ago when EISA was still mainstream, but not nowadays when EISA systems are I suppose more of a curiosity rather than the usual equipment. This patch series has been thoroughly verified with Linux 5.11.0 as released and then a Raptor Talos II POWER9 system and a Malta 5Kc MIPS64 system for PCI DEFPA adapter support, an Advanced Integrated Research 486EI x86 system for EISA DEFEA adapter support, and a Digital Equipment DECstation 5000 model 260 MIPS III system for TURBOchannel DEFTA adapter support, covering both port I/O and MMIO operation where applicable. Please apply. Maciej