Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1644463pxb; Wed, 10 Feb 2021 13:09:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyofsgMk3M9Lyl7UbcgMIQ0NxMrsWZzYORREbB5qhWLtvo5FqaQXUqvOk4Ogl4XwwzTUfpY X-Received: by 2002:a17:907:768e:: with SMTP id jv14mr5011265ejc.453.1612991372232; Wed, 10 Feb 2021 13:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612991372; cv=none; d=google.com; s=arc-20160816; b=AybahItwypqOr01uAXP4J9AyYT/5FxV1JaL0UworQhfc1xpSCC0QVJKjHhYNzRWpDn cdKl/MQ6xKI+J6wjBONyQPGGmV+fpsdDHveqBmOj8SehfSD3Z+GrsZmqzDzvwIxeN5cy criECeDoJIGkjkG5D57NUmPFW6HmXko1wFuNQEarpVdk5DyoBN3gVCoUtVe/YB3gI7Kb ptT+kaDfOVWd1W2rqP76NzKPO6K9AULdEk/A6PZMCNsQcbi0RDO8utZe6xK5vQ5jrWom oZTXgNwgpHD3FfSuX7ltGqI8NysQwW/qB82fyfhCJs/k2VHxiHSDQl9+5MF7MICLD3HF K8ZQ== 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=R5u23N5Zz5+3tPLNYBxzhrwlFnZlW6gRJvyjuBaGQKE=; b=JSlIn9WdUomSkQ13DdzUjYfBedrnEZoCv2r0e1dJOrNteAWRVrGS0yFqnld+BaawSs hiysdsEtnyN8+KNOenMyAzZ0hxjRhplhThhPBt47lVE2A5wAFXMv80wQBMLf5B1AIgLJ BBSEA3aj36d/MFivMn5MIzfxDpHlf1vMhAmUfQdWKM+QTu1vHNzHihLKeGS3iQC9FBfp Z3XyFYlPnG0Jtk5Odjn7A9ygNK49ECVZg6WT1YxXPFBXBy6WbuJBF2szrpndoEwSXTnP unOzbuwPmxiVa1sJc65+3Mtw+zj0vz5xHst3JLjnioGKaQhDRuGBPLT2Ek9QyBRlVE6M uXDQ== 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 n19si1960376ejb.295.2021.02.10.13.09.04; Wed, 10 Feb 2021 13:09:32 -0800 (PST) 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 S233238AbhBJVHh (ORCPT + 99 others); Wed, 10 Feb 2021 16:07:37 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:41484 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbhBJVHf (ORCPT ); Wed, 10 Feb 2021 16:07:35 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id A9B2A292FB; Wed, 10 Feb 2021 16:06:50 -0500 (EST) Date: Thu, 11 Feb 2021 08:06:56 +1100 (AEDT) From: Finn Thain To: "Song Bao Hua (Barry Song)" cc: tanxiaofei , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxarm@openeuler.org" , "linux-m68k@vger.kernel.org" Subject: RE: [Linuxarm] Re: [PATCH for-next 00/32] spin lock usage optimization for SCSI drivers In-Reply-To: <00c06b19e87a425fa3a4b6aaecc66d49@hisilicon.com> Message-ID: <9611728-3e7-3954-cfee-f3d3cf45df6@telegraphics.com.au> References: <1612697823-8073-1-git-send-email-tanxiaofei@huawei.com> <31cd807d-3d0-ed64-60d-fde32cb3833c@telegraphics.com.au> <88d26bd86c314e5483ec596952054be7@hisilicon.com> <00c06b19e87a425fa3a4b6aaecc66d49@hisilicon.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, 10 Feb 2021, Song Bao Hua (Barry Song) wrote: > > On Tue, 9 Feb 2021, Song Bao Hua (Barry Song) wrote: > > > > > > > sonic_interrupt() uses an irq lock within an interrupt handler > > > > > to avoid issues relating to this. This kind of locking may be > > > > > needed in the drivers you are trying to patch. Or it might not. > > > > > Apparently, no-one has looked. > > > > > > Is the comment in sonic_interrupt() outdated according to this: > > > m68k: irq: Remove IRQF_DISABLED > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=77a4279 > > > http://lkml.iu.edu/hypermail/linux/kernel/1109.2/01687.html > > > > > > > The removal of IRQF_DISABLED isn't relevant to this driver. Commit > > 77a42796786c ("m68k: Remove deprecated IRQF_DISABLED") did not disable > > interrupts, it just removed some code to enable them. > > > > The code and comments in sonic_interrupt() are correct. You can > > confirm this for yourself quite easily using QEMU and a > > cross-compiler. > > > > > and this: genirq: Warn when handler enables interrupts > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b738a50a > > > > > > wouldn't genirq report a warning on m68k? > > > > > > > There is no warning from m68k builds. That's because > > arch_irqs_disabled() returns true when the IPL is non-zero. > > > So for m68k, the case is > arch_irqs_disabled() is true, but interrupts can still come? > > Then it seems it is very confusing. If prioritized interrupts can still > come while arch_irqs_disabled() is true, Yes, on m68k CPUs, an IRQ having a priority level higher than the present priority mask will get serviced. Non-Maskable Interrupt (NMI) is not subject to this rule and gets serviced regardless. > how could spin_lock_irqsave() block the prioritized interrupts? It raises the the mask level to 7. Again, please see arch/m68k/include/asm/irqflags.h > Isn't arch_irqs_disabled() a status reflection of irq disable API? > Why not? Are all interrupts (including NMI) masked whenever arch_irqs_disabled() returns true on your platforms? > Thanks > Barry > >