target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/15] target: fix __transport_register_session locking
@ 2018-07-15 23:16 Mike Christie
  2018-07-18 22:11 ` Bart Van Assche
  2018-07-19 20:38 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Christie @ 2018-07-15 23:16 UTC (permalink / raw)
  To: target-devel

When __transport_register_session is called from
transport_register_session irqs will already have been disabled,
so we do not want the unlock irq call to enable them until
the higher level has done the final
spin_unlock_irqrestore/spin_unlock_irq.

This has __transport_register_session use the save/restore
call.

Signed-off-by: Mike Christie <mchristi@redhat.com>
---
 drivers/target/target_core_transport.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 6324743..75ddbbb 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -347,6 +347,7 @@ void __transport_register_session(
 {
 	const struct target_core_fabric_ops *tfo = se_tpg->se_tpg_tfo;
 	unsigned char buf[PR_REG_ISID_LEN];
+	unsigned long flags;
 
 	se_sess->se_tpg = se_tpg;
 	se_sess->fabric_sess_ptr = fabric_sess_ptr;
@@ -384,7 +385,7 @@ void __transport_register_session(
 			WARN_ON(hex2bin((u8 *)&se_sess->sess_bin_isid, buf, 6));
 		}
 
-		spin_lock_irq(&se_nacl->nacl_sess_lock);
+		spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
 		/*
 		 * The se_nacl->nacl_sess pointer will be set to the
 		 * last active I_T Nexus for each struct se_node_acl.
@@ -393,7 +394,7 @@ void __transport_register_session(
 
 		list_add_tail(&se_sess->sess_acl_list,
 			      &se_nacl->acl_sess_list);
-		spin_unlock_irq(&se_nacl->nacl_sess_lock);
+		spin_unlock_irqrestore(&se_nacl->nacl_sess_lock, flags);
 	}
 	list_add_tail(&se_sess->sess_list, &se_tpg->tpg_sess_list);
 
-- 
2.7.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 03/15] target: fix __transport_register_session locking
  2018-07-15 23:16 [PATCH 03/15] target: fix __transport_register_session locking Mike Christie
@ 2018-07-18 22:11 ` Bart Van Assche
  2018-07-19 20:38 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2018-07-18 22:11 UTC (permalink / raw)
  To: target-devel

On Sun, 2018-07-15 at 18:16 -0500, Mike Christie wrote:
+AD4- When +AF8AXw-transport+AF8-register+AF8-session is called from
+AD4- transport+AF8-register+AF8-session irqs will already have been disabled,
+AD4- so we do not want the unlock irq call to enable them until
+AD4- the higher level has done the final
+AD4- spin+AF8-unlock+AF8-irqrestore/spin+AF8-unlock+AF8-irq.
+AD4- 
+AD4- This has +AF8AXw-transport+AF8-register+AF8-session use the save/restore
+AD4- call.

Reviewed-by: Bart Van Assche +ADw-bart.vanassche+AEA-wdc.com+AD4-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 03/15] target: fix __transport_register_session locking
  2018-07-15 23:16 [PATCH 03/15] target: fix __transport_register_session locking Mike Christie
  2018-07-18 22:11 ` Bart Van Assche
@ 2018-07-19 20:38 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-07-19 20:38 UTC (permalink / raw)
  To: target-devel

On Sun, Jul 15, 2018 at 06:16:19PM -0500, Mike Christie wrote:
> When __transport_register_session is called from
> transport_register_session irqs will already have been disabled,
> so we do not want the unlock irq call to enable them until
> the higher level has done the final
> spin_unlock_irqrestore/spin_unlock_irq.

if you use up your line length this could be:

so we do not want the unlock irq call to enable them until the higher
level has done the final spin_unlock_irqrestore/spin_unlock_irq.


> 
> This has __transport_register_session use the save/restore
> call.

Can be condensed as well.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-19 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-15 23:16 [PATCH 03/15] target: fix __transport_register_session locking Mike Christie
2018-07-18 22:11 ` Bart Van Assche
2018-07-19 20:38 ` Christoph Hellwig

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).