Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp617958pxb; Wed, 18 Nov 2020 12:41:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxohF7PsZP7+GOIq4sJxwxgsGRC4KFR4e/zaDvpcQ/jBu1L34rNEktOqawi4JM5lwLZmeMa X-Received: by 2002:a17:906:57ca:: with SMTP id u10mr26476824ejr.389.1605732081785; Wed, 18 Nov 2020 12:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605732081; cv=none; d=google.com; s=arc-20160816; b=mZ671kLg0Ro4hCawfet571w5xoEwR1UAtzTatXlWd+4awnuFts7MuDWRsDH11KwMGf SWg5HjgEiNa8h7g397GecQYFgpJ7EPUxRlocN4SmW96a82g2ZOM9JR9EQ0/CigVRwgkx HwT/brRWNf/9u9QrOO4B03t0P68udlA6e9ux2zmeLed0HuFE6cE5+YUrV/gRvBIrm6Tq uDv2yz98eHRpFTstYyoB+qnR8X8T5dWa/OUjUwewJXamLJgYJ1pJ1d+q2bllTjAuILW2 xbDEjt3vRekL7cSvZ9Z6go/vBlmoyKlAS6CJqw7ghaJFBtVwtmIJDsAF5UmeQpDy74O9 Ws2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YiWxz68PD3O5WNfXGGFmtMTSiZE5NrznzFvOOj8jOqQ=; b=iZQaIymRqJ4SYX5OzRYieFiXC6qkRr9GcncjtHyCeN9E/OyYjjsI5MPXxRP7iGfiGr 6R6t+vkcNLZlGPwLt4MaIgU5DON2mUjfLgz9kyhMPg5sn8HZLCUZDs6orC6SBjecaaoh ahTyhXJh7Z1d005lcs6G8bxZaQ4aRdFrJCNmblWhvoPcHFLW5r0iayH23PaN7mbZ395P 1opU929JZC+n9bZ3985r2OBLiWqEtokcOvsnB0gI0Ag/s23Tlh6mMqGbAmc05ObnT1zg SvqbWfBDUAqngosIuL4cDI012OBfxLPDvu81aFQLpw3dygPWSdpElAZxuXLhjTMKrVBJ cuQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw14si15367675ejb.319.2020.11.18.12.40.55; Wed, 18 Nov 2020 12:41:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbgKRUie (ORCPT + 99 others); Wed, 18 Nov 2020 15:38:34 -0500 Received: from mailout02.rmx.de ([62.245.148.41]:46406 "EHLO mailout02.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgKRUid (ORCPT ); Wed, 18 Nov 2020 15:38:33 -0500 Received: from kdin01.retarus.com (kdin01.dmz1.retloc [172.19.17.48]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout02.rmx.de (Postfix) with ESMTPS id 4Cbvll6pCgzNljV; Wed, 18 Nov 2020 21:38:27 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin01.retarus.com (Postfix) with ESMTPS id 4CbvkC0SJxz2xDh; Wed, 18 Nov 2020 21:37:07 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.25) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 18 Nov 2020 21:33:17 +0100 From: Christian Eggers To: Vladimir Oltean , Jakub Kicinski , Andrew Lunn , Richard Cochran , "Rob Herring" CC: Vivien Didelot , "David S . Miller" , Kurt Kanzenbach , George McCollister , Marek Vasut , Helmut Grohne , Paul Barker , Codrin Ciubotariu , Tristram Ha , Woojung Huh , Microchip Linux Driver Support , Christian Eggers , , , Subject: [PATCH net-next v3 05/12] net: dsa: microchip: ksz9477: move chip reset to ksz9477_switch_init() Date: Wed, 18 Nov 2020 21:30:06 +0100 Message-ID: <20201118203013.5077-6-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201118203013.5077-1-ceggers@arri.de> References: <20201118203013.5077-1-ceggers@arri.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.54.25] X-RMX-ID: 20201118-213715-4CbvkC0SJxz2xDh-0@kdin01 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The next patch will add basic interrupt support. Chip reset must be performed before requesting the IRQ, so move this from ksz9477_setup() to ksz9477_init(). Signed-off-by: Christian Eggers --- drivers/net/dsa/microchip/ksz9477_main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477_main.c b/drivers/net/dsa/microchip/ksz9477_main.c index abfd3802bb51..c0b4cf66c904 100644 --- a/drivers/net/dsa/microchip/ksz9477_main.c +++ b/drivers/net/dsa/microchip/ksz9477_main.c @@ -1345,19 +1345,12 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) static int ksz9477_setup(struct dsa_switch *ds) { struct ksz_device *dev = ds->priv; - int ret = 0; dev->vlan_cache = devm_kcalloc(dev->dev, sizeof(struct vlan_table), dev->num_vlans, GFP_KERNEL); if (!dev->vlan_cache) return -ENOMEM; - ret = ksz9477_reset_switch(dev); - if (ret) { - dev_err(ds->dev, "failed to reset switch\n"); - return ret; - } - /* Required for port partitioning. */ ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY, true); @@ -1537,10 +1530,16 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { static int ksz9477_switch_init(struct ksz_device *dev) { - int i; + int i, ret; dev->ds->ops = &ksz9477_switch_ops; + ret = ksz9477_reset_switch(dev); + if (ret) { + dev_err(dev->dev, "failed to reset switch\n"); + return ret; + } + for (i = 0; i < ARRAY_SIZE(ksz9477_switch_chips); i++) { const struct ksz_chip_data *chip = &ksz9477_switch_chips[i]; -- Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler