lkml.org 
[lkml]   [2023]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v7 1/8] bnxt_en: Add auxiliary driver support
On Sat, 14 Jan 2023 12:39:09 -0800 Ajit Khaparde wrote:
> > > +static void bnxt_aux_dev_release(struct device *dev)
> > > +{
> > > + struct bnxt_aux_dev *bnxt_adev =
> > > + container_of(dev, struct bnxt_aux_dev, aux_dev.dev);
> > > + struct bnxt *bp = netdev_priv(bnxt_adev->edev->net);
> > > +
> > > + bnxt_adev->edev->en_ops = NULL;
> > > + kfree(bnxt_adev->edev);
> >
> > And yet the reference counted "release" function accesses the bp->adev
> > like it must exist.
> >
> > This seems odd to me - why do we need refcounting on devices at all
> > if we can free them synchronously? To be clear - I'm not sure this is
> > wrong, just seems odd.
> I followed the existing implementations in that regard. Thanks

Leon, could you take a look? Is there no problem in assuming bnxt_adev
is still around in the release function?

\
 
 \ /
  Last update: 2023-03-26 23:43    [W:0.090 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site