Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4074830pxb; Sat, 13 Feb 2021 21:11:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMAbZyBPO8PDlKlg9uydauqGvKSpAg6Qa2AvOhbYi0CdJveHwhiqb1t35skh8j/1o6PIcG X-Received: by 2002:a50:d4d5:: with SMTP id e21mr3915515edj.373.1613279515679; Sat, 13 Feb 2021 21:11:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613279515; cv=none; d=google.com; s=arc-20160816; b=RoQ+M1D4ycsCCNCAeFL0i4+exdS+q/t9CXmgfcENzG7gae4jDSTvqEEYpaxbsFjc5K aJ2yEZNSAMB3G96fUXhXt2+RBWbGAOgT4V1Footm7p2ykmYqh4E89ITRaEmJNFwa85nY 9p4ckARBjG5f4ezjDJ3SzL3zzCob5XxaHt9h8nMVPLT7j8MyOElIQDYgyq8zH4zuvHJZ G3eZqXSH3ufH7TYSRal1NDq3G+GlxUpgClZamLA0+AsWvBJCb/bXTRzYMFHMAYg8QqnA 0N5KwD8s/oNMyTBfKWjy9gtgCCqIolfusBkWAWnRMRmWCfOvxmH4Z63ON6kBYo0dmqeg FZ/A== 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=bpMXPSfVyY7Bdr+PI4o8z9dO4TsiwzqlHWZhHD/BDh8=; b=Vsc4Ndc6PVhA3grA/CqIT6jVmtXFv20Y3nvCxLP30rhZFxJmB+o170Q50KQU+okIOt +Yjmxgf3cqyAcyVV1VSczsjUj54jGWuLiXs/uSXCUlYIsx/eINdL+ytN6kk2dphj5LF4 GD/Ar4eXLfQrgZR1r9V4MUVkbVBt4sQT5uL3SSHOi4J5teEi78yMr+PgkRkQKe0Ewvrh +fB4UI/f1YQGs6g48ALXF3e5zCYFL14H0RBeRSW8mkWPcTtXiUP2QXA2ib0p580Em+ej RbsXbtsBNshGA/WIRjaKY7SJk57v/xgCljrqFYo9MGU2oF6iJkmPIQImcY8nCHU1MgGo p9dQ== 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 t18si9239381ejo.231.2021.02.13.21.11.32; Sat, 13 Feb 2021 21:11:55 -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 S229576AbhBNFLG (ORCPT + 99 others); Sun, 14 Feb 2021 00:11:06 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:53284 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbhBNFLF (ORCPT ); Sun, 14 Feb 2021 00:11:05 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 632302A16B; Sun, 14 Feb 2021 00:10:21 -0500 (EST) Date: Sun, 14 Feb 2021 16:10:30 +1100 (AEDT) From: Finn Thain To: "Song Bao Hua (Barry Song)" cc: Arnd Bergmann , "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "geert@linux-m68k.org" , "funaho@jurai.org" , "philb@gnu.org" , "corbet@lwn.net" , "mingo@redhat.com" , "linux-m68k@lists.linux-m68k.org" , "linux-kernel@vger.kernel.org" Subject: RE: [RFC] IRQ handlers run with some high-priority interrupts(not NMI) enabled on some platform In-Reply-To: <5148eb2aaceb42d78087bc6d8ce15183@hisilicon.com> Message-ID: <5fcea94e-6fc9-c340-d7d2-4ae8b69890b8@telegraphics.com.au> References: <24e0652b3afa48cdbf7c83287e43c087@hisilicon.com> <0b766dba0b004ced94131e158cd8e67d@hisilicon.com> <5148eb2aaceb42d78087bc6d8ce15183@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 Sat, 13 Feb 2021, Song Bao Hua (Barry Song) wrote: > > So what is really confusing and a pain to me is that: > For years people like me have been writing device drivers > with the idea that irq handlers run with interrupts > disabled after those commits in genirq. So I don't need > to care about if some other IRQs on the same cpu will > jump out to access the data the current IRQ handler > is accessing. > > but it turns out the assumption is not true on some platform. > So should I start to program devices driver with the new idea > interrupts can actually come while irqhandler is running? > > That's the question which really bothers me. > That scenario seems a little contrived to me (drivers for two or more devices sharing state through their interrupt handlers). Is it real? I suppose every platform has its quirks. The irq lock in sonic_interrupt() is only there because of a platform quirk (the same device can trigger either of two IRQs). Anyway, no-one expects all drivers to work on all platforms; I don't know why it bothers you so much when platforms differ.