From patchwork Mon Jan 15 14:56:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 188220 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1760132dyc; Mon, 15 Jan 2024 07:07:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfJn1GAskK5sypzCGpvlYvMtfLqLcjbW/eREBNRQ3IgT+XTizJ3TvWVhuRepmyHnRwCf2O X-Received: by 2002:ac8:4e89:0:b0:429:fdb2:6246 with SMTP id 9-20020ac84e89000000b00429fdb26246mr526578qtp.37.1705331240233; Mon, 15 Jan 2024 07:07:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705331240; cv=none; d=google.com; s=arc-20160816; b=RCyQa3PHqARn877Y9KSik+tKBKOlZ8qOMA+qv6BodEUgyQWzMQttoB/aosCKvwTRH8 F+W1xkdDUET0AUrU9YXU94PadHpXPixvvbIRu457Lg/I55Wl+j8u8ne3Xqa6F05+Bzb3 zlP5WdcYWsF8A2LH5tXpP7zIhLJGB7ESUb3DoshXmjkHpZT8oUsuXWAlnfEhVETtssC1 LhvLVjEXcOxAG0UnmEVUQyurJd0AStnYV6sHJYmquuJiXvCZnuVuF/MN5t02CZ3gAdM8 iW8vGaxHi3GRQRXyfJFzbPUZT/pDoSwe8s2Sh9KhMoeDgAb2EHZhnuM91KMZXiOPgpZ7 26dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=f53Zp5Ie7SvA/urVLBu9knCFVK7DSFZQ8gZToRBEIg4=; fh=fVWNSIr8Vd5WRJo6LslfqG3nFGLhcHDnKbQ0ZKCs5kk=; b=p/LtJfbBA2HHlC4h0nLndSDJlB4iaBAqWUsjDEurhYY8QkvXKaubttr+JbDCmqeln/ KWQ6zKHN5NaSX+cwybl6+k60a89orBXGWLYu+aVjXED743K5nEmOUuwLy/YpA5NCOXRx ejML9ICbNmFp6oEVv6z7QkLJUfMmtVeM2Rs9zB5pJg0JG2nAspRANCxj61K3YBuHbB5L JhoabbI5Wu98MaPk+h0bDGp2iQFzHxsPK+IECi6oji9E76AjG/lAC4fRCgA0oKjYMgAc uleFdeFFTXJKyreMreKJoL4P5wTkcPWYXWQqSQytpE3KQhVult7VWkao8Lo6O0+vXDn7 2bSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OF5Itzhq; spf=pass (google.com: domain of linux-kernel+bounces-26155-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26155-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p9-20020a05622a048900b00429b3b3dc08si8243041qtx.742.2024.01.15.07.07.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:07:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26155-ouuuleilei=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=@bootlin.com header.s=gm1 header.b=OF5Itzhq; spf=pass (google.com: domain of linux-kernel+bounces-26155-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26155-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 0AF6B1C21B64 for ; Mon, 15 Jan 2024 15:07:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B343017C72; Mon, 15 Jan 2024 15:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OF5Itzhq" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 53FAD179B5; Mon, 15 Jan 2024 15:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id D9714C646B; Mon, 15 Jan 2024 14:59:20 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 905CAFF80E; Mon, 15 Jan 2024 14:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705330753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f53Zp5Ie7SvA/urVLBu9knCFVK7DSFZQ8gZToRBEIg4=; b=OF5ItzhqFaamgBezgWVg9/B2KXGRP9tnRoLiz7gqbObeTDOch0oAdJ1BN+ou03qFQWa03k YGosK7D0zkB51PkdUbRgQ6tRuJFjFxurKykh5by0HzrwIVrePxv4xeGMBq0ONpz3m4sXBN AeY7aYS8FnHqm0HrgA2HhyZJpzO/blLF3vGgaYPef1/zXxvA9dmcJ28LeAr37QRDHNrc93 9pF48Da9UoZ4T6Lb0hdvtzZyoBTzrlkKUIfk3QnQ0eu9or2866oFKneEsTfLboFmKCaker ttH58df2vTQ7QK1565WiKtrLJOZoxad1TBYuhxHSjrBfcJ495VBfq7GQCfJTUQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Mon, 15 Jan 2024 15:56:30 +0100 Subject: [PATCH 1/5] wifi: wilc1000: set preamble size to auto as default in wilc_init_fw_config() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240115-wilc_1000_fixes-v1-1-54d29463a738@bootlin.com> References: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , David Mosberger-Tang , Thomas Petazzoni , linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788169410673987077 X-GMAIL-MSGID: 1788169410673987077 From: Ajay Singh Changed the default value preamble to WILC_FW_PREAMBLE_AUTO in wilc_init_fw_config(). Signed-off-by: Ajay Singh Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index 91d71e0f7ef2..8923eb64c964 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -284,7 +284,7 @@ static int wilc_init_fw_config(struct net_device *dev, struct wilc_vif *vif) if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, &b, 1, 0, 0)) goto fail; - b = WILC_FW_PREAMBLE_SHORT; + b = WILC_FW_PREAMBLE_AUTO; if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, &b, 1, 0, 0)) goto fail; From patchwork Mon Jan 15 14:56:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 188221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1760265dyc; Mon, 15 Jan 2024 07:07:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2ZKJgU9Za+QAIOPTeJAPTJg9Dfw0QEeTaSJuuuNUBG82bNJisSWKl/WHY7gA/TPmMlP5K X-Received: by 2002:a05:6402:5242:b0:558:9db4:30b3 with SMTP id t2-20020a056402524200b005589db430b3mr7861812edd.15.1705331251936; Mon, 15 Jan 2024 07:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705331251; cv=none; d=google.com; s=arc-20160816; b=wpMOdweBU62C47qv75xJSonz1xTpGm07QQECChZvY654F++5Txy/KPc0cUzAG4BZjp D6aJMOWGUtRhWnSjnGLrWvEOP3XzxXxahOd4YnSedIlCuAB9vhrDl29iEJV1ezcSgd2Z U1ZFrzLNi8sfXneEbgcj8mxL88c97FVmyKYlQqdS3knjIHveAhu+/UABIHjkfQmDd0mu /TxEdFDA4acVNFOdU8//S9J/A6mUTiI8peZaG69fTKqIDTk0BJj4zJYaJBkY2wit2NqN qqbDKUxYxl/+t3IsP9ZAA6+OkeSVdGYp/8F0O92b35+HgfKn7MmJobPb8SOpRbKUC3TS wwSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=qUQFLny0OJogecoJQ6XqtWgWxGYqMWpFkFbyJn8U9iw=; fh=fVWNSIr8Vd5WRJo6LslfqG3nFGLhcHDnKbQ0ZKCs5kk=; b=ZGhp3tf1Qoz+RWQYQD2P6FH2HjLZ/FG2iMEFBLHfW2pnRbny9rvxxId+oMfh2RCMpd uv7znEpp5LZYh5sHnFV9aHKwGNEvXxGqNlY/W2PKzl8Ndhuimje0QaL9tuco5WitG2+H 5wW2iseHseVzy38ziLr0MHhvy0dafCYE2nncp9ySFR1R2R/ASKCnydsVnWK1f9n48XFH 2J8dWLciYuBmtDoSDCgUP0tolBkTaI2La6HnotZ0ilF7P2Y02wqSfyKLRy56KEGa7JxR sHSop4zxX1CV+IoR4aKx0riaSW3LmFDL3j0ynUwtlxypEatVfWZvQkVa6X9Y+6im11Tj 2H+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DUVyiaxL; spf=pass (google.com: domain of linux-kernel+bounces-26156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26156-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n23-20020a5099d7000000b0055390d3c062si3954502edb.529.2024.01.15.07.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:07:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=DUVyiaxL; spf=pass (google.com: domain of linux-kernel+bounces-26156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26156-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 889551F22B14 for ; Mon, 15 Jan 2024 15:07:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A92661802A; Mon, 15 Jan 2024 15:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="DUVyiaxL" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 53FDC179B7; Mon, 15 Jan 2024 15:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id CD0D8C646A; Mon, 15 Jan 2024 14:59:20 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1D897FF805; Mon, 15 Jan 2024 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705330753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qUQFLny0OJogecoJQ6XqtWgWxGYqMWpFkFbyJn8U9iw=; b=DUVyiaxLVcCQGvgki9t3xNTv8GyWblnTcZhvz4bwUksdLH++0leG6dGavwjxpuGjuXmFQo AtpUp3KdZ5ca5Q5GBW/O5IdK5X+Ji5HN9f9Hd1FZmMqycOtJFi00CfxpxqVEogkGynnEYc gYVu5cF29DpkofadmoGsTjxKllPp2aMsKbxA5EN45TFimjykjtuqydiJUMbse7nH6b+J6k 1cwwXy7sFTN78n84yRwUF+GZfILWRWpyRj4ivqIW6IrLMgk/kWq2xhCdMtgIdWsUzR268u EUAT96Afx6Roxd2AWcce9OVrmRouRfODQarR7qs347kTnnbd6oCfbarp00bcPw== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Mon, 15 Jan 2024 15:56:31 +0100 Subject: [PATCH 2/5] wifi: wilc1000: fix driver_handler when committing initial configuration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240115-wilc_1000_fixes-v1-2-54d29463a738@bootlin.com> References: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , David Mosberger-Tang , Thomas Petazzoni , linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788169422964497420 X-GMAIL-MSGID: 1788169422964497420 From: Ajay Singh During firmware initial configuration in wilc_init_fw_config, the special driver_handler 0 should be used instead of targeting a specific virtual interface (either 1 or 2) The issue does not seem to have real consequence (both virtual interfaces seems to answer correctly to a Add Block Ack request with the Immediate policy), but lets make everything homogeneous Signed-off-by: Ajay Singh Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index 8923eb64c964..f3b9709f8730 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -416,7 +416,7 @@ static int wilc_init_fw_config(struct net_device *dev, struct wilc_vif *vif) b = 1; if (!wilc_wlan_cfg_set(vif, 0, WID_11N_IMMEDIATE_BA_ENABLED, &b, 1, - 1, 1)) + 1, 0)) goto fail; return 0; From patchwork Mon Jan 15 14:56:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 188222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1760508dyc; Mon, 15 Jan 2024 07:07:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEdQjDISfK+kGmxtMHdAUCLyBLLGmSjxfEcN6io0GRjkdvRMCHjVWRIffIL0R7jblWiSMj X-Received: by 2002:a17:902:bb89:b0:1d4:f804:6fb8 with SMTP id m9-20020a170902bb8900b001d4f8046fb8mr2469561pls.89.1705331269040; Mon, 15 Jan 2024 07:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705331269; cv=none; d=google.com; s=arc-20160816; b=Aa/tQogxPooy7rtq5wMmx8v2ieW6utpyq8kKeoeTDmlqCbazcFwKk0hN9kwqL1P1Zq naXdCh0+J2zQ6J/HN/EcJYD4szosxxJ9ZGlJqMh+79a4gNxFMGUUzep1T/MfwhchGTgf 7/Q5+hBqTFiPMeBP5wvuGIwPbhxrLX6mKpOv1cm9/K39ZhhH25RDhXl763kLSjmnfc3V qgZNcttwrx/3WthLlUU4rnFgimmg0exMS0RcOQ+FOQ2TKUJr44Foq14S8r9TxhaB5Kcb 0ZgNfDtDoIVP0Bc1418O9MWTK4i8ROvYxChz4B0u6/EHvk2aRqoGxFZm1nlTy0RT47sf J12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=LZkhrW90NftZl3gLX1/zmDX5uMKEyUwGVtpHtaU4N8U=; fh=fVWNSIr8Vd5WRJo6LslfqG3nFGLhcHDnKbQ0ZKCs5kk=; b=gHFx4t7+4gy8RY5qP3iSXF+USFzwOIiWUcDNIIP/gGvoHUa50JabNzWKynrfzW2QT5 e9Ala5amwoetqkHn+xUrRDbzphd3aKjveJZPViX1LCkk3HPkX8TNA1YWpBSBgW7cZiU1 f1C0/pxRdiQTDXmNgXTlMGIMey/pOZX+UaH1btFBXDLV7Po693uFT/LO2hhWs2Xp6tiO t54LtlPEo4IFY29pigekA5mWgEy48NB22x2c0gr/69CVVfDKg4X0UZYyzJ+jgVwIltAu ejfFJnlU63SBlrADK9ahm/ZWAw8wa2pgW8wRUJfUXP85vMyFfzMvOmcHSgIqSfUQp3By BqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GweDVpgJ; spf=pass (google.com: domain of linux-kernel+bounces-26157-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26157-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i15-20020a17090332cf00b001d4af53a8edsi9955711plr.340.2024.01.15.07.07.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26157-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GweDVpgJ; spf=pass (google.com: domain of linux-kernel+bounces-26157-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26157-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0760B2829A9 for ; Mon, 15 Jan 2024 15:07:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E090182AA; Mon, 15 Jan 2024 15:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GweDVpgJ" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 06F9118034; Mon, 15 Jan 2024 15:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 7B6B6C646F; Mon, 15 Jan 2024 14:59:21 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 92FD7FF806; Mon, 15 Jan 2024 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705330754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LZkhrW90NftZl3gLX1/zmDX5uMKEyUwGVtpHtaU4N8U=; b=GweDVpgJMSSmnHDrqmQBkSgYcuyaENwV0UjwFyxfClxgoiIXeBUkXey1+EA5lKU8L5AtdD oP4H8zC3IFSIU225CdWHjaZ1ZqLgE/BTlkAaLWVZFK3nAKOfxQqYUszQfUk1XVwSBFDHFg nvpFHkg4WSZQw5ZJZD3sRueewkmqdsBSjzju7oFR0UDvHG+KGqAQTA6RSfMlg3YsNEwzQG LILREwXQv1DnrHtulS1cnfgKNiDIc9Eef/M8zrXJGPOHLxCmf12ZCVnhNnBgVMa5GJee0v LcjATmebjbgSP6myKf/FgYiUk04w5cjK5EvtQmQspBpf0sUEUC6jQtSec50MfA== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Mon, 15 Jan 2024 15:56:32 +0100 Subject: [PATCH 3/5] wilc: wifi: do not realloc workqueue everytime an interface is added Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240115-wilc_1000_fixes-v1-3-54d29463a738@bootlin.com> References: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , David Mosberger-Tang , Thomas Petazzoni , linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788169440785806871 X-GMAIL-MSGID: 1788169440785806871 From: Ajay Singh Commit 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"") moved workqueue creation in wilc_netdev_ifc_init in order to set the interface name in the workqueue name. However, while the driver needs only one workqueue, the wilc_netdev_ifc_init is called each time we add an interface over a phy, which in turns overwrite the workqueue with a new one. This can be observed with the following commands: for i in $(seq 0 10) do iw phy phy0 interface add wlan1 type managed iw dev wlan1 del done ps -eo pid,comm|grep wlan 39 kworker/R-wlan0 98 kworker/R-wlan1 102 kworker/R-wlan1 105 kworker/R-wlan1 108 kworker/R-wlan1 111 kworker/R-wlan1 114 kworker/R-wlan1 117 kworker/R-wlan1 120 kworker/R-wlan1 123 kworker/R-wlan1 126 kworker/R-wlan1 129 kworker/R-wlan1 Fix this leakage by putting back hif_workqueue allocation in wilc_cfg80211_init. Regarding the workqueue name, it is indeed relevant to set it lowercase, however it is not attached to a specific netdev, so enforcing netdev name in the name is not so relevant. Still, enrich the name with the wiphy name to make it clear which phy is using the workqueue. Fixes: 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"") Signed-off-by: Ajay Singh Co-developed-by: Alexis Lothoré Signed-off-by: Alexis Lothoré --- This patch has initially been done by Ajay, and I slightly reworked it 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"") also mentions that this workqueue allocation move has also been done to make wq alloc/dealloc symmetric: the revert set back the assymetry, and that remains something to be fixed. Deallocation should likely be moved from netdev.c to cfg80211, but that would be a dedicated rework topic --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 11 ++++++++++- drivers/net/wireless/microchip/wilc1000/netdev.c | 10 +--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index ad2509d8c99a..2d0474e6404e 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1804,15 +1804,24 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type, INIT_LIST_HEAD(&wl->rxq_head.list); INIT_LIST_HEAD(&wl->vif_list); + wl->hif_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + wiphy_name(wl->wiphy)); + if (!wl->hif_workqueue) { + ret = -ENOMEM; + goto free_cfg; + } vif = wilc_netdev_ifc_init(wl, "wlan%d", WILC_STATION_MODE, NL80211_IFTYPE_STATION, false); if (IS_ERR(vif)) { ret = PTR_ERR(vif); - goto free_cfg; + goto free_hq; } return 0; +free_hq: + destroy_workqueue(wl->hif_workqueue); + free_cfg: wilc_wlan_cfg_deinit(wl); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index f3b9709f8730..da52f4a9c1fe 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -989,13 +989,6 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, goto error; } - wl->hif_workqueue = alloc_ordered_workqueue("%s-wq", WQ_MEM_RECLAIM, - ndev->name); - if (!wl->hif_workqueue) { - ret = -ENOMEM; - goto unregister_netdev; - } - ndev->needs_free_netdev = true; vif->iftype = vif_type; vif->idx = wilc_get_available_idx(wl); @@ -1008,12 +1001,11 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, return vif; -unregister_netdev: +error: if (rtnl_locked) cfg80211_unregister_netdevice(ndev); else unregister_netdev(ndev); - error: free_netdev(ndev); return ERR_PTR(ret); } From patchwork Mon Jan 15 14:56:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 188223 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1760668dyc; Mon, 15 Jan 2024 07:08:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPUg7ALZIsqQ7SUy5dhqrjFQbpMGdCL4GyGKspYyvnvob2W0srWYTSRVF5d5FshVaz3dGu X-Received: by 2002:a17:907:3a14:b0:a2a:640d:3c64 with SMTP id fb20-20020a1709073a1400b00a2a640d3c64mr4609629ejc.32.1705331283718; Mon, 15 Jan 2024 07:08:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705331283; cv=none; d=google.com; s=arc-20160816; b=GzoCfBrbgYKq7/wP/0HThIl0ZYweq3nlkXkvoMfoeiLKKl62T2y5sKW9gQI49Z9JZ1 sMEJXxgXJiBtzlrhL0HfZCGXMrs2XM+SkHA1AXSRe7OOJsbUpkLqVvDAmMIn1CLZ/I5r iwvXBxyccysTB6FryZaqd7QJfJq0LF0aaD12/GFr6WcIxk1BXKybz4fFpEL8DAcAuUMm mGUMXoYFpXjyzxMmbUzhr5RlMMs+N+No1acrupRBCGt5ef4Ojqg0LDWi6xl4t16no4qj vCFNPATzDNPmWDYgnkivyJKVRV+6Xsm1MZy6NMheqDBnKJ93TXw5kGpzn3o07yYgqnq3 jOeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=zbYOaOM3QGrDC1DK3YRlyfVFVMs9CV5+vSCXqg6nHbs=; fh=jNt7BTrn7eCiWlnQ3eh96G8VRgXhssn8dx2sFpswZac=; b=BI15tLN8p63FN67bqh6r1zf7D5T5GlAIEV22ypWrUxPFtYUi3nDhQwpDgcy9znkQEg JKLZtAE5Js3FUoIJvukCM7VPaQsYFeWWNlc/ol5lJ13vMWLhFmS7B5b1kKaWaiNjFhcp jt8DFn1ZtBV+FF05gcgNH+TZaRwzXNY4ZbmmYW+z5E0Rbh+7m5TQ9VsIma8caFjJhzwc yhzEX2KyIVyPzivtLfeSGUBZYeN+xqQgQ7trDTVQs8IODyb1ibCigBSS1W2sFCGc48YE DvgAD19evulxSjbBgw1xOGV5r/OlLhVYNdxZ22PhSwHl3lQUKIdUNJz4Qx4EoYRVqn55 cDCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VRCkCtrQ; spf=pass (google.com: domain of linux-kernel+bounces-26158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26158-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q19-20020a1709066b1300b00a27586b81e9si3757099ejr.256.2024.01.15.07.08.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:08:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VRCkCtrQ; spf=pass (google.com: domain of linux-kernel+bounces-26158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26158-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 56F4A1F229A9 for ; Mon, 15 Jan 2024 15:08:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF60318638; Mon, 15 Jan 2024 15:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VRCkCtrQ" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 15894182BF; Mon, 15 Jan 2024 15:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id A4CDAC6470; Mon, 15 Jan 2024 14:59:21 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1246BFF80F; Mon, 15 Jan 2024 14:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705330754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zbYOaOM3QGrDC1DK3YRlyfVFVMs9CV5+vSCXqg6nHbs=; b=VRCkCtrQqelHjj9OS2DN1LwBbCx7PMCRs/YxKZgFM45s4k16/w4/tqPmVdhmB6mBRdqK7m w/tICl/5UzYHjurWgXpQEbZKaojMyY5YCK4zS/BZriki33p+OWdmYJzkc8+nVhzN7IPqSj 7LCtL1qxF73Aic6UJK3UKZibxvsWBSYCJpBUmSHZTi623MUVspF+jmfI8A/qd0xVyCA6hF x8zabXhn/jvtAc+A+XjfZWwDumDlVBqZh2gbWCfjYMPBxDWnC3AEBVma96Aco/2pR/cjgK sgWzh/wj+byWJcrlUlHLe2wPpYy6QXCNNi6Pa4h4kui9XF3wr3EgroA+9eStrQ== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Mon, 15 Jan 2024 15:56:33 +0100 Subject: [PATCH 4/5] wifi: wilc1000: fix incorrect power down sequence Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240115-wilc_1000_fixes-v1-4-54d29463a738@bootlin.com> References: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , David Mosberger-Tang , Thomas Petazzoni , linux-kernel@vger.kernel.org, Michael Walle , =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788169456373465741 X-GMAIL-MSGID: 1788169456373465741 From: Ajay Singh Use the correct register configuration when the WILC chip is down so the successive interface up operation is successful. The modified registers values during chip down helps to avoid the "FW not responding" debug message which sometimes occurs because of temporary bus communication failure during the next start. Also, make sure on first communication with the chip that it is indeed woken up. Reported-by: Michael Walle Closes: https://lore.kernel.org/linux-wireless/20221026085415.6jgwrhq4sunqaypm@0002.3ffe.de/ Signed-off-by: Ajay Singh Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/wlan.c | 33 +++++++++++++++----------- drivers/net/wireless/microchip/wilc1000/wlan.h | 6 +++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index 9eb115c79c90..6b2f2269ddf8 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -1198,27 +1198,32 @@ int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); - if (ret) { - netdev_err(vif->ndev, "Error while reading reg\n"); + ret = wilc->hif_func->hif_read_reg(wilc, GLOBAL_MODE_CONTROL, ®); + if (ret) goto release; - } - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, - (reg | WILC_ABORT_REQ_BIT)); - if (ret) { - netdev_err(vif->ndev, "Error while writing reg\n"); + reg &= ~WILC_GLOBAL_MODE_ENABLE_WIFI; + ret = wilc->hif_func->hif_write_reg(wilc, GLOBAL_MODE_CONTROL, reg); + if (ret) + goto release; + + ret = wilc->hif_func->hif_read_reg(wilc, PWR_SEQ_MISC_CTRL, ®); + if (ret) + goto release; + + reg &= ~WILC_PWR_SEQ_ENABLE_WIFI_SLEEP; + ret = wilc->hif_func->hif_write_reg(wilc, PWR_SEQ_MISC_CTRL, reg); + if (ret) goto release; - } - ret = wilc->hif_func->hif_read_reg(wilc, WILC_FW_HOST_COMM, ®); + ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); if (ret) { netdev_err(vif->ndev, "Error while reading reg\n"); goto release; } - reg = BIT(0); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_FW_HOST_COMM, reg); + ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, + (reg | WILC_ABORT_REQ_BIT)); if (ret) { netdev_err(vif->ndev, "Error while writing reg\n"); goto release; @@ -1410,7 +1415,7 @@ static int init_chip(struct net_device *dev) struct wilc_vif *vif = netdev_priv(dev); struct wilc *wilc = vif->wilc; - acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); + acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); chipid = wilc_get_chipid(wilc, true); @@ -1440,7 +1445,7 @@ static int init_chip(struct net_device *dev) } release: - release_bus(wilc, WILC_BUS_RELEASE_ONLY); + release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); return ret; } diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index a72cd5cac81d..f02775f7e41f 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -156,6 +156,12 @@ #define WILC_GP_REG_0 0x149c #define WILC_GP_REG_1 0x14a0 +#define GLOBAL_MODE_CONTROL 0x1614 +#define PWR_SEQ_MISC_CTRL 0x3008 + +#define WILC_GLOBAL_MODE_ENABLE_WIFI BIT(0) +#define WILC_PWR_SEQ_ENABLE_WIFI_SLEEP BIT(28) + #define WILC_HAVE_SDIO_IRQ_GPIO BIT(0) #define WILC_HAVE_USE_PMU BIT(1) #define WILC_HAVE_SLEEP_CLK_SRC_RTC BIT(2) From patchwork Mon Jan 15 14:56:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 188224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1760939dyc; Mon, 15 Jan 2024 07:08:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRk/gCDQ7jfKEO3naDG092LkW8Btimk2hPTxSrPFi47yZrfHqrvga5lT906ES3I5psxEhX X-Received: by 2002:a05:6a00:1307:b0:6d9:a32b:a26b with SMTP id j7-20020a056a00130700b006d9a32ba26bmr3116221pfu.45.1705331305109; Mon, 15 Jan 2024 07:08:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705331305; cv=none; d=google.com; s=arc-20160816; b=dAkhEdLcTglQbac/h4dzrJ1jH6CtCcFQZQ3F1poaHWIw6ml0P1L9h7Vg9I6J3N9pO9 BwUXaitcxPEPttcZmwzxBD06PeovvPnqZtVUW37YOYctJXjk62dDpnU/s0X/m+rrrAVD XcKKEee4eWQ1C1N375l8Lwrgl4iCDEQpjwoSCVZATCVsQFtb+muKpT0pKHwBEaSGIxAX ddqhKk5OiB3516kAvoiEu/RIfz47Cwfy4S/EyIacuW9a1VJf4Fx5wqGuB+f8ncRcvXkT MzB/xzCSQ6VDBalJAppmxukjrRqkGsn4h/v8sEBJdr1DVKLFHk8X+d2MFksLkrwO/cX7 /mKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=KljMchxpu6sUXwdpmR1vxK0+FWcbaI+DBRqAnIQUPW8=; fh=fVWNSIr8Vd5WRJo6LslfqG3nFGLhcHDnKbQ0ZKCs5kk=; b=N8ItIlhdmU1dv+rButBLVp4qMr/qnk46iME6FmT4B7LtwyTo5tSicjxO6oRo/LoSdB urQkmWLpEtfH2Z266UsWFGPPnUnQiwUe6mwieriDUnt/h2g/029dDO9kPxSqKZCphCa2 EPduin+AIO8aA20TrAizSFEwjSLE8b37nnrEge5kt+955GP6+PIvu8v0XLCSAaA1Z4ID VhbMZaQlEGSLNC+FkmWPz7nzqfMmFebMUlAanO/JcBDk/K2gk9984TgvfQftdYZXtc8Q DsLXIvbRcXg/ZSbJ1WQS+TqRYbEu0KDDasWDAPSL6hdV3RUr2YaLLhyVqn5SGQAjnlIT +EYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eQp3fu30; spf=pass (google.com: domain of linux-kernel+bounces-26159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26159-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i3-20020a63cd03000000b005cf588da70fsi5365443pgg.643.2024.01.15.07.08.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 07:08:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eQp3fu30; spf=pass (google.com: domain of linux-kernel+bounces-26159-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26159-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 061C2282B83 for ; Mon, 15 Jan 2024 15:08:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB77617756; Mon, 15 Jan 2024 15:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="eQp3fu30" Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 7626018629; Mon, 15 Jan 2024 15:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 95A43C6473; Mon, 15 Jan 2024 14:59:22 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 954FAFF812; Mon, 15 Jan 2024 14:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705330755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KljMchxpu6sUXwdpmR1vxK0+FWcbaI+DBRqAnIQUPW8=; b=eQp3fu301Pdbrj+5NEEwhB3xtfqdd9CrRZuNr4j+TnGsXarH/kVpLtdeYvHaixB6ExxMTG mN5jxpP6VHWMrGHwGj7dWEo8XkBAL36stLNgR+OTGWliEQh5zWQCnAUwF7ocfgo9DmCO+Y FVlIeszJvowU32RiBfsGCs+7M/eZvHgg+ZyyG9NxLS+iK76xCrhsaga0CSWs4g6FO5MEn0 cTtk9zBZkHmZFpLXEX+BI60Z8jUzQe+5DdIKsHkjXBqpoPjPDDE/1P6liFl1dU1ogyfolq wlBhNylR8C6qQrHEh1Es/3qrMzz73MpaZaQAW5moO2Knxum4b7Gv0yG/f5G04Q== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Mon, 15 Jan 2024 15:56:34 +0100 Subject: [PATCH 5/5] wifi: wilc1000: fix multi-vif management when deleting a vif Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240115-wilc_1000_fixes-v1-5-54d29463a738@bootlin.com> References: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> In-Reply-To: <20240115-wilc_1000_fixes-v1-0-54d29463a738@bootlin.com> To: linux-wireless@vger.kernel.org Cc: Ajay Singh , Claudiu Beznea , Kalle Valo , David Mosberger-Tang , Thomas Petazzoni , linux-kernel@vger.kernel.org, =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.12.4 X-GND-Sasl: alexis.lothore@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788169478476800264 X-GMAIL-MSGID: 1788169478476800264 From: Ajay Singh Adding then removing a second vif currently makes the first vif not working anymore. This is visible for example when we have a first interface connected to some access point: - create a wpa_supplicant.conf with some AP credentials - wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0 - dhclient wlan0 - iw phy phy0 interface add wlan1 type managed - iw dev wlan1 del wlan0 does not manage properly traffic anymore (eg: ping not working) This is due to vif mode being incorrectly reconfigured with some default values in del_virtual_intf, affecting by default first vif. Prevent first vif from being affected on second vif removal by removing vif mode change command in del_virtual_intf Fixes: 9bc061e88054 ("staging: wilc1000: added support to dynamically add/remove interfaces") Signed-off-by: Ajay Singh Co-developed-by: Alexis Lothoré Signed-off-by: Alexis Lothoré --- This patch has been initiated by Ajay, and I reworked it a bit/split it. I could have just fixed the parameters passed to wilc_set_operation_mode, but I observed that even calling wilc_set_operation_mode seems faulty in del_virtual_intf: for example the thread in charge of sending commands to the chip is possibly not running (because interface is not up). Also, the vif mode is only configured in change_virtual_intf and not in add_virtual_intf, which tends to validate the removal from del_virtual_intf. --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index 2d0474e6404e..f03fd15c0c97 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -1609,7 +1609,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) cfg80211_unregister_netdevice(vif->ndev); vif->monitor_flag = 0; - wilc_set_operation_mode(vif, 0, 0, 0); mutex_lock(&wl->vif_mutex); list_del_rcu(&vif->list); wl->vif_num--;