Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1103245ybc; Tue, 12 Nov 2019 14:25:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxwqsArUkSqccqv4kj808Q9BYirYVRWioo2UnGpqyuogXPkqfD1GI9cHlqRUxD9s99OlXlA X-Received: by 2002:a17:906:d052:: with SMTP id bo18mr11305759ejb.128.1573597531390; Tue, 12 Nov 2019 14:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573597531; cv=none; d=google.com; s=arc-20160816; b=UQQf2dpNQgTKFWoScyTO/20TT/9jm/xQrgYkefm6gPX8c9j/lAYEcq1PHqlqZiYJC0 pKCjogP+xzpbRnHft0iCh6/o4wVoJ8fKfDTU2lFFqEzDgKSPATyuNa2ceKvj79HiwDt2 J1Na6/1gJzB8yySmM6HUfKehqIpdo5NWFbkiEl0oEyeVZdAMvi3tZmDygqz/xPhIjnk0 HwrU5ESahhwz9L28nanptzrrl29qe63rr9hNjnjsS4eHUIbrx8Vel9ZPzXY4SqPGbO5p trS1pNu96nZUs7BbbaWsMmicYa2A838G+YgqFGNdrDz/BF0JU6kwK6JxhRiNnI97niry zuZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ry7MlWHWsPiTlOdYnNj9Sx46aKAp4p8fIGij3YUbq4o=; b=iX+mMjHYxgRH0Y4Mif74dBZpbOJeGudxZk7KUPrs1D4UEpyS94Jwy5q0KIc3OtpetI G7lmJ0Dqa4B2xzz6ULHYCfth/fjurIbb9dCtaojlRdyDkcIZlMGn1PxHthYmZsV5gTQ/ MX9Z+aqxOv2+nsT8QWiReRPovOA31iqbF3zS8HSaRXAf/EjiRH8F8YmbrWhuSeuaevlJ Gg5sNrReVALNLG18yGSSCxdf4gyjzKXuaIy7aOz+COsysJajcshOQGSwtP/RsWcQ3MlJ zw5ey2XLxykkYDAb5t8bM8XewbyGW1p873yJt3a991GyWNy6pb4K5mRS5MYb/V1Cdyyc pZ4g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si13879914eda.307.2019.11.12.14.25.06; Tue, 12 Nov 2019 14:25:31 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbfKLWY0 (ORCPT + 99 others); Tue, 12 Nov 2019 17:24:26 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:32997 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbfKLWYZ (ORCPT ); Tue, 12 Nov 2019 17:24:25 -0500 Received: by mail-pf1-f196.google.com with SMTP id c184so113659pfb.0; Tue, 12 Nov 2019 14:24:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ry7MlWHWsPiTlOdYnNj9Sx46aKAp4p8fIGij3YUbq4o=; b=RTCM3YsuRrBW1rSeGPMHQg1g+lNT6bOGCkb3Q07RPmw6sh5OfeM386QRjVFgVu/kLi oe7ucjtMpCMjw8BhzrZ9AM+8/+KUFtitMxXsG03P2p1hg74YHqnKVpRUxS9J5I19z0IA w8IH9+5SaJUwCjJHnaIUeGwOwmW8C4vLFzIJnQUD89npc+soZcURMXAu7o4rwhlb8V1u x0XMVTpxekcpRvezoBqC1noTgjCShaVbRzxGphO+GcYC6Lujv/gBL3pD6JXcdUJOQvQU DujfpatjoFJ1wsu0sDCdCoebrr4CFGUZ3VYFVCP2BFTKqBK8K+OarHiLQOeR4hDDmYkG PeNQ== X-Gm-Message-State: APjAAAVZ+0iNipGWuqD3ZZpdYKT13SXPwxED9f4J5HbAgqFWWqxbzNI/ 4G43OlA0WDB/q2Mb7DtM+c4= X-Received: by 2002:a63:d258:: with SMTP id t24mr37597711pgi.289.1573597465040; Tue, 12 Nov 2019 14:24:25 -0800 (PST) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id c6sm20600076pfj.59.2019.11.12.14.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 14:24:23 -0800 (PST) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 4625B403DC; Tue, 12 Nov 2019 22:24:23 +0000 (UTC) Date: Tue, 12 Nov 2019 22:24:23 +0000 From: Luis Chamberlain To: Daniel Vetter , Juergen Gross Cc: Christoph Hellwig , Tuowen Zhao , AceLan Kao , Mika Westerberg , Andy Shevchenko , Roman Gilg , Lee Jones , "Luis R. Rodriguez" , Arnd Bergmann , Bartlomiej Zolnierkiewicz , X86 ML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , linux-ia64@vger.kernel.org, Tony Luck , Fenghua Yu , Maarten Lankhorst , Souptick Joarder , dri-devel , Linux Fbdev development list , Linux Kernel Mailing List Subject: Re: [PATCH] video: fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Message-ID: <20191112222423.GO11244@42.do-not-panic.com> References: <20191111192258.2234502-1-arnd@arndb.de> <20191112105507.GA7122@lst.de> <20191112140631.GA10922@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 03:26:35PM +0100, Daniel Vetter wrote: > On Tue, Nov 12, 2019 at 3:06 PM Christoph Hellwig wrote: > > On Tue, Nov 12, 2019 at 02:04:16PM +0100, Daniel Vetter wrote: > > > Wut ... Maybe I'm missing something, but from how we use mtrr in other > > > gpu drivers it's a) either you use MTRR because that's all you got or > > > b) you use pat. Mixing both sounds like a pretty bad idea, since if > > > you need MTRR for performance (because you dont have PAT) then you > > > can't fix the wc with the PAT-based ioremap_uc. And if you have PAT, > > > then you don't really need an MTRR to get wc. > > > > > > So I'd revert this patch from Luis and ... > > > > Sounds great to me.. > > > > > ... apply this one. Since the same reasoning should apply to anything > > > that's running on any cpu with PAT. > > > > Can you take a look at "mfd: intel-lpss: Use devm_ioremap_uc for MMIO" > > in linux-next, which also looks rather fishy to me? Can't we use > > the MTRR APIs to override the broken BIOS MTRR setup there as well? > > Hm so that's way out of my knowledge, but I think mtrr_cleanup() was > supposed to fix up messy/broken MTRR setups by the bios. So maybe they > simply didn't enable that in their .config with CONFIG_MTRR_SANITIZER. I had originally suggested to just make the driver build on x86, but an atlternative was to provide the call for the missing architecture. > An explicit cleanup is currently not possible for drivers, since the > only interface exported to drivers is arch_phys_wc_add/del (which > short-circuits if pat works since you don't need mtrr in that case). Right, the goal was to not call MTRR directly. > Adding everyone from that commit, plus Luis. Drivers really shouldn't > assume/work around the bios setting up superflous/wrong MTRR. Such things are needed, otherwise some systems may not boot... > > With that we could kill ioremap_uc entirely. > > So yeah removing that seems definitely like the right thing. I think this would be possible if we could flop ioremap_nocache() to UC instead of UC- on x86. Otherwise, I can't see how we can remove this by still not allowing direct MTRR calls. Luis