Netdev Archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
To: naveenm@marvell.com
Cc: fujita.tomonori@gmail.com, netdev@vger.kernel.org,
	andrew@lunn.ch, horms@kernel.org, kuba@kernel.org,
	jiri@resnulli.us, pabeni@redhat.com, linux@armlinux.org.uk,
	hfdevel@gmx.net
Subject: Re: [PATCH net-next v6 5/6] net: tn40xx: add mdio bus support
Date: Wed, 15 May 2024 19:29:38 +0900 (JST)	[thread overview]
Message-ID: <20240515.192938.1400783775062196516.fujita.tomonori@gmail.com> (raw)
In-Reply-To: <SJ2PR18MB5635B758C9807AA7520E01EFA2E22@SJ2PR18MB5635.namprd18.prod.outlook.com>

Hi,

On Mon, 13 May 2024 09:40:08 +0000
Naveen Mamindlapalli <naveenm@marvell.com> wrote:

>> +static u32 tn40_mdio_stat(struct tn40_priv *priv) {
>> +	void __iomem *regs = priv->regs;
>> +
>> +	return readl(regs + TN40_REG_MDIO_CMD_STAT); }
>> +
>> +static int tn40_mdio_get(struct tn40_priv *priv, u32 *val) {
> 
> The argument "val" is not used inside this function.

Oops, I'll fix in v7.


>> +static int tn40_mdio_write(struct tn40_priv *priv, int port, int device,
>> +			   u16 regnum, u16 data)
>> +{
>> +	void __iomem *regs = priv->regs;
>> +	u32 tmp_reg = 0;
>> +	int ret;
>> +
>> +	/* wait until MDIO is not busy */
>> +	if (tn40_mdio_get(priv, NULL))
>> +		return -EIO;
>> +	writel(TN40_MDIO_CMD_VAL(device, port), regs +
>> TN40_REG_MDIO_CMD);
>> +	writel((u32)regnum, regs + TN40_REG_MDIO_ADDR);
>> +	if (tn40_mdio_get(priv, NULL))
>> +		return -EIO;
>> +	writel((u32)data, regs + TN40_REG_MDIO_DATA);
>> +	/* read CMD_STAT until not busy */
>> +	ret = tn40_mdio_get(priv, &tmp_reg);
> 
> Is "tn40_mdio_get()" supposed to return any status in tmp_reg (which is missing?).

Indeed.

Thanks a lot!

  reply	other threads:[~2024-05-15 10:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12  8:56 [PATCH net-next v6 0/6] add ethernet driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-05-12  8:56 ` [PATCH net-next v6 1/6] net: tn40xx: add pci " FUJITA Tomonori
2024-05-12  8:56 ` [PATCH net-next v6 2/6] net: tn40xx: add register defines FUJITA Tomonori
2024-05-12  8:56 ` [PATCH net-next v6 3/6] net: tn40xx: add basic Tx handling FUJITA Tomonori
2024-05-12  8:56 ` [PATCH net-next v6 4/6] net: tn40xx: add basic Rx handling FUJITA Tomonori
2024-05-13 18:37   ` Joe Damato
2024-05-15  9:37     ` FUJITA Tomonori
2024-05-12  8:56 ` [PATCH net-next v6 5/6] net: tn40xx: add mdio bus support FUJITA Tomonori
2024-05-13  9:40   ` Naveen Mamindlapalli
2024-05-15 10:29     ` FUJITA Tomonori [this message]
2024-05-12  8:56 ` [PATCH net-next v6 6/6] net: tn40xx: add phylink support FUJITA Tomonori

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=20240515.192938.1400783775062196516.fujita.tomonori@gmail.com \
    --to=fujita.tomonori@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=hfdevel@gmx.net \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).