DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing
@ 2018-09-25 19:22 Thomas Monjalon
  2018-09-26  8:12 ` Shreyansh Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-09-25 19:22 UTC (permalink / raw)
  To: hemant.agrawal, shreyansh.jain; +Cc: dev

The probing functions of NXP buses were missing to set
the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set
in the device structures.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/dpaa/dpaa_bus.c   | 6 +++++-
 drivers/bus/fslmc/fslmc_bus.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 16fabd1be..49cd04dbb 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -563,8 +563,12 @@ rte_dpaa_bus_probe(void)
 			    dev->device.devargs->policy ==
 			    RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
-				if (ret)
+				if (ret) {
 					DPAA_BUS_ERR("Unable to probe.\n");
+				} else {
+					dev->driver = drv;
+					dev->device.driver = &drv->driver;
+				}
 			}
 			break;
 		}
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index d2900edc5..bfe81e236 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -396,8 +396,12 @@ rte_fslmc_probe(void)
 			   dev->device.devargs->policy ==
 			   RTE_DEV_WHITELISTED)) {
 				ret = drv->probe(drv, dev);
-				if (ret)
+				if (ret) {
 					DPAA2_BUS_ERR("Unable to probe");
+				} else {
+					dev->driver = drv;
+					dev->device.driver = &drv->driver;
+				}
 			}
 			break;
 		}
-- 
2.19.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing
  2018-09-25 19:22 [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing Thomas Monjalon
@ 2018-09-26  8:12 ` Shreyansh Jain
  2018-09-27 12:40   ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Shreyansh Jain @ 2018-09-26  8:12 UTC (permalink / raw)
  To: Thomas Monjalon, hemant.agrawal; +Cc: dev

On Wednesday 26 September 2018 12:52 AM, Thomas Monjalon wrote:
> The probing functions of NXP buses were missing to set
> the driver used for successfully probing a device.
> 
> The NXP driver and the generic rte_driver are now set
> in the device structures.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

A part of this was already being done in the drv->probe(), though it was 
  not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).

--->8---net/dpaa2/dpaa2_ethdev.c--
2008
2009         eth_dev->device = &dpaa2_dev->device;
2010         eth_dev->device->driver = &dpaa2_drv->driver;
2011
--->8---

Thank you!

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing
  2018-09-26  8:12 ` Shreyansh Jain
@ 2018-09-27 12:40   ` Thomas Monjalon
  2018-09-28 12:27     ` Shreyansh Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-09-27 12:40 UTC (permalink / raw)
  To: Shreyansh Jain; +Cc: dev, hemant.agrawal

26/09/2018 10:12, Shreyansh Jain:
> On Wednesday 26 September 2018 12:52 AM, Thomas Monjalon wrote:
> > The probing functions of NXP buses were missing to set
> > the driver used for successfully probing a device.
> > 
> > The NXP driver and the generic rte_driver are now set
> > in the device structures.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> 
> A part of this was already being done in the drv->probe(), though it was 
>   not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).
> 
> --->8---net/dpaa2/dpaa2_ethdev.c--
> 2008
> 2009         eth_dev->device = &dpaa2_dev->device;
> 2010         eth_dev->device->driver = &dpaa2_drv->driver;
> 2011
> --->8---

I guess we could remove the driver assignment in NXP drivers,
after this patch applied.

> Thank you!
> 
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Applied

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing
  2018-09-27 12:40   ` Thomas Monjalon
@ 2018-09-28 12:27     ` Shreyansh Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Shreyansh Jain @ 2018-09-28 12:27 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, hemant.agrawal

On Thursday 27 September 2018 06:10 PM, Thomas Monjalon wrote:
> 26/09/2018 10:12, Shreyansh Jain:
>> On Wednesday 26 September 2018 12:52 AM, Thomas Monjalon wrote:
>>> The probing functions of NXP buses were missing to set
>>> the driver used for successfully probing a device.
>>>
>>> The NXP driver and the generic rte_driver are now set
>>> in the device structures.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>
>> A part of this was already being done in the drv->probe(), though it was
>>    not complete (dpaa2_dev->driver = dpaa2_drv; was not being done).
>>
>> --->8---net/dpaa2/dpaa2_ethdev.c--
>> 2008
>> 2009         eth_dev->device = &dpaa2_dev->device;
>> 2010         eth_dev->device->driver = &dpaa2_drv->driver;
>> 2011
>> --->8---
> 
> I guess we could remove the driver assignment in NXP drivers,
> after this patch applied.
> 

Sent. I have kept fixes reference to your patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-28 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-25 19:22 [dpdk-dev] [PATCH] drivers/bus: fill driver reference after NXP probing Thomas Monjalon
2018-09-26  8:12 ` Shreyansh Jain
2018-09-27 12:40   ` Thomas Monjalon
2018-09-28 12:27     ` Shreyansh Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).