From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis R. Rodriguez" Date: Wed, 22 Apr 2015 15:33:48 +0000 Subject: Re: [PATCH v4 2/2] IB/qib: use arch_phys_wc_add() Message-Id: <20150422153348.GD5622@wotan.suse.de> List-Id: References: <1429653035-19424-1-git-send-email-mcgrof@do-not-panic.com> <1429653035-19424-3-git-send-email-mcgrof@do-not-panic.com> <1429710878.45956.94.camel@redhat.com> In-Reply-To: <1429710878.45956.94.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Doug Ledford Cc: "Luis R. Rodriguez" , infinipath-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org, mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cocci-/FJkirnvOdkvYVN+rsErww@public.gmane.org, Toshi Kani , Rickard Strandqvist , Mike Marciniszyn , Roland Dreier , Dennis Dalessandro , Suresh Siddha , Ingo Molnar , Thomas Gleixner , Juergen Gross , Daniel Vetter , Dave Airlie , Bjorn Helgaas , Antonino Daplas , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Dave On Wed, Apr 22, 2015 at 09:54:38AM -0400, Doug Ledford wrote: > On Tue, 2015-04-21 at 14:50 -0700, Luis R. Rodriguez wrote: > > This: > > + /* MTRR was used if this is non-zero */ > > + if (!dd->wc_cookie) > > vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); > > And this: > > + dd->wc_cookie = arch_phys_wc_add(pioaddr, piolen); > > + if (dd->wc_cookie < 0) > > + ret = -EINVAL; > > don't agree on what wc_cookie will be on error. Can you elaborate? The one below is the one that starts things, and arch_phys_wc_add() will return 0 on PAT systems. For non-PAT systems it will return a number > 0 *iff* a valid MTRR was added. It will return negative onloy on error then. The change above is meant to replace a check put in place to see if PAT was enabled. The way we replace this is to ensure that arch_phys_wc_add() returned 0. If you disagree it'd be great if you can elaborate why. Luis