From patchwork Sat Dec 9 00:35:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10103469 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B75A60223 for ; Sat, 9 Dec 2017 00:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FA402862D for ; Sat, 9 Dec 2017 00:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8265B28DE8; Sat, 9 Dec 2017 00:35:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CB6D2862D for ; Sat, 9 Dec 2017 00:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492AbdLIAfO (ORCPT ); Fri, 8 Dec 2017 19:35:14 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:43138 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbdLIAfN (ORCPT ); Fri, 8 Dec 2017 19:35:13 -0500 Received: by mail-pg0-f67.google.com with SMTP id b18so7899246pgv.10 for ; Fri, 08 Dec 2017 16:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to; bh=IcKZiLVUu9Pp9HHnlXCFz//4zJFOBZ2YpJ9uM8yVkyY=; b=P/G1tj9hLNQqsUWF3QXsHV9Pp32ELtWOE6NaAk0vOTAuIGUgGWTD6xQiGWUJICJsgC XxC6j6lNXywCHgw0Oike/yKUobCEImK9wCK8vnjSPcnyWKIsWd1UO+gCzm5J/hJNX76t CvzhRnVthrO5dledRpokPGlKY7U5e0B5wvKjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=IcKZiLVUu9Pp9HHnlXCFz//4zJFOBZ2YpJ9uM8yVkyY=; b=ZcdYVeLm+IlsFx2TNEggvLJK5QvFq01M3sOVQPAKnVl/6grX9Hm0D9w1CPgm9vrxp6 lpIT8VLiIgzn+BDDOu8Ny+YQlIx1CflE3v2Mtw0PIlEVhnJ9ueG2qi+1C+eNv1x6WtUm jTvps4d7SNI9dS2BahHKoksWmx8wDAvZe+bTftyDUuGqXHNcI5amw2U14VE6rN0Umdeq Egb8yKt/dHMCfg8Qtv2mdfCfwF6BqFTO4pUWuMst77L3I7vHO96JrYQSwmLEQ7msh1c6 s/JwtIuae1gBv5yGsrtzXqrq4ySYC5BhkbRrhcVzLMaVdnm4++cXXetNkjhHMlTlvvB0 WBYQ== X-Gm-Message-State: AKGB3mKCN1hsXviA0bb5oeTjAWuWhwJFG6NXiM4jrC0AcWXf4Zvd3Agp 6qcGAf4hz66fpUzmQK4DtENT8Q== X-Google-Smtp-Source: ACJfBovrWgTmoI0dUg9YphPSuGawGlQpUeplXh4qBgbKg/AKUzP6LdJDJRXM3UoQndX6T7kspeA5RA== X-Received: by 10.159.254.6 with SMTP id r6mr325030pls.144.1512779712394; Fri, 08 Dec 2017 16:35:12 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id m5sm1133403pgp.55.2017.12.08.16.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 16:35:11 -0800 (PST) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo , Loic Poulain Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] wcn36xx: Reduce spinlock in indication handler Date: Fri, 8 Dec 2017 16:35:08 -0800 Message-Id: <20171209003508.3507-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <1512725730-19188-1-git-send-email-loic.poulain@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The purpose of pushing indication on a list and handle these in a separate worker is to allow the handlers to sleep. It does therefor not make much sense to hold the queue spinlock through the entire indication worker function. By removing items from the queue early we don't need to hold the lock throughout the indication worker, allowing the individual handlers to sleep. Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index fa88a2a460aa..52daae863aed 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2414,6 +2414,8 @@ static void wcn36xx_ind_smd_work(struct work_struct *work) hal_ind_msg = list_first_entry(&wcn->hal_ind_queue, struct wcn36xx_hal_ind_msg, list); + list_del(wcn->hal_ind_queue.next); + spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); msg_header = (struct wcn36xx_hal_msg_header *)hal_ind_msg->msg; @@ -2450,8 +2452,6 @@ static void wcn36xx_ind_smd_work(struct work_struct *work) wcn36xx_err("SMD_EVENT (%d) not supported\n", msg_header->msg_type); } - list_del(wcn->hal_ind_queue.next); - spin_unlock_irqrestore(&wcn->hal_ind_lock, flags); kfree(hal_ind_msg); } int wcn36xx_smd_open(struct wcn36xx *wcn)