Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp667219pxk; Sun, 30 Aug 2020 18:58:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEM2RAUe5y/h1rV0fkWFqiJmZH+FN+NuDAjoLdgrdE86TclwBGqwrxBRMwdGsyqexmWDph X-Received: by 2002:aa7:d697:: with SMTP id d23mr9664991edr.13.1598839130165; Sun, 30 Aug 2020 18:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598839130; cv=none; d=google.com; s=arc-20160816; b=kFbSD3e8ugusiCwvODLEnI40WgpO4txh4M7xLbj4jJVF4HKaMaoTuMW5o9unUugMzD xLvwHtf2oCPnyiUOVhgn0D6SRD8uvyHfo+ovzpAbiTLRiPfIdsdHDk23MlamRHL4k/yf OfeG+ZVl3oNl9bAwrvu6oDVj/kMsfjCq4jkVjFlh9FaN77A+FrffmMdcBxb7yxHZNCHR andREk290A3LK79FygZxG/I5wcx1gI6fCjhY/TIbpLodKFeBhjnCBG96TehA+hR2szsE gtyAP4SjwgyS4IUOgNHLww5wZPmB28VM4YowY19pWo93btUEBBUePQAFJ35YBNePS2Vj ytcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=DR+s6UFz/JVmTHxp5x23gH90WUmrrxg0uxy6X7Xtrd8=; b=loYEsZ4+le8Vv2UXGeesbmHHUocF/WNXlpqyWggmEGsMW8cZIEWpYGyCmNibh30oNy 5li3aUfH5d/JjqrSOmgzVB4I9XYIYciLqDGZsH96wEQuM5vtSdONVi7MJxIjmEz8Kz6o DNQ7rNGxlk7Pv+g+fYa/2PuPludEdlY9soThbUARrsLOSEnpt6Cohm177tGtSl9mTTe3 sqyv/2pmD4SWQ8su0lQ1oheuuPpFlp7rcLs7VYz7utaY9RiTy8Y0I4wqnqDzi7uOrWl1 F7ckYnlFTRYc7nhl0OQOGUQMSY5aOgJmXEdK0lI7XSYoOiQ2UF+tQUxxme2kFDCL+O6U CqrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=TKDhuGbz; 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 i21si4485504eje.143.2020.08.30.18.58.27; Sun, 30 Aug 2020 18:58:50 -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=@ellerman.id.au header.s=201909 header.b=TKDhuGbz; 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 S1726775AbgHaBzR (ORCPT + 99 others); Sun, 30 Aug 2020 21:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbgHaBzO (ORCPT ); Sun, 30 Aug 2020 21:55:14 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3382C061573; Sun, 30 Aug 2020 18:55:14 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BftYy6xJlz9sTW; Mon, 31 Aug 2020 11:55:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1598838904; bh=Fevkc9YaB+1sYDbeOG8T4LT6GQdE5UvQoFOdg072Pu4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TKDhuGbzZwJiCgjOR9K0+Eoiu1N+9y45LmPK2aIISkDfk+UEbKCBwjQ7Qhdpnkfyw kyplzaIOzSMtPulaeL074BS0aq/GM4fIN9UBXOvms4bTKzoucGapMzW/Q6L4UP3MA/ 2NqFCcpi9lId2L8nzWPulhyV+5XbgBxZkuoyuYMl6Xex6L7GiaGoI81QWsm/cq9YOY yQwrxa6jjC9Whjq4YOzOV/5NyZMdJDF/vbajRMvRTB57SfyVGRYTOxaBigewE1UlCt /jvBjUEltBJx4sRKP1ya6z56t8KGzMkjjZNSnRDnADcpFegpCY+uOtR0ngkd4pTDFV YD86uNOQfMvWw== From: Michael Ellerman To: Linus Torvalds , Guenter Roeck Cc: Luc Van Oostenryck , Herbert Xu , Andrew Morton , Joerg Roedel , Li Yang , Zhang Wei , Dan Williams , Vinod Koul , linuxppc-dev , dma , Linux Kernel Mailing List Subject: Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits() In-Reply-To: References: <20200829105116.GA246533@roeck-us.net> <20200829124538.7475-1-luc.vanoostenryck@gmail.com> <59cc6c99-9894-08b3-1075-2156e39bfc8e@roeck-us.net> Date: Mon, 31 Aug 2020 11:54:58 +1000 Message-ID: <874koj37gt.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Sat, Aug 29, 2020 at 1:40 PM Guenter Roeck wrote: >> >> Except for >> >> CHECK: spaces preferred around that '+' (ctx:VxV) >> #29: FILE: drivers/dma/fsldma.h:223: >> + u32 val_lo = in_be32((u32 __iomem *)addr+1); > > Added spaces. > >> I don't see anything wrong with it either, so >> >> Reviewed-by: Guenter Roeck >> >> Since I didn't see the real problem with the original code, >> I'd take that with a grain of salt, though. > > Well, honestly, the old code was so confused that just making it build > is clearly already an improvement even if everything else were to be > wrong. The old code is not that old, only ~18 months: a1ff82a9c165 ("dmaengine: fsldma: Adding macro FSL_DMA_IN/OUT implement for ARM platform") (Jan 2019) So I think it's possible it's never been tested on 32-bit ppc at all. I did have a 32-bit FSL machine but it lost its network card in a power outage and now it won't boot (and I can't get to it physically). > So I committed my "fix". If it turns out there's more wrong in there > and somebody tests it, we can fix it again. But now it hopefully > compiles, at least. > > My bet is that if that driver ever worked on ppc32, it will continue > to work whatever we do to that function. > > I _think_ the old code happened to - completely by mistake - get the > value right for the case of "little endian access, with dma_addr_t > being 32-bit". Because then it would still read the upper bits wrong, > but the cast to dma_addr_t would then throw those bits away. And the > lower bits would be right. > > But for big-endian accesses or for ARCH_DMA_ADDR_T_64BIT it really > looks like it always returned a completely incorrect value. > > And again - the driver may have worked even with that completely > incorrect value, since the use of it seems to be very incidental. > > In either case ("it didn't work before" or "it worked because the > value doesn't really matter"), I don't think I could possibly have > made things worse. Agreed. Hopefully someone from NXP can test it. cheers