Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933390AbbGUUpA (ORCPT ); Tue, 21 Jul 2015 16:45:00 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:51553 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932835AbbGUUoq (ORCPT ); Tue, 21 Jul 2015 16:44:46 -0400 Message-ID: <1437511418.3214.233.camel@hp.com> Subject: Re: Regression in v4.2-rc1: vmalloc_to_page with ioremap From: Toshi Kani To: Ashutosh Dixit Cc: "linux-kernel@vger.kernel.org" , "Dutt, Sudeep" , "Rao, Nikhil" , "Williams, Dan J" Date: Tue, 21 Jul 2015 14:43:38 -0600 In-Reply-To: <1437511150.3214.230.camel@hp.com> References: <6DC2528F945B4149AB6566DFB5F22ED39BC5540B@ORSMSX115.amr.corp.intel.com> <1437407695.3214.156.camel@hp.com> <1437407942.3214.159.camel@hp.com> <1437420078.3214.185.camel@hp.com> <1437511150.3214.230.camel@hp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.3 (3.16.3-2.fc22) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1597 Lines: 39 On Tue, 2015-07-21 at 14:39 -0600, Toshi Kani wrote: > On Tue, 2015-07-21 at 08:17 -0700, Ashutosh Dixit wrote: > > On Mon, Jul 20 2015 at 12:21:18 PM, Toshi Kani : > > Yes, you are correct, the 'struct page' pointer returned by > > vmalloc_to_page does not point to a "real" struct page entry. Neither > > have we allocated a struct page for the range. However, because we pass > > the returned pointer to streaming DMA mapping API's > > (dma_map_ops->dma_map_sg or dma_map_ops->dma_map_page) and all those > > functions do is call page_to_phys, they only care about the physical > > address, it used to work. > > > > Would it be possible to have a different API which can do this or can > > vmalloc_to_page be updated to handle huge ioremaps without crashing? > > Or > > would you have a suggestion for doing this differently? > > You can do the following instead. If you have the physical address > already > (i.e. the address you passed to ioremap), you can skip > slow_virt_to_phys(). > pfn_to_page() is a hack for the time being so that you can use the same > DMA mapping APIs. > > phys = slow_virt_to_phys(vaddr); > page = pfn_to_page(phys >> PAGE_SHIFT); Forgot to mention. slow_virt_to_phys() is only defined in x86, but I think your driver is x86-only. Let me know if this is a problem. Thanks, -Toshi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/