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: 121248 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp153289qgn; Fri, 8 Dec 2017 16:35:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMaMCuLPRy0hqmSPJD0PKS60tSF+CHxgQ7OU8SY6iVIN/in2AzF9/bkABBMBpnmjN8QQSrjc X-Received: by 10.84.204.8 with SMTP id a8mr31966206ple.399.1512779717925; Fri, 08 Dec 2017 16:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512779717; cv=none; d=google.com; s=arc-20160816; b=e8Ox0M6GTJRTWdo0UehZlgEss42uU/t2WgKJpKknB+WGydD5M1mWAyP9EMnQK8/B4o GrEFAP74f2x2tk4UgZU/NgIif9GOq26KkCkpUJIPCVh+algiphpGZN9cZYq+K+qU9I5D ANv9uI7N+Fq6irkjd3Q+cs7UYVwn9QmWsbXXhSec7EdKQ4TwaA8v5xM5iV1jLUekiGZd pu4ZwZ5VMxuUXEte7A7XcyLhk0vtCK6z2JJPwwZKHAb0SE7rSEJQC8XzORRcLXjWTYbs agM4To7CMAD0qbGiAhJKj7AQWpHyG719Ck7uGqtncGVz8ngXZLbe6Q6huVwHOTiV9HgI DnDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=IcKZiLVUu9Pp9HHnlXCFz//4zJFOBZ2YpJ9uM8yVkyY=; b=j6kQVDckVc57TRGBEv4VAWU1uC9hFCgkTuKUkuzilop2Duzjj8XHDvAH73RUAsEDP6 hdYABGE9t9QeObfFJ08d+vgULiIgS/SYm3weOU1MeRQV0U+rH8jTiM448UFznpzF8zak LXZnCqo8zj/aMjUc1PItMAqJtMvl2a6oO3Ez4jRCy3VKSDE/wNlHcU8LAJ31aT2/iuPg QaZG6yAYzppG1EHj8Oqu3PbPR2DHt4AJFZRlRItojVD3MaMnsZqMWUM+V8FZCZkw5zeT 7MNrcsZEcJ/lz0K45LEnSfQg6Ny+BEFW7l27rPm+cKCQcY0YIADWN9S+bCj5C9oXbR+A NwpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P/G1tj9h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si6250173plx.365.2017.12.08.16.35.17; Fri, 08 Dec 2017 16:35:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P/G1tj9h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699AbdLIAfQ (ORCPT + 19 others); Fri, 8 Dec 2017 19:35:16 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38689 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753186AbdLIAfN (ORCPT ); Fri, 8 Dec 2017 19:35:13 -0500 Received: by mail-pg0-f65.google.com with SMTP id f12so7903314pgo.5 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=idD4lGKe9+Lf5kb5YtOP52RpdelwEnzAmCLFtxf5ENwM1e00VH6359F02ImiJ5hHM/ GXwoAtQZenyDSn3Pcbg/reExoRuRIPI9FpGTquYFXr93N2nqTZ4GSjk7r9iLNMka7WY7 Tz37VL8/XK113Jl5tSPBa8JKp+wTwLYMei9RV5XzFr866xCLFXrXb18Jk/W2aw+20pY5 Zg5H5lZuiii8ES3+qkGZS0iSJiVx5Cn8rERRYWtdib6JmcAhE7I9sp9PwESIzngP23E6 45oXkdlA5BDOpGld/WBBC0MiCudURjo31OQHdW0lOgO7vT/5w/AQne3FrBgm34ThaqtD Tbig== X-Gm-Message-State: AKGB3mI266nY72twicHtgh2cuOR+Rh9l0+YGM0c6hfBfWMZaSTTMGx3C PAvrVUtMb1ObaBazhAhQ7yNJiw== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.15.0 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)