From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DACEC52D6F for ; Thu, 8 Aug 2024 14:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kSHBR50la6iokVWygP7kM2FMcIflEjS6RBzmmxnEkQw=; b=gGQgccR7WEZTfolmJ0hnqe0wPW cGaI0ZFzT/cVQ/YgfD6ziYHPX9nz8Psit10l/Z37w4Nx9R/SwKx1lTMYL400QGv5qvcq356xfqZJY Cw/QEGltEyNwPO8FpJZLyPCQ59VQDCkqsB8/73u7rvxJPCpX34blatIwB5i2UxPXqEDV+/RPbGnAq PW1NPQ0T3fsi3PV1Zru8l6Jvir2qq1oeND/1zkps2yx0VT0oLXmANTF8UqC85if6cntOERCIYER0f bXpIdQDRRR7qZBk2Lg7jYYxLzmfcSJb0GiodbdhmdyNC7SycUC/4bR1VsAtJXFPdTCBEXgYz7htH3 bXCBMZFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc3oT-00000008SR0-3LDG; Thu, 08 Aug 2024 14:08:21 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc3nt-00000008SGg-3AZG for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 14:07:48 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id CF814E0005; Thu, 8 Aug 2024 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723126060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSHBR50la6iokVWygP7kM2FMcIflEjS6RBzmmxnEkQw=; b=D6uE+mMvqw6FhVXuMMxS/wRCXEj95rNeYf2PE5mBLmG/2wWNrcjPIvN1OBHXC0TJSKbA1J DTqOLD3CzBr3c2kcjAJSdw4gQ5kXZ/1eftc4QYDXcyG0lM/wQXfIREbNEdw6FZH0lEoXPp kaq1mliaOqvtQgzBlXPN9r5/vM+XvcTdj/9sBCRommwRQq2W54tBIR3CQ0JCkhCOwOBlRB hqEVCKArZitC2HnLPdD6KN5Y7D+CWwXFAIPkV3g/f7JZoODSB01zyVW8+SP5Kg5UUWW7iT 7dMdfE6LimW9RuptcqfsvYFl1pyts57y2OdsYVorSp/tCiT5rF/fSu9JBBTlHA== Date: Thu, 8 Aug 2024 16:07:37 +0200 From: Herve Codina To: Andy Shevchenko Cc: Geert Uytterhoeven , Simon Horman , Lee Jones , Arnd Bergmann , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Rob Herring , Saravana Kannan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , Andrew Lunn , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Allan Nielsen , Luca Ceresoli , Thomas Petazzoni Subject: Re: [PATCH v4 1/8] misc: Add support for LAN966x PCI device Message-ID: <20240808160737.4d8806ee@bootlin.com> In-Reply-To: References: <20240805101725.93947-1-herve.codina@bootlin.com> <20240805101725.93947-2-herve.codina@bootlin.com> <20240807120956.30c8264e@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_070746_629029_487EBF9F X-CRM114-Status: GOOD ( 26.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andy, On Thu, 8 Aug 2024 15:32:07 +0300 Andy Shevchenko wrote: > On Wed, Aug 7, 2024 at 1:10 PM Herve Codina wrote: > > On Mon, 5 Aug 2024 22:13:38 +0200 > > Andy Shevchenko wrote: > > > On Mon, Aug 5, 2024 at 12:19 PM Herve Codina wrote: > > ... > > > > > + if (!pdev->irq) > > > > + return ERR_PTR(-EOPNOTSUPP); > > > > > > Before even trying to get it via APIs? (see below as well) > > > Also, when is it possible to have 0 here? > > > > pdev->irq can be 0 if the PCI device did not request any IRQ > > (i.e. PCI_INTERRUPT_PIN in PCI config header is 0). > > > I use that to check whether or not INTx is supported. > > But why do you need that? What happens if you get a new device that > supports let's say MSI? > > > Even if this code is present in the LAN966x PCI driver, it can be use as a > > starting point for other drivers and may be moved to a common part in the > > future. > > > > Do you think I should remove it ? > > I think pci_alloc_vectors() should be enough. Make it to be the first > call, if you think it's better. > Thanks for your answer. I will remove the pdev->irq check an rely pci_alloc_vectors(). Not sure that I will move the call to the first call. Best regards. Hervé