From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9496C433E0 for ; Wed, 24 Feb 2021 20:27:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8624E64E20 for ; Wed, 24 Feb 2021 20:27:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8624E64E20 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=orq1V7NPhKKfNEtfQ6lU14ajmJX9iqMT/k1CpHds1yM=; b=Co874l1IOMVWoJk0zSggPlZkQ eYMfCORHstyiA2y6RnijxO2By6Yb4PqKD3AFtey9bICFo5ceiL+dOkNwn+rDh9VuhphoSbsBJw/29 XFniomglZUAnTqH6Tz+N7JW0ZG2k1qro9E2D76Ek0OxlP3IMzYbw8BY7FSStG5Eg4/Xg5wNgStPRc l4fwwXdubEvP22WTxx11M93bvdYraxBWe8FQL640S24+hp6cwp3ItRqu7UDaquH0d6sH86zjMrals 3KnD7RI6R8y8Azqv97Zi51/S3E8OZb0sxxn3DAHfQhw1o146SXWoe77Nwoyv97THpntEO6d5bHyGd mU8lqXwNA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lF0ja-00052S-LV; Wed, 24 Feb 2021 20:26:10 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lF0jY-00051y-Hp; Wed, 24 Feb 2021 20:26:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=12uBme4GCr5a64UICfDbTfX0OuT87MBZBcK/kCTZvbk=; b=SLzy9dCxAYlVLXy9GlVICcWvPV ZONL9MQqnJfS1YM/LP75Jfcel8YwDJkw6fH5DdbfexEETSxS9ZiRhvP8QNPaYa3T9rbQ+ZZ8DRQev sLpED6AGOXn7Og/bztdtJXh8KRt17lvpa1FwI/tAXYAuNYvurT1uej9jqAJ/BIB6GnEgm7XDrBvUH HZu1fqXTyo9NXr27Gq3Gjgc9BCbWq39LBfHPCepditv8nnhRU5uj/uu1OzpfSorpP9bx1uQUYKIRx m8qNHOcctLnyxydwggT39kNF1kscayTHiEI7wCW2WEr9V4ZpWxZ3zfeHojXDcUffe8WJB/8raN8lB hbB9c3NQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lF0j4-009qsn-3j; Wed, 24 Feb 2021 20:25:49 +0000 Date: Wed, 24 Feb 2021 20:25:38 +0000 From: Christoph Hellwig To: Florian Fainelli Subject: Re: RPi4 can't deal with 64 bit PCI accesses Message-ID: <20210224202538.GA2346950@infradead.org> References: <2220c875-f327-586c-79c7-eadff87e4b4d@arm.com> <6088038a-2366-2f63-0678-c65a0d2efabd@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6088038a-2366-2f63-0678-c65a0d2efabd@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , Rob Herring , linux-pci , Bjorn Helgaas , Nicolas Saenz Julienne , bcm-kernel-feedback-list , Robin Murphy , Robin Murphy , linux-arm-kernel , linux-rpi-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 24, 2021 at 08:55:10AM -0800, Florian Fainelli wrote: > > Working around kernel I/O accessors is all very well, but another > > concern for PCI in particular is when things like framebuffer memory can > > get mmap'ed into userspace (or even memremap'ed within the kernel). Even > > in AArch32, compiled code may result in 64-bit accesses being generated > > depending on how the CPU and interconnect handle LDRD/STRD/LDM/STM/etc., > > so it's basically not safe to ever let that happen at all. > > Agreed, this makes finding a generic solution a tiny bit harder. Do you > have something in mind Nicolas? The only workable solution is a new bool 64bit_mmio_supported(void) check that is used like: if (64bit_mmio_supported()) readq(foodev->regs, REG_OFFSET); else lo_hi_readq(foodev->regs, REG_OFFSET); where 64bit_mmio_supported() return false for all 32-bit kernels, true for all non-broken 64-bit kernels and is an actual function for arm64 multiplatforms builds that include te RPi quirk. The above would then replace the existing magic from the and headers. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel