Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16FF315C9; Thu, 18 Jul 2024 02:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721269480; cv=none; b=M9RYdm0outSI/6gUqUmMcu9w/f4Arqw19kUQQJyzzaH8BRSKjXn4FCuCwJTpMRgR+Bp8BEgjV5ELX/KcKyejdEp5SmOf/kTcMs2rkeF63pYSmNY4xaiZCLmyOM1Ak6onzY7PlwhTJwHGEPidkl7VaeCjsvuI68cdM7Zxq0demNk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721269480; c=relaxed/simple; bh=acUxYiwvNbR5WEmoBtEcy5LUMGpl1V6pDAJlxr5ua6w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Jwa3/UB3W51ksgBNaZf6znAiDGIEtFhsCFIWVb/ur9hL33iUa6o4AvNmGr4w+leVmJoDm8N4bqMZlQtoT2CyH9kyRy/Npffg1aiTrD3u3dxN6iXT/+2MunPRlZoeG/DNpqhmfAQvaLJh5ZIOTqlHnDcHd3FE9MR8KMOOrFmC/EE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=6cSfuiec; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="6cSfuiec" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=0vk8fef/oz3YdgiNmk3ULxUwdiIR7F4J+UJ0/Uf9pnE=; b=6cSfuiecrWilzJ7nH+o56SBaUG EjBLFPLBBgOrA0R3/xATbgXZ4YzIabz5PHDHgfhGZ7nxC8FtRgi8lv+KC2uqrhpK0NjssR/S9sbp2 fuOvfGGFvTMpotywVvGjtU6oyDSq3OFOy2NGoQ5MBuJgde2MjeWcPxab9uDHTQ28zlPw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sUGos-002kdR-G6; Thu, 18 Jul 2024 04:24:34 +0200 Date: Thu, 18 Jul 2024 04:24:34 +0200 From: Andrew Lunn To: vtpieter@gmail.com Cc: devicetree@vger.kernel.org, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, o.rempel@pengutronix.de, Pieter Van Trappen Subject: Re: [PATCH 3/4] net: dsa: microchip: check erratum workaround through indirect register read Message-ID: References: <20240717193725.469192-1-vtpieter@gmail.com> <20240717193725.469192-2-vtpieter@gmail.com> <20240717193725.469192-3-vtpieter@gmail.com> <20240717193725.469192-4-vtpieter@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240717193725.469192-4-vtpieter@gmail.com> On Wed, Jul 17, 2024 at 09:37:24PM +0200, vtpieter@gmail.com wrote: > From: Pieter Van Trappen > > Check the erratum workaround application which ensures in addition > that indirect register write and read work as expected. > > Commit b7fb7729c94f ("net: dsa: microchip: fix register write order in > ksz8_ind_write8()") would have been found faster like this. > > Also fix the register naming as in the datasheet. We are in the merge window at the moment, so net-next is closed at the moment. Please repost in two weeks. > > @@ -1974,6 +1974,7 @@ static int ksz8_handle_global_errata(struct dsa_switch *ds) > { > struct ksz_device *dev = ds->priv; > int ret = 0; > + u8 data = 0xff; Reverse Christmas tree please. > > /* KSZ87xx Errata DS80000687C. > * Module 2: Link drops with some EEE link partners. > @@ -1981,8 +1982,13 @@ static int ksz8_handle_global_errata(struct dsa_switch *ds) > * KSZ879x/KSZ877x/KSZ876x and some EEE link partners may result in > * the link dropping. > */ > - if (dev->info->ksz87xx_eee_link_erratum) > - ret = ksz8_ind_write8(dev, TABLE_EEE, REG_IND_EEE_GLOB2_HI, 0); > + if (dev->info->ksz87xx_eee_link_erratum) { > + ret = ksz8_ind_write8(dev, TABLE_EEE, REG_IND_EEE_GLOB2_LO, 0); > + if (!ret) > + ret = ksz8_ind_read8(dev, TABLE_EEE, REG_IND_EEE_GLOB2_LO, &data); > + if (!ret && data) > + dev_err(dev->dev, "failed to disable EEE next page exchange (erratum)\n"); If data is not 0, should it be considered fatal? Maybe return -EIO ? Andrew