mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Torgue <alexandre.torgue@st.com>
To: Niklas Cassel <niklas.cassel@axis.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Niklas Cassel <niklass@axis.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/6] net: stmmac: return error if no DMA configuration is found
Date: Thu, 8 Dec 2016 11:44:35 +0100	[thread overview]
Message-ID: <d18098a5-a4a4-0c63-f64c-cdb7144dd67e@st.com> (raw)
In-Reply-To: <1481120409-18103-2-git-send-email-niklass@axis.com>

Hi Niklas,

On 12/07/2016 03:20 PM, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>
>
> All drivers except pci glue layer calls stmmac_probe_config_dt.
> stmmac_probe_config_dt does a kzalloc dma_cfg.
>
> pci glue layer does kzalloc dma_cfg explicitly, so all current
> drivers does a kzalloc dma_cfg.
>
> Return an error if no DMA configuration is found, that way
> we can assume that the DMA configuration always exists.
>
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>

Acked-by: Alexandre Torgue <alexandre.torgue@stcom>

> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 982c95213da4..14366800e5e6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1578,16 +1578,12 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv)
>   */
>  static int stmmac_init_dma_engine(struct stmmac_priv *priv)
>  {
> -	int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, aal = 0;
> -	int mixed_burst = 0;
>  	int atds = 0;
>  	int ret = 0;
>
> -	if (priv->plat->dma_cfg) {
> -		pbl = priv->plat->dma_cfg->pbl;
> -		fixed_burst = priv->plat->dma_cfg->fixed_burst;
> -		mixed_burst = priv->plat->dma_cfg->mixed_burst;
> -		aal = priv->plat->dma_cfg->aal;
> +	if (!priv->plat->dma_cfg) {
> +		dev_err(priv->device, "DMA configuration not found\n");
> +		return -EINVAL;
>  	}
>
>  	if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE))
> @@ -1599,8 +1595,12 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
>  		return ret;
>  	}
>
> -	priv->hw->dma->init(priv->ioaddr, pbl, fixed_burst, mixed_burst,
> -			    aal, priv->dma_tx_phy, priv->dma_rx_phy, atds);
> +	priv->hw->dma->init(priv->ioaddr,
> +			    priv->plat->dma_cfg->pbl,
> +			    priv->plat->dma_cfg->fixed_burst,
> +			    priv->plat->dma_cfg->mixed_burst,
> +			    priv->plat->dma_cfg->aal,
> +			    priv->dma_tx_phy, priv->dma_rx_phy, atds);
>
>  	if (priv->synopsys_id >= DWMAC_CORE_4_00) {
>  		priv->rx_tail_addr = priv->dma_rx_phy +
>

  reply	other threads:[~2016-12-08 10:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 14:20 [PATCH v3 0/6] net: stmmac: make DMA programmable burst length more configurable Niklas Cassel
2016-12-07 14:20 ` [PATCH v3 1/6] net: stmmac: return error if no DMA configuration is found Niklas Cassel
2016-12-08 10:44   ` Alexandre Torgue [this message]
2016-12-08 15:19     ` David Miller
2016-12-08 15:41       ` Alexandre Torgue
2016-12-07 14:20 ` [PATCH v3 2/6] net: stmmac: simplify the common DMA init API Niklas Cassel
2016-12-08  8:50   ` Alexandre Torgue
2016-12-07 14:20 ` [PATCH v3 3/6] net: stmmac: stmmac_platform: fix parsing of DT binding Niklas Cassel
2016-12-08  9:02   ` Alexandre Torgue
2016-12-08  9:46     ` Niklas Cassel
2016-12-08  9:54       ` Alexandre Torgue
2016-12-07 14:20 ` [PATCH v3 4/6] net: stmmac: dwmac1000: fix define DMA_BUS_MODE_RPBL_MASK Niklas Cassel
2016-12-08  9:12   ` Alexandre Torgue
2016-12-07 14:20 ` [PATCH v3 5/6] net: stmmac: add support for independent DMA pbl for tx/rx Niklas Cassel
2016-12-08 10:30   ` Alexandre Torgue
2016-12-07 14:20 ` [PATCH v3 6/6] net: smmac: allow configuring lower pbl values Niklas Cassel
2016-12-08 10:42   ` Alexandre Torgue
2016-12-08 13:44     ` Andreas Färber
2016-12-08 15:18     ` David Miller
2016-12-08 18:07 ` [PATCH v3 0/6] net: stmmac: make DMA programmable burst length more configurable David Miller

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=d18098a5-a4a4-0c63-f64c-cdb7144dd67e@st.com \
    --to=alexandre.torgue@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.cassel@axis.com \
    --cc=niklass@axis.com \
    --cc=peppe.cavallaro@st.com \
    /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

all inboxes | Powered by JetHome®