Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1189954lqp; Fri, 22 Mar 2024 07:59:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHy7dp3pACYaLstWRj5HOYBYgTz8X0N2mmcGpVfa9bD/fBOYJ3Oeg0d4VTsYNBjeFAujZWxIggvWIXjNO22slAeyW6GGpkTrZJ27kZWA== X-Google-Smtp-Source: AGHT+IFBRWxQOB1hfbmePmJMZtcSzt/NkwAQ1TfXtbCBYjPrqYUq9mtS6AyveZPPcUMvvYTGugt9 X-Received: by 2002:a05:622a:1046:b0:431:156:b0a0 with SMTP id f6-20020a05622a104600b004310156b0a0mr2470083qte.23.1711119550434; Fri, 22 Mar 2024 07:59:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711119550; cv=pass; d=google.com; s=arc-20160816; b=G3DZsILT5qNRxAUvpFuFBlGs7kXE1Dind7KOM58hFUq+4/eno1npga0SS5ZANh1jWw QR7v0pUWdVk1N+sO+6wzLUFmBg9lo8qDjQycJuiZDE2RzrqpF9Xz/cSNzFM/Q/mUsGJ6 mKEDgm/LZ1fz42ybNpEeNuJmpunx1RTCijNmQyp4m7SIAOtXbjOUWHWJHUviz510DHrt pbtCcb7AeGQb65GmsM43bpb2pC84c6VWkKV3TVALJFYEsCWr8f3yI7Z3RiI9G7imrj80 yst+JcGfp2JrMrHcnC/HNmiy9R2HdIdDNS3YWl78lx8n8umBGEjQf/sentgerIEi7pwg OmxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=avF4Td+5sDoAM4wZ/tsgIe8phCBwKRX1SbsfID3iEnY=; fh=ejeoASFx1vZwAG8HV5Ctk6/26Y6Ltvp/j9K8pB39sYg=; b=fSlt8f23+xRI/b+GHZRPJjYvBfM6vl+o5k6CIWRVtiq1zFLBnPzcLNdeAGBpKi4W5/ 3+egmcb+u4sufssqF+wjGls/7wqesCk5z/zwRFkSvhCoAMVvEVoUUMUSF4g8WEU8iNJc CzcBMbilQWJ9ToNyeXJbT6f5vvgFBCs1hYet8p22OSjUWP98sKhEZCemSWOVeaq6D6+7 U9tSkHlXEp/KXgKwrCifG4x6akO6OKmoxAPh9Ls6l6Vmi8ZKSNa+2KkN+e1OY/Rgdwm0 4egP5eSjFvdz5nF+5z66PAwUDLY4MrNTAsYNjvjCm60wqyTMcTjM8XQmCYULA8UpegTf Lfjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111665-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s16-20020ac85cd0000000b0042ef635b836si2100235qta.694.2024.03.22.07.59.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-111665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111665-linux.lists.archive=gmail.com@vger.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 24AE81C225DD for ; Fri, 22 Mar 2024 14:59:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D18E53E3D; Fri, 22 Mar 2024 14:58:09 +0000 (UTC) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D123524DF; Fri, 22 Mar 2024 14:58:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711119489; cv=none; b=WczjTYvS9v4BLwzo5k4PFm/TSyjLQ3xaOOhSJBt7/p1ctE9MAKb4Bd6oAKhsACSxC0krKPlhyIM+WmCz/TvqsPvSNg9eTMo3iQPnJRVXQjI612vi35L2ApWJ6RJjdMJKeOJxtHJqymBtF6+/LZoxSRbmvyr9yMNE9kfpfoTpmbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711119489; c=relaxed/simple; bh=685WdBxw0GOy/a0oTxvU+HyP265MQxO4nlLlheBUxR0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b8taLitRzsyge7tvhLR+ABWe7vFN83rGAf73jFNBuiiQJEEJP0WXhVOZYvcHIteQixYwDZO1ABtdvI5+XTtopIfappPeuCdO0gepHFvJjGDLM8lg7hxC6sdOKcYC5YkgaMyySrCYJMObokZ8wwoJItjI6DaTPB0KlcRXg7pccMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-513d23be0b6so2664822e87.0; Fri, 22 Mar 2024 07:58:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711119485; x=1711724285; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=avF4Td+5sDoAM4wZ/tsgIe8phCBwKRX1SbsfID3iEnY=; b=iVvpEzLtfVqc33ud9rkUQWqYdSQdRu5fcSm3Jm3cpyiA20uPQZwm5y0TgJx9Hu/xNr lWI9PuD5Bxzz54UV29HP1uJQp5etwmQ/TiZd5yBkHFe0xzhvz5NvUXMnyUSn7HFH5Qzd nm17febbuxfqGCekAvXxvRV+sBKwLxr/O/Icyu71vFKzqixyB2AECjCWcpCZMsnsFDhq FVqnVHSbwiNOXWkX5lwY80jtrhtIZuF3Z9q04BogsneSSfKsbWIEO86Zva4V7LV8cu7C inSaGSUs46dmJZEL76jDidknUQh64iUAR2sWBDbkIPFHliXDEIozQfQ1iHuilu7h/Pn4 I0bQ== X-Forwarded-Encrypted: i=1; AJvYcCV+6uAFtgfSvGixg3ctwuA7UvPJjwifLhpiFQUuNvqJqX/GXwhOEKOtaSjzkmTdBFOq0nRFyGDVrmdtvJTNSM07nFSfrIWKj08tnavb37E2NIh+urciTJsMrcWDQSmD5i2gq2G3EWXLi/puBko= X-Gm-Message-State: AOJu0YyAe/Qqe9recl5tZQJuVfKkVqGW2GeEXuViomgp3wFRMYUkXUdF h6uoFnt/YTZxa8RcNnHyXjtF7cdOcTcw1H8fiwLH+WsKNSOQ34Wc X-Received: by 2002:ac2:546d:0:b0:513:cab1:354b with SMTP id e13-20020ac2546d000000b00513cab1354bmr1898523lfn.41.1711119485063; Fri, 22 Mar 2024 07:58:05 -0700 (PDT) Received: from gmail.com (fwdproxy-lla-120.fbsv.net. [2a03:2880:30ff:78::face:b00c]) by smtp.gmail.com with ESMTPSA id r16-20020a170906351000b00a46cddf1efbsm1092197eja.29.2024.03.22.07.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:58:04 -0700 (PDT) Date: Fri, 22 Mar 2024 07:58:02 -0700 From: Breno Leitao To: Jakub Kicinski Cc: Jeff Johnson , Kalle Valo , Jeff Johnson , keescook@chromium.org, "open list:NETWORKING DRIVERS (WIRELESS)" , "open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER" , open list Subject: Re: [PATCH] ath10k: allocate dummy net_device dynamically Message-ID: References: <20240319104754.2535294-1-leitao@debian.org> <9fcdb857-da62-4832-ae11-043fe993e4ad@quicinc.com> <20240321072821.59f56757@kernel.org> <5039256c-03eb-4cda-8d11-49e4561cf1ef@quicinc.com> <20240321151744.246ce2d0@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321151744.246ce2d0@kernel.org> Hello Jakub, On Thu, Mar 21, 2024 at 03:17:44PM -0700, Jakub Kicinski wrote: > On Thu, 21 Mar 2024 15:02:39 -0700 Jeff Johnson wrote: > > >> As suggested there we should just use kmalloc/kfree to match the existing logic. > > > > > > Please no. There is no magic here. alloc + free must match whether > > > you're using magic object alloc wrapper (alloc_netdev()) or straight > > > up kzalloc(). > > > > Based upon the ath11k patch there must be something going on with > > alloc_netdev()/free_netdev() that doesn't occur when these aren't used. > > Looks like init_dummy_netdev wipes the netdev structure clean, so I > don't think we can use it directly as the setup function, Breno :( Before my patch, init_dummy_netdev was being also used. The patch was basically replacing the init_dummy_netdev by alloc_netdev() with will call "setup(dev);" later. - init_dummy_netdev(&irq_grp->napi_ndev); + irq_grp->napi_ndev = alloc_netdev(0, "dummy", NET_NAME_UNKNOWN, + init_dummy_netdev); I am wondering if alloc_netdev() is messing with something instead of init_dummy_netdev(). Also, Kalle's crash is during rmmod, and not during initialization. getting NULL after free_netdev() is called. > Maybe we should add a new helper to "alloc dummy netdev" which can > call alloc_netdev() with right arguments and do necessary init? What are the right arguments in this case? Thanks!