Received: by 10.223.185.111 with SMTP id b44csp1656281wrg; Sat, 10 Mar 2018 10:45:44 -0800 (PST) X-Google-Smtp-Source: AG47ELs0jlWC3W4yUJJU+CHJ8kLqYc2QSynk0cDTWEUzB3EJWp7VyBzzNSrVYHJcFhSGNhkHoEcy X-Received: by 2002:a17:902:b20f:: with SMTP id t15-v6mr2774530plr.349.1520707544321; Sat, 10 Mar 2018 10:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520707544; cv=none; d=google.com; s=arc-20160816; b=W7RbReBFAMeUeqWqE0E0yw6XwA/eBoNvrUFlLMFPgBeMhxwr0sPjup3LyPj5UllYJn QO+TKXfkqfLizKnN4TulcbAAiG25QGiL7Ypo7RpexGCOAkCaz6Y4F06Jjsu1DoL5e6os dOSUrpRWgvPZRFi16TVkE6HJj8OKN5mSz+wYRsM5cl5uS+abMQDQkGChJ7L8iy5xDl8g 5crR1Jlwm2/98gKCiT7WBk5YZw8I7XlP9pinhwyS7uFy5OSo0YwlCOjKDVFYWUZ1Gu94 f50oSgaH6kq1+1Em8ksjZgtlR7hvLfceVkvfn6B8NL9O6FydNM9mDm4UKPVFLr/KtqHC ttVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=S4CWlEk7R1BHQ7C6/+ZDw4WD+l93r90o4McUG52LB3c=; b=Bzm8/+31784o/rx5z5AgJz7FRtaHg+k+yEsnxIu/DMTd9ipOQNIJ9kmo6bxAHPa045 tVdlSsVMK6iuP26ySIH2IS4b1bQKuRYijBmQOfvHfSAvpztaSVa36WmZTTwqg3DsPM+U LBzMLadtwVj6sbYeqwMW7P+EMdEXuElhpfmka/z1CNU+LTsvEaMQ8EPvJt26byceoY2N lfKcl3XHfLzG3Kj4HrQTVyxuYlqvWRrdN08XdL8rsWh++uh20lC2UlQITVxHEAEU+GjO a20dlrmkzdB27ZvhaZMZUT38VAK+pn05ql/uTKnYE4pk4NzkLce04Fjmc5VYFb0PgEUy ssCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=LmEXxhF9; 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 u6-v6si3125887pld.606.2018.03.10.10.45.29; Sat, 10 Mar 2018 10:45:44 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=LmEXxhF9; 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 S1752205AbeCJSoJ (ORCPT + 99 others); Sat, 10 Mar 2018 13:44:09 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41585 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932241AbeCJSU0 (ORCPT ); Sat, 10 Mar 2018 13:20:26 -0500 Received: by mail-pf0-f195.google.com with SMTP id f80so2617281pfa.8 for ; Sat, 10 Mar 2018 10:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=S4CWlEk7R1BHQ7C6/+ZDw4WD+l93r90o4McUG52LB3c=; b=LmEXxhF9HrmINhbyAT4f7sjfK6qsoA5EzZhkbAPclfdj+gCZDZK/Q5GYxiZdkbckZz GB7GftCLevWr7JoK18Snir7RfhYGdJ18KpMCd4BdTX7W4ykZW3SwIXo1+WOYnBj4LXoN RQSqOUZKx/N2xT/8vf30Iwwlh66d14qXI9NB6Ige2kWkDjsflULRKeOZ1eN59OjIXBal Rd/gr085YyCJxVuCyExeI+xvCnT1ZtErJfo7FajwcKVD1A3Bn1qJNgurRXrcPZol18eA gR4O4zGhOJywiSqY/E+rzKGChIkWUX3holuzcLK/C9mOj5orXPShpH8aRo/BHAP+io9m QTlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=S4CWlEk7R1BHQ7C6/+ZDw4WD+l93r90o4McUG52LB3c=; b=r25avYLbFpwfMAUb1sLgwvZjlX3NNRQK3uP0P/QkH0r81MdxQ9XnKs2xkdHQx/+B58 Uz7MN9BETioMMOQGACoXEYMUiOK26sZFWquDope8pmsMx3FwlJ6AVfS6xm08pVZuXm+v lveEgiamhnIeuQNj3V2dwI1Qk2m8TWpDGB/qyCdoLg8tg+xN+7swZMnf/fxucDxKBOxC AGxWel3sj3k5m8znv4JJHh11OMDdSg6B4U8sGnoPpLHzPMtLjCEWq4JH25AKgpTEAm4E +gbRaDyZM0Dae2jRBu8iq8I80HBwhtdV+3lQ1PKiNd6yPnOXsUaEo8fxjgkZ/7rORnyg Dtrg== X-Gm-Message-State: AElRT7HYZbxvyvN3uIelT5WZ/Gzr2RCFqzK9F7DZhySBFA/2Go/RmjYL Ylodk4yW/EMGJWID95GC75oXtw== X-Received: by 10.98.25.10 with SMTP id 10mr2645501pfz.136.1520706025962; Sat, 10 Mar 2018 10:20:25 -0800 (PST) Received: from ?IPv6:2601:646:c200:7429:448:34d1:439:4e56? ([2601:646:c200:7429:448:34d1:439:4e56]) by smtp.gmail.com with ESMTPSA id e10sm8229558pff.151.2018.03.10.10.20.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 10:20:24 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: ivtv: use arch_phys_wc_add() and require PAT disabled From: Andy Lutomirski X-Mailer: iPhone Mail (15D100) In-Reply-To: Date: Sat, 10 Mar 2018 10:20:23 -0800 Cc: "Luis R. Rodriguez" , Andy Lutomirski , "hans.verkuil@cisco.com" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" Content-Transfer-Encoding: quoted-printable Message-Id: <67E7293F-6045-4EA1-8AEF-E4B92E046581@amacapital.net> References: <20180301171936.GU14069@wotan.suse.de> <20180307190205.GA14069@wotan.suse.de> <20180308040601.GQ14069@wotan.suse.de> <20180308041411.GR14069@wotan.suse.de> To: "French, Nicholas A." Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 10, 2018, at 8:57 AM, French, Nicholas A. wrote: >=20 >> On Wed, Mar 07, 2018 at 11:23:09PM -0600, French, Nicholas A. wrote: >>> On Thu, Mar 08, 2018 at 04:14:11AM +0000, Luis R. Rodriguez wrote: >>>> On Thu, Mar 08, 2018 at 04:06:01AM +0000, Luis R. Rodriguez wrote: >>>>> On Thu, Mar 08, 2018 at 03:16:29AM +0000, French, Nicholas A. wrote: >>>>>=20 >>>>> Ah, I see. So my proposed ioremap_wc call was only "working" by aliasi= ng the >>>>> ioremap_nocache()'d mem area and not actually using write combining at= all. >>>>=20 >>>> There are some debugging PAT toys out there I think but I haven't playe= d with >>>> them yet or I forgot how to to confirm or deny this sort of effort, but= >>>> likeley. >>>=20 >>> In fact come to think of it I believe some neurons are telling me that i= f >>> two type does not match we'd get an error? >=20 > I can confirm that my original suggested patch just aliases to ivtv-driver= 's nocache mapping: > $ sudo modprobe ivtvfb > $ sudo dmesg > ... > x86/PAT: Overlap at 0xd5000000-0xd5800000 > x86/PAT: reserve_memtype added [mem 0xd5510000-0xd56b0fff], track uncached= -minus, req write-combining, ret uncached-minus > ivtvfb0: Framebuffer at 0xd5510000, mapped to 0x00000000c6a7ed52, size 166= 5k > ... > $ sudo cat /sys/kernel/debug/x86/pat_memtype_list | grep 0xd5 > uncached-minus @ 0xd5000000-0xd5800000 > uncached-minus @ 0xd5510000-0xd56b1000 >=20 > So nix that. >=20 >>> No what if the framebuffer driver is just requested as a secondary step >>> after firmware loading? >>=20 >> Its a possibility. The decoder firmware gets loaded at the beginning of t= he decoder >> memory range and we know its length, so its possible to ioremap_nocache e= nough >> room for the firmware only on init and then ioremap the remaining non-fir= mware >> decoder memory areas appropriately after the firmware load succeeds... >=20 > I looked in more detail, and this would be "hard" due to the way the rest o= f the > decoder offsets are determined by either making firmware calls or scanning= the > decoder memory range for magic bytes and other mess. >=20 > I think some smart guy named mcgrof apparently came to the same conclusion= =20 > in a really old email chain I found [https://lists.gt.net/linux/kernel/238= 7536]: > "The ivtv case is the *worst* example we can expect where the firmware > hides from us the exact ranges for write-combining, that we should somehow= > just hope no one will ever do again." > :-) >=20 >> Perhaps the easy answer is to change the fatal is-pat-enabled check to ju= st a >> warning like "you have PAT enabled, so wc is disabled for the framebuffer= . >> if you want wc, use the nopat parameter"? >=20 > I like this idea more and more. I haven't experience any problems running > with PAT-enabled and no write-combining on the framebuffer. Any objections= ? >=20 >=20 None from me.=20 However, since you have the hardware, you could see if you can use the chang= e_page_attr machinery to change the memory type on the framebuffer once you f= igure out where it is.=