From patchwork Thu Feb 2 12:59:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Sankaranarayanan X-Patchwork-Id: 51911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp221604wrn; Thu, 2 Feb 2023 05:00:50 -0800 (PST) X-Google-Smtp-Source: AK7set/avnQIe6BDmRdm4zIurh+ukDO/Xx70v/uefqikUMiovBGna3qPLZLyq81r7ppu6pb1bE0X X-Received: by 2002:a05:6402:1146:b0:492:609a:f148 with SMTP id g6-20020a056402114600b00492609af148mr6240913edw.3.1675342850097; Thu, 02 Feb 2023 05:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675342850; cv=none; d=google.com; s=arc-20160816; b=j9O8s8aZqPwBojJWn0Kvhc29RA77Orx4LVxQKfJolRnv0cXM+Gu5k1EubxnZfUwgVg uC+ri7tLU0SzzoUxtq1BC5EEe9e98RJe7Y9icNYc4DFGIIxIaaMzHVhBj7kl40x9PJYV aeXi0nUMhIxHdUSoE14AP7pkMMy30WUDoVKs3mf3t6lDDc+zv+yfeDcoEjQYBauppKrQ OQuorcbPGAyvDUcw6UxY8fknguTcLOKv9rq8AXvzaLqZRALWMrxihTUHimVv8sLCDTdl TU3s6bS/gWVaTzxAlqArp0swRg5G3uO+Cn6+893TqV6MZopzCco7b2Dw9WoSqw4i77Zj IMUg== 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 :dkim-signature; bh=Disen6rdiT2ayQgp0btUaKgSVAw7VLKB6y0LGZQ3THE=; b=tK9dcHqo+ZznaVJ3bJs4wYOXdK/1CVr/MkGB+CH8AHGVNysL9Gbo+yWqPkAijETmOw o0tZESx5Qjibi4rhb4JflkxVXKP06dAzGbgkylQeaJgDSY+65XJAQvl4xNCD2Twid2yV FYn7iE+RKXNcoBey0UErhAcA6O+ooLzUmqUXZ2kaJMG2lvvy+nEVWxUbuYpYQnDF5SXK v40dQuntwxHoreM+iNqw9P5cGQHO1lDl2P96/Q+Ic+gERhYhme4i6yVYHTMJ/DXOKv5d 7hdK2LgkbrnN6vlPv5dXZlZfS3lAkADhIVZLVtGxfhpK1fp5C647W3t4RALmGttCzrBp oRpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="xh/ILQrO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a056402032c00b004a245704d9esi12940785edw.303.2023.02.02.05.00.21; Thu, 02 Feb 2023 05:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="xh/ILQrO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbjBBM7S (ORCPT + 99 others); Thu, 2 Feb 2023 07:59:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232371AbjBBM7D (ORCPT ); Thu, 2 Feb 2023 07:59:03 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F67B8E484; Thu, 2 Feb 2023 04:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1675342740; x=1706878740; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=09IBqS4LmrOKoAcjHwQjILLjOKkVRx2085Me/Fn628s=; b=xh/ILQrOOKZfZ737sSsXrL3SRW5et8xnY4qKGt1D3mVWqBeId3Hj8o2J RuukaqzZZWW9Nm3izAuI4DpUtgmfQdkmKEpKk0QWgZNBln1z5mMEfvFlh kvg5/x8j/djBZs1H0QrkWZeUnLUDXHvScHAY81Y4a35uv+90PFCsKN3pZ vJr/3bl6zsKdH4QdFD54GsVBesoK8lbtA0B3KTJsuC2FFMkvP7WgwKquB RRi5zLGyP2wpNGgrOe/DFWj6tanIB2gcmVJsbhUAeONpZW0eq7TmvfGEM tH6GIv1hU0yvn1+qcjtIG/KZNGnzONNUhvWGD7uRzaAFAX9y5mhqjloV7 Q==; X-IronPort-AV: E=Sophos;i="5.97,267,1669100400"; d="scan'208";a="198620642" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2023 05:58:59 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Feb 2023 05:58:54 -0700 Received: from che-lt-i67786lx.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Feb 2023 05:58:50 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , Subject: [RFC PATCH net-next 05/11] net: dsa: microchip: lan937x: add shared global interrupt Date: Thu, 2 Feb 2023 18:29:24 +0530 Message-ID: <20230202125930.271740-6-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> References: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756724304765054958?= X-GMAIL-MSGID: =?utf-8?q?1756724304765054958?= In cascade mode interrupt line is shared among both switches. Update global interrupt flag for shared interrupt, otherwise second switch probe will fail with busy status. Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/ksz_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 7062ce1749fb..adf8391dd29f 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -2009,7 +2009,8 @@ static irqreturn_t ksz_irq_thread_fn(int irq, void *dev_id) return (nhandled > 0 ? IRQ_HANDLED : IRQ_NONE); } -static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq) +static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq, + unsigned long flag) { int ret, n; @@ -2025,7 +2026,7 @@ static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq) irq_create_mapping(kirq->domain, n); ret = request_threaded_irq(kirq->irq_num, NULL, ksz_irq_thread_fn, - IRQF_ONESHOT, kirq->name, kirq); + flag, kirq->name, kirq); if (ret) goto out; @@ -2048,7 +2049,7 @@ static int ksz_girq_setup(struct ksz_device *dev) girq->irq_num = dev->irq; - return ksz_irq_common_setup(dev, girq); + return ksz_irq_common_setup(dev, girq, (IRQF_ONESHOT | IRQF_SHARED)); } static int ksz_pirq_setup(struct ksz_device *dev, u8 p) @@ -2064,7 +2065,7 @@ static int ksz_pirq_setup(struct ksz_device *dev, u8 p) if (pirq->irq_num < 0) return pirq->irq_num; - return ksz_irq_common_setup(dev, pirq); + return ksz_irq_common_setup(dev, pirq, IRQF_ONESHOT); } static int ksz_setup(struct dsa_switch *ds)