From patchwork Mon Apr 9 00:22:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132984 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp732887ljb; Sun, 8 Apr 2018 19:50:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/UzU4spSeZHhBNkAv+FuhaquhiGgVUc4IUSkTs4D1BP/kmKdj2LiBoxeh1WM/d5PGPIOR5 X-Received: by 10.99.115.84 with SMTP id d20mr23828627pgn.362.1523242210568; Sun, 08 Apr 2018 19:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523242210; cv=none; d=google.com; s=arc-20160816; b=ccYGtbWPtJeLEmzcQzzgDB1RbQBPeAQfB03MdSIw/GyBtHuUqtm5PLwhdp4Qk7qCEs 7d8Dv+yiNpaPYda9LyZL93buZfiRSDBpKC56pYXzgY3d+5mjYrvcpEbyy9cdzg6WlPdM a51LheUyEE3c/9Hu2/M2gQFRnO85XGFqBgh946Lk4or5Kmzd/xCcTYpQiCM5nehLtN3W oamz4Cpi++QSqnTn4CgJyPJu8RZpXTo8rs+Gcx/4qz0SCU8ikdPM93KmrMw6pTCy4TGP 1H1cWQu12G2b9SF1DjN+3DAk1QTwLxgC4oqUwn7cnUiNkubpqBxPz6gEphGBvcTBwkw8 Y1Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/2Q7BDTX5laciXSJBEK8RmhsqJ1fdR/6W6U9pYji35s=; b=0h0+71wqe/UPB42bXpSNYAmVeQQgUKaHkuj6JrJ+p6eTtsY36vrEYHwLit6F91xdCv G/5xVDxbBGlml/nj2VpaJzYkOfoswVV+E4212iSLMCp7EqXE3GRj79gzYIoVG0FzJ6Fy zVSTJU9He6eil6uW56zHovlloQN8A2ktwB9axnmxW4eKhXWJXqs/66qzsEO78DDpzxn4 ZqFSHccRVlfLo4G1PRhbmSr6FkwyQNRdHA/pYccqVigq+7b8Do76BeT6CmqyjQr/kGI6 afnnxxY7wCNahHJwnSJJRKux4BQ3T959VV7MOh18LGcGvAFE+ftSKPRcFKCpVS1jk5+I H8hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=OuVTe6DH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6-v6si3137969plz.27.2018.04.08.19.50.10; Sun, 08 Apr 2018 19:50:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=OuVTe6DH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933256AbeDICuF (ORCPT + 29 others); Sun, 8 Apr 2018 22:50:05 -0400 Received: from mail-by2nam01on0099.outbound.protection.outlook.com ([104.47.34.99]:2811 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755360AbeDIA0e (ORCPT ); Sun, 8 Apr 2018 20:26:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/2Q7BDTX5laciXSJBEK8RmhsqJ1fdR/6W6U9pYji35s=; b=OuVTe6DH7xR7EXqYRQVyLSdo1b9nqOazHewN9ZR+rsIQAsfJqgLhu5W/UljGVhuybPwvBLHg1Oa+2SFH34z6x4jfqlNr+zGcuJYm8VjoGW6wjHWWcJ/Y/19ejwUajCGbLTC8qwHwCnHeX6R8/7RTqS9p4dIX3jEsSa+hUn9y350= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1015.namprd21.prod.outlook.com (52.132.133.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:28 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:28 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Mark Salter , Marc Zyngier , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 161/161] irqchip/gic-v3: Change pr_debug message to pr_devel Thread-Topic: [PATCH AUTOSEL for 4.14 161/161] irqchip/gic-v3: Change pr_debug message to pr_devel Thread-Index: AQHTz5jLRCly1kzllk2wGeDYrsUfxQ== Date: Mon, 9 Apr 2018 00:22:07 +0000 Message-ID: <20180409001936.162706-161-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1015; 7:B53CpvK+WjtFJPhGxozLjphx0nPVK2OShtaWlPjq7NMEHjaqzhobPIsWjlrHmQQQhwpyMWIItWDvKYMCNkF+6+C4vv7Z/kX2XOL6UPiXXmkC1JZFfGgNdTH2yScvjqx7BtT26T/hpQMmueBOlVL4NybV873Bt38I54/YnG22nUUNSLM5OjwQWLqPkAW01zpcXJR+MC3qu93jzKrcUTF8dRyzporlpeA10a/tNxW88ZHSZ6f5RWekVz4ajj4nODh7; 20:Xq8/PgX0NCLXyXzaqwW7LZdVLn6RZnePMbDZ4k0atGbMvohlMv5bdNC90TalEuJ62stvqLqjKlr7Ox0XvXFNbG7OFTwSfErO9Zuhi0zYRVtcDMiKDQY5nZU8lqVHIezxLvXHAYUGFZY4WhG4rKiazWYdYFEnVPn03mM2EuzTDkI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 7e6907b3-1a84-4181-9c21-08d59db08981 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1015; x-ms-traffictypediagnostic: DM5PR2101MB1015: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1015; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1015; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(189003)(199004)(53936002)(4326008)(478600001)(72206003)(3280700002)(2616005)(14454004)(305945005)(5250100002)(3660700001)(2501003)(2900100001)(54906003)(110136005)(86362001)(1076002)(107886003)(6506007)(36756003)(446003)(68736007)(6512007)(7736002)(486006)(2906002)(15650500001)(5660300001)(6436002)(3846002)(86612001)(6486002)(66066001)(11346002)(476003)(6666003)(59450400001)(26005)(10090500001)(316002)(22452003)(8676002)(81156014)(81166006)(6116002)(105586002)(99286004)(186003)(106356001)(76176011)(25786009)(97736004)(10290500003)(102836004)(8936002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1015; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1oTQ1iwLYpojFCM7HRsQFBqr9J247EKoUWmbNs6mvvWeSZ9h6L1gtlNyJd38eQ3OpvhLaCDOV7ETgT/qlsMXQlb+bjxVvXg2XGkxEfNLSVsPEb3QnJ1kGRnsHlFCeQuQjqZ2XKGPQYCcQy7HD4LNoHsdqsila95RJuObc50v4XBvDeaVXr4r7+wLp2oMOnbUxTVz7/AgnpryPt1kYxSXLV+N03yi9lbyELaXfoA5purAiAwphASQGSM83tduWwfkzSgMTYfkV5BdatcOJZ0yauVudDQoBdT9Fiy0IjuJ/OpoxJdsFIGCQg2gaXBq49PtAfVSer5yWRh8c9DVDRaVAQapCnenntC6C7A9q0Yb/5NkHqKxciJPt8jzVN48KxjCCe0Nwk7Hnh2vK6gTlNLwOMMMroRrf5thX5F9drmJmVs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e6907b3-1a84-4181-9c21-08d59db08981 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:22:07.7997 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1015 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Salter [ Upstream commit b6dd4d83dc2f78cebc9a7e6e7e4bc2be4d29b94d ] The pr_debug() in gic-v3 gic_send_sgi() can trigger a circular locking warning: GICv3: CPU10: ICC_SGI1R_EL1 5000400 ====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #1 Tainted: G W ------------------------------------------------------ dynamic_debug01/1873 is trying to acquire lock: ((console_sem).lock){-...}, at: [<0000000099c891ec>] down_trylock+0x20/0x4c but task is already holding lock: (&rq->lock){-.-.}, at: [<00000000842e1587>] __task_rq_lock+0x54/0xdc which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rq->lock){-.-.}: __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock+0x4c/0x60 task_fork_fair+0x3c/0x148 sched_fork+0x10c/0x214 copy_process.isra.32.part.33+0x4e8/0x14f0 _do_fork+0xe8/0x78c kernel_thread+0x48/0x54 rest_init+0x34/0x2a4 start_kernel+0x45c/0x488 -> #1 (&p->pi_lock){-.-.}: __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 try_to_wake_up+0x48/0x600 wake_up_process+0x28/0x34 __up.isra.0+0x60/0x6c up+0x60/0x68 __up_console_sem+0x4c/0x7c console_unlock+0x328/0x634 vprintk_emit+0x25c/0x390 dev_vprintk_emit+0xc4/0x1fc dev_printk_emit+0x88/0xa8 __dev_printk+0x58/0x9c _dev_info+0x84/0xa8 usb_new_device+0x100/0x474 hub_port_connect+0x280/0x92c hub_event+0x740/0xa84 process_one_work+0x240/0x70c worker_thread+0x60/0x400 kthread+0x110/0x13c ret_from_fork+0x10/0x18 -> #0 ((console_sem).lock){-...}: validate_chain.isra.34+0x6e4/0xa20 __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 down_trylock+0x20/0x4c __down_trylock_console_sem+0x3c/0x9c console_trylock+0x20/0xb0 vprintk_emit+0x254/0x390 vprintk_default+0x58/0x90 vprintk_func+0xbc/0x164 printk+0x80/0xa0 __dynamic_pr_debug+0x84/0xac gic_raise_softirq+0x184/0x18c smp_cross_call+0xac/0x218 smp_send_reschedule+0x3c/0x48 resched_curr+0x60/0x9c check_preempt_curr+0x70/0xdc wake_up_new_task+0x310/0x470 _do_fork+0x188/0x78c SyS_clone+0x44/0x50 __sys_trace_return+0x0/0x4 other info that might help us debug this: Chain exists of: (console_sem).lock --> &p->pi_lock --> &rq->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rq->lock); lock(&p->pi_lock); lock(&rq->lock); lock((console_sem).lock); *** DEADLOCK *** 2 locks held by dynamic_debug01/1873: #0: (&p->pi_lock){-.-.}, at: [<000000001366df53>] wake_up_new_task+0x40/0x470 #1: (&rq->lock){-.-.}, at: [<00000000842e1587>] __task_rq_lock+0x54/0xdc stack backtrace: CPU: 10 PID: 1873 Comm: dynamic_debug01 Tainted: G W 4.15.0+ #1 Hardware name: GIGABYTE R120-T34-00/MT30-GS2-00, BIOS T48 10/02/2017 Call trace: dump_backtrace+0x0/0x188 show_stack+0x24/0x2c dump_stack+0xa4/0xe0 print_circular_bug.isra.31+0x29c/0x2b8 check_prev_add.constprop.39+0x6c8/0x6dc validate_chain.isra.34+0x6e4/0xa20 __lock_acquire+0x3b4/0x6e0 lock_acquire+0xf4/0x2a8 _raw_spin_lock_irqsave+0x58/0x70 down_trylock+0x20/0x4c __down_trylock_console_sem+0x3c/0x9c console_trylock+0x20/0xb0 vprintk_emit+0x254/0x390 vprintk_default+0x58/0x90 vprintk_func+0xbc/0x164 printk+0x80/0xa0 __dynamic_pr_debug+0x84/0xac gic_raise_softirq+0x184/0x18c smp_cross_call+0xac/0x218 smp_send_reschedule+0x3c/0x48 resched_curr+0x60/0x9c check_preempt_curr+0x70/0xdc wake_up_new_task+0x310/0x470 _do_fork+0x188/0x78c SyS_clone+0x44/0x50 __sys_trace_return+0x0/0x4 GICv3: CPU0: ICC_SGI1R_EL1 12000 This could be fixed with printk_deferred() but that might lessen its usefulness for debugging. So change it to pr_devel to keep it out of production kernels. Developers working on gic-v3 can enable it as needed in their kernels. Signed-off-by: Mark Salter Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index ae9ff72e83ee..4d4d46dc1a6d 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -645,7 +645,7 @@ static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq) MPIDR_TO_SGI_AFFINITY(cluster_id, 1) | tlist << ICC_SGI1R_TARGET_LIST_SHIFT); - pr_debug("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val); + pr_devel("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val); gic_write_sgi1r(val); }