public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: spi: rockchip: check requesting dma channel with EPROBE_DEFER
Date: Mon, 14 Mar 2016 18:21:00 +0800	[thread overview]
Message-ID: <56E6908C.3060904@rock-chips.com> (raw)
In-Reply-To: <20160314094844.GA12754@mwanda>

On 2016/3/14 17:48, Dan Carpenter wrote:
> Hello Shawn Lin,
>
> The patch 61cadcf46cfd: "spi: rockchip: check requesting dma channel
> with EPROBE_DEFER" from Mar 9, 2016, leads to the following static
> checker warning:
>
> 	drivers/spi/spi-rockchip.c:742 rockchip_spi_probe()
> 	warn: passing zero to 'PTR_ERR'
>
> drivers/spi/spi-rockchip.c
>     732
>     733          rs->dma_tx.ch = dma_request_slave_channel(rs->dev, "tx");
>     734          if (IS_ERR_OR_NULL(rs->dma_tx.ch)) {
>     735                  /* Check tx to see if we need defer probing driver */
>     736                  if (PTR_ERR(rs->dma_tx.ch) == -EPROBE_DEFER) {
>     737                          ret = -EPROBE_DEFER;
>     738                          goto err_get_fifo_len;
>
> What's going on here?  Are we planning to change dma_request_slave_channel()
> to return error pointers?  Also what about other error pointers besides
> EPROBE_DEFER it seems dangerous to leave rs->dma_tx.ch as an error
> pointer.  We probably eventually try to free it if it's non-NULL.

yes, we are plannig to return EPROBE_DEFER/NULL for
dma_request_slave_channel to make sure we don't decide
the dma cap based on driver probe sequence.

No any other error pointer will be returned to the caller

>
>     739                  }
>     740                  dev_warn(rs->dev, "Failed to request TX DMA channel\n");
>     741          }
>     742
>
> regards,
> dan carpenter
>
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-14 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  9:48 spi: rockchip: check requesting dma channel with EPROBE_DEFER Dan Carpenter
2016-03-14 10:21 ` Shawn Lin [this message]
     [not found]   ` <56E6908C.3060904-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-03-14 11:14     ` Dan Carpenter

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=56E6908C.3060904@rock-chips.com \
    --to=shawn.lin-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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