From patchwork Fri Oct 23 21:46:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7478681 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F5199F302 for ; Fri, 23 Oct 2015 21:46:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 528D820675 for ; Fri, 23 Oct 2015 21:46:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68CE420670 for ; Fri, 23 Oct 2015 21:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbbJWVqJ (ORCPT ); Fri, 23 Oct 2015 17:46:09 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:35508 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbbJWVqH (ORCPT ); Fri, 23 Oct 2015 17:46:07 -0400 Received: by lfbn126 with SMTP id n126so62983644lfb.2 for ; Fri, 23 Oct 2015 14:46:05 -0700 (PDT) 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 :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=1nGCr7X4Y/EANPpD2epazh0+BfhPuM5q5CduflgHHEE=; b=H0NeCYyoaDqG741buyr7VyK+MCAMgRu6NbzEtdFrwfRr2Sk9mFQxKPAvKVSgxhyh5o MTu416SAKKwnqeyEOl9vgv5nGL1w9d7L/Tp95sawBulYQDmVFpoRIBa9R9KcDLt/sfQa Jc/zet4hfU3hCGHMuHAg51//ilg3/B9h36k0ktEPVr2BCASJVHDSiKean1YCTpPB+3hm 7wVOCCUoiqoh9yF2r8P4V0lzReCqeXF9dI2Q3GHfouPV7uLWEzrIWgtfBL/fEEvGqivn 1cYFeEPGjYoT0zm8PAUOQzo2ogKhaRzooGcq1frfSZtUeZpfRoNVRKvg0H2r9hU09FOe eHpg== 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:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=1nGCr7X4Y/EANPpD2epazh0+BfhPuM5q5CduflgHHEE=; b=K2iXAoHlA54Dd1RJDLyHkf4JOm/RZRCkKu8PMz0Pz7zD7qeIWXjNiYXFCAsHLfAqYk xxSDZcrtSW+cIHo1EhPFgYsiuBneUwhA95rfkrlLluhkhoPl5I74ncD42HZ55ul/bDj2 qR1BvTWyxWVV79XijSG2qfQJuxUSix73qXfAJHBed7y2H+xcw4W6B0dElly6rSGS7lSx 163KR+S4WAbvYrDH7EGCzI0HBiNCTQNBoatFW5GAA5VdKV6OURoWBcWVOQdtEasKDqT2 Ld05kl6O/BlcAR9oqSdKgWh2fRBw3wZhEqDexYxacBNmBE9kBrLtsZqdMQETSMj4uL// +ccQ== X-Gm-Message-State: ALoCoQmFs2OH7EJf6sIo6Ykr54/MPDQjoYcX/2gT2eQ62hjdGYEM5jT2H0AfDOLJv2q3b1aSkS1h X-Received: by 10.112.146.104 with SMTP id tb8mr12330102lbb.35.1445636765882; Fri, 23 Oct 2015 14:46:05 -0700 (PDT) Received: from wasted.cogentembedded.com ([83.149.8.130]) by smtp.gmail.com with ESMTPSA id i126sm3660323lfe.45.2015.10.23.14.46.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 14:46:05 -0700 (PDT) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 1/2] sh_eth: fix RX buffer size alignment Date: Sat, 24 Oct 2015 00:46:03 +0300 Message-ID: <1685698.osUG5igxWz@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.8-100.fc21.x86_64; KDE/4.14.9; x86_64; ; ) In-Reply-To: <2249923.hKhT9K6gME@wasted.cogentembedded.com> References: <2249923.hKhT9K6gME@wasted.cogentembedded.com> 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,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 Both Renesas R-Car and RZ/A1 manuals state that RX buffer length must be a multiple of 32 bytes, while the driver only uses 16 byte granularity... Signed-off-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/sh_eth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 @@ -1148,8 +1148,8 @@ static void sh_eth_ring_format(struct ne /* RX descriptor */ rxdesc = &mdp->rx_ring[i]; - /* The size of the buffer is a multiple of 16 bytes. */ - rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16); + /* The size of the buffer is a multiple of 32 bytes. */ + rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 32); dma_addr = dma_map_single(&ndev->dev, skb->data, rxdesc->buffer_length, DMA_FROM_DEVICE); @@ -1506,7 +1506,7 @@ static int sh_eth_rx(struct net_device * if (mdp->cd->rpadir) skb_reserve(skb, NET_IP_ALIGN); dma_unmap_single(&ndev->dev, rxdesc->addr, - ALIGN(mdp->rx_buf_sz, 16), + ALIGN(mdp->rx_buf_sz, 32), DMA_FROM_DEVICE); skb_put(skb, pkt_len); skb->protocol = eth_type_trans(skb, ndev); @@ -1524,8 +1524,8 @@ static int sh_eth_rx(struct net_device * for (; mdp->cur_rx - mdp->dirty_rx > 0; mdp->dirty_rx++) { entry = mdp->dirty_rx % mdp->num_rx_ring; rxdesc = &mdp->rx_ring[entry]; - /* The size of the buffer is 16 byte boundary. */ - rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16); + /* The size of the buffer is 32 byte boundary. */ + rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 32); if (mdp->rx_skbuff[entry] == NULL) { skb = netdev_alloc_skb(ndev, skbuff_size);