Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5403440pxu; Thu, 22 Oct 2020 01:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMNS+T4RiYxezczUMgWxHWJMsH/OfgwTZaH1VpRABPWSaz0Ei6fBYLWDgFYy57M1LATGBT X-Received: by 2002:aa7:cfc1:: with SMTP id r1mr1162981edy.138.1603353717263; Thu, 22 Oct 2020 01:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603353717; cv=none; d=google.com; s=arc-20160816; b=l2WeiUIkz01GsbqW76tWjYqNbvAHxmqPh14U3EV8kad2ov0RyCYrVeUi/ha92hG7K1 mVW56QVFaYgALAJGXSMgQdMtiLy3zw7o8SzCSZ1EoyyTf1hWLFCpNqaVSoDqYCLm/jNe 2HxqK4xSnALZbhe2tMiUOKGVFQ9y/yhpyDZKqaYYzSo9utvgoKHbI1Sjh1cJcdNmuv5D +qDl3feykR3Gv4nLfOPNTQNSkcc6dPnJuxvQyB4zCUEk1L+LirYbLQGOY/35GyMX+puU rmsGjLhrZeXvaLq6dOD0gdx/bwVK8pi5V37Q3aS6eNv84zq5iUrY2wZqgVQ9xLIdlxQF EIqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=RkACise5j5MdYDYOsQT9oyRHkhy/tr19DKbhV/kyZuE=; b=WOe8DuUjc+ajN7Z3Nuabw+vwRRMZgajGzNaYIRgszzAM1hSLHl+KCd5iueIkBFfyux 77PP2sr43RgGYDQrhZSQaDZW3/jk6foo539tCX49REhvjMrsK0BCGHvwl7pd+Pa7PDox d8t14OBucuSnNG0ylV6cwFzwHEAsxUETZMsP1DImryfTen/6Iu70hxW8HlU0Bp/pLbck QFaqF/Ej+yg2++x4KA5cBK4xU3/tSFUkbm9HLzN9/4hvRQuq2T0/VjJJmALY6mj9E9i/ eom2NkpJuOEw7+6Dl67/WeytiyYb0OAyXNPnwa1uuIim4cEdE1EQRSEb/dTn0JxWmA2w OMDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt23si417294ejb.147.2020.10.22.01.01.34; Thu, 22 Oct 2020 01:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895032AbgJVCYz (ORCPT + 99 others); Wed, 21 Oct 2020 22:24:55 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:46046 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895026AbgJVCYz (ORCPT ); Wed, 21 Oct 2020 22:24:55 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id C397122444; Wed, 21 Oct 2020 22:24:51 -0400 (EDT) Date: Thu, 22 Oct 2020 13:25:00 +1100 (AEDT) From: Finn Thain To: Xianting Tian cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: megaraid_sas: use spin_lock() in hard IRQ In-Reply-To: <20201021064502.35469-1-tian.xianting@h3c.com> Message-ID: References: <20201021064502.35469-1-tian.xianting@h3c.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Oct 2020, Xianting Tian wrote: > Since we already in hard IRQ context when running megasas_isr(), On m68k, hard irq context does not mean interrupts are disabled. Are there no other architectures in that category? > so use spin_lock() is enough, which is faster than spin_lock_irqsave(). > Is that measurable? > Signed-off-by: Xianting Tian > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c > index 2b7e7b5f3..bd186254d 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > @@ -3977,15 +3977,14 @@ static irqreturn_t megasas_isr(int irq, void *devp) > { > struct megasas_irq_context *irq_context = devp; > struct megasas_instance *instance = irq_context->instance; > - unsigned long flags; > irqreturn_t rc; > > if (atomic_read(&instance->fw_reset_no_pci_access)) > return IRQ_HANDLED; > > - spin_lock_irqsave(&instance->hba_lock, flags); > + spin_lock(&instance->hba_lock); > rc = megasas_deplete_reply_queue(instance, DID_OK); > - spin_unlock_irqrestore(&instance->hba_lock, flags); > + spin_unlock(&instance->hba_lock); > > return rc; > } >