Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: Marek Vasut <marex@denx.de>, linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Adham Abozaeid <adham.abozaeid@microchip.com>,
	Ajay Singh <ajay.kathat@microchip.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	Conor Dooley <conor+dt@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Kalle Valo <kvalo@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c
Date: Wed, 28 Aug 2024 09:48:02 +0200	[thread overview]
Message-ID: <2f84827c-bbe9-419a-a3f4-71a8889e99d0@bootlin.com> (raw)
In-Reply-To: <182e449a-3e6d-4727-a538-6fd518ae75f8@denx.de>

On 8/27/24 17:34, Marek Vasut wrote:
> On 8/27/24 9:51 AM, Alexis Lothoré wrote:
> 
> Hi,
> 
>>> +static u32 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);
>> If we search for WILC_CHIPID in the whole driver, there are still two places
>> manually reading this register. Shouldn't those places also benefit from
>> wilc_get_chipid ?
> 
> Both the one in wilc_wlan_start() and wilc_validate_chipid() look more like some
> sort of communication check attempt, rather than reading out the chipid for any
> sort of actual chip identification purpose. I could simply remove those ?

Agree about the purpose of this reading in wilc_wlan_start and wilc_validate_chipid.
And about removing those: I would say why not. wilc_validate_chipid has proven
to be quite useful to diagnose some early communication failure, but I guess
there are enough communications attempts around
(wilc_spi_configure_bus_protocol, wilc_load_mac_from_nv) to still validate than
we are able to communicate with the chip at probe time.
> 
>>> +        wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID,
>>> +                         &rfrevid);
>>> +        if (!is_wilc1000(chipid)) {
>>> +            wilc->chipid = 0;
>>
>> While at it, since you have trimmed the update parameter, it would be nice to
>> also fix this return value (ie make wilc_getchipid() not return 0 but a real
>> error code if we can not read the chip id.
> 
> Fixed in V3, thanks .

Great, thanks

Alexis

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


  reply	other threads:[~2024-08-28  7:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 16:08 [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Marek Vasut
2024-08-23 16:08 ` [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c Marek Vasut
2024-08-23 17:46   ` Simon Horman
2024-08-23 20:38     ` Marek Vasut
2024-08-24 12:44       ` Simon Horman
2024-08-24 21:18         ` Marek Vasut
2024-08-27  7:51   ` Alexis Lothoré
2024-08-27 15:34     ` Marek Vasut
2024-08-28  7:48       ` Alexis Lothoré [this message]
2024-08-23 16:08 ` [PATCH v2 3/4] wifi: wilc1000: Fold chip_allow_sleep()/chip_wakeup() " Marek Vasut
2024-08-27  8:14   ` Alexis Lothoré
2024-08-27 16:23     ` Marek Vasut
2024-08-23 16:08 ` [PATCH v2 4/4] wifi: wilc1000: Add WILC3000 support Marek Vasut
2024-08-27  8:28   ` Alexis Lothoré
2024-08-27 16:31     ` Marek Vasut
2024-08-24  6:22 ` [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Krzysztof Kozlowski
2024-08-24 21:21   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f84827c-bbe9-419a-a3f4-71a8889e99d0@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=adham.abozaeid@microchip.com \
    --cc=ajay.kathat@microchip.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox