Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp811243pxa; Wed, 5 Aug 2020 13:22:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRtefRrg08ptF/p4f+klkvfmkIQRBZZhq1HIY8FSBtI6/yGWxiNV/gfn8ukrY7J1gjv9n8 X-Received: by 2002:a50:d485:: with SMTP id s5mr996780edi.285.1596658956774; Wed, 05 Aug 2020 13:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596658956; cv=none; d=google.com; s=arc-20160816; b=V+IfRSDbYjLcNVkr6z4VrcbthbCFVdCQMIT7dD0LTq6WgCnrCcCD21TQkwDO8i/npd Q3sfHq2LkWLqbdgvnrqWknPxWXdn66RJv+oP1leGFZfNF8W3vWI3cs8t2zF1HRrLPXLd gXrhLztikwjQOETX6V/5OLMmRHpcbHGTIG7sqIH3EpepCIIWvKH7+yWk+c13N8dZhIug KqLPpj1yX+3BUUUsMNr5WltXqaftXdrFC+rpDc2pDUszeXyVi7eWdkGeuUjj37lEPwFM Wa4YYgD4+AiF5sb0waP3LiBo6kJ2QB4vKTYFEhWNBCCG4i1h3HSFM/vmSRE1hyNPrrom DcIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qVjtbYhstiKuNQL6JeVbBPs4G1xXwyHdcoC1ZxR9HUQ=; b=EA0BfQS26TYXBPRUmj+MNI7QRZuROiDwjh5RfC3X0RHl46DtQUf6NdQ+1/TBBj0bHY j3MfyN6IObyKSW0dqoEqbWowAfVSMUVYKVIUd8FiqCQYRkmy37udLrV46lTxRouAIbYD xug+egQmMi9lMk7gNv355BL7/0j8oC1Q6MfnOLJPF7eShZoIecjiyJo2DOtR3Xr/grr9 I6o8P5eJhqrLWMM3mEWeksrZCIkP0I/RfMcwc3VPGVYfSBBiA6gf32mM1azJNGpWd+f3 hBgecjlUMgcGUpRmjQZZwm1C/mv8EHhY9xyIpIMjRNDbaNKum3w5Zh+aj4scGjZuQpFL 8zPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lBeyGQOG; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf13si1899481ejb.179.2020.08.05.13.22.12; Wed, 05 Aug 2020 13:22:36 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=lBeyGQOG; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbgHEUT4 (ORCPT + 99 others); Wed, 5 Aug 2020 16:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgHEUTq (ORCPT ); Wed, 5 Aug 2020 16:19:46 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C270DC061757 for ; Wed, 5 Aug 2020 13:19:46 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id t6so5114216pjr.0 for ; Wed, 05 Aug 2020 13:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVjtbYhstiKuNQL6JeVbBPs4G1xXwyHdcoC1ZxR9HUQ=; b=lBeyGQOGbakQKscP5qJp87U0BD2iPT7BShFj1oh45m4vW3V+uOyjQZjzqLblxE+DoG ub+MTpdonw61jGuhYukxNyO/HMUXjsmaRDFu5GslTldXpvTE1UfUzpXvKOGxj4GBOLFJ o1jzDk6g7iUKQwYW/KEivXAieYBSN294EgsiL2TdFPLYA4zX/pRBxN4U3YNsKkDsBxqR aW+1CWTbx8Oktp2rcBVnX7xXXbWHanLCj0j5d3/0RGRRX8bdH+kVmgZKOjHTKoPbwrjy kD9dI/VFWynhcgO7mpFsAc5PiwBbeklTcxzilRT/p1dFwFyC+yDqdJhCmaEC7t6r8Ihd ix+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qVjtbYhstiKuNQL6JeVbBPs4G1xXwyHdcoC1ZxR9HUQ=; b=mmhomsUWzkLd6sJ+GF1/LKe/Gl0tCEdpX+81dRfyMRM+JK3sV32QV6kEdRIv5/TX+p WpSdbTe7KbpcOLkP80ncqA/4JDqt1te8mEOyMclb1xTioRWPrx4/LgZiiaAAhgYtxEub BRc/vSQsWumt2aFwJXVmq/7jUWMXtUyaS1cTVUNx9dsuwekuIUNBuVzQkIyvY/cDs6Wl AlpoEFj7uOIEig8W2/jSUNMpbt3IIcY59sp4TnxPJkGgpc1onHb7cnq7+ImBY6EZCxZe MgNdjOn2zj05kHvA6qv6vTLctTdYrf17liK3PbZHPfeCF0OiFBcONeKLUhPC0ps5Sl/y EDgQ== X-Gm-Message-State: AOAM533ptNCnCtOyy4WA718O3o6HvvZ+SFFrfPkSLlm31XLAMWfZty8c KVUeozUjx/5hqtZaij09yk6HKBu+r3ziwvwZdKXLjA== X-Received: by 2002:a17:90a:17e9:: with SMTP id q96mr4963217pja.91.1596658785977; Wed, 05 Aug 2020 13:19:45 -0700 (PDT) MIME-Version: 1.0 References: <20200718000637.3632841-1-saravanak@google.com> <20200718000637.3632841-3-saravanak@google.com> In-Reply-To: From: Saravana Kannan Date: Wed, 5 Aug 2020 13:19:10 -0700 Message-ID: Subject: Re: [PATCH v3 2/4] irqchip/qcom-pdc: Switch to using IRQCHIP_PLATFORM_DRIVER helper macros To: John Stultz Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Matthias Brugger , Andy Gross , Bjorn Andersson , Android Kernel Team , lkml , linux-arm-kernel , "moderated list:ARM/Mediatek SoC support" , linux-arm-msm , Hanks Chen , CC Hwang , Loda Chou Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 5, 2020 at 12:44 AM John Stultz wrote: > > On Fri, Jul 17, 2020 at 5:06 PM Saravana Kannan wrote: > > > > Switch the driver to use the helper macros. In addition to reducing the > > number of lines, this also adds module unload protection (if the driver > > is compiled as a module) by switching from module_platform_driver to > > builtin_platform_driver. > > > > Signed-off-by: Saravana Kannan > > --- > > drivers/irqchip/qcom-pdc.c | 26 +++----------------------- > > 1 file changed, 3 insertions(+), 23 deletions(-) > > > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > > index 5b624e3295e4..c1c5dfad57cc 100644 > > --- a/drivers/irqchip/qcom-pdc.c > > +++ b/drivers/irqchip/qcom-pdc.c > > @@ -432,28 +432,8 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent) > > return ret; > > } > > > > -static int qcom_pdc_probe(struct platform_device *pdev) > > -{ > > - struct device_node *np = pdev->dev.of_node; > > - struct device_node *parent = of_irq_find_parent(np); > > - > > - return qcom_pdc_init(np, parent); > > -} > > - > > -static const struct of_device_id qcom_pdc_match_table[] = { > > - { .compatible = "qcom,pdc" }, > > - {} > > -}; > > -MODULE_DEVICE_TABLE(of, qcom_pdc_match_table); > > - > > -static struct platform_driver qcom_pdc_driver = { > > - .probe = qcom_pdc_probe, > > - .driver = { > > - .name = "qcom-pdc", > > - .of_match_table = qcom_pdc_match_table, > > - .suppress_bind_attrs = true, > > - }, > > -}; > > -module_platform_driver(qcom_pdc_driver); > > +IRQCHIP_PLATFORM_DRIVER_BEGIN(qcom_pdc) > > +IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init) > > +IRQCHIP_PLATFORM_DRIVER_END(qcom_pdc) > > MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); > > MODULE_LICENSE("GPL v2"); > > > So this is where I bashfully admit I didn't get a chance to try this > patch series out, as I had success with a much older version of > Saravana's macro magic. > > But unfortunately, now that this has landed in mainline, I'm seeing > boot regressions on db845c. :( This is in the non-modular case, > building the driver in. Does that mean the modular version is working? Or you haven't tried that yet? I'll wait for your reply before I try to fix it. I don't have the hardware, but it should be easy to guess this issue looking at the code delta. The only significant change from what your probe function is doing is this snippet. But it'd be surprising if this only affects the builtin case. + if (par_np == np) + par_np = NULL; + + /* + * If there's a parent interrupt controller and none of the parent irq + * domains have been registered, that means the parent interrupt + * controller has not been initialized yet. it's not time for this + * interrupt controller to initialize. So, defer probe of this + * interrupt controller. The actual initialization callback of this + * interrupt controller can check for specific domains as necessary. + */ + if (par_np && !irq_find_matching_host(np, DOMAIN_BUS_ANY)) + return -EPROBE_DEFER; > I managed to bisect it down to this patch, and reverting it avoids the > issue. I don't see what is wrong right off, but I really need to get > to bed, so I'll dig further tomorrow. > > Saravana: Apologies for not getting around to testing this beforehand! No worries. Apologies for breaking it accidentally. -Saravana