From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753842AbbC0IhR (ORCPT ); Fri, 27 Mar 2015 04:37:17 -0400 Received: from filtteri1.pp.htv.fi ([213.243.153.184]:39974 "EHLO filtteri1.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488AbbC0IhM (ORCPT ); Fri, 27 Mar 2015 04:37:12 -0400 Date: Fri, 27 Mar 2015 10:37:04 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: "Luis R. Rodriguez" , luto@amacapital.net, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jgross@suse.com, JBeulich@suse.com, bp@suse.de, suresh.b.siddha@intel.com, venkatesh.pallipadi@intel.com, airlied@redhat.com, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, "Luis R. Rodriguez" , Ingo Molnar , Linus Torvalds , Daniel Vetter , Antonino Daplas , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Subject: Re: [PATCH v1 09/47] vidoe: fbdev: atyfb: remove and fix MTRR MMIO "hole" work around Message-ID: <20150327083703.GB22926@sci.fi> Mail-Followup-To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , "Luis R. Rodriguez" , luto@amacapital.net, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jgross@suse.com, JBeulich@suse.com, bp@suse.de, suresh.b.siddha@intel.com, venkatesh.pallipadi@intel.com, airlied@redhat.com, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, "Luis R. Rodriguez" , Ingo Molnar , Linus Torvalds , Daniel Vetter , Antonino Daplas , Jean-Christophe Plagniol-Villard , Tomi Valkeinen References: <1426893517-2511-1-git-send-email-mcgrof@do-not-panic.com> <1426893517-2511-10-git-send-email-mcgrof@do-not-panic.com> <20150321091514.GA22926@sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150321091514.GA22926@sci.fi> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 21, 2015 at 11:15:14AM +0200, Ville Syrjälä wrote: > On Fri, Mar 20, 2015 at 04:17:59PM -0700, Luis R. Rodriguez wrote: > > diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c > > index 8025624..8875e56 100644 > > --- a/drivers/video/fbdev/aty/atyfb_base.c > > +++ b/drivers/video/fbdev/aty/atyfb_base.c > > @@ -2630,21 +2630,10 @@ static int aty_init(struct fb_info *info) > > > > #ifdef CONFIG_MTRR > > par->mtrr_aper = -1; > > - par->mtrr_reg = -1; > > if (!nomtrr) { > > - /* Cover the whole resource. */ > > - par->mtrr_aper = mtrr_add(par->res_start, par->res_size, > > + par->mtrr_aper = mtrr_add(info->fix.smem_start, > > + info->fix.smem_len, > > MTRR_TYPE_WRCOMB, 1); > > MTRRs need power of two size, so how is this supposed to work? Still waiting for an answer... > > > - if (par->mtrr_aper >= 0 && !par->aux_start) { > > - /* Make a hole for mmio. */ > > - par->mtrr_reg = mtrr_add(par->res_start + 0x800000 - > > - GUI_RESERVE, GUI_RESERVE, > > - MTRR_TYPE_UNCACHABLE, 1); > > - if (par->mtrr_reg < 0) { > > - mtrr_del(par->mtrr_aper, 0, 0); > > - par->mtrr_aper = -1; > > - } > > - } > > } > > #endif > > > > @@ -2776,10 +2765,6 @@ aty_init_exit: > > par->pll_ops->set_pll(info, &par->saved_pll); > > > > #ifdef CONFIG_MTRR > > - if (par->mtrr_reg >= 0) { > > - mtrr_del(par->mtrr_reg, 0, 0); > > - par->mtrr_reg = -1; > > - } > > if (par->mtrr_aper >= 0) { > > mtrr_del(par->mtrr_aper, 0, 0); > > par->mtrr_aper = -1; > > @@ -3466,7 +3451,7 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, > > } > > > > info->fix.mmio_start = raddr; > > - par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000); > > + par->ati_regbase = ioremap_nocache(info->fix.mmio_start, 0x1000); > > if (par->ati_regbase == NULL) > > return -ENOMEM; > > > > @@ -3491,6 +3476,8 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, > > info->fix.smem_start = addr; > > info->fix.smem_len = 0x800000; > > > > + aty_fudge_framebuffer_len(info); > > + > > info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); > > if (info->screen_base == NULL) { > > ret = -ENOMEM; > > @@ -3563,6 +3550,7 @@ static int atyfb_pci_probe(struct pci_dev *pdev, > > return -ENOMEM; > > } > > par = info->par; > > + par->bus_type = PCI; > > info->fix = atyfb_fix; > > info->device = &pdev->dev; > > par->pci_id = pdev->device; > > @@ -3732,10 +3720,6 @@ static void atyfb_remove(struct fb_info *info) > > #endif > > > > #ifdef CONFIG_MTRR > > - if (par->mtrr_reg >= 0) { > > - mtrr_del(par->mtrr_reg, 0, 0); > > - par->mtrr_reg = -1; > > - } > > if (par->mtrr_aper >= 0) { > > mtrr_del(par->mtrr_aper, 0, 0); > > par->mtrr_aper = -1; > > -- > > 2.3.2.209.gd67f9d5.dirty > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- > Ville Syrjälä > syrjala@sci.fi > http://www.sci.fi/~syrjala/ -- Ville Syrjälä syrjala@sci.fi http://www.sci.fi/~syrjala/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Date: Fri, 27 Mar 2015 08:37:04 +0000 Subject: Re: [PATCH v1 09/47] vidoe: fbdev: atyfb: remove and fix MTRR MMIO "hole" work around Message-Id: <20150327083703.GB22926@sci.fi> List-Id: References: <1426893517-2511-1-git-send-email-mcgrof@do-not-panic.com> <1426893517-2511-10-git-send-email-mcgrof@do-not-panic.com> <20150321091514.GA22926@sci.fi> In-Reply-To: <20150321091514.GA22926@sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: "Luis R. Rodriguez" , luto@amacapital.net, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jgross@suse.com, JBeulich@suse.com, bp@suse.de, suresh.b.siddha@intel.com, venkatesh.pallipadi@intel.com, airlied@redhat.com, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, "Luis R. Rodriguez" , Ingo Molnar , Linus Torvalds , Daniel Vetter , Antonino Daplas , Jean-Christophe Plagniol-Villard , Tomi Valkeinen On Sat, Mar 21, 2015 at 11:15:14AM +0200, Ville Syrj=E4l=E4 wrote: > On Fri, Mar 20, 2015 at 04:17:59PM -0700, Luis R. Rodriguez wrote: > > diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev= /aty/atyfb_base.c > > index 8025624..8875e56 100644 > > --- a/drivers/video/fbdev/aty/atyfb_base.c > > +++ b/drivers/video/fbdev/aty/atyfb_base.c > > @@ -2630,21 +2630,10 @@ static int aty_init(struct fb_info *info) > > =20 > > #ifdef CONFIG_MTRR > > par->mtrr_aper =3D -1; > > - par->mtrr_reg =3D -1; > > if (!nomtrr) { > > - /* Cover the whole resource. */ > > - par->mtrr_aper =3D mtrr_add(par->res_start, par->res_size, > > + par->mtrr_aper =3D mtrr_add(info->fix.smem_start, > > + info->fix.smem_len, > > MTRR_TYPE_WRCOMB, 1); >=20 > MTRRs need power of two size, so how is this supposed to work? Still waiting for an answer... >=20 > > - if (par->mtrr_aper >=3D 0 && !par->aux_start) { > > - /* Make a hole for mmio. */ > > - par->mtrr_reg =3D mtrr_add(par->res_start + 0x800000 - > > - GUI_RESERVE, GUI_RESERVE, > > - MTRR_TYPE_UNCACHABLE, 1); > > - if (par->mtrr_reg < 0) { > > - mtrr_del(par->mtrr_aper, 0, 0); > > - par->mtrr_aper =3D -1; > > - } > > - } > > } > > #endif > > =20 > > @@ -2776,10 +2765,6 @@ aty_init_exit: > > par->pll_ops->set_pll(info, &par->saved_pll); > > =20 > > #ifdef CONFIG_MTRR > > - if (par->mtrr_reg >=3D 0) { > > - mtrr_del(par->mtrr_reg, 0, 0); > > - par->mtrr_reg =3D -1; > > - } > > if (par->mtrr_aper >=3D 0) { > > mtrr_del(par->mtrr_aper, 0, 0); > > par->mtrr_aper =3D -1; > > @@ -3466,7 +3451,7 @@ static int atyfb_setup_generic(struct pci_dev *pd= ev, struct fb_info *info, > > } > > =20 > > info->fix.mmio_start =3D raddr; > > - par->ati_regbase =3D ioremap(info->fix.mmio_start, 0x1000); > > + par->ati_regbase =3D ioremap_nocache(info->fix.mmio_start, 0x1000); > > if (par->ati_regbase =3D NULL) > > return -ENOMEM; > > =20 > > @@ -3491,6 +3476,8 @@ static int atyfb_setup_generic(struct pci_dev *pd= ev, struct fb_info *info, > > info->fix.smem_start =3D addr; > > info->fix.smem_len =3D 0x800000; > > =20 > > + aty_fudge_framebuffer_len(info); > > + > > info->screen_base =3D ioremap(info->fix.smem_start, info->fix.smem_le= n); > > if (info->screen_base =3D NULL) { > > ret =3D -ENOMEM; > > @@ -3563,6 +3550,7 @@ static int atyfb_pci_probe(struct pci_dev *pdev, > > return -ENOMEM; > > } > > par =3D info->par; > > + par->bus_type =3D PCI; > > info->fix =3D atyfb_fix; > > info->device =3D &pdev->dev; > > par->pci_id =3D pdev->device; > > @@ -3732,10 +3720,6 @@ static void atyfb_remove(struct fb_info *info) > > #endif > > =20 > > #ifdef CONFIG_MTRR > > - if (par->mtrr_reg >=3D 0) { > > - mtrr_del(par->mtrr_reg, 0, 0); > > - par->mtrr_reg =3D -1; > > - } > > if (par->mtrr_aper >=3D 0) { > > mtrr_del(par->mtrr_aper, 0, 0); > > par->mtrr_aper =3D -1; > > --=20 > > 2.3.2.209.gd67f9d5.dirty > >=20 > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-fbdev" = in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html >=20 > --=20 > Ville Syrj=E4l=E4 > syrjala@sci.fi > http://www.sci.fi/~syrjala/ --=20 Ville Syrj=E4l=E4 syrjala@sci.fi http://www.sci.fi/~syrjala/