On Sun, Apr 19, 2020 at 10:29 PM Ma, Jiping <[email protected]> wrote: > > Hi, Bruce > > The fix is for kernel 5.2. > Upstream had merged the fix. > No, it is not specific to the yocto integrated changes, it is common. > I send the review to kernel upstream firstly, then send the review to yocto. >
It looks like PaulG has this in his latest -stable, so I already have it on the branches. Cheers, Bruce > Thanks, > Jiping > ________________________________ > 发件人: Bruce Ashfield <[email protected]> > 发送时间: 2020年4月20日 9:22 > 收件人: Ma, Jiping <[email protected]> > 抄送: Tao, Yue <[email protected]>; Yang, Liezhi > <[email protected]>; Hatle, Mark <[email protected]>; > Development list for the linux-yocto repositories > <[email protected]> > 主题: Re: [PATCH] stmmac: debugfs entry name is not be changed when udev rename > device name. > > What kernel versions does this change target ? > > And what is the upstream status of this one ? Is it specific to the > yocto integrated changes ? Is it a backport ? > > Bruce > > On Fri, Apr 17, 2020 at 5:59 AM Jiping Ma <[email protected]> wrote: > > > > Add one notifier for udev changes net device name. > > > > Signed-off-by: Jiping Ma <[email protected]> > > --- > > .../net/ethernet/stmicro/stmmac/stmmac_main.c | 32 +++++++++++++++++++ > > 1 file changed, 32 insertions(+) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > index b14f46a57154..8d927e455123 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > @@ -104,6 +104,7 @@ MODULE_PARM_DESC(chain_mode, "To use chain instead of > > ring mode"); > > static irqreturn_t stmmac_interrupt(int irq, void *dev_id); > > > > #ifdef CONFIG_DEBUG_FS > > +static const struct net_device_ops stmmac_netdev_ops; > > static int stmmac_init_fs(struct net_device *dev); > > static void stmmac_exit_fs(struct net_device *dev); > > #endif > > @@ -4038,6 +4039,34 @@ static int stmmac_dma_cap_show(struct seq_file *seq, > > void *v) > > } > > DEFINE_SHOW_ATTRIBUTE(stmmac_dma_cap); > > > > +/* Use network device events to rename debugfs file entries. > > + */ > > +static int stmmac_device_event(struct notifier_block *unused, > > + unsigned long event, void *ptr) > > +{ > > + struct net_device *dev = netdev_notifier_info_to_dev(ptr); > > + struct stmmac_priv *priv = netdev_priv(dev); > > + > > + if (dev->netdev_ops != &stmmac_netdev_ops) > > + goto done; > > + > > + switch (event) { > > + case NETDEV_CHANGENAME: > > + if (priv->dbgfs_dir) > > + priv->dbgfs_dir = debugfs_rename(stmmac_fs_dir, > > + priv->dbgfs_dir, > > + stmmac_fs_dir, > > + dev->name); > > + break; > > + } > > +done: > > + return NOTIFY_DONE; > > +} > > + > > +static struct notifier_block stmmac_notifier = { > > + .notifier_call = stmmac_device_event, > > +}; > > + > > static int stmmac_init_fs(struct net_device *dev) > > { > > struct stmmac_priv *priv = netdev_priv(dev); > > @@ -4076,6 +4105,8 @@ static int stmmac_init_fs(struct net_device *dev) > > return -ENOMEM; > > } > > > > + register_netdevice_notifier(&stmmac_notifier); > > + > > return 0; > > } > > > > @@ -4083,6 +4114,7 @@ static void stmmac_exit_fs(struct net_device *dev) > > { > > struct stmmac_priv *priv = netdev_priv(dev); > > > > + unregister_netdevice_notifier(&stmmac_notifier); > > debugfs_remove_recursive(priv->dbgfs_dir); > > } > > #endif /* CONFIG_DEBUG_FS */ > > -- > > 2.23.0 > > > > > -- > - Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its end > - "Use the force Harry" - Gandalf, Star Trek II -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#8615): https://lists.yoctoproject.org/g/linux-yocto/message/8615 Mute This Topic: https://lists.yoctoproject.org/mt/73140892/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
