From patchwork Thu Feb 9 09:24:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 93677 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp158340qgi; Thu, 9 Feb 2017 01:27:53 -0800 (PST) X-Received: by 10.99.164.18 with SMTP id c18mr2846223pgf.40.1486632473758; Thu, 09 Feb 2017 01:27:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si9597152plg.100.2017.02.09.01.27.53; Thu, 09 Feb 2017 01:27:53 -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; 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 S1752319AbdBIJ12 (ORCPT + 25 others); Thu, 9 Feb 2017 04:27:28 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:62535 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbdBIJ1H (ORCPT ); Thu, 9 Feb 2017 04:27:07 -0500 Received: from 172.24.1.60 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.60]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id COY98308; Thu, 09 Feb 2017 17:25:34 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.203.181.151) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Thu, 9 Feb 2017 17:25:22 +0800 From: Salil Mehta To: CC: , , , , , , Kejian Yan Subject: [PATCH net] net: hns: Fix the device being used for dma mapping during TX Date: Thu, 9 Feb 2017 09:24:09 +0000 Message-ID: <20170209092409.202832-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 X-Originating-IP: [10.203.181.151] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kejian Yan This patch fixes the device being used to DMA map skb->data. Erroneous device assignment causes the crash when SMMU is enabled. This happens during TX since buffer gets DMA mapped with device correspondign to net_device and gets unmapped using the device related to DSAF. Signed-off-by: Kejian Yan Reviewed-by: Yisen Zhuang Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index 672b646..2b52a12 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -305,7 +305,7 @@ int hns_nic_net_xmit_hw(struct net_device *ndev, struct hns_nic_ring_data *ring_data) { struct hns_nic_priv *priv = netdev_priv(ndev); - struct device *dev = priv->dev; + struct device *dev = ring_to_dev(ring_data->ring); struct hnae_ring *ring = ring_data->ring; struct netdev_queue *dev_queue; struct skb_frag_struct *frag;