Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp859067rwb; Fri, 23 Sep 2022 05:14:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5UuynHPIRvE/2nS+6loG4at/i8E5UtqFz7DC4j++Xea4i05tL/fjz3BEshmopCRU7NZZbV X-Received: by 2002:a17:907:a04e:b0:770:79f4:f520 with SMTP id gz14-20020a170907a04e00b0077079f4f520mr6572712ejc.730.1663935293092; Fri, 23 Sep 2022 05:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663935293; cv=none; d=google.com; s=arc-20160816; b=J9WUReW96O7JLmUweygzdmDEF/Mb+Z+h738Y3ts0xnh7AXwJRGnNAV4bdBw0ippw8Q Z34Q2IJjGzZT7+bxxl+nfHYAYx3IOqa7wIS7/OPHyTA+bL29+REGHMV+N1LqxHeTYSMF f62UT7BTAr12iy+NbuKNwV9kGKO8Gb77rcQpLKIIv8N1ZH9S1FuAdfvUEhn6pq8YIDa2 UIPIA40EPHEISRsk0J/1QyA+0IJL5gvvGYlSywPbkxHTCM+gC9NBE+ckTG6tKh472kS8 UMobDtHzLUmD7n99Rv45yUNGrprIEcFZh1f3qhOO/hYNIEl6Cp4af9+upZuIE7YDXHn/ stjQ== 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:references:message-id :in-reply-to:subject:cc:to:from:date; bh=HffOo3i/+oCN+NFxDOp1VNd/D1Nt/Yphw6URFblHDL8=; b=O/fxodNfjAzAyjSu+ICqNAIaQ7rDvBY9Otq/DrqYRUpviu3T6Ds2e974T9VOnw5Ont GtquNjZvdZ7lkLVmUiB6EUVXycAnEUBXJ3R5AwUYK/07d2Tmo6kXhluUy60wbpfNyHJl IT4VnILfrWsOPjSmMx0OkEQbDQuidNfPJ0gitdKHSyj29GVEM7OVZWhX4fn9Y8WDLdyR wixleX1cRxsa5XSU5Jp+Msto6ftIkVMkKfXd99ucnuNFCI0XCpZ30ebRLnFK36CJKPEC zI3a9AE6J39YF8earhFJIMkVTUpGR8+bqfvXrc1v+WwK5mQLVo3aA7vW/i0M41dS2pXB O7sg== 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 k17-20020a170906129100b0077081057215si6985015ejb.956.2022.09.23.05.14.27; Fri, 23 Sep 2022 05:14:53 -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 S230456AbiIWLjC (ORCPT + 99 others); Fri, 23 Sep 2022 07:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiIWLjA (ORCPT ); Fri, 23 Sep 2022 07:39:00 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A21813746C for ; Fri, 23 Sep 2022 04:38:58 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 31B9992009C; Fri, 23 Sep 2022 13:38:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 2B7E692009B; Fri, 23 Sep 2022 12:38:57 +0100 (BST) Date: Fri, 23 Sep 2022 12:38:57 +0100 (BST) From: "Maciej W. Rozycki" To: Arnd Bergmann cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RISC-V: Make port I/O string accessors actually work In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Fri, 23 Sep 2022, Arnd Bergmann wrote: > > Fix port I/O string accessors such as `insb', `outsb', etc. which use > > the physical PCI port I/O address rather than the corresponding memory > > mapping to get at the requested location, which in turn breaks at least > > accesses made by our parport driver to a PCIe parallel port such as: > > > > PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20 > > parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO > > [PCSPP,TRISTATE,COMPAT,EPP,ECP] > > The patch looks correct to me, but I'm curious: Are you actually > using a parport device on your system, or just testing it to > make it work? I do, e.g. I have a MIPS Malta development board that uses an otherwise standard Super I/O parallel port for firmware downloads and have had a need recently to use it in the course of addressing a firmware bug. This is how I actually triggered this bug; the Oops is from a download attempt. For the time being I resorted to using the only other parallel port I have in my lab, which is in my 25 years old x86 box, but I'd rather rely on a fast modern machine that is subject to less risk to fail. And I found my HiFive Unmatched board a perfect fit for this purpose. I have a pair of Grammar Engine ROM emulators too that have both a serial and a parallel port for the purpose of image downloads, either of which can be used, except that the parallel interface is lightning fast compared to the serial one (so possibly the best arrangement is to use the serial port for control and the parallel one for data). I haven't used them for a while now, but there's another firmware bug I plan to get at sometime, with my Broadcom SWARM development board. So yes, I have an ongoing interest in working parallel ports. > > +#define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), > > buffer, count) > > +#define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), > > buffer, count) > > +#define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), > > buffer, count) > > > > I don't see anything actually risc-v specific in these definitions, > and it would be great to make the asm-generic version do the > right thing here. As far as I can tell, the only difference is > the barriers in the risc-v version, and we should really have the > same in the generic code anyway. Fine with me as the next step, but we need to fix the bug at hand first and get the fix backported with the RISC-V port. Thanks for your review! Maciej