From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Subject: Re: [PATCH 31/37] misc: Add host side pci driver for pci test function device Date: Wed, 25 Jan 2017 11:10:53 +0530 Message-ID: <58883A65.8020306@ti.com> References: <1484216786-17292-1-git-send-email-kishon@ti.com> <1484216786-17292-32-git-send-email-kishon@ti.com> <20170124160224.GA23528@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170124160224.GA23528-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Christoph Hellwig Cc: Bjorn Helgaas , Jingoo Han , Joao Pinto , Arnd Bergmann , linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-VrBV9hrLPhE@public.gmane.org, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, nsekhar-l0cyMroinI0@public.gmane.org List-Id: linux-arm-msm@vger.kernel.org Hi, On Tuesday 24 January 2017 09:32 PM, Christoph Hellwig wrote: > On Thu, Jan 12, 2017 at 03:56:20PM +0530, Kishon Vijay Abraham I wrote: >> Add PCI endpoint test driver that can verify base address >> register, legacy interrupt/MSI interrupt and read/write/copy >> buffers between host and device. The corresponding pci-epf-test >> function driver should be used on the EP side. > > Just curious: what would you think of a text based (e.g. debugfs) > interface to avoid the need for a userspace tool here? I felt having a userspace tool gives the flexibility to add more tests (iterations, sizes etc..) while the driver can just focus on performing simple tests. Say we'd like to perform infinite read/write tests, it's better if the userspace tool invokes read/write tests repeatedly instead of that being implemented in the driver. > >> +static const struct pci_device_id pci_endpoint_test_tbl[] = { >> + { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_ANY_ID) }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl); > > Also this looks really odd, and dangerous. Probing for any > TI device will bind to all kinds of legit devices. It would > be good if you could squeeze out a single id for this device There is actually an id for the device, but I think we'll need an id for every function right? Having said that the id for the device is better than PCI_ANY_ID. Will fix it in my next revision. Thanks Kishon -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbdAYFmc (ORCPT ); Wed, 25 Jan 2017 00:42:32 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:56482 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbdAYFm3 (ORCPT ); Wed, 25 Jan 2017 00:42:29 -0500 Subject: Re: [PATCH 31/37] misc: Add host side pci driver for pci test function device To: Christoph Hellwig References: <1484216786-17292-1-git-send-email-kishon@ti.com> <1484216786-17292-32-git-send-email-kishon@ti.com> <20170124160224.GA23528@infradead.org> CC: Bjorn Helgaas , Jingoo Han , Joao Pinto , Arnd Bergmann , , , , , , , , , , , From: Kishon Vijay Abraham I Message-ID: <58883A65.8020306@ti.com> Date: Wed, 25 Jan 2017 11:10:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20170124160224.GA23528@infradead.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tuesday 24 January 2017 09:32 PM, Christoph Hellwig wrote: > On Thu, Jan 12, 2017 at 03:56:20PM +0530, Kishon Vijay Abraham I wrote: >> Add PCI endpoint test driver that can verify base address >> register, legacy interrupt/MSI interrupt and read/write/copy >> buffers between host and device. The corresponding pci-epf-test >> function driver should be used on the EP side. > > Just curious: what would you think of a text based (e.g. debugfs) > interface to avoid the need for a userspace tool here? I felt having a userspace tool gives the flexibility to add more tests (iterations, sizes etc..) while the driver can just focus on performing simple tests. Say we'd like to perform infinite read/write tests, it's better if the userspace tool invokes read/write tests repeatedly instead of that being implemented in the driver. > >> +static const struct pci_device_id pci_endpoint_test_tbl[] = { >> + { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_ANY_ID) }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl); > > Also this looks really odd, and dangerous. Probing for any > TI device will bind to all kinds of legit devices. It would > be good if you could squeeze out a single id for this device There is actually an id for the device, but I think we'll need an id for every function right? Having said that the id for the device is better than PCI_ANY_ID. Will fix it in my next revision. Thanks Kishon From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Subject: Re: [PATCH 31/37] misc: Add host side pci driver for pci test function device To: Christoph Hellwig References: <1484216786-17292-1-git-send-email-kishon@ti.com> <1484216786-17292-32-git-send-email-kishon@ti.com> <20170124160224.GA23528@infradead.org> From: Kishon Vijay Abraham I Message-ID: <58883A65.8020306@ti.com> Date: Wed, 25 Jan 2017 11:10:53 +0530 MIME-Version: 1.0 In-Reply-To: <20170124160224.GA23528@infradead.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Joao Pinto , Arnd Bergmann , linux-doc@vger.kernel.org, Jingoo Han , linux-arm-msm@vger.kernel.org, nsekhar@ti.com, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-samsung-soc@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , linux-omap@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: Hi, On Tuesday 24 January 2017 09:32 PM, Christoph Hellwig wrote: > On Thu, Jan 12, 2017 at 03:56:20PM +0530, Kishon Vijay Abraham I wrote: >> Add PCI endpoint test driver that can verify base address >> register, legacy interrupt/MSI interrupt and read/write/copy >> buffers between host and device. The corresponding pci-epf-test >> function driver should be used on the EP side. > > Just curious: what would you think of a text based (e.g. debugfs) > interface to avoid the need for a userspace tool here? I felt having a userspace tool gives the flexibility to add more tests (iterations, sizes etc..) while the driver can just focus on performing simple tests. Say we'd like to perform infinite read/write tests, it's better if the userspace tool invokes read/write tests repeatedly instead of that being implemented in the driver. > >> +static const struct pci_device_id pci_endpoint_test_tbl[] = { >> + { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_ANY_ID) }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl); > > Also this looks really odd, and dangerous. Probing for any > TI device will bind to all kinds of legit devices. It would > be good if you could squeeze out a single id for this device There is actually an id for the device, but I think we'll need an id for every function right? Having said that the id for the device is better than PCI_ANY_ID. Will fix it in my next revision. Thanks Kishon _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: kishon@ti.com (Kishon Vijay Abraham I) Date: Wed, 25 Jan 2017 11:10:53 +0530 Subject: [PATCH 31/37] misc: Add host side pci driver for pci test function device In-Reply-To: <20170124160224.GA23528@infradead.org> References: <1484216786-17292-1-git-send-email-kishon@ti.com> <1484216786-17292-32-git-send-email-kishon@ti.com> <20170124160224.GA23528@infradead.org> Message-ID: <58883A65.8020306@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On Tuesday 24 January 2017 09:32 PM, Christoph Hellwig wrote: > On Thu, Jan 12, 2017 at 03:56:20PM +0530, Kishon Vijay Abraham I wrote: >> Add PCI endpoint test driver that can verify base address >> register, legacy interrupt/MSI interrupt and read/write/copy >> buffers between host and device. The corresponding pci-epf-test >> function driver should be used on the EP side. > > Just curious: what would you think of a text based (e.g. debugfs) > interface to avoid the need for a userspace tool here? I felt having a userspace tool gives the flexibility to add more tests (iterations, sizes etc..) while the driver can just focus on performing simple tests. Say we'd like to perform infinite read/write tests, it's better if the userspace tool invokes read/write tests repeatedly instead of that being implemented in the driver. > >> +static const struct pci_device_id pci_endpoint_test_tbl[] = { >> + { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_ANY_ID) }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl); > > Also this looks really odd, and dangerous. Probing for any > TI device will bind to all kinds of legit devices. It would > be good if you could squeeze out a single id for this device There is actually an id for the device, but I think we'll need an id for every function right? Having said that the id for the device is better than PCI_ANY_ID. Will fix it in my next revision. Thanks Kishon