Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160AbdLSSdn (ORCPT ); Tue, 19 Dec 2017 13:33:43 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35277 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbdLSSdj (ORCPT ); Tue, 19 Dec 2017 13:33:39 -0500 X-Google-Smtp-Source: ACJfBouRyUrcg05e2QH1RKhMMPYFSQF3wiqI4nsjo+jiDWodJJ1RgjRk5T5Ro4WNy8NX9HsYmkJdlA== Subject: Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths To: Alexander Kochetkov , David Miller Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com References: <1513358406-32503-1-git-send-email-al.kochet@gmail.com> <20171219.102254.1959679351283055093.davem@davemloft.net> From: Florian Fainelli Message-ID: <9170e5bb-4765-a4dd-9d85-e44791877ea1@gmail.com> Date: Tue, 19 Dec 2017 10:33:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 35 On 12/19/2017 07:49 AM, Alexander Kochetkov wrote: > >> 19 дек. 2017 г., в 18:22, David Miller написал(а): >> >> From: Alexander Kochetkov >> Date: Fri, 15 Dec 2017 20:20:06 +0300 >> >>> arc_emac_rx() has some issues found by code review. >>> >>> In case netdev_alloc_skb_ip_align() or dma_map_single() failure >>> rx fifo entry will not be returned to EMAC. >>> >>> In case dma_map_single() failure previously allocated skb became >>> lost to driver. At the same time address of newly allocated skb >>> will not be provided to EMAC. >>> >>> Signed-off-by: Alexander Kochetkov >> >> This patch adds quite a few bugs, here is one which shows this is not >> functionally tested: > > May be I don’t understand correctly, but I don’t see bug here. > > Wrong dma mapping usage should immediately manifest itself (kernel > instability, koops and so on). The patch was tested on rk3188 and work fine for me. > Also I did simulations of netdev_alloc_skb_ip_align() and dma_map_single() > faults and can confirm that new error handling work. > > Could someone else with ARC EMAC test the patch? I would be very grateful for the help. > Florian or Eric, can you test it on your hardware? I don't actually have access to this hardware, the only change I did to this driver was to use a standard Device Tree property :) -- Florian