From patchwork Sun Mar 29 10:57:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 11463973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7031D14B4 for ; Sun, 29 Mar 2020 10:58:03 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22CEF20732 for ; Sun, 29 Mar 2020 10:58:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22CEF20732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=cip-dev-bounces@lists.cip-project.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C1F012044A; Sun, 29 Mar 2020 10:58:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WfphmvnGoit7; Sun, 29 Mar 2020 10:58:01 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id BA1A220403; Sun, 29 Mar 2020 10:58:01 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9CFD8C07FF; Sun, 29 Mar 2020 10:58:01 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id DBECAC07FF for ; Sun, 29 Mar 2020 10:57:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C06C72044A for ; Sun, 29 Mar 2020 10:57:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MC3JoVq0fT-a for ; Sun, 29 Mar 2020 10:57:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by silver.osuosl.org (Postfix) with ESMTPS id 07AE520403 for ; Sun, 29 Mar 2020 10:57:57 +0000 (UTC) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id ED7071C0323; Sun, 29 Mar 2020 12:57:52 +0200 (CEST) Date: Sun, 29 Mar 2020 12:57:52 +0200 From: Pavel Machek To: Chris.Paterson2@renesas.com, ben.hutchings@codethink.co.uk, cip-dev@lists.cip-project.org Message-ID: <20200329105752.GA8804@duo.ucw.cz> MIME-Version: 1.0 User-Agent: Mutt/1.10.1 (2018-07-13) Subject: [cip-dev] 4.4-rt: Need testing on arm32 X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cip-dev-bounces@lists.cip-project.org Sender: "cip-dev" Hi! I tried to prepare next 4.4-rt release. I have code ready, but while running tests I realized that only two targets are used to run them. We 4.19-rt has known bugs breaking boot on de0-nano (and probably other) boards, and according to code inspection, same bug is present in 4.4-rt. Fix is not complex, but I'm not comfortable applying it without _any_ testing. If I'm right, 4.4-rt should be broken on socfpga boards (arm32) in non-realtime configuration; it should panic on boot in cca 50% of cases. Patch below should fix it. Best regards, Pavel commit 20124aef8572b764ffd90d836253153102c763c5 Author: Pavel Machek Date: Sat Mar 21 22:58:43 2020 +0100 With -rt tree but prempt-rt not enabled, de0-nano was getting failures during boot, such as this: https://lava.ciplatform.org/scheduler/job/13037 [ 6.813352] Freeing unused kernel memory: 1024K [ 6.817927] Unable to handle kernel paging request at virtual address e7fddef0 [ 6.825121] pgd = (ptrval) [ 6.827816] [e7fddef0] *pgd=27e1141e(bad) [ 6.831818] Internal error: Oops: 8000000d [#1] SMP ARM [ 6.837019] Modules linked in: [ 6.840067] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.106-cip21-gc82fe0af5 #1 [ 6.847601] Hardware name: Altera SOCFPGA [ 6.851596] PC is at 0xe7fddef0 [ 6.854733] LR is at irq_work_run_list+0x84/0xc0 Bisect revealed fc9f4631a290 is the problematic commit, and some code auditing revealed that it is working with wrong list. Fix it. Signed-off-by: Pavel Machek Fixes: fc9f4631a290 ("irqwork: push most work into softirq context") diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 2899ba0d23d1..19896e6f1b2a 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -78,7 +78,8 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) if (!irq_work_claim(work)) return false; - if (IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) + if ((IS_ENABLED(CONFIG_PREEMPT_RT_FULL) && !(work->flags & IRQ_WORK_HARD_IRQ)) + || (work->flags & IRQ_WORK_LAZY)) list = &per_cpu(lazy_list, cpu); else list = &per_cpu(raised_list, cpu);