Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp876633pxm; Fri, 25 Feb 2022 23:34:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0JTo6Hq6sqdpTxi4x5jPmL4L7lQLjwVITDky4vrjplo18EakDjJsA4W7BX+vq1lbzOtge X-Received: by 2002:aa7:dbd6:0:b0:408:4a31:97a5 with SMTP id v22-20020aa7dbd6000000b004084a3197a5mr10661724edt.186.1645860893245; Fri, 25 Feb 2022 23:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645860893; cv=none; d=google.com; s=arc-20160816; b=dZ1IP+Bit0nOlbk/tAAuNLThPnOGGhXt7u2qrjVnO0QELN17njAG7iKcpfVtWtkMkE N7ptl90UZ7ADObi32eX4xo5XObmPOCMP5T3zXg61KWut+O3BElXow8teQfNaVYWPdZTi Tq4JPFqhPmxj8j8jVPlLKokiI1it9klxdZgZbBQxbL4dzcGwdCvt8aeyF0nN2W0mhkHe xwBYzJk3LTK4waknotYiWWdTQQJL4bx9Jl/a1TKaJXouVssdLcjYfLrr6p0oJJFn4/Ir 6DRabtSOQBcMxy7gjQaK7xwYwYaRnH6eeRpKDYbJBQ3QOXe9Ku1GhuPFZxrZ1AJ64wJj GVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mNJmRladIG0MIyTpnWNdzJ7Wu8b9X3eMoZWgYJ/b03g=; b=hTNtPh+BRaI1plRDmv1G1L9zUmvJVTt/KxQk+aYfHmiW2/oCLMvT/2Ih9g5bU47CQs MxYeroQU6HFH74J4D2BTwibdMOThN/437NlDOlDArYWYN/QheVIKEMmtZc4/9aFCE6KJ fBjsx5WXfdi7qOQ1dPt+34A4rvqxeSO95eXskuWywSlKcwNOL+lL8K+1CTZhlPOfo5D+ bg0g6//4DK89p2lyx9rbuYt7LanUwCzKZxuVeUCJFPM1UkYdznNaUu6GtzNAeBjOZ0NA YuF1qgHRhgJGuG80cjtid9NxtiwTGeIqEbf63ftpqkQbwqeD+OKDPGRFb9865QzY1g4K 7VKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="X/VL0230"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a056402358d00b00410f0104b92si4862353edc.190.2022.02.25.23.34.28; Fri, 25 Feb 2022 23:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="X/VL0230"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbiBZGTZ (ORCPT + 99 others); Sat, 26 Feb 2022 01:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiBZGTY (ORCPT ); Sat, 26 Feb 2022 01:19:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB01BEA7; Fri, 25 Feb 2022 22:18:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7520060BAA; Sat, 26 Feb 2022 06:18:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BB15C340E9; Sat, 26 Feb 2022 06:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645856329; bh=cvyzwbI5HARqFp7JbFizipx8dXGTknMqqqUTGAQ4dbY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X/VL0230OLIO4M5oLHzzJZKdCAgFnLTWXxQroiwJhIVEMCN5kXXkuci+WfosgEEV8 1sUzZ872pdaUYm6oNcWM5AbtEdPVi+/GQhqQea0yUfgoYY/YLvEstlhVvt1yR0Ls6m HSLadE9rtPuBw2gpIuu3Kxuc5E7LaP0RSy8s2I0SJnd4YDJszTVbf1yc0lZfXdgRCI WdX2WmHUR0z0GRd7fB44mFgXlKERNyqSOO9AWjRnm4B7W5n+xLzaLGH4n3aRmOtk0J 9cApo5K6KMk+DDhbxfQvj+q1rcmS3EypZcDiQ9RQ+WHPOArPx6BldhjW+O3vQgvpwB W3kf42TomE4Ow== Date: Fri, 25 Feb 2022 22:18:48 -0800 From: Jakub Kicinski To: Felix Fietkau Cc: netdev@vger.kernel.org, John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Matthias Brugger , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 03/11] net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED) Message-ID: <20220225221848.7c7be7f6@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20220225101811.72103-4-nbd@nbd.name> References: <20220225101811.72103-1-nbd@nbd.name> <20220225101811.72103-4-nbd@nbd.name> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Feb 2022 11:18:02 +0100 Felix Fietkau wrote: > + page_list = kcalloc(n_pages, sizeof(*page_list), GFP_KERNEL); > + if (!page_list) > + return -ENOMEM; > + > + dev->buf_ring.size = ring_size; > + dev->buf_ring.pages = page_list; > + > + desc = dma_alloc_coherent(dev->hw->dev, ring_size * sizeof(*desc), > + &desc_phys, GFP_KERNEL); > + if (!desc) > + return -ENOMEM; > + > + dev->buf_ring.desc = desc; > + dev->buf_ring.desc_phys = desc_phys; > + > + for (i = 0, page_idx = 0; i < ring_size; i += MTK_WED_BUF_PER_PAGE) { > + dma_addr_t page_phys, buf_phys; > + struct page *page; > + void *buf; > + int s; > + > + page = __dev_alloc_pages(GFP_KERNEL, 0); > + if (!page) > + return -ENOMEM; I haven't looked at the code, yet, but this sure looks leaky.