Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1599110pxb; Thu, 16 Sep 2021 10:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAAIF0m+ISe+9iPwjFneg6FRUL3An7hPc8psS8NnytQaOeVJsfCioBwKZeNCyPrIwZ8wbM X-Received: by 2002:a17:906:3ce2:: with SMTP id d2mr7614002ejh.410.1631814341169; Thu, 16 Sep 2021 10:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631814341; cv=none; d=google.com; s=arc-20160816; b=Fh3akj4mgUAZAFsGPBfH85PexN2BuZu2x8IbF5WS72xvjMdOEzhbPN3YLliojV4GWI FXrz5QEYPFtE0wooTPisMWekgIv/GObvrvCDMj7DhuWVI0fNKmbjpf6rE9J7Locrq8BH f0xKTUOyx0g/B8RejueT3ivt+EEsq+d7R0cQj2v+0JMTyF87FyUzMF6JxP+9La+7P223 rquUobk7N+sx4nTy7PmsuVGRg91cZxt8mbJ/LZjiTtvypBQYGEvJpjRA3v6M6l/lOfTB zDFaufcm+35P68ehOo6HW3+nxGwPXYEd2xca8McMmaJ68GACxCGDTgQ8+keMEfHgIAik tXsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PTXGEnB9DiyWtB63yQyALlfETOKew7D8vM+rEURPg4c=; b=yCKCMb/04vS+bGI0nqmCktVHqSN8vltnwFJWhqhWyAv1qlCXPOLjsfaOmzg2jBbiP2 bcMX9IHElmzyuTjpheXKx9/Aano29Ywphb2FrEveQIrFz2oO66Gh6uhHC0ZI+sWfvB3D PPuZA9M1E/YNy+RTWzZmdwzABIRHBNFm9z6RzyGCKReaXM3ttU1/N7vkGwayPN7C5BCc XrBAYRYwr6fBht4BqChK2/N1vDM1vACXaaV8l6bigQz4MMOQToUP3CY9lGSS7soQAAtk DrwFOcBWUNCxXVgIk8BjWGwByiStGhHzJTxGEN2EPx2FWCt++VNbFDsnSN5IIA6YpGm7 1LsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=sKtAMXHF; 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 l24si4061479edw.288.2021.09.16.10.45.17; Thu, 16 Sep 2021 10:45:41 -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=@lunn.ch header.s=20171124 header.b=sKtAMXHF; 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 S1355440AbhIPRlb (ORCPT + 99 others); Thu, 16 Sep 2021 13:41:31 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44556 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344330AbhIPRfp (ORCPT ); Thu, 16 Sep 2021 13:35:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=PTXGEnB9DiyWtB63yQyALlfETOKew7D8vM+rEURPg4c=; b=sKtAMXHFMpblRZ4ZRcrz3Vsxv/ WIbEKb+DoWjYcKLVSx2GGZcWy2SuVFnCAAPPQ/+cKa0xYfKEl/bkvwqKeRQkBbHmMFjWROzU8FXCu aovJgT/IyReR4tuKGEsosFtUANPUkUPRNIyohpH04+CGUpMdtHYKSjMnN8KlrAqk3zWU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mQvHA-006x1E-ST; Thu, 16 Sep 2021 19:34:20 +0200 Date: Thu, 16 Sep 2021 19:34:20 +0200 From: Andrew Lunn To: Asmaa Mnebhi Cc: "andy.shevchenko@gmail.com" , "linux-gpio@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "kuba@kernel.org" , "linus.walleij@linaro.org" , "bgolaszewski@baylibre.com" , "davem@davemloft.net" , "rjw@rjwysocki.net" , David Thompson Subject: Re: [PATCH v1 1/2] gpio: mlxbf2: Introduce IRQ support Message-ID: References: <20210915222847.10239-1-asmaa@nvidia.com> <20210915222847.10239-2-asmaa@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 16, 2021 at 03:48:51PM +0000, Asmaa Mnebhi wrote: > > + /* Enable PHY interrupt by setting the priority level */ > > This should be an abstract driver for a collection of GPIO lines. > Yes, one of these GPIOs is used for the PHY, but the GPIO driver does not care. So please remove this comment. > Asmaa>> Done > > > + val = readl(gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); > > + val |= BIT(offset); > > + writel(val, gs->gpio_io + YU_GPIO_CAUSE_OR_EVTEN0); > > What exactly does this do? It appears to clear the interrupt, if i understand mlxbf2_gpio_irq_handler(). I don't know the GPIO framework well enough to know if this is correct. It does mean if the interrupt signal is active but masked, and you enable it, you appear to loose the interrupt? Maybe you want the interrupt to fire as soon as it is enabled? > > Asmaa>> > YU_GPIO_CAUSE_OR_CLRCAUSE - Makes sure the interrupt is initially cleared. Otherwise, we will not receive further interrupts. If the interrupt status bit is set, as soon as you unmask the interrupt, the hardware should fire the interrupt. At least, that is how interrupt controllers usually work. A typical pattern is that the interrupt fires. You mask it, ack it, and then do what is needed to actually handle the interrupt. While doing the handling, the hardware can indicate the interrupt again. But since it is masked nothing happened. This avoids your interrupt handler going recursive. Once the handler has finished, the interrupt is unmasked. At this point it actually fires, triggering the interrupt handler again. Please also get your email client fixed. I wrap my emails at around 75 characters. Your mailer has destroyed it. Your text should also be wrapped at about 75 characters. Andrew