Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2563932rdb; Mon, 5 Feb 2024 10:13:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGC2uy64UASBEg67yb5QwJxLmH4Sg2cuN6BMfoWD2oO7opMV16WlrzCnCITesR6xp95UGG X-Received: by 2002:ac8:7493:0:b0:42c:a4f:3330 with SMTP id v19-20020ac87493000000b0042c0a4f3330mr176224qtq.28.1707156813647; Mon, 05 Feb 2024 10:13:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707156813; cv=pass; d=google.com; s=arc-20160816; b=QIeIFRQmQBee/GYZDucYtaGvbsd+0pku3NGVvNPi2Mc/F5VOvVSuznyrNFT22wKD5y cJNEPRhIIT6NkUM1xqES77e9SjNafhvTxNqsESDEF7tG9yQOhSf8wqYSk0rVyut+zJ2P hgauH2febvRVmqCTfVf4XfxgRRxP4TK12HeclZ1mwkhtbjrx66OYqOHotCT9tiv5T45D OEA6Q3rKT7TytedYqk3g5CXvFcoFOqRsqQBlzdiYFGM11DCjFg8kVZ++B+HVQp0JuJv+ gkCOzdxDudfvYuttcm807ENpSwvPDrlkdS6lMW0LVLwpQZOnZAN7YbGnAnafMidXD/g5 523g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=Ch5pFYB6Og1VjBGwd7wbRUYJGPJmtjNxSGpD0EJVzCg=; fh=0J9CRCt7z8ELqHGBo5by2XisNS5wCGSvN8OyRdejQYw=; b=nNwhSd/oT8INptWQedCBI/KoOhTRbW4G2gQ9ufbc5HYtuBdbsoILyszvMbAQRVENW6 md0NQ9UoOfPIbcxCrtiy2QCztG4eTb8TXaFekfqpoAG9GJemM1rRHk3n8H7bjc+XMTQ8 n40F+H7vVDLC4ZgP6bXbQrrnmEICzGswjw5RrBzAWyX4e2hvXw5Jqr0ni6mYPEy1VnCO XTVP8V8kWw8RPiVdt1gQSYLyoQsOLFlXeJLZCoyyj1GAlM+TCRlr1H9yFjOTt26IEVGE NdoyBGGJZcqgrqz1Mab/Pq4kgBt4aUvVksXzpC+xsgvbGOhrduvDUJM873yAfv4WVIGt nQRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZcED2MTl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWupO6epBgxeDwzno1ylddO/c+ep6Tzr2eKUtVP+2xtt327bfTa3KsQ/L/rgf956vLtkfoix/AYEYw0B9PzJCmt8QbTqrTe7AY26cU74Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v15-20020a05622a130f00b0042c210595dcsi407799qtk.336.2024.02.05.10.13.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 10:13:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3145-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=ZcED2MTl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3145-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 2928A1C22DFF for ; Mon, 5 Feb 2024 18:13:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 444EC47F47; Mon, 5 Feb 2024 18:13:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZcED2MTl" X-Original-To: linux-wireless@vger.kernel.org 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 1929D45957; Mon, 5 Feb 2024 18:13:28 +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=1707156809; cv=none; b=d0jyDuvOxrwy6c134t72dZphGNdB4j24bA46NJ4hT67TnWdPerkzD6A2XqJI1rTq8qZLdjVsLu8ZvW9Uqp1br3PZUMi82FhdO4JCeBnRhskhrozMqa53Vcb1zZ2Wc5YGLyUiLtQW/XVQujQpnMFZgplJO87fY+59kua+NTwoeFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707156809; c=relaxed/simple; bh=zwWd6kMUZL9LhGKU5H/sABkgezip0N01LItAnce207s=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=CK/hJ7r/Dt4z+bbAXPiIsy1X7r7Ft+43bMEeJkUfBKb0VuoOLwhbIjDOl1yMLMG2eAEI/1t5mg2DYmyTUfl0+229R1kCsbu3bta+1eaaioq7ZkiY4LbPncj2fQAgLxGbWPlYEkEABQHGmo1iEqkhHpih6yVqtuQ+ecxxnXhUbAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZcED2MTl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97E68C433C7; Mon, 5 Feb 2024 18:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707156808; bh=zwWd6kMUZL9LhGKU5H/sABkgezip0N01LItAnce207s=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=ZcED2MTlyOPWREAeEJYA6ocQXSVuOqH3Z1ufADn5PUv8WNpcTUIGLlkXEv9kISzvh Hnsa1izkdRiA+RQaXzNjDR9xfuIw5pBbTVhrEK+YPwF53lDCiTDwTNInrJVlJd0Hh8 Eaa1ffFWZ0unOSZ8m8dhv36PGkaOSD5zVC7W1iwWN6Dn4RflfMcLG0EBN1CsfD+gzq bA3bXkTvpb60DhxO7Hz1kwhsDWW9FyCTFa0QabniskTotpN/XcfbitW+EHoTqHczyV nr4BPeR4xKtW2b2sHgL0VuF5hQb0kOlvTjsifRaZsO+Up6GT9IwHAIrnI+t7D5jhW9 Pq6SK++RWIg9Q== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH 1/6] wifi: ath9k: Obtain system GPIOS from descriptors From: Kalle Valo In-Reply-To: <20240131-descriptors-wireless-v1-1-e1c7c5d68746@linaro.org> References: <20240131-descriptors-wireless-v1-1-e1c7c5d68746@linaro.org> To: Linus Walleij Cc: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Arend van Spriel , Franky Lin , Hante Meuleman , Andy Shevchenko , Arnd Bergmann , Lee Jones , Brian Norris , Srinivasan Raju , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, Linus Walleij User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170715680359.1586694.14954330985835827619.kvalo@kernel.org> Date: Mon, 5 Feb 2024 18:13:25 +0000 (UTC) Linus Walleij wrote: > The ath9k has an odd use of system-wide GPIOs: if the chip > does not have internal GPIO capability, it will try to obtain a > GPIO line from the system GPIO controller: > > if (BIT(gpio) & ah->caps.gpio_mask) > ath9k_hw_gpio_cfg_wmac(...); > else if (AR_SREV_SOC(ah)) > ath9k_hw_gpio_cfg_soc(ah, gpio, out, label); > > Where ath9k_hw_gpio_cfg_soc() will attempt to issue > gpio_request_one() passing the local GPIO number of the controller > (0..31) to gpio_request_one(). > > This is somewhat peculiar and possibly even dangerous: there is > nowadays no guarantee of the numbering of these system-wide > GPIOs, and assuming that GPIO 0..31 as used by ath9k would > correspond to GPIOs 0..31 on the system as a whole seems a bit > wild. > > My best guess is that everyone actually using this driver has > support for the local (custom) GPIO API and the bit in > h->caps.gpio_mask is always set for any GPIO the driver may > try to obtain, so this facility to use system-wide GPIOs is > actually unused and could be deleted. > > Anyway: I cannot know if this is really the case, so implement > a fallback handling using GPIO descriptors obtained from the > ah->dev device indexed 0..31. These can for example be passed > in the device tree, ACPI or through board files. I doubt that > anyone will use them, but this makes it possible to obtain a > system-wide GPIO for any of the 0..31 GPIOs potentially > requested by the driver. > > Signed-off-by: Linus Walleij > Acked-by: Toke Høiland-Jørgensen I understood that there will be a new version for ath9k so dropping patch 1. Patch set to Changes Requested. -- https://patchwork.kernel.org/project/linux-wireless/patch/20240131-descriptors-wireless-v1-1-e1c7c5d68746@linaro.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches