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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B1CCC4320E for ; Tue, 3 Aug 2021 09:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C0DA60F94 for ; Tue, 3 Aug 2021 09:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235004AbhHCJ7t (ORCPT ); Tue, 3 Aug 2021 05:59:49 -0400 Received: from foss.arm.com ([217.140.110.172]:46156 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235030AbhHCJ65 (ORCPT ); Tue, 3 Aug 2021 05:58:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B9868150C; Tue, 3 Aug 2021 02:58:46 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 077693F40C; Tue, 3 Aug 2021 02:58:44 -0700 (PDT) Date: Tue, 3 Aug 2021 10:58:39 +0100 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Cc: Arnd Bergmann , Rob Herring , Bjorn Helgaas , Lokesh Vutla , Greg Kroah-Hartman , Tom Joseph , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nadeem@cadence.com Subject: Re: [PATCH v2 5/6] misc: pci_endpoint_test: Do not request or allocate IRQs in probe Message-ID: <20210803095839.GA11252@lpieralisi> References: <20210803074932.19820-1-kishon@ti.com> <20210803074932.19820-6-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210803074932.19820-6-kishon@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 03, 2021 at 01:19:31PM +0530, Kishon Vijay Abraham I wrote: > Allocation of IRQ vectors and requesting IRQ is done as part of > PCITEST_SET_IRQTYPE. Do not request or allocate IRQs in probe for > AM654 and J721E so that the user space test script has better control > of the devices for which the IRQs are configured. Since certain user > space scripts could rely on allocation of IRQ vectors during probe, > remove allocation of IRQs only for TI's K3 platform. > > Signed-off-by: Kishon Vijay Abraham I > --- > drivers/misc/pci_endpoint_test.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) I don't claim to understand the inner details of the endpoint test device but it looks like this approach should be redesigned. I don't believe using devices quirks is the best approach to expose/remove a feature to userspace, this can soon become unmaintenable. Maybe you can elaborate a bit more on what the real issue is please ? Thanks, Lorenzo > diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c > index c7ee34013485..9740f2a0e7cd 100644 > --- a/drivers/misc/pci_endpoint_test.c > +++ b/drivers/misc/pci_endpoint_test.c > @@ -79,6 +79,9 @@ > #define PCI_DEVICE_ID_RENESAS_R8A774C0 0x002d > #define PCI_DEVICE_ID_RENESAS_R8A774E1 0x0025 > > +#define is_j721e_pci_dev(pdev) \ > + ((pdev)->device == PCI_DEVICE_ID_TI_J721E) > + > static DEFINE_IDA(pci_endpoint_test_ida); > > #define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \ > @@ -810,9 +813,11 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, > > pci_set_master(pdev); > > - if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) { > - err = -EINVAL; > - goto err_disable_irq; > + if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { > + if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) { > + err = -EINVAL; > + goto err_disable_irq; > + } > } > > for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { > @@ -850,9 +855,11 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, > goto err_ida_remove; > } > > - if (!pci_endpoint_test_request_irq(test)) { > - err = -EINVAL; > - goto err_kfree_test_name; > + if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { > + if (!pci_endpoint_test_request_irq(test)) { > + err = -EINVAL; > + goto err_kfree_test_name; > + } > } > > misc_device = &test->miscdev; > -- > 2.17.1 > 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 X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F2AAC4338F for ; Tue, 3 Aug 2021 10:00:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D2ABE60F56 for ; Tue, 3 Aug 2021 10:00:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2ABE60F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: 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=3oTIHrW2A7i2Qjy3aSy+9hX6Uj6A/TzvfsifKoeaQUg=; b=N5ZuB/I81Iebjh bagcUqLjET4WmtGeZ7luPTyCZNwrQoMNnoN401qrj6u9pJI472sNFsaC2IBZUeavrfMFOVnqDgiPQ okKpDowqx5Zi/SHZ1IVHesFPk5JzzuDAmLnOmjrEont2QWqNQ1QRRtWI3ZzoSbr/OEmssfAOfYSXv mSsSR7/cPN08h9sRIw4IEUqoQkir6FmLf8UaRe/i8uYV7Z/hPJ4Tai4Zo9QZtYgszeAEdPLDVK411 evJ6o4UoqHLY4zj5/HatG+jBXgh6CJqpP9q/WjwDXqPq7ZV3ODyO3ilayaqci0aTrc3IgW+0MDk/R 8vkEXrMRU4y8HLehseIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mArCG-001uHu-E7; Tue, 03 Aug 2021 09:58:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mArCC-001uGr-Fm for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 09:58:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B9868150C; Tue, 3 Aug 2021 02:58:46 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 077693F40C; Tue, 3 Aug 2021 02:58:44 -0700 (PDT) Date: Tue, 3 Aug 2021 10:58:39 +0100 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Cc: Arnd Bergmann , Rob Herring , Bjorn Helgaas , Lokesh Vutla , Greg Kroah-Hartman , Tom Joseph , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nadeem@cadence.com Subject: Re: [PATCH v2 5/6] misc: pci_endpoint_test: Do not request or allocate IRQs in probe Message-ID: <20210803095839.GA11252@lpieralisi> References: <20210803074932.19820-1-kishon@ti.com> <20210803074932.19820-6-kishon@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210803074932.19820-6-kishon@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210803_025848_625746_588409BD X-CRM114-Status: GOOD ( 21.54 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Aug 03, 2021 at 01:19:31PM +0530, Kishon Vijay Abraham I wrote: > Allocation of IRQ vectors and requesting IRQ is done as part of > PCITEST_SET_IRQTYPE. Do not request or allocate IRQs in probe for > AM654 and J721E so that the user space test script has better control > of the devices for which the IRQs are configured. Since certain user > space scripts could rely on allocation of IRQ vectors during probe, > remove allocation of IRQs only for TI's K3 platform. > > Signed-off-by: Kishon Vijay Abraham I > --- > drivers/misc/pci_endpoint_test.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) I don't claim to understand the inner details of the endpoint test device but it looks like this approach should be redesigned. I don't believe using devices quirks is the best approach to expose/remove a feature to userspace, this can soon become unmaintenable. Maybe you can elaborate a bit more on what the real issue is please ? Thanks, Lorenzo > diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c > index c7ee34013485..9740f2a0e7cd 100644 > --- a/drivers/misc/pci_endpoint_test.c > +++ b/drivers/misc/pci_endpoint_test.c > @@ -79,6 +79,9 @@ > #define PCI_DEVICE_ID_RENESAS_R8A774C0 0x002d > #define PCI_DEVICE_ID_RENESAS_R8A774E1 0x0025 > > +#define is_j721e_pci_dev(pdev) \ > + ((pdev)->device == PCI_DEVICE_ID_TI_J721E) > + > static DEFINE_IDA(pci_endpoint_test_ida); > > #define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \ > @@ -810,9 +813,11 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, > > pci_set_master(pdev); > > - if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) { > - err = -EINVAL; > - goto err_disable_irq; > + if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { > + if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) { > + err = -EINVAL; > + goto err_disable_irq; > + } > } > > for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { > @@ -850,9 +855,11 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, > goto err_ida_remove; > } > > - if (!pci_endpoint_test_request_irq(test)) { > - err = -EINVAL; > - goto err_kfree_test_name; > + if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { > + if (!pci_endpoint_test_request_irq(test)) { > + err = -EINVAL; > + goto err_kfree_test_name; > + } > } > > misc_device = &test->miscdev; > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel