From patchwork Fri Nov 13 16:10:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 1399914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=qCKhKMuX; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=JI7mWy+j; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CXk312z4dz9sTc for ; Sat, 14 Nov 2020 03:10:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgKMQKe (ORCPT ); Fri, 13 Nov 2020 11:10:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbgKMQKd (ORCPT ); Fri, 13 Nov 2020 11:10:33 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32405C0617A6 for ; Fri, 13 Nov 2020 08:10:33 -0800 (PST) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605283831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AtTI7NFycMlcXCxrx0rhwpmFlRCD+YdkiRGEFXOES9w=; b=qCKhKMuXBw9aE8dNEVCXvfu774/HzCHTzrEKWkLDK/Vss2c7EWZDA0SDrG8jw6jcx/7DIH Ns4zhQQ7R33PZDUxQdK7M03lfKzXr2qXSnIqwEwE+6mE23iKh7n4yM3u8XjT8wKk8YQLKK ANJXJukENLDOUjdB50tfAFjd7/XQ2asmud6DWv4KSN1FhrzocEYb/rQjFI7CScxQXvjMOo ccyOctEvwD2QO9sbXhtMNwczqfVJgJakgGWAo54D1h3/Hr+MzE69PyNDcRQDV1yTF5Wu/U PcKov0+taEGkFGNyKP58C77aFs2etKTY2jT0TszllWLhbFmK7fqu/XGAjAEi5Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605283831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AtTI7NFycMlcXCxrx0rhwpmFlRCD+YdkiRGEFXOES9w=; b=JI7mWy+j4k+Cnt5A5ZtrtGSn8spL4EZTf2lW7zZKgXfJFXLJvWwLclXX8D6YHefkXBFCfO gqFP2w9m/f1iM+CA== To: linux-ide@vger.kernel.org Cc: Andrew Morton , Thomas Gleixner , Sebastian Andrzej Siewior , "David S. Miller" Subject: [PATCH 1/2] ide/Falcon: Remove in_interrupt() usage. Date: Fri, 13 Nov 2020 17:10:20 +0100 Message-Id: <20201113161021.2217361-2-bigeasy@linutronix.de> In-Reply-To: <20201113161021.2217361-1-bigeasy@linutronix.de> References: <20201113161021.2217361-1-bigeasy@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org falconide_get_lock() is called by ide_lock_host() and its caller (ide_issue_rq()) has already a might_sleep() check. stdma_lock() has wait_event() which also has a might_sleep() check. Remove the in_interrupt() check. Cc: "David S. Miller" Cc: linux-ide@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/ide/falconide.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c index dbeb2605e5f6e..77af4c1a3f38c 100644 --- a/drivers/ide/falconide.c +++ b/drivers/ide/falconide.c @@ -51,8 +51,6 @@ static void falconide_release_lock(void) static void falconide_get_lock(irq_handler_t handler, void *data) { if (falconide_intr_lock == 0) { - if (in_interrupt() > 0) - panic("Falcon IDE hasn't ST-DMA lock in interrupt"); stdma_lock(handler, data); falconide_intr_lock = 1; } From patchwork Fri Nov 13 16:10:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 1399912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=sP2lOmN3; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=1sxM/Vfs; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CXk306hfbz9sTR for ; Sat, 14 Nov 2020 03:10:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbgKMQKe (ORCPT ); Fri, 13 Nov 2020 11:10:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgKMQKd (ORCPT ); Fri, 13 Nov 2020 11:10:33 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66211C0617A7 for ; Fri, 13 Nov 2020 08:10:33 -0800 (PST) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605283831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1w3yjPRtORE4NOObQSdQ4B9t7jLlM7676y+/oFEEmaY=; b=sP2lOmN3Mpyie297gMiayh6rEui1hL+XRvLYpAKJAejrLVx67XR6SREXJmJYOm6EEUFVy1 JQKbLJuFutHQ9KaBX+IHoepZMUTEr8qL6jVIv5BpNNgVq3Fb08nBoMwF4NkZBqLidRUkyc Z6sEhRPoiy7fAcVw00fDVaLRmapaW1iZ+zHOiwCRQ7EJWQHMpIsvGsh2zBg02r2XRdXxYE eXcIMvj9FVUeAvTmmgmGhLwZfXbACuQ+5DbH075yfl6we67uEU0X6RYhg+a6fUyalzRRrC EiHAn3Dom8qeGARpe8R6QJNkuIQHnsNID7D0et17LnyH2PcfgcV+Vnitwedj2w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605283831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1w3yjPRtORE4NOObQSdQ4B9t7jLlM7676y+/oFEEmaY=; b=1sxM/VfsPpp3PYsgiq+HtZVs/29n9HnDocrukQWU3AZ6E3ATtenRYwTimhzOEQfI6OTKNU NFFUK0TM8jpz85Dg== To: linux-ide@vger.kernel.org Cc: Andrew Morton , Thomas Gleixner , Sebastian Andrzej Siewior , "David S. Miller" Subject: [PATCH 2/2] ide: Remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister() Date: Fri, 13 Nov 2020 17:10:21 +0100 Message-Id: <20201113161021.2217361-3-bigeasy@linutronix.de> In-Reply-To: <20201113161021.2217361-1-bigeasy@linutronix.de> References: <20201113161021.2217361-1-bigeasy@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Both BUG_ON() 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. Cc: "David S. Miller" Cc: linux-ide@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/ide/ide-probe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 1c1567bb51942..aefd74c0d8628 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1539,9 +1539,6 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices); static void ide_unregister(ide_hwif_t *hwif) { - BUG_ON(in_interrupt()); - BUG_ON(irqs_disabled()); - mutex_lock(&ide_cfg_mtx); if (hwif->present) {