Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp978597pxb; Fri, 15 Apr 2022 17:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBq4HraT9gbrvm2h+G3ouMFWkHBMwUvWuUfCTJb4DGuTEfWucJMF7G19CwARAsGD3QosOT X-Received: by 2002:a17:902:e804:b0:158:8117:7e41 with SMTP id u4-20020a170902e80400b0015881177e41mr1212812plg.64.1650068055089; Fri, 15 Apr 2022 17:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068055; cv=none; d=google.com; s=arc-20160816; b=PEAsjGYwH8Eo199LjBvSgmlOAzAJ3TIdglTFX819tfBnDEuEz2gyfofCrLXx/ymCmW l1MtkENmP+uqR9LNXIEgsNWxqOn6qKhxGYdUIGkdl7nD2SrF9dsb+oFxLiMdOVPcxNE+ bgvOhEu2ZsgMu1q2HZeNUL1x0LeQCfI1+wD/Do4Q0YZw8bqygUY/nydS7QoAQrULRHq/ 7bz5lC/FHty7amsOD//1NM2/USfvIH6SGBqmpzGDS0i76MUQ0x25iL6K6qSwX48IsAfB KGRlSRHI/7PgD21yjr1lVaQv0KHt1bDpK+sOsGoAcFECwQkmObdpsK33xQQVtbm0ahrl WZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VSPSHGLNryKTOTOge0ylfTJKLHsA725QG3K5z7xv3vQ=; b=O6gOifVlVrclP9E4XGS6ajCfyXgEvZ8mTOWuuJvehv2IFv2hZ2OBFC0eBTsxAdFzQ1 l3CBdz6B8SzlViBv+LLyI4HOYjBA0lLI1h8AZS17o/Sl7iRRfRPwxlUYfAFctFk2RTLE NnNOMrowlVqSVKxufESmA/kynt7HEGZnLANOEKkSuuD9I1O4EoHu4Lz8tc1bjBfBQgQ1 dfkE9lx5V8p8Ou1uPtcNLt5QCEtBcUlTy6mid5bGZtzTJthoyENkfDZN+epVM2zit3xW 2y7H91hWshJAljoJ/KDjOqe0PK4sWL2sNwhKoBa2va/wujn8lj5i0QU8ieOJTUu56Ftg SE8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mzWrWwME; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 6-20020a631246000000b00398b6b8cdf4si2481421pgs.224.2022.04.15.17.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mzWrWwME; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E21D60AB9; Fri, 15 Apr 2022 17:14:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243319AbiDNN1W (ORCPT + 99 others); Thu, 14 Apr 2022 09:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244183AbiDNNXo (ORCPT ); Thu, 14 Apr 2022 09:23:44 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E47F939ED; Thu, 14 Apr 2022 06:18:33 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-2eafabbc80aso54530987b3.11; Thu, 14 Apr 2022 06:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VSPSHGLNryKTOTOge0ylfTJKLHsA725QG3K5z7xv3vQ=; b=mzWrWwMEQ3pI8mP8YATBmRidCAoh3CfJ3ZEoKRvU/hHhk+epGF0cWiBIe+gMTfRG7M JLofzUCSt7FOvDvWoAd0Cz4EJjHM+vtgdfOyvRV1Df6lpRDHn+ycrgprZg3GPWuVWXw/ zDqLZHVkl55JdcERRPvuilaE0ghuLJhV3jYRHp7aQEazFf0h+AZb/OY0BNm7FFikyUh8 2OFyH+OSRjSojLe4FzHaaEfUxSsSGF/T8sQZ+6AjO1r5Tk6/4ba7mnJt19a5ITEXX7ms Ig8C1xutmBlhR42x9LIgohdBjS8wRUNKcPCywc2WDCV893IRcfLphbHWbvkYOZtem/KC UJ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VSPSHGLNryKTOTOge0ylfTJKLHsA725QG3K5z7xv3vQ=; b=hzWdlTmEd4mD9a+12mm17fULW07cK/ocaZ5HT0C1WXqkwnEbIFCnuAitnyUvUZw7H4 n8yJxurUfntrDMV6XpHTpf1fKRM3ne3otu8CWupdxlYzBqtHcqjXKz2I3iCzoZV8SNFF ZQHglEnBkPIEOFwwHK4m8SNyWpEE4kPht5Fjl8uGdS/tcHnqaMPuG67OPJrLNgvfjzHO zW1Ux3cIpcjSaUU7APaZedK5J2bjXZ0fMElpzJeO8GyHpenrdtz3af5Gv1aSIGbPeRoM ZhktCPP3aPS48YlbmxMKNAo3fHs8iKQWtTAC4urdjA0bFy1+OK68NY1m+WvfRas7L2Ed Cj0Q== X-Gm-Message-State: AOAM531YT/l3FjiBMCQGt8urDFAm9ZIZMO8wcNZJhPzHzIqJCjZ/710+ 7h8F7HWmLhhitqPRiE26GjNzu/r1RGHaz2RTH6mhr9USvyM= X-Received: by 2002:a0d:d702:0:b0:2ef:32f7:b800 with SMTP id z2-20020a0dd702000000b002ef32f7b800mr1937878ywd.482.1649942312435; Thu, 14 Apr 2022 06:18:32 -0700 (PDT) MIME-Version: 1.0 References: <9e12d806c5554b4ed18c644f71f6662fcf0d0516.1649813822.git.lhjeff911@gmail.com> In-Reply-To: From: =?UTF-8?B?6YOt5Yqb6LGq?= Date: Thu, 14 Apr 2022 21:16:15 +0800 Message-ID: Subject: Re: [PATCH] spi: remove spin_lock_irq in the irq procress To: Tom Rix Cc: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?B?5ZGC6Iqz6aiwTHVXZWxscw==?= , "lh.kuo" , nathan@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Tom : This SPI driver only handles one transfer at a time. That's why locks are not needed. Li-hao Kuo Tom Rix =E6=96=BC 2022=E5=B9=B44=E6=9C=8813=E6=97=A5 =E9= =80=B1=E4=B8=89 =E4=B8=8B=E5=8D=887:45=E5=AF=AB=E9=81=93=EF=BC=9A > > > On 4/12/22 6:38 PM, Li-hao Kuo wrote: > > - remove spin_lock_irq and spin_unlock_irq in the irq funciton > > function > > I was expecting a statement on why is the lock is not needed. > > Could you add one ? > > Tom > > > > > Signed-off-by: Li-hao Kuo > > --- > > drivers/spi/spi-sunplus-sp7021.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus= -sp7021.c > > index f989f7b..120623c 100644 > > --- a/drivers/spi/spi-sunplus-sp7021.c > > +++ b/drivers/spi/spi-sunplus-sp7021.c > > @@ -199,8 +199,6 @@ static irqreturn_t sp7021_spi_master_irq(int irq, v= oid *dev) > > if (tx_len =3D=3D 0 && total_len =3D=3D 0) > > return IRQ_NONE; > > > > - spin_lock_irq(&pspim->lock); > > - > > rx_cnt =3D FIELD_GET(SP7021_RX_CNT_MASK, fd_status); > > if (fd_status & SP7021_RX_FULL_FLAG) > > rx_cnt =3D pspim->data_unit; > > @@ -239,7 +237,7 @@ static irqreturn_t sp7021_spi_master_irq(int irq, v= oid *dev) > > > > if (isrdone) > > complete(&pspim->isr_done); > > - spin_unlock_irq(&pspim->lock); > > + > > return IRQ_HANDLED; > > } > > >