Skip to contentSkip to conversation

ALSA: core: remove redundant spin_lock pair in snd_card_disconnect

PATCH In review root 2 participants 4 messages Mar 29, 2021 – Mar 30, 2021 Sound

lore
Share & tools
lore

root

author
#0 lore raw

PATCH 1/1 ALSA: core: remove redundant spin_lock pair in snd_card_disconnect

From: Jia Zhou <[email protected]>

modification in commit 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") resulting in this problem.

---
 sound/core/init.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/init.c +0 -2
index 018ce4ef1..9f5270c90 100644
@@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card)
 		return 0;
 	}
 	card->shutdown = 1;
-	spin_unlock(&card->files_lock);
 
 	/* replace file->f_op with special dummy operations */
-	spin_lock(&card->files_lock);
 	list_for_each_entry(mfile, &card->files_list, list) {
 		/* it's critical part, use endless loop */
 		/* we have no room to fail */
Signature · 1 line
2.18.4
#1 lore raw
Quoted 10 lines · root

[1.1.1 <text/plain; UTF-8 (base64)>]

From: Jia Zhou <[email protected]>

modification in commit 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") resulting in this problem.

The code change looks good, but the patch isn't cleanly applicable via git-am. Could you fix your MUA setup, or try to submit via git-send-email?

thanks,

Takashi

Quoted 23 lines
---
 sound/core/init.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/init.c +0 -2
index 018ce4ef1..9f5270c90 100644
@@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card)
         return 0;
     }
     card->shutdown = 1;
-    spin_unlock(&card->files_lock);
 
     /* replace file->f_op with special dummy operations */
-    spin_lock(&card->files_lock);
     list_for_each_entry(mfile, &card->files_list, list) {
         /* it's critical part, use endless loop */
         /* we have no room to fail */
Signature · 1 line
2.18.4
#2 lore raw

Hi Takashi,

Thanks a lot for your review!

Quoted 10 lines
Quoted 8 lines · root

[1.1.1 <text/plain; UTF-8 (base64)>]

From: Jia Zhou <[email protected]>

modification in commit 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") resulting in this problem.

Quoted 6 lines
Quoted 2 lines

The code change looks good, but the patch isn't cleanly applicable via git-am. Could you fix your MUA setup, or try to submit via git-send-email?

Apologise to the inconvenient of the format. This is a bug in the mail system of our company's IT department, which confued us for a long time and will be resolved in next month :(

Would you please do me a favor to accept this patch manually? Many thanks.

Quoted 20 lines

thanks,

Takashi

Quoted 14 lines
---
 sound/core/init.c | 2 --
 1 file changed, 2 deletions(-)
sound/core/init.c +0 -1
index 018ce4ef1..9f5270c90 100644
@@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card)
         return 0;
     }
     card->shutdown = 1;
-    spin_unlock(&card->files_lock);
 
Quoted 8 lines
Quoted 8 lines
sound/core/init.c +0 -2
     /* replace file->f_op with special dummy operations */
-    spin_lock(&card->files_lock);
     list_for_each_entry(mfile, &card->files_list, list) {
         /* it's critical part, use endless loop */
         /* we have no room to fail */
--

2.18.4

---
Best wishes
Yi Wang

#3 lore raw
Quoted 22 lines · On Tue, 30 Mar 2021 04:31:55 +0200, <[email protected]> wrote:

Hi Takashi,

Thanks a lot for your review!

Quoted 10 lines
Quoted 8 lines · root

[1.1.1 <text/plain; UTF-8 (base64)>]

From: Jia Zhou <[email protected]>

modification in commit 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") resulting in this problem.

Quoted 6 lines
Quoted 2 lines

The code change looks good, but the patch isn't cleanly applicable via git-am. Could you fix your MUA setup, or try to submit via git-send-email?

Quoted 5 lines

Apologise to the inconvenient of the format. This is a bug in the mail system of our company's IT department, which confued us for a long time and will be resolved in next month :(

Would you please do me a favor to accept this patch manually? Many thanks.

OK, now applied manually. Thanks.

Takashi