From patchwork Mon Feb 29 08:24:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 8450241 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF4CD9FC55 for ; Mon, 29 Feb 2016 08:25:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1492E200E6 for ; Mon, 29 Feb 2016 08:25:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB6F0202E5 for ; Mon, 29 Feb 2016 08:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752698AbcB2IYx (ORCPT ); Mon, 29 Feb 2016 03:24:53 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:44005 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752464AbcB2IYv convert rfc822-to-8bit (ORCPT ); Mon, 29 Feb 2016 03:24:51 -0500 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Feb 2016 08:24:49 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Feb 2016 08:24:46 -0000 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: dahi@linux.vnet.ibm.com X-IBM-RcptTo: linux-renesas-soc@vger.kernel.org;linux-sh@vger.kernel.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6A88117D8056; Mon, 29 Feb 2016 08:25:09 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1T8OjUH65142788; Mon, 29 Feb 2016 08:24:45 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1T8OjAl026165; Mon, 29 Feb 2016 01:24:45 -0700 Received: from thinkpad-w530 (dyn-9-152-224-42.boeblingen.de.ibm.com [9.152.224.42]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u1T8Oi9Q026118; Mon, 29 Feb 2016 01:24:44 -0700 Date: Mon, 29 Feb 2016 09:24:41 +0100 From: David Hildenbrand To: Hans Verkuil Cc: John Paul Adrian Glaubitz , Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, Simon Horman , Linux-sh list Subject: Re: sh7724 regression: commit 8222dbe21e79338de92d5e1956cd1e3994cc9f93 Message-ID: <20160229092441.2e999f8d@thinkpad-w530> In-Reply-To: <56D1B3D6.8010103@xs4all.nl> References: <56D1A99E.5080908@xs4all.nl> <56D1B28C.2030600@physik.fu-berlin.de> <56D1B3D6.8010103@xs4all.nl> Organization: IBM Deutschland GmbH X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022908-0025-0000-0000-0000092AE866 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > On 02/27/2016 03:28 PM, John Paul Adrian Glaubitz wrote: > > Hi Hans! > > > > On 02/27/2016 03:20 PM, Geert Uytterhoeven wrote: > >>> I noticed that 4.1 was ok and v4.2 wasn't, so I did a git bisect and ended up with > >>> commit 8222dbe21e79338de92d5e1956cd1e3994cc9f93 (sched/preempt, mm/fault: Decouple > >>> preemption from the page fault logic) as the culprit. > > > > If you like, please report this the kernel bug tracker and set > > "Hardware" to "SuperH". This way we are able to keep track of > > the issue. > > > > I think Yoshinori Sato and Rich Felker will have a look at this. > > > > Adrian > > > > Done: https://bugzilla.kernel.org/show_bug.cgi?id=113321 > > Regards, > > Hans > Looks like the code then requires to not be allowed to sleep/preempt in these sections (just like kmap_atomic, or kmap_coherent on mips). So the fix should be simple as (untested): From d29f0d0cb670175c688cdd181c7a693d28b27a33 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Mon, 29 Feb 2016 09:19:24 +0100 Subject: [PATCH] sched/preempt, sh: kmap_coherent relies on disabled preemption kmap_coherent needs disabled preemption to not schedule in the critical section, just like kmap_coherent on mips and kmap_atomic in general. Fixes: 8222dbe21e79 "sched/preempt, mm/fault: Decouple preemption from the page fault logic" Reported-by: Hans Verkuil Signed-off-by: David Hildenbrand --- arch/sh/mm/kmap.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.3.9 David Tested-by: Hans Verkuil diff --git a/arch/sh/mm/kmap.c b/arch/sh/mm/kmap.c index ec29e14..bf25d7c 100644 --- a/arch/sh/mm/kmap.c +++ b/arch/sh/mm/kmap.c @@ -36,6 +36,7 @@ void *kmap_coherent(struct page *page, unsigned long addr) BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); + preempt_disable(); pagefault_disable(); idx = FIX_CMAP_END - @@ -64,4 +65,5 @@ void kunmap_coherent(void *kvaddr) } pagefault_enable(); + preempt_enable(); }