From patchwork Tue Dec 15 03:03:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11973611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32D00C4361B for ; Tue, 15 Dec 2020 03:03:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D6327223E0 for ; Tue, 15 Dec 2020 03:03:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6327223E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 798916B0072; Mon, 14 Dec 2020 22:03:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 76DC76B0073; Mon, 14 Dec 2020 22:03:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6844F6B0074; Mon, 14 Dec 2020 22:03:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 52A4B6B0072 for ; Mon, 14 Dec 2020 22:03:30 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1D465180AD837 for ; Tue, 15 Dec 2020 03:03:30 +0000 (UTC) X-FDA: 77594020980.01.bed01_0c0834227420 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id E60781004646D for ; Tue, 15 Dec 2020 03:03:29 +0000 (UTC) X-HE-Tag: bed01_0c0834227420 X-Filterd-Recvd-Size: 2611 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Dec 2020 03:03:29 +0000 (UTC) Date: Mon, 14 Dec 2020 19:03:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608001408; bh=jJPG+A7ilcZMCAw2TU2tp2dNhFz5CptulM8mfDbkyxk=; h=From:To:Subject:In-Reply-To:From; b=dg9zHVpxs8Znmt2fnrkP9GgpGIZVBxBar3aGfY9qPIbVHTRNMUhn0+Z5Hl7wUoxwD c8TTzzH7eAwUKdAtLb+AdwrBfAYNMtTgcouA/t0ZXuOuqg40E1ewgcIVagxqiniSMM +0wBN1alMhWkEZ7Ljo1LVTT9lOIfW3h6zVUiU01k= From: Andrew Morton To: akpm@linux-foundation.org, axboe@kernel.dk, bigeasy@linutronix.de, davem@davemloft.net, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 005/200] ide: remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister() Message-ID: <20201215030327.1xgifoCou%akpm@linux-foundation.org> In-Reply-To: <20201214190237.a17b70ae14f129e2dca3d204@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Sebastian Andrzej Siewior Subject: ide: remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister() In the discussion about preempt count consistency across kernel configurations: https://lore.kernel.org/r/20200914204209.256266093@linutronix.de/ it was concluded that the usage of in_interrupt() and related context checks should be removed from non-core code. Both BUG_ON()s in ide-probe.c were introduced in commit 4015c949fb465 ("[PATCH] update ide core") when ide_unregister() was extended with semaphore based locking. Both checks won't complain about disabled preemption which is also wrong. The might_sleep() in today's mutex_lock() will complain about the missuses. Remove the BUG_ON() statements. Link: https://lkml.kernel.org/r/20201120092421.1023428-3-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Jens Axboe Cc: "David S. Miller" Signed-off-by: Andrew Morton --- drivers/ide/ide-probe.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/ide/ide-probe.c~ide-remove-bug_onin_interrupt-irqs_disabled-from-ide_unregister +++ a/drivers/ide/ide-probe.c @@ -1592,9 +1592,6 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_de static void ide_unregister(ide_hwif_t *hwif) { - BUG_ON(in_interrupt()); - BUG_ON(irqs_disabled()); - mutex_lock(&ide_cfg_mtx); if (hwif->present) {