From patchwork Mon Jun 10 20:22:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2699061 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 67E6D3FD4E for ; Mon, 10 Jun 2013 20:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323Ab3FJUW5 (ORCPT ); Mon, 10 Jun 2013 16:22:57 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:48448 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929Ab3FJUW4 (ORCPT ); Mon, 10 Jun 2013 16:22:56 -0400 Received: by mail-la0-f44.google.com with SMTP id er20so6219174lab.31 for ; Mon, 10 Jun 2013 13:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:cc:from:organization:date:mime-version:content-type :content-transfer-encoding:message-id:x-gm-message-state; bh=NmyT2mDPL/Gu++hBXUXJoLLC9r1iUxpo8g4kASfbazc=; b=NdbtVGDQUuUbuls7ZXSMFLSDsV4bNVHESM412lOs+sqMWr5AlxsKqphkUkSQy4Uzs/ YHwlZQrC7MkkKi3HLTiMeLQTk5ZhqSpxJoQDwJTku9DrDTTfZtHZvKI8ppmXwcTthybB QL8TR7CcHSufbM9YPyu6ie8xPa6VoDAVuSbZPWHbaAVV15kQxynDJZKhAkOFzZn08VUt aHbNLLy/6GI2zSkr8Z66FyPyAhlBRWFW7MDsz9LJUMflaKmmLU6czt5JXoeqSSOR1CST iHYXm74DVKKtOGDIMK2hHFeHdjPiC1io7xELCuH5G5JetOEnVcJFer2mOOhzOZ37EBi7 xiLg== X-Received: by 10.152.6.228 with SMTP id e4mr5766083laa.61.1370895774448; Mon, 10 Jun 2013 13:22:54 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (mail.dev.rtsoft.ru. [213.79.90.226]) by mx.google.com with ESMTPSA id c5sm6268333lbe.1.2013.06.10.13.22.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 13:22:53 -0700 (PDT) To: netdev@vger.kernel.org Subject: [PATCH] sh_eth: get R8A7740 Rx descriptor word 0 shift out of #ifdef Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org, yoshihiro.shimoda.uh@renesas.com From: Sergei Shtylyov Organization: Cogent Embedded Date: Tue, 11 Jun 2013 00:22:50 +0400 MIME-Version: 1.0 Message-Id: <201306110022.51293.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlsMRflw9DaDFnlGEbivcL92VfhRL3w3m/O139YWHeQ474p8e7x5MZV+7HXSUOBbkXywyqr Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org The only R8A7740 specific #ifdef hindering ARM multiplatform build is left in sh_eth_rx(): it covers a very strange code shifting Rx buffer descriptor word 0 by 16 (which should cause Rx length error to be logged on every buffer several lines later). Get rid of the #ifdef by adding 'shift_rd0' field to the 'struct sh_eth_cpu_data', making the shift dependent on it, and setting it to 1 for the R8A7740 case... Signed-off-by: Sergei Shtylyov --- The patch is against Dave Miller's 'net-next.git' repo. I have no R8A7740 manual, so have to trust that the code is correct. It would be good to get some comments from the author of the original commit that added R8A7740 support, so CCing him... drivers/net/ethernet/renesas/sh_eth.c | 6 +++--- drivers/net/ethernet/renesas/sh_eth.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -667,6 +667,7 @@ static struct sh_eth_cpu_data r8a7740_da .no_ade = 1, .tsu = 1, .select_mii = 1, + .shift_rd0 = 1, }; static struct sh_eth_cpu_data sh7619_data = { @@ -1260,9 +1261,8 @@ static int sh_eth_rx(struct net_device * desc_status = edmac_to_cpu(mdp, rxdesc->status); pkt_len = rxdesc->frame_length; -#if defined(CONFIG_ARCH_R8A7740) - desc_status >>= 16; -#endif + if (mdp->cd->shift_rd0) + desc_status >>= 16; if (--boguscnt < 0) break; Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -476,6 +476,7 @@ struct sh_eth_cpu_data { unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ unsigned hw_crc:1; /* E-DMAC have CSMR */ unsigned select_mii:1; /* EtherC have RMII_MII (MII select register) */ + unsigned shift_rd0:1; /* shift Rx buffer descriptor word 0 by 16 */ }; struct sh_eth_private {