Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1471228lqe; Mon, 8 Apr 2024 09:44:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWv6jJWkfDkOnuJPImi0NVpD6PnGDiYKCQjXDCO9GxDCqgDtUJJogL0//FX/2tY4QcFt1gmNuOjc0XrOKxlLTYuZN5jzNG9IjiUDnaQ0Q== X-Google-Smtp-Source: AGHT+IG6WuK0jk2nsclyTyyBt4To8exzCJOH7RdlvnCV1KL265URSTzDvlvqm7arkf/UrQvbzWv/ X-Received: by 2002:a05:6214:1256:b0:691:67f9:16e7 with SMTP id r22-20020a056214125600b0069167f916e7mr389488qvv.24.1712594643094; Mon, 08 Apr 2024 09:44:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712594643; cv=pass; d=google.com; s=arc-20160816; b=FGtg5M8U8IeEfIjiPS5T8eYZMaUG7kn3hgU0Sk8W/ogD08Fc24u0evExRRenQrao56 6TEhEYpgjkb2AjAO3/GY7GEVV4b5Tb8Xx/iIC8NAj9xX2HmuUL369iwNGa+NCDI7+QN4 +h7ALtH+Zxb+6Qxx7XTlx18j6dceQ7xN2MHjLB9HgJ9ifZWoRJp09lYqT2N9mvElqiH5 G/w1AicR1VcxleMNrezBgJ2C8r79sN4NJt6AOkF/qUFW2gyxykOyFn1Rr9gKnoaWfxeh OvCmCbX2DJX6Jhf7FcLA9Q5gRkSeWrY+eWhAZ1HBJ/fn1vylsq1hL+rxyFw4qS970DQ/ vmQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=D+df3KZS7e6XYAnaWh9fWGUkdnHcCqEkIpNVuIL0CIs=; fh=u01iK4+1ahoESo5++m1OCMPAGJeSkUPMPMfRRFLUbqc=; b=qxXto5NR3AkHHs7rg3JrfwpsL6hxuWFC3apLN5nRukfMiL5DWqrBLurJdpJqI7pQwt WKbNFmSzY3V0ruwj1Nnm4u76glJYM8p5eJPPYo/DB+8LhD5vCFToKuHTxfcTpE2yHwmE jgTYnXN7ObQOm/W+GCXtSKtZ9fHwW5WRLsTLd8MWUi82cgvYd45zMoO/CONCI/5Qa3KS 3XM0qhpAXPvaxNsveOer4Wg729k0zCz2ZMBR5sGLiZkjEsWuppeXDrNZ8t3pZhp1WP40 cqskc57ByUaEO86xuA0SAXGx47t3htilVLzKlZeAmKqYrMQ3drKynEDhyMBsRP2/3cWe zd6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uJ6UPBrY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d8-20020a05621421c800b0069b1e62f8d0si2205746qvh.457.2024.04.08.09.44.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 09:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uJ6UPBrY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CFBD91C211BF for ; Mon, 8 Apr 2024 16:44:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5764143879; Mon, 8 Apr 2024 16:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uJ6UPBrY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F41E414263A; Mon, 8 Apr 2024 16:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712594627; cv=none; b=NUaQ4fqPeql954nTIojncKPwH+x2soQJXFXPZj3OBlhD0ZbzmYo8R3EG9fVNoSqlGVNcu/z7nsy6mbNcxHCC2FKg2oaqGkIctZVvYmQumvW5qupF/tiz2jN8EyPx8/MvQs1hM2qSC+5Fab6zfC1ttlnO9/CaXVB/Ta+7plTaqD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712594627; c=relaxed/simple; bh=GxSn5Dg+E+RmqcRAj1lrGgjD7usuAbhQ8PYEXM7ou9g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=lxUWH+kDo4NbC+1/q+sFBUMep3EH6xxdhq9dKKaaGbEKXCQHmntxPOaU0mgkwZY87HYETmG56bLEAyZpRuMTPMwP+XDXKPKFKZ+bBkHzdxaG7ivQobWfZuZBO+6StqRKNwD+aOTasPa0ynhnC7c8VzzjxHyPz/CpMuiQtI98mZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uJ6UPBrY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 917E9C433F1; Mon, 8 Apr 2024 16:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712594626; bh=GxSn5Dg+E+RmqcRAj1lrGgjD7usuAbhQ8PYEXM7ou9g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=uJ6UPBrYDRX64lzJjnzYDk2dG7dGz66e0Kjkj3DhPYIhov5Cbu3a8bv5NOlBOxV0i ZbxNxh/2qy/gKrHkqfwCDSpWbeyPuF4Dvg2qmFObpMbgx725MaqI+boXwK492Vc/Yu Ei4orRw1hSzNT3BMXch7zz9+y8lhsmG+tnA3tOt/+SWnXalqgYR2jvc5SyrOuyU4Q+ jJMRerXFKzKnA18oD/mnvjCJkgGzc0dFkIib/OsvqYtX0sBNcIU+XRBk++Be+8jKO9 T71DVZH25KdQHwLPglR99BeQYDP4BlcHHOBVIcQ/uhYo0Pdrc2BI5Gf3Atw9iwFEcA yNcPxsfHyeF+A== From: Kalle Valo To: Breno Leitao Cc: kuba@kernel.org, ath11k@lists.infradead.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, imitsyanko@quantenna.com, geomatsi@gmail.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/3] wifi: Un-embed ath10k and ath11k dummy netdev References: <20240405122123.4156104-1-leitao@debian.org> <87y19r264m.fsf@kernel.org> Date: Mon, 08 Apr 2024 19:43:42 +0300 In-Reply-To: (Breno Leitao's message of "Mon, 8 Apr 2024 06:33:56 -0700") Message-ID: <87pluz24ap.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Breno Leitao writes: > Hello Kalle, > > On Fri, Apr 05, 2024 at 06:15:05PM +0300, Kalle Valo wrote: >> Breno Leitao writes: >> >> > struct net_device shouldn't be embedded into any structure, instead, >> > the owner should use the private space to embed their state into >> > net_device. >> > >> > This patch set fixes the problem above for ath10k and ath11k. This also >> > fixes the conversion of qtnfmac driver to the new helper. >> > >> > This patch set depends on a series that is still under review: >> > https://lore.kernel.org/all/20240404114854.2498663-1-leitao@debian.org/#t >> > >> > If it helps, I've pushed the tree to >> > https://github.com/leitao/linux/tree/wireless-dummy >> > >> > PS: Due to lack of hardware, unfortunately all these patches are >> > compiled tested only. >> > >> > Breno Leitao (3): >> > wifi: qtnfmac: Use netdev dummy allocator helper >> > wifi: ath10k: allocate dummy net_device dynamically >> > wifi: ath11k: allocate dummy net_device dynamically >> >> Thanks for setting up the branch, that makes the testing very easy. I >> now tested the branch using the commit below with ath11k WCN6855 hw2.0 >> on an x86 box: >> >> 5be9a125d8e7 wifi: ath11k: allocate dummy net_device dynamically >> >> But unfortunately it crashes, the stack trace below. I can easily test >> your branches, just let me know what to test. A direct 'git pull' >> command is the best. > > Thanks for the test. > > Reading the issue, I am afraid that freeing netdev explicitly > (free_netdev()) might not be the best approach at the exit path. > > I would like to try to leverage the ->needs_free_netdev netdev > mechanism to do the clean-up, if that makes sense. I've updated the > ath11k patch, and I am curious if that is what we want. > > Would you mind testing a net patch I have, please? > > https://github.com/leitao/linux/tree/wireless-dummy_v2 I tested this again with my WCN6855 hw2.0 x86 test box on this commit: a87674ac820e wifi: ath11k: allocate dummy net_device dynamically It passes my tests and doesn't crash, but I see this kmemleak warning a lot: unreferenced object 0xffff888127109400 (size 128): comm "insmod", pid 2813, jiffies 4294926528 hex dump (first 32 bytes): d0 93 d5 0a 81 88 ff ff d0 93 d5 0a 81 88 ff ff ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc 870e4f12): [] kmemleak_alloc+0x45/0x80 [] kmalloc_trace+0x278/0x2c0 [] __hw_addr_create+0x55/0x260 [] __hw_addr_add_ex+0x2fb/0x6d0 [] dev_addr_init+0x144/0x230 [] alloc_netdev_mqs+0x12e/0xfe0 [] alloc_netdev_dummy+0x25/0x30 [] ath11k_pcic_ext_irq_config+0x1ad/0xc10 [ath11k] [] ath11k_pcic_config_irq+0x2f1/0x4b0 [ath11k] [] ath11k_pci_probe+0x874/0x1210 [ath11k_pci] [] local_pci_probe+0xd6/0x180 [] pci_call_probe+0x15a/0x400 [] pci_device_probe+0xa6/0x100 [] really_probe+0x1d5/0x920 [] __driver_probe_device+0x2e8/0x3f0 [] driver_probe_device+0x4a/0x140 -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches