Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1114376rwn; Thu, 15 Sep 2022 10:37:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5vuipxooIDOiqZXTNyRY2ngiNK0CaCZygea0M+wXaKmFAGBIp60XsbORvLUhRNXQxpjFYq X-Received: by 2002:a17:90a:5b0d:b0:1fe:3769:5fb8 with SMTP id o13-20020a17090a5b0d00b001fe37695fb8mr12266966pji.152.1663263467284; Thu, 15 Sep 2022 10:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663263467; cv=none; d=google.com; s=arc-20160816; b=LoVbVVtq5KPt04FuxOsI87MSpP55DmS2bSPrpiolSLzO8DHLjwCAjTcMvZfWprFmcH mZh6clcVTX2Qbk0nLZixG9opDAryBRAv21sltZAndUzNvx3g3Y6TMHb4NwkwGf2HIMam 79BZjNmLnujZWlOYpilx5WZ2kDa14JzMhSlup0Sxle9D+cBW0q+w+dRe+pvtBxemdLOc W8VugtjealknkRgbGOz3Z/L6pIDQu4lErlkjwAxQF4BVKMfbAilsaPsThGZ6TNwVEw3L e/i8lxoTkoePrWbxE6hepB/ygT98xp90Gg8Et41f8tSMMaK8wd65wPtl2emz8NsQ99Nu fsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AbP6CVs2QyPBwuEArSUrorWYOdYxHwW8OIfOfTn5CKQ=; b=ZBfHPiS/c5j6YfF6VM1aCawgM0wREQZQpqXgTZgF7evHSCZ6wobH1PPeW3O7AwMzGl /vYmkmkBPV/czR/M9kT8BHOue9GuRhvOrUpZvdkWJ49OhIY6ar/sTgOjzlhNSSGzTP6I YZa2+DRKOcqgv9gjoVBAjqaFlU4HKOCN9b+6tYO0aN6JWqoViGMX9iSTq/Akk1Iy7EIZ pOB7xBAVH+lRsqWqXxORFGk0TXtbhdhcva+SgeA3kNjiWAxN92KdZRxHNC/XajbJZG8o TNCL0WR/m4a4aVyyByY4PMGikiBPfQuRoga8sT2qJh3wJGDDTKGvIPN9hbqZQW1qvkyR 8xVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOa25gfw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a632c0b000000b0042a33a98315si19450125pgs.737.2022.09.15.10.37.35; Thu, 15 Sep 2022 10:37:47 -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=@gmail.com header.s=20210112 header.b=eOa25gfw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbiIOROY (ORCPT + 99 others); Thu, 15 Sep 2022 13:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiIOROX (ORCPT ); Thu, 15 Sep 2022 13:14:23 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7494398371 for ; Thu, 15 Sep 2022 10:14:22 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id 130so28681335ybz.9 for ; Thu, 15 Sep 2022 10:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=AbP6CVs2QyPBwuEArSUrorWYOdYxHwW8OIfOfTn5CKQ=; b=eOa25gfwje15AbAqwKI/mJQjw1D11JnbJ1y5vLhY0zMwPhKwwItsPsXB8GLxGFu7sI cwDeNb2HpbwezE7WMZF9aa2m2n3Qvt6a28Azr5tShVTCqLZigd3D+kOwm6ciP62uoVAd xhNdeXJOTzSTkx5W3OUAedy8cRtrHEA0+l8p77vEEQZBn8rsound+XYLc0x28T8woXQh IlOWBYgnt0FzFQlHrOD6dZajt0F22shBPoNgF1QOQxkhNYi3KdUItJuuBem/B7BmaNmT ZsDvrYVfcrNmbVRbGjAUEiQn9LU5OckBsiDWGwpPIrSKyCxALEi+CkKzEw01GjH4vLIm L+Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=AbP6CVs2QyPBwuEArSUrorWYOdYxHwW8OIfOfTn5CKQ=; b=4B2Sd2vkeKaH3JVVk34IJklzjT8QcURHupAvOcuGLgQfhi+rjR3fxPNEi1Fl0irWou yoM1jifoDHDeOJxcW3xbUs7r9Q7/UDSFpUgee1t7rBr12HIIeqBHF0cL9pPcBsC9luqD QZHruA3oMNehQDzZuJh6pFOXf51VVc8tFFqijPibpN20ZXYk/cOSuebxomklIYq7jj64 tWwBu6iAMUYE66L+XL+29nt78SBmfEVYQuqaLYRLD7lje9DrTqi8FwMfzK0yN5ONTLIh yhKejdvb+wYgAFHkbIOwFQE3HbMPiIcbVgCur6yc8AUj/FBdJ05R/kRkmA8DuVzn8oJv 5SZw== X-Gm-Message-State: ACrzQf2YCnvF1x1YtxhPyrUfBAsIcAtni/szY1FD70lof0LFTEHaqHDE SaJsFlh5t6iqLq4pA8KmSeeW2V0ZqgyQqlRBwio= X-Received: by 2002:a25:adc6:0:b0:6ae:e4dc:942c with SMTP id d6-20020a25adc6000000b006aee4dc942cmr684152ybe.599.1663262061676; Thu, 15 Sep 2022 10:14:21 -0700 (PDT) MIME-Version: 1.0 References: <20220914080016.67951-1-namcaov@gmail.com> In-Reply-To: From: Nam Cao Date: Thu, 15 Sep 2022 19:14:10 +0200 Message-ID: Subject: Re: [PATCH] staging: vt6655: replace spin_lock_irqsave with spin_lock To: Greg KH Cc: forest@alittletooquiet.net, philipp.g.hortmann@gmail.com, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Thu, Sep 15, 2022 at 10:44 AM Greg KH wrote: > > 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? My understanding is that no lock is accessed in the irq in this driver. But it seems like I am wrong. Sorry for sending a buggy patch, I may follow-up with this later when I figure out what I did wrong. Best regards, Nam.