Thread (25 messages) flat view 25 messages, 5 authors, 2023-02-02

Re: [PATCH v4 net-next 1/8] sfc: add devlink support for ef100

From: Lucero Palau, Alejandro <hidden>
Date: 2023-02-02 06:41:52
Also in: linux-doc


On 2/1/23 19:01, Jakub Kicinski wrote:
On Wed, 1 Feb 2023 10:07:33 +0100 Jiri Pirko wrote:
quoted
quoted
This is due to the recommended/required devlink lock/unlock during
driver initialization/removal.

I think it is better to keep the lock/unlock inside the specific driver
devlink code, and the functions naming reflects a time window when
devlink related/dependent processing is being done.

I'm not against changing this, maybe adding the lock/unlock suffix would
be preferable?:

int efx_probe_devlink_and_lock(struct efx_nic *efx);
void efx_probe_devlink_unlock(struct efx_nic *efx);
void efx_fini_devlink_lock(struct efx_nic *efx);
void efx_fini_devlink_and_unlock(struct efx_nic *efx);
Sounds better. Thanks!
FWIW I'd just take the devl lock in the main driver code.
devlink should be viewed as a layer between bus and driver rather
than as another subsystem the driver registers with. Otherwise reloads
and port creation get awkward.

But the above sounds okay, too.
That is what I have tried to do with these extra functions invoked from 
the main driver code.

The problem is one part of the protection needs to be done inside the 
driver's devlink code (if we want to avoid different calls for 
allocating then registering or unregistering then releasing), so it 
looked awkward to me the other protection part being directly in main 
driver code. So, I think the extra functions are worth for avoiding 
confusion.




Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help