Commit fd4a1056 authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

net: mvpp2: do not update the queue mode while probing

This patch updates the probing function so that the queue mode isn't
updated while probing, as the driver would silently end up using a
configuration not wanted by the user. The patch adds an extra check to
validate the chosen queue mode instead, and the driver will fail to
probe if the configuration is invalid.
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 930e1f56
...@@ -4240,6 +4240,10 @@ static bool mvpp2_port_has_irqs(struct mvpp2 *priv, ...@@ -4240,6 +4240,10 @@ static bool mvpp2_port_has_irqs(struct mvpp2 *priv,
char name[5]; char name[5];
int i; int i;
/* ACPI */
if (!port_node)
return true;
if (priv->hw_version == MVPP21) if (priv->hw_version == MVPP21)
return false; return false;
...@@ -4634,16 +4638,13 @@ static int mvpp2_port_probe(struct platform_device *pdev, ...@@ -4634,16 +4638,13 @@ static int mvpp2_port_probe(struct platform_device *pdev,
int phy_mode; int phy_mode;
int err, i, cpu; int err, i, cpu;
if (port_node) {
has_tx_irqs = mvpp2_port_has_irqs(priv, port_node, &flags); has_tx_irqs = mvpp2_port_has_irqs(priv, port_node, &flags);
} else { if (!has_tx_irqs && queue_mode == MVPP2_QDIST_MULTI_MODE) {
has_tx_irqs = true; dev_err(&pdev->dev,
queue_mode = MVPP2_QDIST_MULTI_MODE; "not enough IRQs to support multi queue mode\n");
return -EINVAL;
} }
if (!has_tx_irqs)
queue_mode = MVPP2_QDIST_SINGLE_MODE;
ntxqs = MVPP2_MAX_TXQ; ntxqs = MVPP2_MAX_TXQ;
if (priv->hw_version == MVPP22 && queue_mode == MVPP2_QDIST_MULTI_MODE) if (priv->hw_version == MVPP22 && queue_mode == MVPP2_QDIST_MULTI_MODE)
nrxqs = MVPP2_DEFAULT_RXQ * num_possible_cpus(); nrxqs = MVPP2_DEFAULT_RXQ * num_possible_cpus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment