From patchwork Wed Nov 11 14:06:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 322927 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp419389ils; Wed, 11 Nov 2020 06:09:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBGCY1vDnnak3pYe6dEUINoqG2O9QcmCw8j4+vpYqG5TN38iZAVxyefjwaZ7Tx2khL8BJv X-Received: by 2002:a17:906:15cc:: with SMTP id l12mr20108831ejd.363.1605103756514; Wed, 11 Nov 2020 06:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605103756; cv=none; d=google.com; s=arc-20160816; b=pbXNXvi8sizflkdD+OsXpSTpLzulsQS5Zkn+0g3UoYxMXP2+Iu0D0U9641H6gSKq8t M5csESRZ+9GV9R9buq0LYWZ7bHesJxuHFSz7tJSz2QkVHqflzWmtAWNkCPe3r12I42va w8fzqMZd8gxXcM5b1b8JcBSKyvjXvZ457iDfoTp4PvsOE8XTUtfONmDpOBtBxCIUNxqw gbSY9r+Hy1AeEJ4lAhu5OsuG0GhULSkGWE/XJ/tHXjJm1TS+iXUT08dTe08mT4LFsIR1 eC0es54Y4gX9UG7OO2QJ0qMReSE90BA+doDgJIyv36cE6fTPG4vQUGcVk55TxlD/Dlib UsXg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=sl17UnNN1853pv8Fm2YJwHvBxDhtc6bmkJMszso6wJw=; b=A4Y0Xfy+m4Ga5laAQZfbG80wBqJS84IINYWbEM2Af0llrRLlRmavqXOG1zxBo8en9i ruc7rV5QAtGMhGfFOPnYUjWFnv6wUrB90NNtd6b+6Yk63eBJXXvDO1K6lDPgzn/mg4sJ xVNpER91QePZxcoHQSxttkOPwmHG/noaacTaJq6V0g5jGbO/mMhy8yoqEHVEXnGIWvoq 6ffjwg9e4F5NCIiZ3upWMZZxWN8I3MdR7Tyk36uoGhy4WOMqlg9pVfIKWTY9m7ndY+Pi 8QQs2lUPLHqfZFeIMW7YZLxNYL/6Q/6jBWzGMUnb0crAbK+W9syP1obF0A+Wk7e913WB 5S/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lWCk5qxl; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si1579895edz.483.2020.11.11.06.09.16; Wed, 11 Nov 2020 06:09:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-gpio-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=@linaro.org header.s=google header.b=lWCk5qxl; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbgKKOJL (ORCPT + 4 others); Wed, 11 Nov 2020 09:09:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbgKKOIg (ORCPT ); Wed, 11 Nov 2020 09:08:36 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF9AC0613D1 for ; Wed, 11 Nov 2020 06:08:36 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id q19so2207899ljc.10 for ; Wed, 11 Nov 2020 06:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sl17UnNN1853pv8Fm2YJwHvBxDhtc6bmkJMszso6wJw=; b=lWCk5qxlFFQNf1X4wZDbIoSNQ3OiEi8AuwEDxdVDpD/FZYdWPgEs4hRKyE5ukfSPrE 26Yy+SvJwmncWe4l0jv9MZL2TXygHdnV88DClbSbAUqnTkWlLKLRCuou0nzhv8eQX/Yf ytT82aZuzfvEGFobCoyI/yDnDzjZITTWeZmH4eQrJfpy64UTO8ROsHIuL29u8cx1omSk hZUTPl3KE7+q+tx7Hyft5vhSYgbY9MOPNpEqOb184/eN49bJqDQpX2qovNb/qUnDu4a1 ke4D0UiHdXpiVLTGtQlTYLWDkVGTrmsgPr+MYVpimrJPzHX3dOLCA/M1YhdlpT6oXJsr uzAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sl17UnNN1853pv8Fm2YJwHvBxDhtc6bmkJMszso6wJw=; b=KEepOjN/uslpsuwkf0Pq9+r56wEuQrWlGtbYsmpzZxl3gLXIRPREijZ6/BRZNumRFm eS8PbhhKizEkoa12Ftfcss4DnIPuR00Kpw5s9B4oES737SbERCjXFovT8MK+iLyFHMvE /hGZn5bU8yJzjZQQ+hBMxDPntNg4B+qHVZISpQvUHnZgLRi1DbXRu1BLaX0B4VgEjcO2 cS9Iz4F30q1iEnK+/ZBtDJSBQUfkLc41xvwhBFN/MWFe5Av0hir+Fo1n/ubSUTQAlc63 ARMsU6rqnziZilf7A1mqYGjo0Z47Zk6B7Zc6fgJcdCXlxT7NWWJEP9ERwOkITgUFBspk mCEQ== X-Gm-Message-State: AOAM530lpDPTBRTE7xlSzF/MViEf7OPdsapowoQyg1HtqgYio1yRgERy rqn4D2gBXtYDlHsNG/ekMZyPV9XwRR8yvCZs X-Received: by 2002:a2e:8753:: with SMTP id q19mr2262360ljj.188.1605103714503; Wed, 11 Nov 2020 06:08:34 -0800 (PST) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id w10sm245437ljo.130.2020.11.11.06.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 06:08:33 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Yash Shah , "Wesley W . Terpstra" , Marc Zyngier Subject: [PATCH 1/2] RFT: gpio: sifive: Set affinity callback to parent Date: Wed, 11 Nov 2020 15:06:27 +0100 Message-Id: <20201111140628.24067-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This assigns the .irq_set_affinity to the parent callback. I assume the sifive GPIO can be used in systems with SMP. I used the pattern making the hirerarchy tolerant for missing parent as in Marc's earlier patches. Cc: Yash Shah Cc: Wesley W. Terpstra Suggested-by: Marc Zyngier Signed-off-by: Linus Walleij --- drivers/gpio/gpio-sifive.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.26.2 diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index c54dd08f2cbf..e4c190562132 100644 --- a/drivers/gpio/gpio-sifive.c +++ b/drivers/gpio/gpio-sifive.c @@ -128,6 +128,16 @@ static void sifive_gpio_irq_eoi(struct irq_data *d) irq_chip_eoi_parent(d); } +static int sifive_gpio_irq_set_affinity(struct irq_data *data, + const struct cpumask *dest, + bool force) +{ + if (data->parent_data) + return irq_chip_set_affinity_parent(data, dest, force); + + return 0; +} + static struct irq_chip sifive_gpio_irqchip = { .name = "sifive-gpio", .irq_set_type = sifive_gpio_irq_set_type, @@ -136,6 +146,7 @@ static struct irq_chip sifive_gpio_irqchip = { .irq_enable = sifive_gpio_irq_enable, .irq_disable = sifive_gpio_irq_disable, .irq_eoi = sifive_gpio_irq_eoi, + .irq_set_affinity = sifive_gpio_irq_set_affinity, }; static int sifive_gpio_child_to_parent_hwirq(struct gpio_chip *gc,