From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>,
linux-serial@vger.kernel.org
Subject: Re: Commit "serial: 8250_exar: Constify the software nodes' breaks suspend/resume
Date: Tue, 8 Jun 2021 16:47:46 +0300 [thread overview]
Message-ID: <YL91AvvSMdYglcgl@smile.fi.intel.com> (raw)
In-Reply-To: <YL9xY7jT13ZVRxMW@kuha.fi.intel.com>
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
next prev parent reply other threads:[~2021-06-08 13:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 13:17 Commit "serial: 8250_exar: Constify the software nodes' breaks suspend/resume Maxim Levitsky
2021-06-08 13:32 ` Heikki Krogerus
2021-06-08 13:47 ` Andy Shevchenko [this message]
2021-06-08 14:20 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YL91AvvSMdYglcgl@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-serial@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=sudip.mukherjee@codethink.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox