Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5929542imu; Tue, 13 Nov 2018 14:07:02 -0800 (PST) X-Google-Smtp-Source: AJdET5dcwk2H1RcCfjDXbRFTT6HUHZ8FWMq2uHkHoJqBA4rD9o9IJSrJk530sezZqENxZFb87nsp X-Received: by 2002:a62:4816:: with SMTP id v22-v6mr6837718pfa.233.1542146822620; Tue, 13 Nov 2018 14:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542146822; cv=none; d=google.com; s=arc-20160816; b=ANUnQMasH0uBz2onGPDcguxalyvPhXa7rUVglpHzF0sMuhK8H882TVPe5zAzrzaSDr aT6vOqJNQNH0cJ6BhsP4NqguVvJxNR5C0IRYtuPpBsTl5LhrbGumfGkZZVtdMRB9jQ1h QRGqk6jv3H1nPpb3ClkaFGggG5LqYZIxTE3EFz/n11iDxxnJd3O82fhePQT4THAluptM dCN7P1ux7rEDqF9HA60EamKQsc3rFWIbaEXGtrC0fdV4nTsjljaNddRFSG6kS5KHqT/M qH+MvuCEDlBg/kmeFTPIKetBE7GrVwB8Oy4wysiC1KUvpviy2nvWexQAQlVEv72TwqPf gO/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=EEMDV3nr8VaopQc/Vhkp5iSOQkR7GETUchojm2CdSwY=; b=O+IOw8GwXe+svdSiICYh35ZaePzxB2SikFcdHERN5+oSM71sbhtmF3KLCaCl+o/dhE rGRRDjnZVXs9b415oSmp5Vp0VL10RXiU+yWu5WEJpbjNVWntUy6PyAqbgPlsmDxvsVse HaVLqIV0zdOvriS6b9NFJRe9VKlCx7rJCsIRQJw+BReeSUK/NBYhHRNJSDfxqXv6Jlzv Fpal5jNNvvJgOt1TXzryvg4AARjC6ZRtL2cCdBUOg9gEYMVOxj0TIACOVk8VLdz4V6Sh 8zIQDL7LJB60x2FQExk78GacIUHjzWR+X74i/kT987VvcGY+Jr/zKGkKgq0uTM7Sm2pH S9eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si20459178pgj.558.2018.11.13.14.06.46; Tue, 13 Nov 2018 14:07:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731126AbeKNIEY (ORCPT + 99 others); Wed, 14 Nov 2018 03:04:24 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:39546 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbeKNIEY (ORCPT ); Wed, 14 Nov 2018 03:04:24 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 49D2229EE7; Tue, 13 Nov 2018 17:04:10 -0500 (EST) Date: Wed, 14 Nov 2018 09:04:36 +1100 (AEDT) From: Finn Thain To: Thomas Gleixner cc: Geert Uytterhoeven , Arnd Bergmann , Stephen N Chivers , Daniel Lezcano , John Stultz , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource API In-Reply-To: Message-ID: References: <2f4015ba435f6f06b874295d2a47319875474c7f.1541995959.git.fthain@telegraphics.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Nov 2018, I wrote: > On Mon, 12 Nov 2018, Thomas Gleixner wrote: > > > > +static u32 clk_total; > > > + > > > +#define PCC_TIMER_CLOCK_FREQ 1000000 > > > +#define PCC_TIMER_CYCLES (PCC_TIMER_CLOCK_FREQ / HZ) > > > + > > > static irqreturn_t mvme16x_timer_int (int irq, void *dev_id) > > > { > > > + irq_handler_t tick_handler = dev_id; > > > + unsigned long flags; > > > + > > > + local_irq_save(flags); > > > > No need for local_irq_save() here. Interrupt handlers are guaranteed to be > > called with interrupts disabled. > > > > That's not the case on m68k, as I understand it. However, the CPU > interrupt level does prevent interrupt handlers from nesting. > What I mean by that is, the interrupt level (IPL) prevents interrupt handlers from being re-entered. But a handler can still get interrupted by a higher priority interrupt request. In the past I've had to add defensive locking because of this. In these patches I've assumed it was possible for some higher priority interrupt handler to perform a clocksource read after the timer handler started executing. Hence the use of local_irq_save/restore. To be sure, I've just run a quick test and confirmed that the timer handler can indeed get interrupted by the ethernet interrupt handler. --