Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5511080ybl; Tue, 27 Aug 2019 05:56:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWxvzEPiwAjt3bBtO5R4ocGP8jYM0jOEAhrzQokH7mr/2Yv6dgpsGmC8Eo78bfl57Q8aV5 X-Received: by 2002:a63:c70d:: with SMTP id n13mr21005905pgg.171.1566910586973; Tue, 27 Aug 2019 05:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566910586; cv=none; d=google.com; s=arc-20160816; b=oQ8C4e9LzhwhUl+ItI1ibbpffOvlNAdGLtIMkut3f9QuCeYaRBlTb8RZc9f8t9Ffug thyVtPe+zrecBGTOm2oo7TsIUmkw1STjDJPfc3N2UxMDSG8P8zRpCBvWfTuNeManwget ZVumdgm5PA29IRCFMso3rwU1F+SW76BY1o3TSILb7fz3QG3iS0S4K12YxBl19LP22Wh7 r9wC1ZT4dLM4SK8AyEmygb8wKGbXZ999xwWyn2V+Kq6oX2UaUywdEP4ELGo9GvhYOa+5 vYGhWHmWSasqZnk7ZTAeoF1O6+1WcuFdiZRjEK8UvfG49nhP9QaK3LOjYxZ7SyY/gdOs Ujmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QQIZRKtBn4+mCRvrRB7rANCiu7s243FAxJxmiRuz/gE=; b=srGR5OfwSHpAhSsgR3Tr1fafCtHMCBurlpwi4ZVRKvJk7b1hBa2NZMJMItS+LGcGaG olwUfRUE5wS1ncbHbGmawsQV0J93R4Yek/4ISrMXRlhf7x8hm5Eas4lCwQZQcluc8kqr cFhv3MY0X2rf/nnsTpSUI1jFzHFl7gE+UVLT01+DTDNPgO6CiO8GLFaXu55QT+EhSuJ5 GwkHMdGV3ihIXoTqhnkWIhz7sgSrF/iKVWgKVxCYUPaoAlZ9xMitZG0UhDSn7dof3L16 3HDzv+f0g+Y/2mECOR1x7E/fN34lp8a4ZL/jwu34yv2V7d8klyvztBKewteSae8DRf+k dICA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b="r3xQ/FkO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cm17si2521452pjb.68.2019.08.27.05.56.11; Tue, 27 Aug 2019 05:56:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b="r3xQ/FkO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728312AbfH0MzI (ORCPT + 99 others); Tue, 27 Aug 2019 08:55:08 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34224 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfH0MzI (ORCPT ); Tue, 27 Aug 2019 08:55:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QQIZRKtBn4+mCRvrRB7rANCiu7s243FAxJxmiRuz/gE=; b=r3xQ/FkOpOf7TZVM3ElpTJ1S5x dHcBJlwUfU7QrDlwfFKJ6y42kryByRVRx+7k9NnkTeCEt5OGgkXrnDmerB24TXvYC2EaP/jxuu9DV p7OgTUqO0FoqATus5zeDeLUbFkV1yJhCSnpJFV5RMprMZrpnb7MwPOfPkiUEs7aZhlRg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1i2b04-0003AX-Tl; Tue, 27 Aug 2019 14:55:04 +0200 Date: Tue, 27 Aug 2019 14:55:04 +0200 From: Andrew Lunn To: Razvan Stefanescu Cc: Woojung Huh , Microchip Linux Driver Support , Vivien Didelot , Florian Fainelli , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] net: dsa: microchip: avoid hard-codded port count Message-ID: <20190827125504.GB11471@lunn.ch> References: <20190827093110.14957-1-razvan.stefanescu@microchip.com> <20190827093110.14957-5-razvan.stefanescu@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827093110.14957-5-razvan.stefanescu@microchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 12:31:10PM +0300, Razvan Stefanescu wrote: > Use port_cnt value to disable interrupts on switch reset. > > Signed-off-by: Razvan Stefanescu > --- > drivers/net/dsa/microchip/ksz9477.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c > index 187be42de5f1..54fc05595d48 100644 > --- a/drivers/net/dsa/microchip/ksz9477.c > +++ b/drivers/net/dsa/microchip/ksz9477.c > @@ -213,7 +213,7 @@ static int ksz9477_reset_switch(struct ksz_device *dev) > > /* disable interrupts */ > ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK); > - ksz_write32(dev, REG_SW_PORT_INT_MASK__4, 0x7F); > + ksz_write32(dev, REG_SW_PORT_INT_MASK__4, dev->port_cnt); > ksz_read32(dev, REG_SW_PORT_INT_STATUS__4, &data32); Humm, is this correct? 0x7f suggests this is a bitmap for 7 ports. The name port_cnt suggests it is a count, e.g. 7 for 7 ports. 0x7f != 7. Thanks Andrew