forked from mirrors/linux
		
	drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself
CPSW interrupts can be disabled by masking CPSW interrupts and clearing interrupt by writing appropriate EOI. So removing all disable_irq/enable_irq as discussed in [1] [1] http://patchwork.ozlabs.org/patch/492741/ Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									5a9348b54d
								
							
						
					
					
						commit
						870915feab
					
				
					 1 changed files with 2 additions and 25 deletions
				
			
		| 
						 | 
					@ -389,7 +389,6 @@ struct cpsw_priv {
 | 
				
			||||||
	/* snapshot of IRQ numbers */
 | 
						/* snapshot of IRQ numbers */
 | 
				
			||||||
	u32 irqs_table[4];
 | 
						u32 irqs_table[4];
 | 
				
			||||||
	u32 num_irqs;
 | 
						u32 num_irqs;
 | 
				
			||||||
	bool irq_enabled;
 | 
					 | 
				
			||||||
	struct cpts *cpts;
 | 
						struct cpts *cpts;
 | 
				
			||||||
	u32 emac_port;
 | 
						u32 emac_port;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -767,12 +766,7 @@ static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
 | 
				
			||||||
	struct cpsw_priv *priv = dev_id;
 | 
						struct cpsw_priv *priv = dev_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
 | 
						cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
 | 
				
			||||||
 | 
						writel(0, &priv->wr_regs->rx_en);
 | 
				
			||||||
	cpsw_intr_disable(priv);
 | 
					 | 
				
			||||||
	if (priv->irq_enabled == true) {
 | 
					 | 
				
			||||||
		disable_irq_nosync(priv->irqs_table[0]);
 | 
					 | 
				
			||||||
		priv->irq_enabled = false;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (netif_running(priv->ndev)) {
 | 
						if (netif_running(priv->ndev)) {
 | 
				
			||||||
		napi_schedule(&priv->napi);
 | 
							napi_schedule(&priv->napi);
 | 
				
			||||||
| 
						 | 
					@ -797,15 +791,8 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	num_rx = cpdma_chan_process(priv->rxch, budget);
 | 
						num_rx = cpdma_chan_process(priv->rxch, budget);
 | 
				
			||||||
	if (num_rx < budget) {
 | 
						if (num_rx < budget) {
 | 
				
			||||||
		struct cpsw_priv *prim_cpsw;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		napi_complete(napi);
 | 
							napi_complete(napi);
 | 
				
			||||||
		cpsw_intr_enable(priv);
 | 
							writel(0xff, &priv->wr_regs->rx_en);
 | 
				
			||||||
		prim_cpsw = cpsw_get_slave_priv(priv, 0);
 | 
					 | 
				
			||||||
		if (prim_cpsw->irq_enabled == false) {
 | 
					 | 
				
			||||||
			prim_cpsw->irq_enabled = true;
 | 
					 | 
				
			||||||
			enable_irq(priv->irqs_table[0]);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (num_rx)
 | 
						if (num_rx)
 | 
				
			||||||
| 
						 | 
					@ -1230,7 +1217,6 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
 | 
				
			||||||
static int cpsw_ndo_open(struct net_device *ndev)
 | 
					static int cpsw_ndo_open(struct net_device *ndev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct cpsw_priv *priv = netdev_priv(ndev);
 | 
						struct cpsw_priv *priv = netdev_priv(ndev);
 | 
				
			||||||
	struct cpsw_priv *prim_cpsw;
 | 
					 | 
				
			||||||
	int i, ret;
 | 
						int i, ret;
 | 
				
			||||||
	u32 reg;
 | 
						u32 reg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1315,14 +1301,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
 | 
				
			||||||
	cpdma_ctlr_start(priv->dma);
 | 
						cpdma_ctlr_start(priv->dma);
 | 
				
			||||||
	cpsw_intr_enable(priv);
 | 
						cpsw_intr_enable(priv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	prim_cpsw = cpsw_get_slave_priv(priv, 0);
 | 
					 | 
				
			||||||
	if (prim_cpsw->irq_enabled == false) {
 | 
					 | 
				
			||||||
		if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) {
 | 
					 | 
				
			||||||
			prim_cpsw->irq_enabled = true;
 | 
					 | 
				
			||||||
			enable_irq(prim_cpsw->irqs_table[0]);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (priv->data.dual_emac)
 | 
						if (priv->data.dual_emac)
 | 
				
			||||||
		priv->slaves[priv->emac_port].open_stat = true;
 | 
							priv->slaves[priv->emac_port].open_stat = true;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					@ -2169,7 +2147,6 @@ static int cpsw_probe(struct platform_device *pdev)
 | 
				
			||||||
	priv->msg_enable = netif_msg_init(debug_level, CPSW_DEBUG);
 | 
						priv->msg_enable = netif_msg_init(debug_level, CPSW_DEBUG);
 | 
				
			||||||
	priv->rx_packet_max = max(rx_packet_max, 128);
 | 
						priv->rx_packet_max = max(rx_packet_max, 128);
 | 
				
			||||||
	priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
 | 
						priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
 | 
				
			||||||
	priv->irq_enabled = true;
 | 
					 | 
				
			||||||
	if (!priv->cpts) {
 | 
						if (!priv->cpts) {
 | 
				
			||||||
		dev_err(&pdev->dev, "error allocating cpts\n");
 | 
							dev_err(&pdev->dev, "error allocating cpts\n");
 | 
				
			||||||
		ret = -ENOMEM;
 | 
							ret = -ENOMEM;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue