lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d9d4896-a81a-4393-8cf3-8e42b36aaae2@bootlin.com>
Date: Thu, 3 Oct 2024 19:33:26 +0200
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: Marek Vasut <marex@...x.de>, linux-wireless@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
 Adham Abozaeid <adham.abozaeid@...rochip.com>,
 Ajay Singh <ajay.kathat@...rochip.com>,
 Claudiu Beznea <claudiu.beznea@...on.dev>, Conor Dooley
 <conor+dt@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Kalle Valo <kvalo@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Rob Herring <robh@...nel.org>, devicetree@...r.kernel.org,
 netdev@...r.kernel.org
Subject: Re: [PATCH v7 2/7] wifi: wilc1000: Clean up usage of
 wilc_get_chipid()

On 10/3/24 13:14, Marek Vasut wrote:
> Reduce the use of wilc_get_chipid(), use cached chip ID wherever
> possible. Remove duplicated partial chip ID read implementations
> from the driver. Update wilc_get_chipid() to always read the chip
> ID out of the hardware and update the cached chip ID, and make it
> return a proper return value instead of a chipid. Call wilc_get_chipid()
> early to make the cached chip ID available to various sites using
> is_wilc1000() to access the cached chip ID.
> 
> Reviewed-by: Alexis Lothoré <alexis.lothore@...tlin.com>
> Signed-off-by: Marek Vasut <marex@...x.de>

[...]

> +int wilc_get_chipid(struct wilc *wilc)
> +{
> +	u32 chipid = 0;
> +	u32 rfrevid = 0;
> +
> +	if (wilc->chipid == 0) {
> +		wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid);
> +		wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID,
> +					     &rfrevid);
> +		if (!is_wilc1000(chipid)) {
> +			wilc->chipid = 0;
> +			return -EINVAL;
> +		}
> +		if (chipid == WILC_1000_BASE_ID_2A) { /* 0x1002A0 */
> +			if (rfrevid != 0x1)
> +				chipid = WILC_1000_BASE_ID_2A_REV1;
> +		} else if (chipid == WILC_1000_BASE_ID_2B) { /* 0x1002B0 */
> +			if (rfrevid == 0x4)
> +				chipid = WILC_1000_BASE_ID_2B_REV1;
> +			else if (rfrevid != 0x3)
> +				chipid = WILC_1000_BASE_ID_2B_REV2;
> +		}
> +
> +		wilc->chipid = chipid;
> +	}
> +
> +	return 0;
> +}

My bad for not having spotted it in v6, but you are still missing an
EXPORT_SYMBOL_GPL(wilc_get_chipid) here, making the build fail if wilc support
is built as module:

ERROR: modpost: "wilc_get_chipid"
[drivers/net/wireless/microchip/wilc1000/wilc1000-sdio.ko] undefined!
ERROR: modpost: "wilc_get_chipid"
[drivers/net/wireless/microchip/wilc1000/wilc1000-spi.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:145: Module.symvers] Error 1
make[1]: *** [/home/alexis/src/microchip/linux/Makefile:1878: modpost] Error 2
make: *** [Makefile:224: __sub-make] Error 2


-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ