From patchwork Sun Dec 13 18:27:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7839511 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55FE3BEEE1 for ; Sun, 13 Dec 2015 18:27:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 758D120389 for ; Sun, 13 Dec 2015 18:27:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9880B20304 for ; Sun, 13 Dec 2015 18:27:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752324AbbLMS1K (ORCPT ); Sun, 13 Dec 2015 13:27:10 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:36750 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbbLMS1I (ORCPT ); Sun, 13 Dec 2015 13:27:08 -0500 Received: by lfed137 with SMTP id d137so56214979lfe.3 for ; Sun, 13 Dec 2015 10:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :mime-version:content-transfer-encoding:content-type; bh=xe2fIzKsKZGMZ8kspb0nVNCy6napICAcdV0XViPH4XY=; b=IHzsAluXukDu+dCrguS18mPNBScGz9ryCAwlP5vhw2SwBG9ToYq6n8rk69HGPjJwrr R7r8XZNJYBj/C31wAgwBdZRUdwSHfWaw+jd5InlBrhvbww5AHcbCVwWGZgj8FKedtsQ6 oDRnw9BWIckrqAv3oUnq/1kbCTMBmEdRjtW9ICBmSw5eEgnwBss0bRj7+ShIxRe0P7kL GBGr5RR9427RJYWHKq6FfPYsEHJBwuKPNnIN3LoU2Qj34GGq6gPaTrPOhgLC+0EtEZkF WoqXh6mZ7Ri8Xx4lhJie7c/fVlZpOeRTjgC3FkpVMxba/J2k23Tgx51eJf1T3zuzZkh6 HYKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=xe2fIzKsKZGMZ8kspb0nVNCy6napICAcdV0XViPH4XY=; b=AdtWDULDWNc1zps4GEsDIWTUiQyKnZKAL+VsASHiMUaAey3Iw7K3jqNUQVJkUg3Scs 8j/WsLKgrywjiFkBKoZPi44+nhdOqFfkSwAqM8gEbAI8bX5eMzagkdEmO+tKJSDWYWrl XTo+aaeBh2uEILjBgQ2WVY5sbjgI+eqjGfIOqkdHwRuvf+FHWk+CgdzX2WUfIU7pRJcT dIZntOdIYM53dxYUkh8OToMGcn7RLSI5mjmbN21xmuIw7vFQjJ40P42agENgLG680i1k 1ngNv/C3SLWk5iMPn1tQpbvCNPdOAh0YFxODFvKhjtTgWeivzFOrwQPE+YqEcXiUxMUo ZsNg== X-Gm-Message-State: ALoCoQld2aTGvSXRXDmLFkxwc1I9wEeraX0LRg2G95z9DreY6oxKgIh202uaMgFKKKkYKfvBVbw24A38f3rvGZuh8dzaaOlwRA== X-Received: by 10.25.162.65 with SMTP id l62mr11567071lfe.64.1450031227062; Sun, 13 Dec 2015 10:27:07 -0800 (PST) Received: from wasted.cogentembedded.com ([83.149.8.38]) by smtp.gmail.com with ESMTPSA id aa4sm4891003lbc.10.2015.12.13.10.27.05 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Dec 2015 10:27:05 -0800 (PST) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH] sh_eth: fix TX buffer byte-swapping Date: Sun, 13 Dec 2015 21:27:04 +0300 Message-ID: <4052048.4A561jYI0l@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.10 (Linux/4.2.6-201.fc22.x86_64; KDE/4.14.14; x86_64; ; ) MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the little-endian SH771x kernels the driver has to byte-swap the RX/TX buffers, however yet unset physcial address from the TX descriptor is used to call sh_eth_soft_swap(). Use 'skb->data' instead... Fixes: 31fcb99d9958 ("net: sh_eth: remove __flush_purge_region") Signed-off-by: Sergei Shtylyov --- The patch is against Dave Miller's 'net.git' repo. Although there have been no complaints during 4+ years of this being broken, I think it's probably worth queuing the patch for the stable trees... drivers/net/ethernet/renesas/sh_eth.c | 3 +-- 1 file changed, 1 insertion(+), 2 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/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net/drivers/net/ethernet/renesas/sh_eth.c @@ -2372,8 +2372,7 @@ static int sh_eth_start_xmit(struct sk_b txdesc = &mdp->tx_ring[entry]; /* soft swap. */ if (!mdp->cd->hw_swap) - sh_eth_soft_swap(phys_to_virt(ALIGN(txdesc->addr, 4)), - skb->len + 2); + sh_eth_soft_swap(PTR_ALIGN(skb->data, 4), skb->len + 2); txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len, DMA_TO_DEVICE); if (dma_mapping_error(&ndev->dev, txdesc->addr)) {