All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Russkikh <irusskikh@marvell.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [EXT] Re: [PATCH v2 net-next 3/3] net: atlantic: implement media detect feature via phy tunables
Date: Fri, 2 Oct 2020 17:41:52 +0300	[thread overview]
Message-ID: <28e7c215-d1f9-77dd-a0bb-3acff2841bf1@marvell.com> (raw)
In-Reply-To: <20201002142452.GD3996795@lunn.ch>



>> +	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

      reply	other threads:[~2020-10-02 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 13:39 [PATCH v2 net-next 0/3] net: atlantic: phy tunables from mac driver Igor Russkikh
2020-10-02 13:39 ` [PATCH v2 net-next 1/3] ethtool: allow netdev driver to define phy tunables Igor Russkikh
2020-10-02 14:25   ` Andrew Lunn
2020-10-02 13:39 ` [PATCH v2 net-next 2/3] net: atlantic: implement phy downshift feature Igor Russkikh
2020-10-02 14:20   ` Andrew Lunn
2020-10-02 13:39 ` [PATCH v2 net-next 3/3] net: atlantic: implement media detect feature via phy tunables Igor Russkikh
2020-10-02 14:24   ` Andrew Lunn
2020-10-02 14:41     ` Igor Russkikh [this message]

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=28e7c215-d1f9-77dd-a0bb-3acff2841bf1@marvell.com \
    --to=irusskikh@marvell.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.