Skip to contentSkip to conversation

s390:tty3270:move spin_lock_bh to spin_lock in tasklet

PATCH In review Jeff Xie 2 participants 2 messages Mar 19, 2019 – Mar 20, 2019 s390

lore
Share & tools
lore

Jeff Xie

author
#0 lore raw

PATCH 1/1 s390:tty3270:move spin_lock_bh to spin_lock in tasklet

It is unnecessary to call spin_lock_bh in a tasklet.

---
 drivers/s390/char/tty3270.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/char/tty3270.c +2 -2
index 2b0c36c2..2963396 100644
@@ -563,7 +563,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
 	char *input;
 	int len;
 
-	spin_lock_bh(&tp->view.lock);
+	spin_lock(&tp->view.lock);
 	/*
 	 * Two AID keys are special: For 0x7d (enter) the input line
 	 * has to be emitted to the tty and for 0x6d the screen
@@ -590,7 +590,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
 		tp->update_flags = TTY_UPDATE_ALL;
 		tty3270_set_timer(tp, 1);
 	}
-	spin_unlock_bh(&tp->view.lock);
+	spin_unlock(&tp->view.lock);
 
 	/* Start keyboard reset command. */
 	raw3270_request_reset(tp->kreset);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 21 lines · Jeff Xie

It is unnecessary to call spin_lock_bh in a tasklet.

---
 drivers/s390/char/tty3270.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/char/tty3270.c +1 -1
index 2b0c36c2..2963396 100644
@@ -563,7 +563,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
 	char *input;
 	int len;
 
-	spin_lock_bh(&tp->view.lock);
+	spin_lock(&tp->view.lock);
 	/*
 	 * Two AID keys are special: For 0x7d (enter) the input line
 	 * has to be emitted to the tty and for 0x6d the screen

drivers/s390/char/tty3270.c tty3270_read_tasklet(struct raw3270_request *rrq) · line 593

Quoted 5 lines
drivers/s390/char/tty3270.c +1 -1
@@ -590,7 +590,7 @@ tty3270_read_tasklet(struct raw3270_request *rrq)
 		tp->update_flags = TTY_UPDATE_ALL;
 		tty3270_set_timer(tp, 1);
 	}
-	spin_unlock_bh(&tp->view.lock);
+	spin_unlock(&tp->view.lock);

I'm not going to take this. There is close to zero benefit, but rather high cost to review this - just because the function is named *tasklet doesn't mean it is only called in tasklet / softirq context.