Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp614991ybt; Wed, 24 Jun 2020 07:11:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznDjlaIafIGmLytHZNNnOJJAnQGyvPfyvupNYQ7heaG6N6pyqUt38mc/CcI6rjgPhLRAQi X-Received: by 2002:a17:906:f298:: with SMTP id gu24mr2183713ejb.302.1593007885883; Wed, 24 Jun 2020 07:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593007885; cv=none; d=google.com; s=arc-20160816; b=t0DgyDNn+bwkzneAsls2KhIVPu/y8KLYe+NPfiYtuRJ+tQmC5eFS0o3lbnlixFvOPC H0Ot4KOtXUx8ohVG4ZOmigo7173fAwuwDTYCGywf4f2mzK6D3MD/71DdJ5z3nJFHdsrp A4vSZzxYIEHq864BUjlN1UEfxQgkaGV1ykGcif7uNNLK/DQwmeC+XBI5TB68PNAxwceE gaZdFJJILhu17I35HCHz0fD509qbYR8Lvq7xBkgejcvNGuvADpYcBzsAzbXgfGfhoJEk y9CJlDnLl6QqlDx2AKQ4yG66cHISh/13JjK7xXks0wUQZbsJ7DmLXJFFNuGOeW/PltHk Azbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gev1bIS92uZfco6kY4Q5CKkZciMWnmtMQi2JfIyCgPA=; b=fbl/X+tCiRn/STR2vopK3NEyamm03OybJiCc2wxnFGQxkKac/xwq1NozYAIqKbcmeu 63Qzedxo3JrVN+KI7tACqtwbr9o0X0gB3AhX00KzEtRv2zcbinMHpaoZOhfR4QOz1Lfd UufD2vKQCrCC3xdbvQtQBQrRpQdiY+uCNVulymrh//pz4PoG1l9KMxYjr0n+9vTXUJaS W5koTkpRzFnpm1GHYqLGd6Hj7xH8yfZxa40hwyUkXTBumlZHF5gAY+9/Mrg0002H0VNl AVNcy2NEbq7oc2vBWSsVbqisFWt0XDU2CUbTjR7N0THt1KqJ7g4/Dpt42PVQ7aF8skWO OI6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JqxpXL7T; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si341643edy.519.2020.06.24.07.11.02; Wed, 24 Jun 2020 07:11:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JqxpXL7T; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403980AbgFXOIN (ORCPT + 99 others); Wed, 24 Jun 2020 10:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388395AbgFXOIN (ORCPT ); Wed, 24 Jun 2020 10:08:13 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A33BC061573; Wed, 24 Jun 2020 07:08:13 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id u128so1455613pgu.13; Wed, 24 Jun 2020 07:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=gev1bIS92uZfco6kY4Q5CKkZciMWnmtMQi2JfIyCgPA=; b=JqxpXL7TQNnqCne9lYUWwS5yBMGbBQP5xqAiSaWEH9j2w4o+K54vJaxMNdzfW2hL8F iob/X6aKzrPTy3acWFPU98fkU3Cra4dE1a91n+tIZC/dsEAEK9Dx1DA1q6N30xcP3TDm 7muRmm7kdkZqERXnu77r0Um19cQMcz7XtfPsTMtHJ7M597wU7xbXvuaiQIOMttnYWUi+ vtWjT8xlxEcvFmamhqqxhPc/smfnAyWy8CcvROAVnhNnQI1UcFTk0+5/6lK5MKW+Tccc LYTWviwAw80lBvIKXHLlnxG1tJA4su/GYYEUYcOCm+O6SnGxttNGCc3tgOYScEh+0UJd HMyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=gev1bIS92uZfco6kY4Q5CKkZciMWnmtMQi2JfIyCgPA=; b=i5k4zz+5dk24eWJrG71D4VzptIJhflahi74zMH1tspV/VZwf/RCi2uYSqcRaE4aOxD PAa1yxvFA8NKB2GyPuW7cIyOBXhANYb7F4dvfDXpewvIxkXH4iMR7ib4PKKz7GKFb+XU +xgfu0+TBfqm1N0QGr4lRpONOO1Wr284Q3h/MrduB+hUaIg6NbtZ1K7bv7Qgl9lMVzLf Fyt1mQIfmXXqj/i8d5XSUurGX9Lya300Pp5/4DDVoEPLT4iP2ZTJJd8MTe3caOqqc8TP oVlixSdRgy0oksAK9SrX6X/VtedDUwKILdtMJBmehT1HCM3CMWLQaguOl6YKbnnpqWwE xwLw== X-Gm-Message-State: AOAM532kuVNfNcGx7i07p5DzaMffRzUCNz5zamx0i2Ju7K8XSZ6BpxcT JTl8kfgQFT/J5AQ5gTj4tH0= X-Received: by 2002:a62:1a87:: with SMTP id a129mr29414043pfa.95.1593007692476; Wed, 24 Jun 2020 07:08:12 -0700 (PDT) Received: from sol (220-235-99-174.dyn.iinet.net.au. [220.235.99.174]) by smtp.gmail.com with ESMTPSA id n2sm4056904pgv.37.2020.06.24.07.08.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jun 2020 07:08:11 -0700 (PDT) Date: Wed, 24 Jun 2020 22:08:06 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: LKML , linux-gpio , Linus Walleij Subject: Re: [PATCH 08/22] gpiolib: cdev: complete the irq/thread timestamp handshake Message-ID: <20200624140806.GA7569@sol> References: <20200623040107.22270-1-warthog618@gmail.com> <20200623040107.22270-9-warthog618@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 04:00:42PM +0200, Bartosz Golaszewski wrote: > wt., 23 cze 2020 o 06:02 Kent Gibson napisaƂ(a): > > > > Reset the timestamp field to 0 after using it in lineevent_irq_thread. > > > > The timestamp is set by lineevent_irq_handler and is tested by > > lineevent_irq_thread to determine if it is called from a nested theaded > > interrupt. > > lineevent_irq_thread is assuming that the nested, or otherwise, status > > of the IRQ is static, i.e. it is either always nested or never nested. > > This change removes that assumption, resetting the timestamp so it can > > be re-used to determine the nested state of subsequent interrupts. > > > > Signed-off-by: Kent Gibson > > > > This change makes sense to me but I'm having a hard time processing > the explanation. If we're requesting the interrupt and allocating the > lineevent state in the same function - how can we run into a situation > here the status of the irq would change like what you describe? > I'm not totally sure myself, as my understanding of how interrupts are shared in the kernel is pretty sketchy, but my concern is that if we are sharing the irq then whoever we are sharing with may release the irq and we go from nested to unnested. Or vice versa. Not sure if that is valid, but that was my concern, and it seemed like a minor change to cover it just in case. Cheers, Kent.