linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "bigeasy@linutronix.de" <bigeasy@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	"nab@linux-iscsi.org" <nab@linux-iscsi.org>
Cc: Bart Van Assche <Bart.VanAssche@wdc.com>,
	"acme@kernel.org" <acme@kernel.org>,
	"daniel@bristot.me" <daniel@bristot.me>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"williams@redhat.com" <williams@redhat.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"lclaudio@redhat.com" <lclaudio@redhat.com>,
	"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
	"linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>
Subject: [PATCH 1/2] target: drop spin_lock_assert() + irqs_disabled() combo checks
Date: Fri, 23 Mar 2018 18:17:36 +0100	[thread overview]
Message-ID: <20180323171736.bcyi2oiolge4l6hl@linutronix.de> (raw)
In-Reply-To: <CA+55aFxVkuntSektVmwXktzvfEezdDTAM_zj4DJdp3qJxWf8aA@mail.gmail.com>

There are a few functions which check for if the lock is held
(spin_lock_assert()) and the interrupts are disabled (irqs_disabled()).
>From looking at the code, each function is static, the caller is near by
and does spin_lock_irq|safe(). As Linus puts it:

|It's not like this is some function that is exported to random users,
|and we should check that the calling convention is right.
|
|This looks like "it may have been useful during coding to document
|things, but it's not useful long-term".

Remove those checks.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/target/target_core_tmr.c       | 2 --
 drivers/target/target_core_transport.c | 6 ------
 2 files changed, 8 deletions(-)

diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index 9c7bc1ca341a..3d35dad1de2c 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -114,8 +114,6 @@ static bool __target_check_io_state(struct se_cmd *se_cmd,
 {
 	struct se_session *sess = se_cmd->se_sess;
 
-	assert_spin_locked(&sess->sess_cmd_lock);
-	WARN_ON_ONCE(!irqs_disabled());
 	/*
 	 * If command already reached CMD_T_COMPLETE state within
 	 * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown,
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 74b646f165d4..2c3ddb3a4124 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2954,9 +2954,6 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop,
 	__acquires(&cmd->t_state_lock)
 {
 
-	assert_spin_locked(&cmd->t_state_lock);
-	WARN_ON_ONCE(!irqs_disabled());
-
 	if (fabric_stop)
 		cmd->transport_state |= CMD_T_FABRIC_STOP;
 
@@ -3241,9 +3238,6 @@ static int __transport_check_aborted_status(struct se_cmd *cmd, int send_status)
 {
 	int ret;
 
-	assert_spin_locked(&cmd->t_state_lock);
-	WARN_ON_ONCE(!irqs_disabled());
-
 	if (!(cmd->transport_state & CMD_T_ABORTED))
 		return 0;
 	/*
-- 
2.16.2

  reply	other threads:[~2018-03-23 17:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 15:38 [PATCH] target: Use WARNON_NON_RT(!irqs_disabled()) Arnaldo Carvalho de Melo
2018-03-21 18:43 ` Linus Torvalds
2018-03-22  9:13   ` Thomas Gleixner
2018-03-22  9:37   ` Arnaldo Carvalho de Melo
2018-03-22  9:40     ` Arnaldo Carvalho de Melo
2018-03-22  9:47     ` Thomas Gleixner
2018-03-23 15:55     ` Sebastian Andrzej Siewior
2018-03-23 16:25       ` Bart Van Assche
2018-03-23 16:33         ` bigeasy
2018-03-23 16:37         ` Linus Torvalds
2018-03-23 17:17           ` bigeasy [this message]
2018-03-23 17:19             ` [PATCH 2/2] target: remove spin_lock_assert() in __target_(attach|detach)_tg_pt_gp() bigeasy
2018-03-23 17:44               ` Bart Van Assche
2018-03-23 17:50                 ` bigeasy
2018-03-23 17:55                   ` Bart Van Assche
2018-03-26 15:38                     ` Steven Rostedt
2018-03-23 17:36             ` [PATCH 1/2 v2] target: drop spin_lock_assert() + irqs_disabled() combo checks Sebastian Andrzej Siewior
2018-03-23 17:47               ` Bart Van Assche
2018-03-26 15:13             ` [PATCH 1/2] " Steven Rostedt
2018-03-28 10:15               ` bigeasy
2018-03-28 15:05                 ` Bart Van Assche
2018-03-28 15:14                   ` bigeasy
2018-03-28 15:31                     ` Bart Van Assche
2018-05-28 14:35                       ` bigeasy
2018-06-04  7:02                         ` Bart Van Assche
2018-06-04  7:16                           ` bigeasy
2018-03-26 14:21       ` [PATCH] target: Use WARNON_NON_RT(!irqs_disabled()) Arnaldo Carvalho de Melo
2018-03-21 18:50 ` Christoph Hellwig
2018-03-21 19:01   ` Steven Rostedt
2018-03-22 10:25 ` kbuild test robot
2018-03-22 10:45 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180323171736.bcyi2oiolge4l6hl@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=Bart.VanAssche@wdc.com \
    --cc=acme@kernel.org \
    --cc=daniel@bristot.me \
    --cc=lclaudio@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=target-devel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).