Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp22360pxk; Sat, 29 Aug 2020 14:21:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJdlE76XUJKpqOGgRQk3XY5Ij100hDGxkl48ag4/Bh9eXXp9rJyfLAq/jmH0ifOifAXuIB X-Received: by 2002:a17:906:3c47:: with SMTP id i7mr3251767ejg.554.1598736106935; Sat, 29 Aug 2020 14:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598736106; cv=none; d=google.com; s=arc-20160816; b=BcjznSnJWMBYnPfSji+OXdgx99bSCo736dRSww2+YwXrA6viiraYv+OrZ1pLrJH4Ru xfHlpOOFf190OZF9w4isebqdACu2pDKGS7Tpi5EWdegWtf4I/DlMXUTJ8Tdi+aUpptc1 r5drEmBVPPxmhQgZe/827BTubo6tugeeYLU6TyLJ9jRroST4Z43DtHPUC3diHGVtnVYE 3e78DH3q+SCxihzj0/datHp5GL6UwusqmNkaaMoU3xHycz3NqV5teGSEPPKi9RHpiiLg 0xY4o1UrlKf4zlLfqh9kpniWYZMy6wpoojlnkjeO3XrShDMY/KS2K7s0Y+z7wkwTscTE 4y8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tZQqP/9kQfBYLXOwwY2/9XmqjIYfArF6oBpsrKgPoWk=; b=PjI3gm+bMrXtXZP7a5azVqpUKnSd06jcckGpM9Se8v8TnbTRB+5f6t7aAiL9uvyqem oSqzTj37qMoOoklX7E76enoFTCH/62jQdyw6CJrLWMkGbip8Svpd8K2CHsKTyQ5D27Vr fGLIodqI9m9D+diju+vLtrV4t4pQhbOQzZdKu1SNeifO7SDF3u5WEnJXruL4A28HH8K7 5Pc6NVnzM+5ZCWH1veTrUahWm4rAO2THUilwSuDWenbJU/wDBZ0ZgTla3gPmJuQ9I1JO yZRkH9HXfsUpu1uqRI4SxtSeTmlosJZDruh52yNJibSGK0NXTRI1LQnBAaIhOnWr5c/W wAaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AbmLqUhk; 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 g16si2599754ejf.103.2020.08.29.14.21.24; Sat, 29 Aug 2020 14:21:46 -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=@linux-foundation.org header.s=google header.b=AbmLqUhk; 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 S1727955AbgH2VUi (ORCPT + 99 others); Sat, 29 Aug 2020 17:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgH2VUg (ORCPT ); Sat, 29 Aug 2020 17:20:36 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D834DC061573 for ; Sat, 29 Aug 2020 14:20:33 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id k10so1508271lfm.5 for ; Sat, 29 Aug 2020 14:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tZQqP/9kQfBYLXOwwY2/9XmqjIYfArF6oBpsrKgPoWk=; b=AbmLqUhkivcRKLvSZehoY6HsfcHP75SHwBbGTVYqRQmORnoNriFSmxObwU2VmHmy63 E4Vz99EJMsmm7F9WygW1iy4/YZzTwxsfG/d5H+d6vMGaF7dADK4foWIt+zXy2W9YpTq+ RCbxEzNzwxpfl9Mn69NXw7mfFaxWWWF27/u6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tZQqP/9kQfBYLXOwwY2/9XmqjIYfArF6oBpsrKgPoWk=; b=GWMBkVdBdJCqo3aw07RXaOfkNu+NIVr8v/0QZcDbJ4P5HuTK3R5p4HF+wa+rOYt/Pj FylcDspRBAi8G38Fz1Uqlh03Zp/BPTpxepkstPqm3A/tyJSgHLAmmMqwoLZiceD6XyIj GlogtIqS6mL8cK2Ezn/AhHhflVU6UcyYLFZcKaYwDSNbTvBKtGahNaGhUhD2U3W92mmY B5+VTb346exGnmG5SI2ssgREF+gfL5EepHurD7g8B+OWUw81Z0bnDJU6EBlk7P/Dk/Ai A7++jOrdKqDrtr+rri6Nq4kuoH+VG8zwYo460iXmyp9ySR366xn0NjaJxlooskPj+vEE iRog== X-Gm-Message-State: AOAM530+uvHQvddNMWZD5rfKg/pRGg8Knfyzmyz6FcxPpr96bgTWxDoQ F46OC8lPTqxtZyzrT6XLOu33SPUb5uYukg== X-Received: by 2002:a19:ae0a:: with SMTP id f10mr2255989lfc.100.1598736031860; Sat, 29 Aug 2020 14:20:31 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id c4sm679209ljk.70.2020.08.29.14.20.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Aug 2020 14:20:30 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id t6so2598342ljk.9 for ; Sat, 29 Aug 2020 14:20:30 -0700 (PDT) X-Received: by 2002:a2e:b5a3:: with SMTP id f3mr1027329ljn.70.1598736030159; Sat, 29 Aug 2020 14:20:30 -0700 (PDT) MIME-Version: 1.0 References: <20200829105116.GA246533@roeck-us.net> <20200829124538.7475-1-luc.vanoostenryck@gmail.com> <59cc6c99-9894-08b3-1075-2156e39bfc8e@roeck-us.net> In-Reply-To: <59cc6c99-9894-08b3-1075-2156e39bfc8e@roeck-us.net> From: Linus Torvalds Date: Sat, 29 Aug 2020 14:20:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits() To: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Famous last words. Linus