[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <28e7c215-d1f9-77dd-a0bb-3acff2841bf1@marvell.com>
Date: Fri, 2 Oct 2020 17:41:52 +0300
From: Igor Russkikh <irusskikh@...vell.com>
To: Andrew Lunn <andrew@...n.ch>
CC: <netdev@...r.kernel.org>, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [EXT] Re: [PATCH v2 net-next 3/3] net: atlantic: implement media
detect feature via phy tunables
>> + if (val > 0 && val != AQ_HW_MEDIA_DETECT_CNT) {
>> + netdev_err(self->ndev, "EDPD on this device could have
> only fixed value of %d\n",
>> + AQ_HW_MEDIA_DETECT_CNT);
>> + return -EINVAL;
>> + }
>> +
>> + /* msecs plays no role - configuration is always fixed in PHY */
>> + cfg->is_media_detect = val ? 1 : 0;
>> +
>> + mutex_lock(&self->fwreq_mutex);
>> + err = self->aq_fw_ops->set_media_detect(self->aq_hw,
> cfg->is_media_detect);
>> + mutex_unlock(&self->fwreq_mutex);
>> +
>> + return err;
>> +}
>
>> +static int aq_fw2x_set_media_detect(struct aq_hw_s *self, bool on)
>> +{
>> + u32 enable;
>> + u32 offset;
>> +
>> + if (self->fw_ver_actual < HW_ATL_FW_VER_MEDIA_CONTROL)
>> + return -EOPNOTSUPP;
>
> So if the firmware is tool old, you return -EOPNOTSUPP. But it appears
> cfg->is_media_detect has already been changed?
Hmm, right. The problem here will be that next --get edpd will return "enabled".
This'll also happen if by some reason FW command will fail to enable EDPD.
Think I have to save 'is_media_detect' only after successful FW operation.
Will send v3, thanks, good catch.
Regards,
Igor
Powered by blists - more mailing lists