From patchwork Mon Feb 22 21:48:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 62639 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1492319lbl; Mon, 22 Feb 2016 13:48:20 -0800 (PST) X-Received: by 10.66.145.232 with SMTP id sx8mr41570782pab.148.1456177700305; Mon, 22 Feb 2016 13:48:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66si42203341pfs.142.2016.02.22.13.48.20; Mon, 22 Feb 2016 13:48:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932208AbcBVVsR (ORCPT + 4 others); Mon, 22 Feb 2016 16:48:17 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:48267 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754742AbcBVVsQ (ORCPT ); Mon, 22 Feb 2016 16:48:16 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u1MLmBJk013895; Mon, 22 Feb 2016 15:48:11 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u1MLmBjr026332; Mon, 22 Feb 2016 15:48:11 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 22 Feb 2016 15:48:10 -0600 Received: from [158.218.103.150] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u1MLmApl001380; Mon, 22 Feb 2016 15:48:10 -0600 To: Arnd Bergmann CC: "open list:TI NETCP ETHERNET DRIVER" From: Murali Karicheri Subject: net: netcp: regarding commit 899077: netcp: try to reduce type confusion in descriptors Organization: Texas Instruments Message-ID: <56CB821E.7040809@ti.com> Date: Mon, 22 Feb 2016 16:48:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Arnd, As promised, here is what I found wrong with the commit 899077 that introduced a regression. With these changes, I am able to boot kernel without issues on K2 platforms. >From the commit description, it appears that you are trying to make the driver do the right thing if compiled for a 64 bit systems. Is it mandatory for all kernel drivers to be 64bit compliant? Similar question on supporting mixed endian in all kernel drivers. Keystone can have SoC configured to be in big endian mode for peripherals and DSP. so that is something we need to support if there is customer interest. Wondering why do one run BE kernel binary on these platforms? Any reason? I saw some reference to that in past discussion on this regression issue. Murali -- Murali Karicheri Linux Kernel, Keystone diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c index c61d66d..ac35161 100644 --- a/drivers/net/ethernet/ti/netcp_core.c +++ b/drivers/net/ethernet/ti/netcp_core.c @@ -167,7 +167,7 @@ static void set_pad_info(u32 pad0, u32 pad1, u32 pad2, struct knav_dma_desc *des { desc->pad[0] = cpu_to_le32(pad0); desc->pad[1] = cpu_to_le32(pad1); - desc->pad[2] = cpu_to_le32(pad1); + desc->pad[2] = cpu_to_le32(pad2); } static void set_org_pkt_info(dma_addr_t buff, u32 buff_len, @@ -870,8 +870,8 @@ static int netcp_allocate_rx_buf(struct netcp_intf *netcp, int fdq) } buf_len = PAGE_SIZE; dma = dma_map_page(netcp->dev, page, 0, buf_len, DMA_TO_DEVICE); - pad[0] = lower_32_bits(dma); - pad[1] = upper_32_bits(dma); + pad[0] = lower_32_bits((uintptr_t)page); + pad[1] = upper_32_bits((uintptr_t)page); pad[2] = 0; } @@ -1194,9 +1194,9 @@ static int netcp_tx_submit_skb(struct netcp_intf *netcp, } set_words(&tmp, 1, &desc->packet_info); - tmp = lower_32_bits((uintptr_t)&skb); + tmp = lower_32_bits((uintptr_t)skb); set_words(&tmp, 1, &desc->pad[0]); - tmp = upper_32_bits((uintptr_t)&skb); + tmp = upper_32_bits((uintptr_t)skb); set_words(&tmp, 1, &desc->pad[1]); if (tx_pipe->flags & SWITCH_TO_PORT_IN_TAGINFO) {