Re: Commit "serial: 8250_exar: Constify the software nodes' breaks suspend/resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 08, 2021 at 04:32:19PM +0300, Heikki Krogerus wrote:
> On Tue, Jun 08, 2021 at 04:17:58PM +0300, Maxim Levitsky wrote:
> > Hi!
> > 
> > I happened to own one of Exar's PCI serial adapters, and this commit that I bisected
> > breaks suspend/resume of the host.
> > 
> > The adapter that I have:
> > 
> > 02:00.0 Serial controller [0700]: Exar Corp. XR17V3521 Dual PCIe UART [13a8:0352] (rev 03) (prog-if 02 [16550])
> > 
> > 
> > First suspend of the system works,but on the second suspend, the system hangs until it reboots.
> > Reverting the commit helps.
> > 
> > I attached a backtrace captured with ramoops 
> > (since I ironically use this serial port to capture the oops backtraces otherwise...)
> > 
> > Best regards,
> > 	Maxim Levitsky
> > 
> 
> Maybe we should fix this by making dev_fwnode() NULL safe?
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index c26370aacdc66..65b866f8bfb1b 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -20,8 +20,8 @@
>  
>  struct fwnode_handle *dev_fwnode(struct device *dev)
>  {
> -       return IS_ENABLED(CONFIG_OF) && dev->of_node ?
> -               of_fwnode_handle(dev->of_node) : dev->fwnode;
> +       return dev ? IS_ENABLED(CONFIG_OF) && dev->of_node ?
> +               of_fwnode_handle(dev->of_node) : dev->fwnode : NULL;
>  }
>  EXPORT_SYMBOL_GPL(dev_fwnode);
> 
> Andy, comments?

We consider dev_fwnode() API to be similar to, let's say, dev_name(). It means
that caller should guarantee that parameter is not NULL.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux