Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp777266rwb; Fri, 23 Sep 2022 04:09:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM585gEQOJB7mbkOLxY9Ge1Dk9f0frC6VrccmxstS4zDWdBQ5YcS9JO4nEX2QYXS7XirhVPu X-Received: by 2002:a63:290:0:b0:43c:20be:9f48 with SMTP id 138-20020a630290000000b0043c20be9f48mr5127605pgc.388.1663931344125; Fri, 23 Sep 2022 04:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663931344; cv=none; d=google.com; s=arc-20160816; b=khXiT7R6EaaSajQuccf7G+nYwyYbtDlU+0NfGhvTZbeUnIWRii1szLn5w7HcTFDq0A LXzAQ4AwXuWO0d9nc37M5JtD05jkwViRElxsv214MRG+VU+HrE+g8nZJwumHFgnyMTTq n4u06XK5kvuXQRqOKhRzKbqyrxp/sL4IGB49iyLeFgkiGMQ94vy4nfjQrs8IfvvkUhqg /usNk5ihqQG+c3GTv2XRn+zXnzOMQwaqLnr9vjlHhMXJA8/9W88tbTB/vE6JpTHEJ5Ok bplW37bBiLsZT8s0ywjTMz5RNL3bqXxOdaXNNZSqP0kR2Zlq9I1st8lI1NYNvlj4Rm0I 9wPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=b5154p7+jwvVybTnV4XOC9aGotedUG0z1MsOq616Jbc=; b=0rORa7HDrn40aRyLP9oQUOacNXaJd7L4mJCuC+337r5+c7y2fXSh+UEWfb4sr4dOxh Lnekh3qP9U3OxBpnlzjRi/bYeTAsi6whAQRa6ntiVxG4Ou9WtZG9b/jKwLTXcdSbX2GG 5ek8mAaecnZRlA0HlRLY5YBl1R0XWRyYh7nb9vemkZrBjEYlQHNsuTl3S/29Dj9nN03H kJ/VwTVRKtDxhJgDVzOrMFddLns5z+dht7QPazu2DcuG3945hb1ZsWyQVEZU1xnF+V88 PlcRVpfqUK9w4IJArfLWpsnBil+Y1TKyBIBXGjtn3x9VU+d5HtE2PXWNTu/FequCYXyk E2vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=k9bU0VOR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=qtSqNLuw; 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 rm3-20020a17090b3ec300b00203246e4383si2652517pjb.145.2022.09.23.04.08.52; Fri, 23 Sep 2022 04:09:04 -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; dkim=pass header.i=@arndb.de header.s=fm1 header.b=k9bU0VOR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=qtSqNLuw; 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 S231751AbiIWKc4 (ORCPT + 99 others); Fri, 23 Sep 2022 06:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231462AbiIWKcS (ORCPT ); Fri, 23 Sep 2022 06:32:18 -0400 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8973412DEF2 for ; Fri, 23 Sep 2022 03:32:03 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 2479F5809F0; Fri, 23 Sep 2022 06:32:01 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Fri, 23 Sep 2022 06:32:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663929121; x=1663932721; bh=b5154p7+jw vVybTnV4XOC9aGotedUG0z1MsOq616Jbc=; b=k9bU0VORHmBJt7KPkKuBBTcZbY QA3kx10eWTFiwOmyoiCict9Dfk8o5uCUg3qg7VM9DFh2a5TbY1E/NMEcKfPsdZSc 08hCSuiKnQSk2mlMKlCGY5V0cha/KM7i2u0FUL0hF2m39ZtESjfsw+Zk1GNUrGrD jGE8C5uaoADfLqRHFvjS0VvsNVu5nnfluIAVulHvjiPi1L8sQYmBpM2OXHANpbRu 8qOBZJa5apfuB9HCwldF0TIz7aqYTg+9622/pHrPAtz1CjI/vG5o+emrNHB8srKk /EXqM/UzPPHcN0/3eLkCgry15A/ir2thuq9O7VKJA1g3YFnFmMU9T2aFuZjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663929121; x=1663932721; bh=b5154p7+jwvVybTnV4XOC9aGoted UG0z1MsOq616Jbc=; b=qtSqNLuwmRHY/7d2tD6A/zls1b51QbKDVrSpnj6LgJLJ yP6nPJ/bX37TyqwR/wUTqnO/WyV2lUOfe2JBYFJ4EV3kbY3bFCJH1dGVe0ylHbQD ZrETuI+61q9GeOlw6Y3ApLS6GZozoqkfezwgEj/RIzQzlSdtZSt+27vIrjIUncK3 d3uji0RhRhRWiCo15BDKaRajgPoLofpKA6+JaHEzxK91RDoZYb0Rj3aER/xNwKWj r+mpfny7tZge0bCtyZLAoqEIq81WUoZNnlKEQP2M9p+ggckJi7YQBsasKbErDimC hx5jp1RBqh0zXgqJm3eBzXoeY0KKRCxO2hJblzYG4g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefiedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 851E9B60086; Fri, 23 Sep 2022 06:32:00 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Fri, 23 Sep 2022 12:31:39 +0200 From: "Arnd Bergmann" To: "Maciej W. Rozycki" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RISC-V: Make port I/O string accessors actually work Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 Thu, Sep 22, 2022, at 11:56 PM, Maciej W. Rozycki 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? > +#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. Arnd