From patchwork Wed Dec 23 11:14:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 560458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D869140C28 for ; Wed, 23 Dec 2015 22:15:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aBhOD-0005kV-QH; Wed, 23 Dec 2015 11:15:29 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aBhOB-0004Xd-5B for linux-snps-arc@lists.infradead.org; Wed, 23 Dec 2015 11:15:28 +0000 Received: from dc8secmta2.synopsys.com (dc8secmta2.synopsys.com [10.13.218.202]) by smtprelay.synopsys.com (Postfix) with ESMTP id 8D7E624E09E7; Wed, 23 Dec 2015 03:15:04 -0800 (PST) Received: from dc8secmta2.internal.synopsys.com (dc8secmta2.internal.synopsys.com [127.0.0.1]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 6B9E3A4114; Wed, 23 Dec 2015 03:15:04 -0800 (PST) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 2AEE8A4102; Wed, 23 Dec 2015 03:15:04 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 10680374; Wed, 23 Dec 2015 03:15:04 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2-vip.internal.synopsys.com [10.12.239.238]) by mailhost.synopsys.com (Postfix) with ESMTP id 8CD9635C; Wed, 23 Dec 2015 03:15:02 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 23 Dec 2015 03:15:02 -0800 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 23 Dec 2015 16:45:00 +0530 Received: from [10.12.197.182] (10.12.197.182) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 23 Dec 2015 16:44:59 +0530 Subject: Re: ARC AXS101 problems with linux next-20151221 To: Christoph Hellwig References: <56784531.1000007@synopsys.com> From: Vineet Gupta Message-ID: <567A8226.80308@synopsys.com> Date: Wed, 23 Dec 2015 16:44:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56784531.1000007@synopsys.com> X-Originating-IP: [10.12.197.182] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151223_031527_363302_F4C62E41 X-CRM114-Status: GOOD ( 15.89 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [198.182.47.9 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Brodkin , Carlos Palminha , lkml , "linux-mm@kvack.org" , Andrew Morton , "linux-snps-arc@lists.infradead.org" Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi Christoph, Andrew > On Tuesday 22 December 2015 12:00 AM, Carlos Palminha wrote: > Hi guys, > > I just compiled the kernel for axs101_defconfig based on linux next tag 'next-20151221'. > I can't boot it due to the following errors causing strange stack traces after freeing unused kernel memory (check log below). > > Any clue? > Do you more info to understand the issue? ....[snip] > dw_mmc e0015000.mmc: IDMAC supports 32-bit address mode. > dw_mmc e0015000.mmc: Using internal DMA controller. > dw_mmc e0015000.mmc: Version ID is 270a > dw_mmc e0015000.mmc: DW MMC controller at irq 34,32 bit host data width,16 deep fifo > dw_mmc e0015000.mmc: 1 slots initialized > sdhci-pltfm: SDHCI platform and OF driver helper > usbcore: registered new interface driver usbhid > usbhid: USB HID core driver > NET: Registered protocol family 17 > NET: Registered protocol family 15 > ttyS3 - failed to request DMA > Freeing unused kernel memory: 928K (80002000 - 800ea000) > INFO: rcu_preempt self-detected stall on CPU > 0-...: (2100 ticks this GP) idle=011/140000000000001/0 softirq=92/92 fqs=0 > (t=2100 jiffies g=-261 c=-262 q=60) > rcu_preempt kthread starved for 2100 jiffies! g4294967035 c4294967034 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 > rcu_preempt S 8053879e 0 7 2 0x00000000 > > Stack Trace: > __switch_to+0x0/0x94 > __schedule+0x1c2/0x724 > schedule+0x2a/0x74 > schedule_timeout+0x126/0x198 > rcu_gp_kthread+0x5fa/0xee8 > kthread+0xe2/0xf4 > ret_from_fork+0x18/0x1c > Task dump for CPU 0: > kworker/0:1 R running 0 19 2 0x00000008 > Workqueue: events_freezable mmc_rescan [snip] It seems the dma ops rework for ARC makes kernel belly up. Patch below fixes it. -------------> From 96b44b39dc39542894a1081e683bd21f56cae1d1 Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Wed, 23 Dec 2015 15:41:20 +0530 Subject: [PATCH] ARC: dma mapping fixes #2 Carlos Palminha reported linux-next boot broken for ARC. (1) dma_map_single() would recursively call itself | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) | dma_map_single_attrs | ops->map_page | arc_dma_map_page | dma_map_single (2) arc_dma_free() to iounmap if memory is coherent Signed-off-by: Vineet Gupta --- arch/arc/mm/dma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg, diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c index 695029f41a48..01eaf88bf821 100644 --- a/arch/arc/mm/dma.c +++ b/arch/arc/mm/dma.c @@ -72,8 +72,8 @@ static void *arc_dma_alloc(struct device *dev, size_t size, static void arc_dma_free(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle, struct dma_attrs *attrs) { - if (!(is_isa_arcv2() && ioc_exists) || - dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs)) + if (!dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs) && + !(is_isa_arcv2() && ioc_exists)) iounmap((void __force __iomem *)vaddr); free_pages_exact((void *)dma_handle, size); @@ -107,7 +107,8 @@ static dma_addr_t arc_dma_map_page(struct device *dev, struct page *page, struct dma_attrs *attrs) { unsigned long paddr = page_to_phys(page) + offset; - return dma_map_single(dev, (void *)paddr, size, dir); + _dma_cache_sync(paddr, size, dir); + return (dma_addr_t)paddr; }