Subject: Re: [PATCH net-next v10 4/7] net: tn40xx: add basic Tx handling

From: Jakub Kicinski <[email-masked]>
Date: Thu, 13 Jun 2024 17:30:38 -0700

On Tue, 11 Jun 2024 13:52:14 +0900 FUJITA Tomonori wrote:
> +static void tn40_init_txd_sizes(void)
> +{
> +	int i, lwords;
> +
> +	if (tn40_txd_sizes[0].bytes)
> +		return;
> +
> +	/* 7 - is number of lwords in txd with one phys buffer
> +	 * 3 - is number of lwords used for every additional phys buffer
> +	 */
> +	for (i = 0; i < TN40_MAX_PBL; i++) {
> +		lwords = 7 + (i * 3);
> +		if (lwords & 1)
> +			lwords++;	/* pad it with 1 lword */
> +		tn40_txd_sizes[i].qwords = lwords >> 1;
> +		tn40_txd_sizes[i].bytes = lwords << 2;
> +	}
> +}

Since this initializes global data - you should do it in module init.
Due to this you can't rely on module_pci_driver(), you gotta write
the module init / exit functions by hand.