linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Woojung Huh <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	kernel@pengutronix.de, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH net-next v6 08/10] net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support
Date: Mon, 26 Apr 2021 14:25:40 +0200	[thread overview]
Message-ID: <20210426122540.xzanhcel7gv4dfsh@pengutronix.de> (raw)
In-Reply-To: <YIRAwY+5yLJf1+CH@lunn.ch>

On Sat, Apr 24, 2021 at 06:01:05PM +0200, Andrew Lunn wrote:
> > +static int ksz8863_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
> > +			     void *val_buf, size_t val_len)
> > +{
> > +	struct ksz_device *dev = ctx;
> > +	struct ksz8 *ksz8 = dev->priv;
> > +	struct mdio_device *mdev = ksz8->priv;
> > +	u8 reg = *(u8 *)reg_buf;
> > +	u8 *val = val_buf;
> > +	int ret = 0;
> > +	int i;
> 
> ...
> 
> 
> > +
> > +	mutex_lock_nested(&mdev->bus->mdio_lock, MDIO_MUTEX_NESTED);
> > +	for (i = 0; i < val_len; i++) {
> > +		int tmp = reg + i;
> > +
> > +		ret = __mdiobus_read(mdev->bus, ((tmp & 0xE0) >> 5) |
> > +				     SMI_KSZ88XX_READ_PHY, tmp);
> > +		if (ret < 0)
> > +			goto out;
> > +
> > +		val[i] = ret;
> > +	}
> > +	ret = 0;
> > +
> > + out:
> > +	mutex_unlock(&mdev->bus->mdio_lock);
> > +
> > +	return ret;
> > +}
> > +
> > +static int ksz8863_mdio_write(void *ctx, const void *data, size_t count)
> > +{
> > +	struct ksz_device *dev = ctx;
> > +	struct ksz8 *ksz8 = dev->priv;
> > +	struct mdio_device *mdev = ksz8->priv;
> > +	u8 *val = (u8 *)(data + 4);
> > +	u32 reg = *(u32 *)data;
> > +	int ret = 0;
> > +	int i;
> 
> ...
> 
> 
> > +static const struct of_device_id ksz8863_dt_ids[] = {
> > +	{ .compatible = "microchip,ksz8863" },
> > +	{ .compatible = "microchip,ksz8873" },
> > +	{ },
> > +};
> 
> Is there code somewhere which verifies that what has been found really
> does match what is in device tree? We don't want errors in the device
> tree to be ignored.
> 
>      Andrew

Hm, it makes sense. But it is not regression of this patches, is it OK
to mainline it separately?

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2021-04-26 12:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  8:02 [PATCH net-next v6 00/10] microchip: add support for ksz88x3 driver family Oleksij Rempel
2021-04-23  8:02 ` [PATCH net-next v6 01/10] net: dsa: microchip: ksz8795: change drivers prefix to be generic Oleksij Rempel
2021-04-24 15:37   ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 02/10] net: dsa: microchip: ksz8795: move cpu_select_interface to extra function Oleksij Rempel
2021-04-24 15:38   ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 03/10] net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct Oleksij Rempel
2021-04-24 15:43   ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 04/10] net: dsa: microchip: ksz8795: add support for ksz88xx chips Oleksij Rempel
2021-04-24 15:51   ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 05/10] net: dsa: microchip: Add Microchip KSZ8863 SPI based driver support Oleksij Rempel
2021-04-24 15:54   ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 06/10] dt-bindings: net: dsa: document additional Microchip KSZ8863/8873 switch Oleksij Rempel
2021-04-23  8:02 ` [PATCH net-next v6 07/10] net: phy: Add support for microchip SMI0 MDIO bus Oleksij Rempel
2021-04-23  8:02 ` [PATCH net-next v6 08/10] net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support Oleksij Rempel
2021-04-24 16:01   ` Andrew Lunn
2021-04-26 12:25     ` Oleksij Rempel [this message]
2021-04-26 12:38       ` Andrew Lunn
2021-04-23  8:02 ` [PATCH net-next v6 09/10] dt-bindings: net: mdio-gpio: add compatible for microchip,mdio-smi0 Oleksij Rempel
2021-04-23  8:02 ` [PATCH net-next v6 10/10] net: tag: ksz: Add KSZ8863 tag code Oleksij Rempel

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=20210426122540.xzanhcel7gv4dfsh@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.grzeschik@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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 NNTP newsgroup(s).