Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp958703ybc; Tue, 12 Nov 2019 11:52:49 -0800 (PST) X-Google-Smtp-Source: APXvYqx6Jw9JfIvbWWyrDxJAhqES3TJnn1gzCiVg9WDmv70sxdH2n16qnBeeN/T/SVYtOY42N/p/ X-Received: by 2002:aa7:d552:: with SMTP id u18mr35152719edr.86.1573588368959; Tue, 12 Nov 2019 11:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573588368; cv=none; d=google.com; s=arc-20160816; b=kaj8qlGHiVjNw8CN/Ka8NYv8VybgqVD2IPMlPxF7b3DA0hob3BX2PACArG69EGxvFe qxAaiqAcTnNOy8Ge9yFEhOUOotPbANNtPAvOMBEkv8m2AvRjRmA0/sUzcd59T9y7Q9AL Fbl+ms1hDSWdDEA2SAUmgOaiVIcfm+IDzohjoQ1j77OHiU1WenPy4NhMUq6j2ug2luY0 JX+SsAHEPzvm6yFhFfXSQiuTmKNgZRpLf5+FTdkmZopZpCbUTMezsDzBnhWlHm6tf+LC Vu13zosyJ4+rQnS0TDiRR7NlaXhl3TstbVd6VqZR5BePMwwxLVU4nGXH9RO15F2LiAR+ Xs7Q== 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=tQtqMeot5LfcVlTdgWDwSqRbJuRC50V8XvcHZihKGG8=; b=g0+1pnbPRkBIKx1/ToNypjkB3UFTkBD2kIHurHMbpTesiJuHU8jN8q/vaH8SDwSGWY VRF/ByHdkOvvfhtVBR3EK7YfGHkvLQcg3XJqUrsopWnKF6fY4n/DkJ7nivLA1MH14fmh A+nZWACoYz8u4sTUSJEfCl1lPe5YwY8uQbVGxgCO5hdB3vGPN/5SzSTZIOAD0zR/gfSO Lb00Ov0+aIMGGtuQ90yZx6Dv8rvrkOh+WTW5n8lBwQCjwvtUY4lO6YrisL4Iauf4Unzv NYl501WIX/Wkpqyu9FgaIKbmWKsB8ZOGw5JWyTSR01C1o+A6GBmBbG5sXogyW8UxBvma P/sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=pEYpkLyP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si15164852edc.6.2019.11.12.11.52.24; Tue, 12 Nov 2019 11:52:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=pEYpkLyP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbfKLTvm (ORCPT + 99 others); Tue, 12 Nov 2019 14:51:42 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:43018 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfKLTvm (ORCPT ); Tue, 12 Nov 2019 14:51:42 -0500 Received: by mail-io1-f67.google.com with SMTP id c11so20097457iom.10 for ; Tue, 12 Nov 2019 11:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tQtqMeot5LfcVlTdgWDwSqRbJuRC50V8XvcHZihKGG8=; b=pEYpkLyPH+Q301rHLJ8Kvnr1eTMi+fysebKB+dV0aT8wS7OK9njRbyWt/OrGymCl26 umQA5eJMRUGkAWMAD9HqWTXO0tL7O5cc4/kAv0cQym46SDDK5P/c5WO6LrtRUyaBZ0Im +eKm0u8JWcvAvBOPhf8MRwz14xkTkpnvC8Qq48xE3cAeaO5LfRSxWUkFZv/pC56ZVBCB KJC59nIid7tWaNHwK058GuJ3QNCeKOBnuk5QXDA+n6Wrg8DFpNid3/Vl6wcLKGLP3XEY deqJB+1/H1SJOdawKdpBI2bm5dUEmTg2VWnWmkbiIWoPfj/8ds46/h9mY3N2IdB3gGzP fRHA== 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=tQtqMeot5LfcVlTdgWDwSqRbJuRC50V8XvcHZihKGG8=; b=khTeyGJI4y5u1b8wGnkWgJoxrCQfEC3PcZHDIIKbnT08JtADz6XgeuDxcz6fc4Cozl LXakgxCBQfVjr2vpY1OXpTV1dQYXjdO8GSr9pyXnjRheN7xPbL6el5OMs02idKqNT+Ds +62xNIU7SRgA1CyKOMTf0J67Ysj5I9Alc0xhg6XntFy58dpMIA/hKejyFhJQpZmWnus0 bN8LMw3LZbEfA8aaj2fp7s2GZHW8vFCvahDCCeneV6KKZa8nTjhbzXvJfRfTlW3U4EVn bFq7NDtsHe8vcr7Tn4b0gzvzXdyswJZWp8ahzXHsqsTGBVdrxZRFOdHkOApGjdWe7HeA w3zQ== X-Gm-Message-State: APjAAAUxfWnAEedmw7EruYGv3bKrmDnqP0My6AEyJoECw0J7KYmj1L0F 2o1j5eTYcJZ2Jfnn+7lBQxNlkTnd0VxVPdzs3nm1NA== X-Received: by 2002:a02:9f12:: with SMTP id z18mr7536892jal.10.1573588301333; Tue, 12 Nov 2019 11:51:41 -0800 (PST) MIME-Version: 1.0 References: <20191111004211.96425-1-olof@lixom.net> <20191111.214658.1031500406952713920.davem@redhat.com> <20191112132311.GA5090@lunn.ch> In-Reply-To: <20191112132311.GA5090@lunn.ch> From: Olof Johansson Date: Tue, 12 Nov 2019 11:51:29 -0800 Message-ID: Subject: Re: [PATCH] net: mdio-octeon: Fix pointer/integer casts To: Andrew Lunn Cc: David Miller , Florian Fainelli , Heiner Kallweit , Network Development , 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 Tue, Nov 12, 2019 at 5:23 AM Andrew Lunn wrote: > > On Mon, Nov 11, 2019 at 09:46:58PM -0800, David Miller wrote: > > From: Olof Johansson > > Date: Sun, 10 Nov 2019 16:42:11 -0800 > > > > > -static inline void oct_mdio_writeq(u64 val, u64 addr) > > > +static inline void oct_mdio_writeq(u64 val, void __iomem *addr) > > > { > > > - cvmx_write_csr(addr, val); > > > + cvmx_write_csr((u64)addr, val); > > > } > > > > I hate stuff like this, I think you really need to fix this from the bottom > > up or similar. MMIO and such addresses are __iomem pointers, period. > > Yes, i agree, but did not want to push the work to Olof. The point of > COMPILE_TEST is to find issues like this, code which should be > architecture independent, but is not. The cast just papers over the > cracks. > > At a minimum, could we fix the stub cvmx_write_csr() used for > everything !MIPS. That should hopefully fix everything !MIPS, but > cause MIPS to start issuing warning. The MIPS folks can then cleanup > their code, which is really what is broken here. I'm not disagreeing with Dave, going all the way down the rabbit hole is preferred. In this case I mostly pushed the lack of __iomem usage down one layer but not the whole way. I'm unlikely to find time to do it in the near future myself (this was a bit of a weekend drive-by from my side), but I don't mind doing it. If someone else beats me to it, feel free to take it over. -Olof