Commit aac840ec authored by Finn Thain's avatar Finn Thain Committed by Michael Ellerman

macintosh/adb-iop: Access current_req and adb_iop_state when inside lock

Drop the redundant local_irq_save/restore() from adb_iop_start() because
the caller has to do it anyway. This is the pattern used in via-macii.
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/bbe32b087c7e04d68e2425f6a2df4a414d167c32.1590880623.git.fthain@telegraphics.com.au
parent 303511ed
...@@ -137,7 +137,6 @@ static void adb_iop_listen(struct iop_msg *msg) ...@@ -137,7 +137,6 @@ static void adb_iop_listen(struct iop_msg *msg)
static void adb_iop_start(void) static void adb_iop_start(void)
{ {
unsigned long flags;
struct adb_request *req; struct adb_request *req;
struct adb_iopmsg amsg; struct adb_iopmsg amsg;
...@@ -146,8 +145,6 @@ static void adb_iop_start(void) ...@@ -146,8 +145,6 @@ static void adb_iop_start(void)
if (!req) if (!req)
return; return;
local_irq_save(flags);
/* The IOP takes MacII-style packets, so strip the initial /* The IOP takes MacII-style packets, so strip the initial
* ADB_PACKET byte. * ADB_PACKET byte.
*/ */
...@@ -161,7 +158,6 @@ static void adb_iop_start(void) ...@@ -161,7 +158,6 @@ static void adb_iop_start(void)
req->sent = 1; req->sent = 1;
adb_iop_state = sending; adb_iop_state = sending;
local_irq_restore(flags);
/* Now send it. The IOP manager will call adb_iop_complete /* Now send it. The IOP manager will call adb_iop_complete
* when the message has been sent. * when the message has been sent.
...@@ -208,13 +204,13 @@ static int adb_iop_write(struct adb_request *req) ...@@ -208,13 +204,13 @@ static int adb_iop_write(struct adb_request *req)
return -EINVAL; return -EINVAL;
} }
local_irq_save(flags);
req->next = NULL; req->next = NULL;
req->sent = 0; req->sent = 0;
req->complete = 0; req->complete = 0;
req->reply_len = 0; req->reply_len = 0;
local_irq_save(flags);
if (current_req != 0) { if (current_req != 0) {
last_req->next = req; last_req->next = req;
last_req = req; last_req = req;
...@@ -223,10 +219,11 @@ static int adb_iop_write(struct adb_request *req) ...@@ -223,10 +219,11 @@ static int adb_iop_write(struct adb_request *req)
last_req = req; last_req = req;
} }
local_irq_restore(flags);
if (adb_iop_state == idle) if (adb_iop_state == idle)
adb_iop_start(); adb_iop_start();
local_irq_restore(flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment