Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1538936lqt; Wed, 20 Mar 2024 07:05:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdJmtK1Cr6AoS+trjN7nFXI43M/8pZsyOAEMKsKDkeyhU7rw5i2QN8HqT7OG3ynjnxyvETy4xBPtxQ898zGcmPZizHUgoStHKzA8ierw== X-Google-Smtp-Source: AGHT+IE1/LDO0pwZtl8ic/ZF5F92I2v4A37QtpF+ti8gRwWBst76h+26T8fF5g0zUehfnhTzDWkA X-Received: by 2002:a0c:ab43:0:b0:690:a66b:268e with SMTP id i3-20020a0cab43000000b00690a66b268emr1854487qvb.57.1710943552595; Wed, 20 Mar 2024 07:05:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710943552; cv=pass; d=google.com; s=arc-20160816; b=N+jj59qK+SQxVEfZdXCzrVvVFCNPKDzxnLwjgGX6r62tuYpaQqpj5Oew8Ut3m2qg70 awvZQ5pvMXDDBxe4cryAhIHxLv5/UA6X8a7tGaWDknYKNUMyHyDX1wHWVyK0ZXDdTtx8 +E8arY0usAeHKPmf/ZjkJRrRqaW3fdc00yHQSVDxYul0ADOOf4nU0Mi23y+wXZeMB/tB 2N1iRec6AUc1c5bl2azFLxfYYQtSb0L6Srf4JA8HWA204sZd2Qx/48I9xC8jo5GlZ367 le11y4Yp4B5XttHqGv0J7qyrmncL03MBNVz/MDb77VET58RI2xTjn5iF3oqMIqkqftEp xcbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=VbVZj4I/+AtmVzGEkeHLDd9U7wOTVaVZVt9tQRs8U4g=; fh=1GZ3lVqmZb79HWy7XcEd1wWRDN+ctd3ng/J4u/qABM4=; b=mlvldnkVtQ6osJ4mum8qYwPphMDPRZLaYJkvBp4Y4z/uIjmN1LN3sJMsbibE1Go/tH /AaGH1vICkHsvDM2kVq0an1FeDEHECUGKfAdW5Q/dZ8lyXNVCbypPyZza1TYe8nG8ytF WLZ5K09QqBxk9ScTZoRbWLUkxEeG+5NAJIeX7nLa8k8oGXOCi8qt9z/3D5Ibm0px/Z5r 447vLBBxUGPz/XBOEYDn9pvoJcLtAB4kTZVAae0DFWsK5Qp4UJtu2PjbGvXVVT4/spCk cj0cJ+pyFriHOpZa2Vfu+iJvCfMxzcNF5aa5rWfDHROrGHE75ULV9QXc5j0OwEn7HI8O Fr0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VfASzQfE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-4984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ib4-20020a0562141c8400b006962b98cc91si4750829qvb.194.2024.03.20.07.05.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 07:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4984-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=@gmail.com header.s=20230601 header.b=VfASzQfE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-4984-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 24B9E1C2356B for ; Wed, 20 Mar 2024 14:05:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24EB641C84; Wed, 20 Mar 2024 14:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VfASzQfE" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 901663EA98; Wed, 20 Mar 2024 14:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710943549; cv=none; b=dz0J+DjMSSDTQbk5Jm+aUOwiSnYbRURMsinACMiJzTEG1psLJaoLkwdZ680tg6JuMdGk63lMOyPn2Z4rjG9eWPwT9yIrACj4W2LxAvXiXQZMDwDFaej09RXME8JpY2nukUYBUAQ7pZ7/52LE279sF/rIH/oWRzfJbH9c62XeG7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710943549; c=relaxed/simple; bh=irrfGLbO01Mq9CLIqn3SwQSHvJHO7nR7VitfAyslVwQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=T9wLqgvB3f1zHU6E6/NQshVVPQKHR7ELMGSZsPV+vaozoeE3gKctZznwg7kkI5NJeDjjLiM6PfHIuQXHxmiCbxow+2GuPw91XoUsMP9PNj/trpPcj5FZSc6L7VHIKU7PCDIodjIt7TqT4UtpcsIK+rNcSwgZMhVU28P1gAwsgME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VfASzQfE; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-695df25699fso32704166d6.2; Wed, 20 Mar 2024 07:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710943546; x=1711548346; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VbVZj4I/+AtmVzGEkeHLDd9U7wOTVaVZVt9tQRs8U4g=; b=VfASzQfEi/wETVMpvQWeypdBBjBwvIlaUUnUGffBvQBmGgSRi9Wfg57HMJBXAJiEsW qI79hxSbNtftlpisW9/i1Vjz7YIsw9Iu0hfk4WEBpnwmbUL2npaZrEcKByQ/AIRsVZX3 bUkB7J2/ZARQIzjkBQZwk8X/mkRyydOjsRQA0kWyrqMuabwXxfBenxHqNwX+1269XMdf 3tlihJ+fLg6dKszpNXZz7kTaKxuXr0bz5TLUMUhpKV2q/g6ghAb+eMsR82/ftJpjySxK qndCotbxSWhL6LBbTV6DnY2XZCqghNWOCG/SK0Rl2EGZtJMGUdIjbgk5cCg++9Odp/6S jMSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710943546; x=1711548346; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VbVZj4I/+AtmVzGEkeHLDd9U7wOTVaVZVt9tQRs8U4g=; b=QiJl9psUJO/XPaEMo0raopSZC8q0TpYHkt6f7taB1Ld8rA2xi6Dzxr6yniNaWi6Zt+ dMV2bp1U9OjgVZQZdSP/NOr+ImqKe6/aqfJSYhhKXo1hy4emdq6NAsmSPSw525sIMgtY PQ6qoLcPC1i886Cz+6kc4jmDHplEzmzJWeWAu2xeJModjmL13CEJmza61XEIcCVL5sjJ Cj7d6C9NXmy9RKYdJd/vzPfYpvPDXhj2/mkBulcxkjWjZmkQS/mqQ2O4XOcOK0E+UMVJ ScPUaL8G/xlFFXlZO5+jfJgZyK71/nBtoErX5wboBJ10TnP2yhXdtzkwbQXGaThlkQhP gqbw== X-Forwarded-Encrypted: i=1; AJvYcCX2QuinpOlS5nq8tpIYcdf2FXuhI5jm4nQAhcvtg9QGt+ZSscRRkm9nvOpohQL3d5VUkNapuuUGAD30w4qZDHl1qVJraIc9rKz9ufiZj3vs5x/To6Xa6lKr0uVWLR+7Qk7HKVjNYELuutBPCx8= X-Gm-Message-State: AOJu0YxaIUl8jdtMc6u7tWtdDqqSoc4vX1Vr37pWfOIW6o9dn1ib+K98 6GjABzhYwFai7DPdYZlC3DN2tH9yMR5TQl2qAGNVxyK7lUJUm8uT X-Received: by 2002:ad4:46d4:0:b0:691:fcc:1518 with SMTP id pm20-20020ad446d4000000b006910fcc1518mr1677638qvb.65.1710943546178; Wed, 20 Mar 2024 07:05:46 -0700 (PDT) Received: from [192.168.1.3] (ip68-4-215-93.oc.oc.cox.net. [68.4.215.93]) by smtp.gmail.com with ESMTPSA id k5-20020ad45be5000000b00690baf5cde9sm7854440qvc.118.2024.03.20.07.05.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 07:05:45 -0700 (PDT) Message-ID: Date: Wed, 20 Mar 2024 07:05:42 -0700 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath11k: allocate dummy net_device dynamically Content-Language: en-US To: Breno Leitao , Kalle Valo , Jeff Johnson Cc: kuba@kernel.org, keescook@chromium.org, "open list:NETWORKING DRIVERS (WIRELESS)" , "open list:QUALCOMM ATHEROS ATH11K WIRELESS DRIVER" , open list References: <20240319185735.1268980-1-leitao@debian.org> From: Florian Fainelli Autocrypt: addr=f.fainelli@gmail.com; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYWluZWxsaUBnbWFpbC5jb20+wmYEExECACYCGyMGCwkIBwMCBBUCCAME F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wGqb0FS0seTcYNvxt8PB2izX+ HZA8SL54j479ubxhfuoTu5nXdtFYFj5Lj5x34LKPx7MpgAmj0H7SDhpFWF2FzcC1bjiW9mjW HaKaX23Awt97AqQZXegbfkJwX2Y53ufq8Np3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mz Joil+u3k01ofvJMK0ZdzGUZ/aPMZ16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKy kuVag+IijCIom78P9jRtB1q1Q5lwZp2TLAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9 aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTC y5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6DChDrguup2aJVU8JPBBgRAgAPAhsMBQJU X9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMeqX5aD/aq/dsbXSfyAKC45Go0YyxV HGuUuzv+GKZ6nsysJw== In-Reply-To: <20240319185735.1268980-1-leitao@debian.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/19/2024 11:57 AM, Breno Leitao wrote: > Embedding net_device into structures prohibits the usage of flexible > arrays in the net_device structure. For more details, see the discussion > at [1]. > > Un-embed the net_device from struct ath11k_ext_irq_grp by converting it > into a pointer. Then use the leverage alloc_netdev() to allocate the > net_device object at ath11k_ahb_config_ext_irq() for ahb, and > ath11k_pcic_ext_irq_config() for pcic. > > The free of the device occurs at ath11k_ahb_free_ext_irq() for the ahb > case, and ath11k_pcic_free_ext_irq() for the pcic case. > > [1] https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ > > Signed-off-by: Breno Leitao > --- > drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++++-- > drivers/net/wireless/ath/ath11k/core.h | 2 +- > drivers/net/wireless/ath/ath11k/pcic.c | 21 +++++++++++++++++---- > 3 files changed, 24 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c > index 7c0a23517949..a8d89f510f62 100644 > --- a/drivers/net/wireless/ath/ath11k/ahb.c > +++ b/drivers/net/wireless/ath/ath11k/ahb.c > @@ -442,6 +442,7 @@ static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) > free_irq(ab->irq_num[irq_grp->irqs[j]], irq_grp); > > netif_napi_del(&irq_grp->napi); > + free_netdev(irq_grp->napi_ndev); > } > } > > @@ -533,8 +534,11 @@ static int ath11k_ahb_config_ext_irq(struct ath11k_base *ab) > > irq_grp->ab = ab; > irq_grp->grp_id = i; > - init_dummy_netdev(&irq_grp->napi_ndev); > - netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi, > + irq_grp->napi_ndev = alloc_netdev(0, "dummy", NET_NAME_UNKNOWN, > + init_dummy_netdev); Is not this going to be a problem with multiple network device drivers loaded in a given system and all using "dummy" here? While NET_NAME_UNKNOWN ensures that this is not exposed to user-space, there is still this part of alloc_netdev_mqs() which is going to be non-unique: ref_tracker_dir_init(&dev->refcnt_tracker, 128, name); -- Florian