Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5303198ybl; Tue, 27 Aug 2019 02:32:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAkWWfwUReKcbBP0X6Th2pn3Yngr9ItXDZnqC8adLvlHyk6eMzsy0K3EiIl0mZm7rXHLvT X-Received: by 2002:a63:c03:: with SMTP id b3mr20879124pgl.23.1566898365256; Tue, 27 Aug 2019 02:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566898365; cv=none; d=google.com; s=arc-20160816; b=SNuIQ18sYo06HUO0MZEAviN9nmc8T96ZTrE54aIygG3GHA/4soZHMn+0bI2IMT5LwJ POz8MT699cIeQyfdlHbzQ4+oojjc5bnwOgwL6V5R6cPHLrpBJPCrvfMVVuCUqGXYF5vB TO9ASdmdGPAG4TzLLwxu3HQtFiu5eEYw/3bxDlVNow8w9jfNxrgLUy+peZTuaXjVeP9q jJ8rm/u2NAb7B/Tel0CMpzdvz3t4RLmxEJvbAHrMrrkmvaLyY6+kqFCjPBIPBjnuYTRg jY4GJ56Sseprfy+YgDK2Y5mlZRjdh6pMOXJzm0AkULFJXHs2iM0NX7hWWexoyB7Cn+3n M+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr; bh=di/hoDByF8mT41xi2HfOSud9He/CsHApx6jP/mP50wQ=; b=yK6LLo8SHhGT445sa1BHUiJh2u+8mu/5/sD2QFbJuQ4DsgVPNeFviDR8el+JIqPGel TzhoDw9tg1ElPpSLXRnqI88QrJZ+uEoLzyEK9bfTMrf/dBTRnM7bLrntHWnXFh3MgMks dRboCFp0EQfXd44rLfxkCl0fUXrLIWW2SSuM5M2U9VylOcomcFwF6lyAKejuvS+u4K2b WXXkWlA+zciJpe/6UNJjP9+GBuRWcWeOXHFCEh1qJRowO7PFWMyIgCdpPMNO3pRLtFJH j+fQfo18WZuT8nndusvEO7mmjnKAJ2NesOjM97xHKI/8pYzI9j1TPOCFQyNU38pEl/h5 nCuQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si11361000pgl.102.2019.08.27.02.32.30; Tue, 27 Aug 2019 02:32:45 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729978AbfH0Jbe (ORCPT + 99 others); Tue, 27 Aug 2019 05:31:34 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:11957 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729936AbfH0Jbb (ORCPT ); Tue, 27 Aug 2019 05:31:31 -0400 Received-SPF: Pass (esa3.microchip.iphmx.com: domain of Razvan.Stefanescu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Razvan.Stefanescu@microchip.com"; x-sender="Razvan.Stefanescu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Razvan.Stefanescu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Razvan.Stefanescu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: W2ATvl1apN+fxwJM8gnuz83BBQ7QJVZbTl0xS5IYs5Cd+tbUiKx00wAOE7Kw87rcvf5r/5bB// 5Q8//D4pl+MpcnzcqRv3bJfwmGounvuNxw273borrI+HCYdZzw/MYFMELc9FswTNo1PISbDhdR +IN9Z3oShwRss8ki1WKbZbibds9U0mYkSvnWfhIhUwLy+AjlaO9VfwkUMyuv9y3LYCy7gD/6mS 73old/z7BqfGICfphMCVMGBhyYrFB4hCbJzDHtTGUaQtjRmlbrwWMPxf+/26lgX0jC9r6ka+Ha upM= X-IronPort-AV: E=Sophos;i="5.64,436,1559545200"; d="scan'208";a="46731640" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Aug 2019 02:31:31 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 27 Aug 2019 02:31:30 -0700 Received: from rob-ult-m50855.microchip.com (10.10.85.251) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 27 Aug 2019 02:31:28 -0700 From: Razvan Stefanescu To: Woojung Huh , Microchip Linux Driver Support , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" CC: , , "Razvan Stefanescu" Subject: [PATCH 4/4] net: dsa: microchip: avoid hard-codded port count Date: Tue, 27 Aug 2019 12:31:10 +0300 Message-ID: <20190827093110.14957-5-razvan.stefanescu@microchip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190827093110.14957-1-razvan.stefanescu@microchip.com> References: <20190827093110.14957-1-razvan.stefanescu@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); /* set broadcast storm protection 10% rate */ -- 2.20.1