Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp352771ybz; Thu, 30 Apr 2020 23:34:41 -0700 (PDT) X-Google-Smtp-Source: APiQypLdUwR1pms4bUrt5XBN/aCJP8ybIqzkMjv8f4+ufEIVc1AJVcmBRBORDXVcTNRdLPkyI3Rm X-Received: by 2002:a17:906:4003:: with SMTP id v3mr1870200ejj.144.1588314880767; Thu, 30 Apr 2020 23:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588314880; cv=none; d=google.com; s=arc-20160816; b=LLsYNWQ8C20cnks0pJtbm/EFO2SJp085aEuyDGwj6zuZjYlQnUHTeQWLFbrKXx/4zZ s0v5Pvkh6GQCoC8VV6NvIu5/ZXzSN76VN0EYMHcrwAo9Aae26Hl0ZHIjzyA2gB73I5aQ kIstlIlZbuLTUdpG1mAZ5Epo4r+YslofjMTmY4eX8saHxgcD/8Be4+JjxxUCttVxrX8A CXlmFY1fmgGLjgpkVjDv2qXU2ruoZ0e6wlBStGu75EhnjN0h7qusYzFHl9ZhvC8tFjsv USew4JTBYCPqbAROcDyKcMaxasjvqpx4u3RT3BDIOabN2uXZC4wc2lv29gxFQ31zBEy6 NN2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=+ZeZENPKHRVIAyX18Mb1d2RgeUC/KuHefKXYMNBHvno=; b=iFvchUN4B1EjvtRH8tBJ1ze0MuJn/WA8kxYQoxQPLDf6LYLFs2rP90rbFsr6CNwphe rleZEu+/ERceAqgQnMynUlOtr7ubNHS6BLiiNZAL2DJYTlMuOsIbuZ06U6PGVjnzPRLA ztGUQlzybNFYMI3FDhXpMbSsoDtdGPflkys9q/wMlBVBc7+tAXucLEMCSeKTMaxLllTv yeLH7cHVtRxc11IAUPWD7ZtgFj1X4oJlCm4i+LM+NewF2Bz4AAVsmy3qG3YY6QS3OI2z P8Oym7+NpjrRbF8ltzIcC91mxl9lfSG/7KSTv8s+7XUILbapLp5GGwzthveddzD912+v zc8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=d7vMcHMM; 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 o12si1187495edv.257.2020.04.30.23.34.16; Thu, 30 Apr 2020 23:34:40 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=d7vMcHMM; 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 S1728371AbgEAGbV (ORCPT + 99 others); Fri, 1 May 2020 02:31:21 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:32358 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728229AbgEAGbU (ORCPT ); Fri, 1 May 2020 02:31:20 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588314680; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=+ZeZENPKHRVIAyX18Mb1d2RgeUC/KuHefKXYMNBHvno=; b=d7vMcHMMQcvrd+mq061Ut5qGYCcmuUMR4bS5qumwHwOTF/F9+KKZy73xLx6stLE+ANHMMrvE blR0vOf8rOKudXHUPuhxZs9V0XQnj0QJ60sgQw6DfN4tYmueQfM99WrNCQOficVMcaAT1wmb mk/+cO70P6Buy3lx2kOKUiG7sHE= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5eabc22c.7f0f9389e3e8-smtp-out-n01; Fri, 01 May 2020 06:31:08 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 885D1C433CB; Fri, 1 May 2020 06:31:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mkshah-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mkshah) by smtp.codeaurora.org (Postfix) with ESMTPSA id E2741C433D2; Fri, 1 May 2020 06:31:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E2741C433D2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=mkshah@codeaurora.org From: Maulik Shah To: andy.gross@linaro.org, bjorn.andersson@linaro.org, linus.walleij@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, dianders@chromium.org, swboyd@chromium.org, rnayak@codeaurora.org, ilina@codeaurora.org, lsrao@codeaurora.org, Venkata Narendra Kumar Gutta , Maulik Shah Subject: [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Date: Fri, 1 May 2020 12:00:17 +0530 Message-Id: <1588314617-4556-1-git-send-email-mkshah@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Venkata Narendra Kumar Gutta Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the affinity of wakeup capable IRQs. Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") Signed-off-by: Venkata Narendra Kumar Gutta [mkshah: updated commit text and minor code fixes] Signed-off-by: Maulik Shah --- drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 29259fe..83b7d64 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -1033,6 +1033,29 @@ static void msm_gpio_irq_relres(struct irq_data *d) module_put(gc->owner); } +static int msm_gpio_irq_set_affinity(struct irq_data *d, + const struct cpumask *dest, bool force) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct msm_pinctrl *pctrl = gpiochip_get_data(gc); + + if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs)) + return irq_chip_set_affinity_parent(d, dest, force); + + return 0; +} + +static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct msm_pinctrl *pctrl = gpiochip_get_data(gc); + + if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs)) + return irq_chip_set_vcpu_affinity_parent(d, vcpu_info); + + return 0; +} + static void msm_gpio_irq_handler(struct irq_desc *desc) { struct gpio_chip *gc = irq_desc_get_handler_data(desc); @@ -1131,6 +1154,8 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake; pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres; pctrl->irq_chip.irq_release_resources = msm_gpio_irq_relres; + pctrl->irq_chip.irq_set_affinity = msm_gpio_irq_set_affinity; + pctrl->irq_chip.irq_set_vcpu_affinity = msm_gpio_irq_set_vcpu_affinity; np = of_parse_phandle(pctrl->dev->of_node, "wakeup-parent", 0); if (np) { -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation