Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp515553rwn; Thu, 15 Sep 2022 02:13:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BNFjuokVfdzxKVG7ao1+6ZQLy6Ncx7NUzQibnt63163BfQi7rCoHtHAZ+52pytrBqHw24 X-Received: by 2002:a17:90b:2643:b0:1fb:707d:af1f with SMTP id pa3-20020a17090b264300b001fb707daf1fmr9673716pjb.7.1663233204651; Thu, 15 Sep 2022 02:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663233204; cv=none; d=google.com; s=arc-20160816; b=0DB8WCeO0LwVrXMs6bxEmWB0A2Co2ZjcNK1Wwd/yn1UKyKRfIjlJGcJ7dddEYHUzMp T7gM3h0YkcWYIPCfpjYl8JQIJcDt9M4xy/XE5SBSKdUksNYgq1XujK37HjQzgoMkhMZk rt3NRSpvSFBmw506vvyW342X2H1l2qPhdMuCWTo05aIgBxJl3ICBuuFiLaeFrhHEY2X9 WHqKBFZDjv0+qb8ypK2orhIidpLvBIY6VjSC++XMWpz7BZLqfOhWEDLct53t1QvQVbip Nm9tFyYFBrqhKCKSbpTf/9k2oBC8Wz/GPnPIzsKG0eNg/BFIs1ti3JznhN6NRAnrhr/o ORHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S9IJaNixHzaNWaEE2QUgvkP7ZZ7oTUdjsRA5Hx9pnJ8=; b=0ZvMQl54xNQm3mwDqcYGH8K7zbrBchLMBLQyOziFik13mqja8HWsdtCpnUx72FaTgO D/EiMscaZLEBlySrR4Np9bbBrEZ+biqmXM8fLBLBqnuvASukuAznLO5uhpMRjtTiJwz7 7CaRZYrSr7QHWBJHxbhnF9dZmLbWGcXZSMVqyPVaZE7YV9SWL7Mi0lZ5M5DvQk4aLF7v ZpanyVZ2UpP/LABUAxv4sfjHCCkzMqumeoWXPzrttIhSYjbcFGGSuKDPGRWdn7ax9qZD HG6RgMlL8kIAEvYoNXAZBsp+zcUh7oKlIJpvhlXWMJWDbzz82sW2gKXQTTLbxf0DOAii yikA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qnKtqTju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13-20020a62790d000000b00537c6b40266si392777pfc.87.2022.09.15.02.13.13; Thu, 15 Sep 2022 02:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qnKtqTju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiIOIoq (ORCPT + 99 others); Thu, 15 Sep 2022 04:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiIOIon (ORCPT ); Thu, 15 Sep 2022 04:44:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18951901B for ; Thu, 15 Sep 2022 01:44:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9FD8EB81EA9 for ; Thu, 15 Sep 2022 08:44:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF5D5C433D6; Thu, 15 Sep 2022 08:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663231480; bh=R6Rl/OlvLJIZv5HR2mE5eYVhd7/iw8En0Km8/MsF17c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qnKtqTjuYbMLQID9jKK84B6m8uVE2TN6PNBwzUVIx/kR1jahm5gUUh2EBhloDoxPg 3w6/bXToHADlvNNZzDDub8QY18UIOTI1cZmeNnJRim2bdGw8aDn9Jq4W7QVjN9B8m5 p+3kQ/9dYTX+hnpkSOPxWcRmqObedFhnDktiklrU= Date: Thu, 15 Sep 2022 10:45:06 +0200 From: Greg KH To: Nam Cao Cc: forest@alittletooquiet.net, philipp.g.hortmann@gmail.com, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH] staging: vt6655: replace spin_lock_irqsave with spin_lock Message-ID: References: <20220914080016.67951-1-namcaov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914080016.67951-1-namcaov@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2022 at 10:00:17AM +0200, Nam Cao wrote: > In vt6655 driver, there is a single interrupt handler: vnt_interrupt(), > and it does not take the spinlock. The interrupt handler only schedules > a workqueue, and the spinlock is taken in this workqueue. Thus, there is > no need to use spin_lock_irqsave, as the spinlock is never taken by an > interrupt. Replace spin_lock_irqsave (and spin_unlock_irqsave) with > spin_lock (and spin_unlock). What is the speed difference before and after this change? And how are interrupts properly handled anymore in this driver if you took away the lock that was being accessed in the irq? thanks, greg k-h