Received: by 10.223.185.116 with SMTP id b49csp5849251wrg; Wed, 7 Mar 2018 20:07:12 -0800 (PST) X-Google-Smtp-Source: AG47ELvHZyhDwsNz76P15l2+BlZ4rE04A46VZQ2d+t32XqnyEQrML8McUkgMytQD6DdluEuX8cvA X-Received: by 10.99.96.137 with SMTP id u131mr20465560pgb.103.1520482031901; Wed, 07 Mar 2018 20:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520482031; cv=none; d=google.com; s=arc-20160816; b=wwepKRCszXErhQ9UZdRISMyZ+UFqM0ULut0k4QMQjEBxxnvAAYU88WFwHAlV4Nf5lg S7WTvp2zRdL3lUUW9kVk/aeX5mwp68GQ7U6wgt9gIUQCikHjP4UMjWdwET/csFBTHLKO 7JmJs3yCIIZIfPL5oPUp2v2dQuSMWPIdZX1dgJ4ZMN4tLJHojcgl/GCQrsOCNzCC/Gc6 qbTOhViEBsqkkM5gzJpIJrPqi3AudphkjdKLu+1NKYHlvopKddinBzdegz5zeYJbBi8E gq8xAEfL6vVthHcCyekusUQy+Pp64si1sfiyuDU7WOd/mJ1VqdXQvJcV6DfMNHc5zgND Ds3Q== 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:arc-authentication-results; bh=OjqX0DlNQYHVba6SLo0l7ulBd4kQcFZSKpOh7VeRB+s=; b=UVkBkAxgfpI2ZEtWWMl+w1CTz0kIK4LiE+6fzELgRtx4DggaHAHoCdbhdgmJcpHl8k O3LPDlaZmOJBb5D1DkMWgeRC1be93i94K0Fo6kUuYpIo1lVbGYqvJXPA2/0GyEdjOJLn gx8yWSrejeljtol1GbSCA8QFSFherADPg6TtboNcx1DFAYcGjOK1sFk+1seiJFQdzUrT +R0DQcSEgn/MkH0cUV78aJgZ/y9wHO72m2OLcx/3ajEUmJOPLQgz/VadVAHAxRCycIpZ qPQXWUmhx8sqHxaCiO5A601blu5sPgvZMmJipJKWKxbFQUnlgKwqCtEwDiQy20E9SshT w64A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si9936411pge.342.2018.03.07.20.06.57; Wed, 07 Mar 2018 20:07:11 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933598AbeCHEGF (ORCPT + 99 others); Wed, 7 Mar 2018 23:06:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:43964 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754066AbeCHEGD (ORCPT ); Wed, 7 Mar 2018 23:06:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 73B6DABE9; Thu, 8 Mar 2018 04:06:02 +0000 (UTC) Date: Thu, 8 Mar 2018 04:06:01 +0000 From: "Luis R. Rodriguez" To: "French, Nicholas A." Cc: "Luis R. Rodriguez" , "hans.verkuil@cisco.com" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" Subject: Re: ivtv: use arch_phys_wc_add() and require PAT disabled Message-ID: <20180308040601.GQ14069@wotan.suse.de> References: <20180301171936.GU14069@wotan.suse.de> <20180307190205.GA14069@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 08, 2018 at 03:16:29AM +0000, French, Nicholas A. wrote: > On Wed, Mar 07, 2018 at 07:02:05PM +0000, Luis R. Rodriguez wrote: > > On Tue, Mar 06, 2018 at 09:01:10PM +0000, French, Nicholas A. wrote: > > > any reason why PAT can't be enabled for ivtvfb as simply as in the attached > > > patch? > > > > Prior to your change the OSD buffer was obtained using the itv->dec_mem + oi->video_rbase > > given itv->dec_mem was initialized via [...] > > itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET - oi->video_buffer_size, > > IVTV_DECODER_SIZE); > > Ah, I see. So my proposed ioremap_wc call was only "working" by aliasing the > ioremap_nocache()'d mem area and not actually using write combining at all. There are some debugging PAT toys out there I think but I haven't played with them yet or I forgot how to to confirm or deny this sort of effort, but likeley. > > So what I'd do is change the ioremap_nocache()'d size by substracting > > oi->video_buffer_size -- but then you have to ask yourself how you'd get > > that size. If its something you can figure out then great. > > Size is easy since its hardcoded, but unfortunately getting the offset of the > framebuffer inside the decoders memory to remove from the ioremap_nocache > call is a chicken and egg problem: the offset is determined by querying the > firmware that has been loaded to the decoder. the firmware itself will be > loaded after the ioremap_nocache call at an offset from the address it > returns. What I expected. Probably why no one had tried before to clean it up. > So unless there is a io-re-remap to change the caching status of a subset of > the decoder's memory once we find out what the framebuffer offset is inside > the original iremap_nocache'd area, then its a no go for write combining to > the framebuffer with PAT. No what if the framebuffer driver is just requested as a secondary step after firmware loading? > On the other hand, it works fine for me with a nocache'd framebuffer. It's > certainly better for me personally to have a nocache framebuffer with > PAT-enabled than the framebuffer completely disabled with PAT-enabled, but I > don't think I would even propose to rollback the x86 nopat requirement in > general. Apparently the throngs of people using this super-popular driver > feature haven't complained in the last couple years, so maybe its OK for me > to just patch the pat-enabled guard out and deal with a nocache'd > framebuffer. Nope, best you add a feature to just let you disable wc stuff, to enable life with PAT. Luis