Received: by 10.223.164.202 with SMTP id h10csp1270768wrb; Sun, 26 Nov 2017 23:44:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMbl2ufCX4KacDs7bsVIyKYU60ASKXyIcKBmLmJAp3DhxHFyzScm9QZWNGGIjbQgN7Z7e1Iu X-Received: by 10.159.242.4 with SMTP id t4mr37021849plr.411.1511768690223; Sun, 26 Nov 2017 23:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511768690; cv=none; d=google.com; s=arc-20160816; b=b20bUeIUl4yCkWmtr7MQfvQ4iI1nEzW7en6imrgsxh3BMNrFjptijnNNZmRhq/OmY5 iaM+S2HNDtkTKurFTpiluZmcKIwBte/k6esq315VWtPRv9BeJuqw6PxlJeB+ub42zMTG +hzZljChUGECIq6gp+p7Wdg4eGOcOWwZE+eDg9NGQUVjAWHYKaqZIEBrGRSvVbNdqBm/ dXzwqlGTL5lRhkDRdTXu/pgPai2TVnlIo29xedLV5uqKEcCIpS805XFIxCZqF7Hw73hq NI9Tz/BMN8SGXv8JXj9yMJuR5U7dkLaN+pN72JG/Cbg3lDxh1kAVVT6YTLZ/bZL+HJ8L m8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=dXxZI31zf5Pc5oLlA1Y8JgnM7dJ04XD+auDuoLbS5Bw=; b=hJLB0eF+CUhBI/TPp8wkYhUy9ylSnVzvyOQh5Uhe/qr8yUcdlJ1b4SYGHjVrXqSK3L vw5dXZLXdJTk9fWoq9blD8k4ZpWnCrft2t7ODvymcVLc0ZWMAZ5y52Gt1LEFqp8JKC8N juD1xMjlNslRCaS+V1iZJLPbzU0KHKcok+42c076auKHHhFh1H5Ep0WpDdGYmtU5hzi6 Vr+oNbuWL83F5u1wU/zFK5tjHK9hMXRBzQnSpOfjsWmGuzIq5X7twhbCmuXzDZjNktCu tGUNt6tuIvKXb2DnxdQvUSQSnlOcw1NN1YJltKfsxVrhX9Rzslokc/0L+VIoWeTnbH8j txAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=fgkufmGB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e23si19133382pli.201.2017.11.26.23.44.38; Sun, 26 Nov 2017 23:44:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=fgkufmGB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbdK0Hnx (ORCPT + 78 others); Mon, 27 Nov 2017 02:43:53 -0500 Received: from mail-bn3nam01on0070.outbound.protection.outlook.com ([104.47.33.70]:55916 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751375AbdK0Hns (ORCPT ); Mon, 27 Nov 2017 02:43:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dXxZI31zf5Pc5oLlA1Y8JgnM7dJ04XD+auDuoLbS5Bw=; b=fgkufmGB1E8CH/ujnEWJlwR2EeGuOB6r6YY7m5ZS0eoq1DYQd85fKp8rjtTWsmGxIyXLfankJU/yeHvasGO1MLzsKv5szL2vqIRvE1Qc8dg29TdK3UPJum57bVsBoXmFzRorjzbsLPXfZRIqUqOK3LhJlJdC1380qGF9x/o4VBE= Received: from BY2PR02CA0008.namprd02.prod.outlook.com (10.163.44.146) by MWHPR02MB3390.namprd02.prod.outlook.com (10.164.187.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Mon, 27 Nov 2017 07:43:41 +0000 Received: from SN1NAM02FT031.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by BY2PR02CA0008.outlook.office365.com (2a01:111:e400:5261::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Mon, 27 Nov 2017 07:43:40 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT031.mail.protection.outlook.com (10.152.72.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.239.4 via Frontend Transport; Mon, 27 Nov 2017 07:43:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1eJE4p-00084z-Ju; Sun, 26 Nov 2017 23:43:39 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eJE4p-00018V-Gp; Sun, 26 Nov 2017 23:43:39 -0800 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id vAR7hWj6005534; Sun, 26 Nov 2017 23:43:32 -0800 Received: from [172.23.37.92] (helo=xhdharinik40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eJE4i-00016g-9A; Sun, 26 Nov 2017 23:43:32 -0800 From: Harini Katakam To: , , CC: , , , , Harini Katakam , Michal Simek Subject: [RFC PATCH 3/3] net: macb: Handle HRESP error Date: Mon, 27 Nov 2017 13:07:18 +0530 Message-ID: <1511768238-3051-4-git-send-email-harinik@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511768238-3051-1-git-send-email-harinik@xilinx.com> References: <1511768238-3051-1-git-send-email-harinik@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23492.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(376002)(346002)(2980300002)(438002)(189002)(199003)(77096006)(2201001)(36386004)(50226002)(5890100001)(39060400002)(2906002)(356003)(48376002)(478600001)(106466001)(8936002)(16586007)(107886003)(316002)(4326008)(189998001)(50466002)(305945005)(36756003)(81156014)(54906003)(106002)(110136005)(9786002)(50986999)(76176999)(7696005)(63266004)(47776003)(51416003)(33646002)(8676002)(6666003)(81166006)(2950100002)(5660300001)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR02MB3390;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT031;1:+1YNUPLABjzC8n6nDaDgvapqg/BIuGzgp0b/lE0WS4kQpVW53rGG1FAd82qZrqD3OFEvxeeToogkXBnhkYJPeEymcjPvfyMS7nBw96Rm5Dte5XyNig0ZQSZeqvCM8ExQ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0adce752-1595-4f91-5922-08d5356a93d4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603258);SRVR:MWHPR02MB3390; X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB3390;3:g07xLEza4QcmHgELYfUliHyNs74cxsGnsHRiW1lXOyD28ePNZQ/OKDe1CiZpvxOU9cuVbVcDQ5t47kQg2HrZYK5Mh993HlPJShezHuvwQzliPrS7Ml6UL1JvtFmijSxU8RWmxFU4Gfka6tB84VjhxBCFRq0YixwX8MOnZSe/ZZgYNonslf4D0tako3042+yC/nv9C3rkZlC9ywVqvz5ElEyU7Z5SxUKM7cQEQul7hpUnl31fN5disrnGoD3BNoro9m9zlgBA4TM3ffhomScOJ4rGlyedwCRe3c5Su9f8z3VrPZbubZIaDs1rfrzHZDoVm2P1gvLIUeyI4HFR4MXaSWF7ssf8q1JVJGC9NODKzEc=;25:mtq19/3THaO7uAMiwDkLVzgnwJ1Thy4x26GMz04+XJEtzuolTcluImjNlC0E5UILNLdstydVMi+2jY2NKkJHCBmsI8FTjzfBVCojji8E7Pf4GnD9DfZAsMOVHH9rydPfq1OKQ2Qsiq19znxDY2P8tWEpQmm0FvHPxo/oC9OkTc5YTvHxdo9irTpEkB48B/yAkzjxnZlYYl5HVAGHn3BAyerbBoaM0mC6d10JwhgjjvcU6Vq461La23slO61di+Ti+u9p5vJCbX05kZ5IKMMqkFIJxPDk59SdlkqyoBOcoKklK/eIbgL9XJyWvxhI481NTx4/5HoJwfmr7/FgD6W0hQ== X-MS-TrafficTypeDiagnostic: MWHPR02MB3390: X-Microsoft-Exchange-Diagnostics: 1;MWHPR02MB3390;31:N5mWAeIs8AshyPOZSWRFdcGOkysCLicZhsutnp2clVNK0gXZxE+8Bp3z11rwFM9zzP4/zj+l8icaVv/9tomYFYHwwFPLq1gjE9tqFi0BT4dFFLl7NsvjdhijujtOjDjRTXK4w9pJPH4piTPFacfQ/bLwpbNY/Qp6lWjAPKjNKzBDKGYOUNTJhZbqMVs5Zot4N8tue8rPHrVPOF8hq2+l3VhNYKS/d73xAKJkZUft4JI=;20:NEQEb/kts+eeo5VwL0DMXfNCCIPBj47N8fq4IQivPanQoeYedCZ8hAZOGl4XdGNw5ap00MZHtP4iRpGNomFOK8xJuqbPLIoxxOR0FA5Jmpzf5LsoEkKwdA6hmDjEY3h9uk8OfKu/b019YJF2y9qM9Z/6kZ569D2YXFXdlGIutnu5lBPcQ0xz9atMcU5zXwXTqxbS22QWM2enHKVrjAf66ynrTT+KgP1zsWIGD/v1zI/b+gc2IsdZ86FB9ODswQ7hTZEKuPvomt++DaQUfKiyIaXYtN8DUTWUV/wGDDbC7fVGOz02/V9UxNCy+58k8AiSgDjvqm2wBVPJeT5e2qSO+djVEoze8o/H/b10Jxiyhcn2ghNQakVHMGLG/pyWwHzy6LY9L3192+Rmt7FGRwHbJokwmQGyPFygi8/wc1dOHtduiCZiX/0L9PaBniBHixjGmide3gZXiX7E084i8ajdVA8adnEafGyDyVmsOiYkzSyVnQrOUfBVcCgEOcz8RtKe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231022)(10201501046)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123555025)(20161123564025)(6072148)(201708071742011);SRVR:MWHPR02MB3390;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR02MB3390; X-Microsoft-Exchange-Diagnostics: 1;MWHPR02M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74vxzzvKObf1sg6wjItkSqX8ZT9xxYSIpNQ5s2H7gZeKgpOlsSvdPK95Mj/5WG/Q27/YZSI6mXEjMoW8qXu90KIvG1jHAWpi8t4ikPw8fpJoDU2+WzQi0hibMHhqQTbLp+FEXBFQ0hMHd/Rf4IPNRP6MPe25C2h5w=;24:p2RQRfhpsN9JVfwGnv2bYxoI0aNlojkOPt5pmI+BHufmhAwc/NuIUKa11E3Eo0f3D5+uJOdCxQeb/HlficcsUQqRnw0oJTkvzkjeNZEtelE=;7:nuaWi06HzpaAtcxmLicjk1RK5LdSQeYNz31YqgzFp8Yd/Ogk4+OyNIM+RM8DfiUA5Po6xNhWQxdwGfYkYXH4SEwHssprXQTmmeeIfwBQioors2i+UKwJ/rNxykExH6uRC2LRJSR66hFZbeRAjt7v/LdHMg5C/09dm1zg0n4oNBNEgZ7Q8NN4USGG1Rfoav9+p2VBmj3xwaW+40d/Utkj27dzW3IyBF1i4o42DJwZaTQ5vAo6UHkqvVY+Xvza7I/f SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2017 07:43:40.3265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0adce752-1595-4f91-5922-08d5356a93d4 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3390 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harini Katakam Handle HRESP error by doing a SW reset of RX and TX and re-initializing the descriptors, RX and TX queue pointers. Signed-off-by: Harini Katakam Signed-off-by: Michal Simek --- drivers/net/ethernet/cadence/macb.h | 2 + drivers/net/ethernet/cadence/macb_main.c | 65 ++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 974c801..5246ee1 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1060,6 +1060,8 @@ struct macb { struct ptp_clock_info ptp_clock_info; struct tsu_incr tsu_incr; struct hwtstamp_config tstamp_config; + + struct tasklet_struct hresp_err_tasklet; }; #ifdef CONFIG_MACB_USE_HWSTAMP diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b14a04d..d76e04f 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1244,6 +1244,63 @@ static int macb_poll(struct napi_struct *napi, int budget) return work_done; } +static void macb_hresp_error_task(unsigned long data) +{ + struct macb *bp = (struct macb *)data; + struct net_device *dev = bp->dev; + struct macb_queue *queue = bp->queues; + unsigned int q; + u32 ctrl; + + for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { + queue_writel(queue, IDR, MACB_RX_INT_FLAGS | + MACB_TX_INT_FLAGS | + MACB_BIT(HRESP)); + } + ctrl = macb_readl(bp, NCR); + ctrl &= ~(MACB_BIT(RE) | MACB_BIT(TE)); + macb_writel(bp, NCR, ctrl); + + netif_tx_stop_all_queues(dev); + netif_carrier_off(dev); + + bp->macbgem_ops.mog_init_rings(bp); + + /* Initialize TX and RX buffers */ + macb_writel(bp, RBQP, lower_32_bits(bp->rx_ring_dma)); +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + if (bp->hw_dma_cap & HW_DMA_CAP_64B) + macb_writel(bp, RBQPH, upper_32_bits(bp->rx_ring_dma)); +#endif + for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { + queue_writel(queue, TBQP, lower_32_bits(queue->tx_ring_dma)); +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + if (bp->hw_dma_cap & HW_DMA_CAP_64B) + queue_writel(queue, TBQPH, upper_32_bits(queue->tx_ring_dma)); +#endif + + /* We only use the first queue at the moment. Remaining + * queues must be tied-off before we enable the receiver. + * + * See the documentation for receive_q1_ptr for more info. + */ + if (q) + queue_writel(queue, RBQP, bp->rx_ring_tieoff_dma); + + /* Enable interrupts */ + queue_writel(queue, IER, + MACB_RX_INT_FLAGS | + MACB_TX_INT_FLAGS | + MACB_BIT(HRESP)); + } + + ctrl |= MACB_BIT(RE) | MACB_BIT(TE); + macb_writel(bp, NCR, ctrl); + + netif_carrier_on(dev); + netif_tx_start_all_queues(dev); +} + static irqreturn_t macb_interrupt(int irq, void *dev_id) { struct macb_queue *queue = dev_id; @@ -1333,10 +1390,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) } if (status & MACB_BIT(HRESP)) { - /* TODO: Reset the hardware, and maybe move the - * netdev_err to a lower-priority context as well - * (work queue?) - */ + tasklet_schedule(&bp->hresp_err_tasklet); netdev_err(dev, "DMA bus error: HRESP not OK\n"); if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE) @@ -3586,6 +3640,9 @@ static int macb_probe(struct platform_device *pdev) goto err_out_unregister_mdio; } + tasklet_init(&bp->hresp_err_tasklet, macb_hresp_error_task, + (unsigned long)bp); + phy_attached_info(phydev); netdev_info(dev, "Cadence %s rev 0x%08x at 0x%08lx irq %d (%pM)\n", -- 2.7.4 From 1584856667668089908@xxx Thu Nov 23 11:38:19 +0000 2017 X-GM-THRID: 1584683454767220899 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread