From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65414C433E0 for ; Wed, 5 Aug 2020 20:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F4AD22CAF for ; Wed, 5 Aug 2020 20:19:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lBeyGQOG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726013AbgHEUT4 (ORCPT ); Wed, 5 Aug 2020 16:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726644AbgHEUTq (ORCPT ); Wed, 5 Aug 2020 16:19:46 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D81C061756 for ; Wed, 5 Aug 2020 13:19:46 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id z20so5342626plo.6 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=T6ecrTbKOvqGwD87tG4nelxH5olT04Fq9PuGfDC5ZuYgQe3zAwbMtuySAgfMaezYFx Kp41ofdbiMSm8y7mM9OEUuAsDQLY0m42nf9DTENPifzVFQUjFIJx/UWSCwE/Kp56XiiW opLrgW8YhqqWWhBMhlyKM/ZApL2bCNzfz7P4ExWIHwbHhDMLPTE1vgWGhHssBA0FTc1y K7aBrMX4eeqAJeHKHF5DXx++7irvRG4QaiIHqCO6KSxbBrN9TtqCyANXHEYzpFltIHG8 UN2jvlErGXCj/w9prb5agRx5cBxX5nZI6CvRLzsuPJ/Wm7rrZW4jAkCNpPUb9ghiLrQ+ IZvw== X-Gm-Message-State: AOAM5331NiTUD7DHgS7NWSAdxriV28etcpXswqgVRArIConEe2EZ5fv4 y43SHEbc0v2O3IRayxXJOFzWjez4PC9reOpFfUpFSQ== X-Google-Smtp-Source: ABdhPJyzC3W0lW0kRAsgMCPz7TzprnpMpUFYzlQwQ8cedIEf9CqmMuoAlFAGdxAKZ6AyjNgpHiemuwv1bJvRpW+qLtA= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52C99C433DF for ; Wed, 5 Aug 2020 20:20:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E30522CAD for ; Wed, 5 Aug 2020 20:20:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vxdcd674"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="lBeyGQOG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E30522CAD Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Hdd/Po0O16QT/ROz+zrE8U68S0WMuiUDSBs7EjZKJSk=; b=Vxdcd674ekCsJQ9tkCwzdhQCg 40ggk6EuSXWYEJ+Nmf6IQNSlGY7TTYuwcN4XZcgkJx795d5wMzPmHsJXBaQelVPip0IvkIrP6A7ka KuGSdYuFtKsdTPUOWouwtMFu0a+2snzzdFXTeunRZCTtt6JI3l9YL9OuNU4JHXh5ahWCKaSge4BZz nDAITKJJLfO1vGEXL1kOjSk/ovH9IwXDjF2VYuA0iJHVyiMIvPvC7435LTj7cEscqKDmgSksYD/2r ZV7CQcL+tQS0tziosVgCLh/L/ZOtt4ampBJh305oQN/7tS0SqyUqjy78//Xll4ks+TtvxzOvztHY1 w3kOBkuoQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3PtC-0004rw-Bc; Wed, 05 Aug 2020 20:19:54 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3Pt8-0004ql-GI for linux-mediatek@lists.infradead.org; Wed, 05 Aug 2020 20:19:51 +0000 Received: by mail-pj1-x1041.google.com with SMTP id i92so3645365pje.0 for ; Wed, 05 Aug 2020 13:19:47 -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=M6b2XXenC7D6x2N5fCcXXNAFg1z1xuRVpjjqPYbyG1UeXm5IirsCHwQ16EaI30qcuf 05slsxmyQSsCGXBsISIXLsZSUBAqYXcDRFO5/3qMnr721OXRfVXLQ55/KuIo4eXKiQGT 0r35U72OZxufx5eNDyw308wawMvFg/uatw9st7c2DzOMSDMO21pTc319GJen6C3u941I a6zq+TdKTE+tFDoDAvsGCnJGBN+vLt/xflnD2N+/56cAADIiNyME3WjVGcNi7XXHbH7L gmeCvsQIk7CLu/2AWYvDdfstXHcl1l5Nx21bRVbkHV3eNWEcUv981NRezkDQsywLZxKo T2UQ== X-Gm-Message-State: AOAM5319OVfID7xgEkfgs7JPwFeKgpGhAmJu4sd1MvLq9yKPHrGuTa8k XNrZASWFaM2FL5yT8BWw826vGw40oCQDdsRDgs5fBw== X-Google-Smtp-Source: ABdhPJyzC3W0lW0kRAsgMCPz7TzprnpMpUFYzlQwQ8cedIEf9CqmMuoAlFAGdxAKZ6AyjNgpHiemuwv1bJvRpW+qLtA= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200805_161950_611652_68E027B4 X-CRM114-Status: GOOD ( 31.64 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CC Hwang , Jason Cooper , Marc Zyngier , Hanks Chen , Loda Chou , lkml , Bjorn Andersson , Andy Gross , "moderated list:ARM/Mediatek SoC support" , linux-arm-msm , Matthias Brugger , Thomas Gleixner , Android Kernel Team , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5228C433E0 for ; Wed, 5 Aug 2020 20:21:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 991B4206A2 for ; Wed, 5 Aug 2020 20:21:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LFCp+GxI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="lBeyGQOG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 991B4206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3d2lnXTW+loCXsItyfXRyaaJusb3imy9NxYR6RTcIeA=; b=LFCp+GxIfGbye8biIKE243i4R bc8et+sYlF5K/d0FCUTV6mHoFnQ4WQ6LgfLNnQ6t5lnuXaFIkci1WDbDYcLOjQyH2MquAhCchFPcB ddVvQMgwdat0bmIRx7eqqkXjwk6XswWNR2yIdVwPJjSm5tTkWaTGPqG5ydflqcOBLYt8VVnsxk52N f3qJF+MIkpDOsQXc3r+ZcgZlav2MA0tB8rUo4dzCRc4GmIKItquO5TtrT3CF2+A01hNIDylMyXQJ0 nC/yuP0mjv72XrT2YB65Ojm5UISMo/BwRrpKXcJCsWMIIosbScf10Jg2PIjGdn/0DmtBjhibJ9FKO SdZ6GiTkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3PtB-0004rZ-6g; Wed, 05 Aug 2020 20:19:53 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3Pt8-0004qm-FD for linux-arm-kernel@lists.infradead.org; Wed, 05 Aug 2020 20:19:51 +0000 Received: by mail-pj1-x1044.google.com with SMTP id c10so3641509pjn.1 for ; Wed, 05 Aug 2020 13:19:47 -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=RwAogUKmOIroZPWJQF9S6piKPLviJD0eS2B8FuGNpITLyxgxmL95IxpaxsD6b/lQYB Vf4blNOSCJWcc8nb0fZNEHIfrTxP2Ec6iQOBsxH1bAf16CpmgqdqzY4xkASIe791Y8lL 1tNdFhDqpNHYHfYw1ykZ6VG3W3dJ5AlWeacQ0I1ZN8ZtdxuSCeipqsusA2VXo7lo18AT Axt/Uyz7lRkom0jysvViRKW8LOofPfgJCa6orKKOcTueEoehJY2mLYGBtEZ/EMOH2xmP 440qDi1YysDvV+60/efewDQwDqxzPL1aisgl89i2v5guavW6S26dzZSWWNNZq9lhWrsD SBSQ== X-Gm-Message-State: AOAM531DeXl7E1P+8ARSxX9Nuw+90HHUgg9a4H6voimTLFDstu7beboE rjAMlfYy0Z0Hvai28jmuW9tgdXGM5lMsWffJ1pJew+nzLZU= X-Google-Smtp-Source: ABdhPJyzC3W0lW0kRAsgMCPz7TzprnpMpUFYzlQwQ8cedIEf9CqmMuoAlFAGdxAKZ6AyjNgpHiemuwv1bJvRpW+qLtA= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200805_161950_607353_49F3617D X-CRM114-Status: GOOD ( 33.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CC Hwang , Jason Cooper , Marc Zyngier , Hanks Chen , Loda Chou , lkml , Bjorn Andersson , Andy Gross , "moderated list:ARM/Mediatek SoC support" , linux-arm-msm , Matthias Brugger , Thomas Gleixner , Android Kernel Team , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel