From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932145AbcFNWJp (ORCPT ); Tue, 14 Jun 2016 18:09:45 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:46249 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbcFNWJo (ORCPT ); Tue, 14 Jun 2016 18:09:44 -0400 Date: Wed, 15 Jun 2016 00:09:41 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH v2 net-next v2 12/12] net: dsa: mv88e6xxx: add addressing mode to info Message-ID: <20160614220941.GJ12832@lunn.ch> References: <20160614183153.32327-1-vivien.didelot@savoirfairelinux.com> <20160614183153.32327-13-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614183153.32327-13-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2016 at 02:31:53PM -0400, Vivien Didelot wrote: > When the SMI address of the switch chip on the SMI master bus is not > zero, some chips (e.g. 88E6352) use an indirect access through two SMI > Command and Data registers, while others (e.g. 88E6060) still use a > direct access. > > Add a capability flag to describe chips supporting the Multi-chip > Addressing Mode. > > Use the SMI indirect access ops only for switches with this flag and > change the direct SMI direct access ops to support non-zero chip > address. > > Signed-off-by: Vivien Didelot > --- > drivers/net/dsa/mv88e6xxx.c | 6 +++--- > drivers/net/dsa/mv88e6xxx.h | 16 +++++++++++++++- > 2 files changed, 18 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c > index fc28a6c..8e12246 100644 > --- a/drivers/net/dsa/mv88e6xxx.c > +++ b/drivers/net/dsa/mv88e6xxx.c > @@ -52,7 +52,7 @@ static int mv88e6xxx_smi_direct_read(struct mii_bus *bus, int sw_addr, > { > int ret; > > - ret = mdiobus_read_nested(bus, addr, reg); > + ret = mdiobus_read_nested(bus, sw_addr + addr, reg); > if (ret < 0) > return ret; If we are doing direct access, doesn't it means sw_addr is 0? So isn't this pointless? Andrew