Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp212665rdb; Sat, 2 Sep 2023 06:34:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhKVAUPnRGyaUh/iEa+q/DGXntLs3s74MjJr7ygvpW7A5r2+QsWntQDiKdD6pOIMXSjg5T X-Received: by 2002:a05:6a20:26a5:b0:13e:b58a:e3e4 with SMTP id h37-20020a056a2026a500b0013eb58ae3e4mr3816963pze.7.1693661647313; Sat, 02 Sep 2023 06:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693661647; cv=none; d=google.com; s=arc-20160816; b=u4Kgz2DQGgjhK685bB7Q1NKBEDLTBweb78pD18J/2RYlrXVCoPzYLNylJ8973igBLo 9F8+GRW4nfJbtTcBSJDYQzckpi9aW3LycDQwN8zI/7i96i2TzygjPCke1k9Z5kThMPIa mASnIWvDofGoo8drqZEozaVIhqCMk1JUR4fPDyKwkDKYJMa4mhOcC3+jSbbyAZv12P9b GwxbBhGZltocmt13JqF+7ltu3Rc5l5c7wKADyhQAtFEAvVoY9eg34un5EWuYu3eUCbVN 2QAFEGLSBAfrVmHzJAFHBOpDkMxJM9s44yL765xF00IleatlwxCfU/oGtdM/P9KIKifJ 8iTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=jmflAyL1J/cad73H5EaGOpi4QBS32Nihpf4PrqtaL3E=; fh=sk35EI51InIcdDgKrMtHpZ7qZu25HCpajL4XfGFHBgM=; b=W4Ys0IypUwK0XjAnP2AAn18+izztA/5F/ws/o1xXNk09GpYHHB8JebngQcvWzKWhv9 o2Fju8GMfVRAt1BqIWsba6HN14wnrrSAw1bx/i5INo/IC+lSmOhxWC2mxAK7mZRL6rPc F+sz3410Qai7+UUovRiZE9acoiYAYEf2AQN138HPKdqQaFyPgcD0kuHeFHK9KMNAIuJK eSAEXS4EtOWBXkubGXFpZegfs3qlfk4OVYw2O6yGszQoUdxDOMJoji0yPl1bFHA2/ZgJ xqudxhduTIvHQfTeVFT8u4mLpL0f960R39c6V/g5qsy1Kx2FBmp8PlnJpTSSJu6XQ7NA Dhvw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a056a00151400b00686ed0dc69esi4645359pfu.327.2023.09.02.06.33.53; Sat, 02 Sep 2023 06:34:06 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237678AbjIAD6B (ORCPT + 99 others); Thu, 31 Aug 2023 23:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbjIAD6B (ORCPT ); Thu, 31 Aug 2023 23:58:01 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAE27CFE; Thu, 31 Aug 2023 20:57:56 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 1474580CF; Fri, 1 Sep 2023 11:57:47 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 1 Sep 2023 11:57:48 +0800 Received: from [192.168.125.127] (183.27.96.188) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 1 Sep 2023 11:57:45 +0800 Message-ID: <837c3675-51d4-2eba-e8c6-3065d6e5d301@starfivetech.com> Date: Fri, 1 Sep 2023 11:57:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c Content-Language: en-US To: Conor Dooley CC: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Emil Renner Berthing , , , , , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie References: <20230825090129.65721-1-minda.chen@starfivetech.com> <20230825090129.65721-9-minda.chen@starfivetech.com> <20230825-sip-pentagon-e1760dcfce58@wendy> From: Minda Chen In-Reply-To: <20230825-sip-pentagon-e1760dcfce58@wendy> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.96.188] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 On 2023/8/25 20:09, Conor Dooley wrote: > Daire, can you look at this one too please? > > On Fri, Aug 25, 2023 at 05:01:26PM +0800, Minda Chen wrote: >> Move IRQ init functions to pcie-plda-host.c. >> mc_handle_event() is merged to plda_handle_event(). >> Set most of the IRQ functions to static in pcie-plda-host.c >> >> Signed-off-by: Minda Chen > >> -void plda_handle_event(struct irq_desc *desc) >> +static void plda_handle_event(struct irq_desc *desc) >> { >> struct plda_pcie_rp *port = irq_desc_get_handler_data(desc); >> struct irq_chip *chip = irq_desc_get_chip(desc); >> @@ -264,14 +268,18 @@ void plda_handle_event(struct irq_desc *desc) >> >> chained_irq_enter(chip, desc); >> >> - val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL); >> - origin = val; >> - val = val >> A_ATR_EVT_POST_ERR_SHIFT; >> - events |= val & 0xff; >> - if (origin & PM_MSI_INT_INTX_MASK) >> - events |= BIT(EVENT_PM_MSI_INT_INTX); >> - val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf; >> - events |= val << EVENT_PM_MSI_INT_MSI; >> + if (port->ops && port->ops->get_events) { > > I still don't love the dancing here. Can you just always register a > callback? > > Thanks, > Conor. > OK, Thanks. >> + events = port->ops->get_events(port); >> + } else { >> + val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL); >> + origin = val; >> + val = val >> A_ATR_EVT_POST_ERR_SHIFT; >> + events |= val & 0xff; >> + if (origin & PM_MSI_INT_INTX_MASK) >> + events |= BIT(EVENT_PM_MSI_INT_INTX); >> + val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf; >> + events |= val << EVENT_PM_MSI_INT_MSI; >> + } >> >> for_each_set_bit(bit, &events, port->num_events) >> generic_handle_domain_irq(port->event_domain, bit);