From patchwork Mon Oct 8 16:32:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 980662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cxFsYV6x"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42TQrW502Gz9s55 for ; Tue, 9 Oct 2018 03:32:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbeJHXov (ORCPT ); Mon, 8 Oct 2018 19:44:51 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45951 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeJHXov (ORCPT ); Mon, 8 Oct 2018 19:44:51 -0400 Received: by mail-pf1-f194.google.com with SMTP id u12-v6so5484263pfn.12 for ; Mon, 08 Oct 2018 09:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GTz03gJ4IksrgBFA4JhWjw4cmCeDwayh/ZV0XygJyaU=; b=cxFsYV6xbuwE+ROejy34kzEr54TlDXRTGzSwG63rUIlEQkG1YYWX9hPWswrcl72rFu McokXcuI7EsCEzXDIWqywl6U75wDdyhaQ+ZU+hsvhP2FnHGbMzLdeeLvpWLPXS575bCd 04YliSHDwlTKFSHVhCph3tb0g/JgHtkj6MKEY= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GTz03gJ4IksrgBFA4JhWjw4cmCeDwayh/ZV0XygJyaU=; b=M0iNyaCx0QRjKAs3fmEBjvLpuCZyELLs/jyJgIxi3gVAdw2lzNVftxOkf8DJPYyoxB CjO6yvshn5pfo3+xMeRulnKta/lbIokzSKfT0Id49FO4d1xklhTeP8cFFwg3EHwRpPma 2j4WEvHzfousfLviQleU4D4y8Tj1TOjjLpxJyofJiFJZki4tXT/ne3LimQRYqixysz6j +Fk14R102douBzHWgVpaNAi02BS1jnuJvLgJbsNz4VqLE7Bqev8L8q0QJA2qIhyUOAfL wr1oeue1EZaf8LzaVPHSKWWyr3RHKnzF1DWtca2fZubVmfndRccyFp/Xng/vgLahnHaF N7tA== X-Gm-Message-State: ABuFfoh/4dCLqqztjmWhP6SFalpyiIgaMCSrHM4tnywZNeraYuKabIJO mNO1l6xX76xoq/U+VYhwStqKQQ== X-Google-Smtp-Source: ACcGV6161Px6A+JN/dYTorPm9bzokF8WzIU/bD5yk6c3xqHcNy4sI6yM+BJ2d04ecUwN+/Xuk6XNyw== X-Received: by 2002:a62:4b09:: with SMTP id y9-v6mr25861149pfa.93.1539016338755; Mon, 08 Oct 2018 09:32:18 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id 3-v6sm29832077pga.12.2018.10.08.09.32.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 09:32:17 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Evan Green , Thierry Reding , Grygorii Strashko Subject: [PATCH 1/4] gpio: Assign gpio_irq_chip::parents to non-stack pointer Date: Mon, 8 Oct 2018 09:32:13 -0700 Message-Id: <20181008163216.97436-2-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181008163216.97436-1-swboyd@chromium.org> References: <20181008163216.97436-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org gpiochip_set_cascaded_irqchip() is passed 'parent_irq' as an argument and then the address of that argument is assigned to the gpio chips gpio_irq_chip 'parents' pointer shortly thereafter. This can't ever work, because we've just assigned some stack address to a pointer that we plan to dereference later in gpiochip_irq_map(). I ran into this issue with the KASAN report below when gpiochip_irq_map() tried to setup the parent irq with a total junk pointer for the 'parents' array. BUG: KASAN: stack-out-of-bounds in gpiochip_irq_map+0x228/0x248 Read of size 4 at addr ffffffc0dde472e0 by task swapper/0/1 CPU: 7 PID: 1 Comm: swapper/0 Not tainted 4.14.72 #34 Call trace: [] dump_backtrace+0x0/0x718 [] show_stack+0x20/0x2c [] __dump_stack+0x20/0x28 [] dump_stack+0x80/0xbc [] print_address_description+0x70/0x238 [] kasan_report+0x1cc/0x260 [] __asan_report_load4_noabort+0x2c/0x38 [] gpiochip_irq_map+0x228/0x248 [] irq_domain_associate+0x114/0x2ec [] irq_create_mapping+0x120/0x234 [] irq_create_fwspec_mapping+0x4c8/0x88c [] irq_create_of_mapping+0x180/0x210 [] of_irq_get+0x138/0x198 [] spi_drv_probe+0x94/0x178 [] driver_probe_device+0x51c/0x824 [] __device_attach_driver+0x148/0x20c [] bus_for_each_drv+0x120/0x188 [] __device_attach+0x19c/0x2dc [] device_initial_probe+0x20/0x2c [] bus_probe_device+0x80/0x154 [] device_add+0x9b8/0xbdc [] spi_add_device+0x1b8/0x380 [] spi_register_controller+0x111c/0x1378 [] spi_geni_probe+0x4dc/0x6f8 [] platform_drv_probe+0xdc/0x130 [] driver_probe_device+0x51c/0x824 [] __driver_attach+0x100/0x194 [] bus_for_each_dev+0x104/0x16c [] driver_attach+0x48/0x54 [] bus_add_driver+0x274/0x498 [] driver_register+0x1ac/0x230 [] __platform_driver_register+0xcc/0xdc [] spi_geni_driver_init+0x1c/0x24 [] do_one_initcall+0x240/0x3dc [] kernel_init_freeable+0x378/0x468 [] kernel_init+0x14/0x110 [] ret_from_fork+0x10/0x18 The buggy address belongs to the page: page:ffffffbf037791c0 count:0 mapcount:0 mapping: (null) index:0x0 flags: 0x4000000000000000() raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff raw: ffffffbf037791e0 ffffffbf037791e0 0000000000000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffffffc0dde47180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc0dde47200: f1 f1 f1 f1 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 >ffffffc0dde47280: f2 f2 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 ^ ffffffc0dde47300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc0dde47380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Let's leave around one unsigned int in the gpio_irq_chip struct for the single parent irq case and repoint the 'parents' array at it. This way code is left mostly intact to setup parents and we waste an extra few bytes per structure of which there should be only a handful in a system. Cc: Evan Green Cc: Thierry Reding Cc: Grygorii Strashko Fixes: e0d897289813 ("gpio: Implement tighter IRQ chip integration") Signed-off-by: Stephen Boyd --- drivers/gpio/gpiolib.c | 3 ++- include/linux/gpio/driver.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 86c147b3f4af..d9d823e3761b 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1684,7 +1684,8 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip, irq_set_chained_handler_and_data(parent_irq, parent_handler, gpiochip); - gpiochip->irq.parents = &parent_irq; + gpiochip->irq.parent_irq = parent_irq; + gpiochip->irq.parents = &gpiochip->irq.parent_irq; gpiochip->irq.num_parents = 1; } diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index f6b95734073f..31e47b1d264e 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -100,6 +100,11 @@ struct gpio_irq_chip { */ unsigned int num_parents; + /** + * private: For use by gpiochip_set_cascaded_irqchip() + */ + unsigned int parent_irq; + /** * @parents: * From patchwork Mon Oct 8 16:32:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 980661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ggpwLzTs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42TQrQ1sKGz9s55 for ; Tue, 9 Oct 2018 03:32:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbeJHXow (ORCPT ); Mon, 8 Oct 2018 19:44:52 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38029 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbeJHXow (ORCPT ); Mon, 8 Oct 2018 19:44:52 -0400 Received: by mail-pg1-f195.google.com with SMTP id f8-v6so1660804pgq.5 for ; Mon, 08 Oct 2018 09:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L7ySiBOV6v4YVbOgXXN8Qe8bELIY9QXgwcfs0zDgPag=; b=ggpwLzTsf7tf8vXPmSIRSmdp1L7WtOA4hALlTi6klcSKIt1e+4cjf0fnJrmLrDsBeg hfOg24kDOijhXK/xD98CX0vnM5LH0RRJQpTIMzgL4FjhGpiSr1a/B62TfqQzG4VRrFGh DyyMNlNJre+hMvqfQJq6axvc9QgNdDmWRtjGs= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=L7ySiBOV6v4YVbOgXXN8Qe8bELIY9QXgwcfs0zDgPag=; b=q8pna4J8Ijdeh2P36uTz3oeOQ5IVH79bHS+/odDnE7thhCZWnpjuyN6wJEqP152x8D yL/g20GwoehU3WGICTujfWnw6dNv5GDn/WwzfAw+RLZUmA7w/LONP+/GIfAxS01tim3I VDh3tCrOp9T1jZSKw/MALfpJkuZy1P9+1ZllU1huq126MxlB88by++bUxmbkGQSq2Ky9 Nr/fWHJKo3qi/O5/2AkTFi+sJTM7ocvmA2a1jfFWxVZuB57jUbRGso6CkIGOZMDIy1Ho CaMnphZOp0Pmm79ttA+CcW41E4LngFJ6Nb1jC4onBetXBvOeVp6TYndjYvw8i9MVw9xN q4sg== X-Gm-Message-State: ABuFfoh9Gz+HzTLyWybIujyIpLdLPsTgVpmJ11r/rAD+k7F2YtH0ctDX wMfU0EAN3UaKOYw2so9Pt0QP3g== X-Google-Smtp-Source: ACcGV60wiZqY2GAAHuB8dVRXxVX21ZCdNKD4+f3L0+ECkVEDjM75VSrrNlXjDNbf5DbnaWLZH2ZYmg== X-Received: by 2002:a62:1095:: with SMTP id 21-v6mr25511922pfq.227.1539016339748; Mon, 08 Oct 2018 09:32:19 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id 3-v6sm29832077pga.12.2018.10.08.09.32.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 09:32:19 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Evan Green , Thierry Reding , Grygorii Strashko Subject: [PATCH 2/4] gpio: Drop parent irq assignment during cascade setup Date: Mon, 8 Oct 2018 09:32:14 -0700 Message-Id: <20181008163216.97436-3-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181008163216.97436-1-swboyd@chromium.org> References: <20181008163216.97436-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We want to set the irq parent for interrupts that we're setting up to be cascaded from another interrupt controller, but we may or may not have already mapped the gpiochip irqs into the kernel's virtual irq number space at this point. If we have mapped irqs before calling here, then we've gone through gpiochip_irq_map() and called irq_set_parent() already. If we haven't mapped irqs, then the gpiochip is dynamically mapping irqs and we can rely on gpiochip_irq_map() or the gpio driver's irqdomain ops to setup the irq parent properly. Either way, setting the parent here when cascading the gpiochip doesn't make much sense because it should be done at irq mapping time. In the dynamic mapping case, this code is mapping virq 0 to some parent virq in a loop. While that's benign, let's drop this code to simplify. Cc: Evan Green Cc: Thierry Reding Cc: Grygorii Strashko Signed-off-by: Stephen Boyd --- drivers/gpio/gpiolib.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d9d823e3761b..8fccfcf559ee 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1663,8 +1663,6 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip, unsigned int parent_irq, irq_flow_handler_t parent_handler) { - unsigned int offset; - if (!gpiochip->irq.domain) { chip_err(gpiochip, "called %s before setting up irqchip\n", __func__); @@ -1688,14 +1686,6 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip, gpiochip->irq.parents = &gpiochip->irq.parent_irq; gpiochip->irq.num_parents = 1; } - - /* Set the parent IRQ for all affected IRQs */ - for (offset = 0; offset < gpiochip->ngpio; offset++) { - if (!gpiochip_irqchip_irq_valid(gpiochip, offset)) - continue; - irq_set_parent(irq_find_mapping(gpiochip->irq.domain, offset), - parent_irq); - } } /** From patchwork Mon Oct 8 16:32:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 980659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="dvuJtZUp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42TQrH6m7Kz9sBh for ; Tue, 9 Oct 2018 03:32:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbeJHXoy (ORCPT ); Mon, 8 Oct 2018 19:44:54 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46244 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbeJHXow (ORCPT ); Mon, 8 Oct 2018 19:44:52 -0400 Received: by mail-pg1-f193.google.com with SMTP id a5-v6so8039517pgv.13 for ; Mon, 08 Oct 2018 09:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tY8fPC4eXBooeYgVdvops20KNuH1M9jYeuVvcX41Iac=; b=dvuJtZUp1ex/foNXzuJcf10hA+1KOk502yIcSVUEuRklbJEjFFcYXLma0kf0lR7SF3 yGGCEtUmw283vmV/x7NTUXXeZ3jGNhE16tAx6qjkH6zK/7x+4AmaVt14qHWsKur+ctpK tF9wNqqNS0zTUhXVnhw4Zf4boHHU+z8IlX91Q= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=tY8fPC4eXBooeYgVdvops20KNuH1M9jYeuVvcX41Iac=; b=eUfUAitjlfGcQQtuhJSqdwVexMx0S8iXkfmAqretSCw/sB24vhM6ACN3ceKlQ0OWyd N10lidh4I2cwH/J4r/wDFscjQFGryRHmMU1ic7YdODflyOGvYYRo+WH9SVxfSDR5DVDK EpNFTZrHaT26FT3I6rYIetlHtlSjF8a9owMyWZOpQ3753c/vtPMMXxL8yEVdomYANe0l HDM4QXVJfUlzuuQJd0ni5p87MIIxy4j1qQnFbHj3l8Oi84S+v44/JJJzjk2m1AN1XVE1 RauMs67jsonaBAtrihvw9b+arp3CjXqFMMHKNeF35plUWAwzRVcVtgXKoc17D9JycSWH jVuw== X-Gm-Message-State: ABuFfogbXVbMac9OUVXIsfB3GQmWH8rM89nsi4p42fpjBGWn7m8wtdrh 2+Jmu1WbDD9Xy6DGhBQvvR6uZw== X-Google-Smtp-Source: ACcGV60Ga0p7FllAN+U+wzL0C0Uaf6rL13TFSJPkE+mmxBMFUpcsUDkwBmf0hld4ScGlQ0H0dxnSaw== X-Received: by 2002:a62:7604:: with SMTP id r4-v6mr26150290pfc.230.1539016340463; Mon, 08 Oct 2018 09:32:20 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id 3-v6sm29832077pga.12.2018.10.08.09.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 09:32:20 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Evan Green , Thierry Reding , Grygorii Strashko Subject: [PATCH 3/4] gpio: Remove unused 'irqchip' argument to gpiochip_set_cascaded_irqchip() Date: Mon, 8 Oct 2018 09:32:15 -0700 Message-Id: <20181008163216.97436-4-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181008163216.97436-1-swboyd@chromium.org> References: <20181008163216.97436-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This argument hasn't ever been used since it was introduced in commit 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib"). Let's drop it to reduce reading confusion. Cc: Evan Green Cc: Thierry Reding Cc: Grygorii Strashko Signed-off-by: Stephen Boyd --- drivers/gpio/gpiolib.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 8fccfcf559ee..37c6fc73b179 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1651,7 +1651,6 @@ EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid); /** * gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip * @gpiochip: the gpiochip to set the irqchip chain to - * @irqchip: the irqchip to chain to the gpiochip * @parent_irq: the irq number corresponding to the parent IRQ for this * chained irqchip * @parent_handler: the parent interrupt handler for the accumulated IRQ @@ -1659,7 +1658,6 @@ EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid); * cascaded, pass NULL in this handler argument */ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip, - struct irq_chip *irqchip, unsigned int parent_irq, irq_flow_handler_t parent_handler) { @@ -1708,8 +1706,7 @@ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, return; } - gpiochip_set_cascaded_irqchip(gpiochip, irqchip, parent_irq, - parent_handler); + gpiochip_set_cascaded_irqchip(gpiochip, parent_irq, parent_handler); } EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip); @@ -1724,8 +1721,7 @@ void gpiochip_set_nested_irqchip(struct gpio_chip *gpiochip, struct irq_chip *irqchip, unsigned int parent_irq) { - gpiochip_set_cascaded_irqchip(gpiochip, irqchip, parent_irq, - NULL); + gpiochip_set_cascaded_irqchip(gpiochip, parent_irq, NULL); } EXPORT_SYMBOL_GPL(gpiochip_set_nested_irqchip); From patchwork Mon Oct 8 16:32:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 980660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="f4re+ohg"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42TQrM0pvwz9sBh for ; Tue, 9 Oct 2018 03:32:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbeJHXoy (ORCPT ); Mon, 8 Oct 2018 19:44:54 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43587 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbeJHXox (ORCPT ); Mon, 8 Oct 2018 19:44:53 -0400 Received: by mail-pg1-f195.google.com with SMTP id 80-v6so8055668pgh.10 for ; Mon, 08 Oct 2018 09:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TzKRxyCHqF26dJMlvbN+uiJtZzu1cpTCP8N1Afaqyeg=; b=f4re+ohgd8+bHH1zc1NzxEnZ/VIL946udSZFI13xHwdmXfEktAkaxM7XRDukmD6au1 xV1akM4i8SOVIgCLSFEIL+Q+nmmawUgQ2O8vAwz1zou7LniaemaBtqa39YaLnjRpf2ao T6D37JjWV40tz+UNbflvqzM/Y6TrRVmvWKUnM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=TzKRxyCHqF26dJMlvbN+uiJtZzu1cpTCP8N1Afaqyeg=; b=B4rHxFfXdfZWE5z5oNFkLSm3eiRPSkiqofLMBntj5ywnyXy1MdGRzNVSH7Fa+EaK+j y280hdgt7A+x661YtBW5hN+hN+QcQAVxuSmyvop6fVR1zgO+uCQqhamURMyuJ8M02jHS MI2q6WchPsuwsCxItNu1f+8z4/sNvT+i750EgaBcPYlvrs94DAdMOwAR9lwdyMLL2VrC c+SOQ01qQudvm06SlhUhLXUSnPfM/RT3+F7FLV1CG3nU68EFm7mhNDbsW9h0slMUOCHN akzWpLE1B081iV4ZPIG1FZMCZUmOjiiTgSfkblqd6KVjaMRgbq2XaOnXwK/DnfnEFAtn Yw7Q== X-Gm-Message-State: ABuFfojNXc7tAazh/FU5X+HKrfh+FFrGpXmY10oadoUHcFRDa/0xffVA vH3/8iK7VvPrsmiYVnKwQRpnbA== X-Google-Smtp-Source: ACcGV60JFCcBPzGRXo7vWlzrn7YlQ9Zo5EfwMG7KMCyFILUpD4xbhvGU21xGRez+6mGuriO3iiGBGw== X-Received: by 2002:a62:62c3:: with SMTP id w186-v6mr14937144pfb.5.1539016341266; Mon, 08 Oct 2018 09:32:21 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fed3:9637:a13a:6c15]) by smtp.gmail.com with ESMTPSA id 3-v6sm29832077pga.12.2018.10.08.09.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 09:32:20 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Evan Green , Thierry Reding , Grygorii Strashko Subject: [PATCH 4/4] gpio: Clarify kerneldoc on gpiochip_set_chained_irqchip() Date: Mon, 8 Oct 2018 09:32:16 -0700 Message-Id: <20181008163216.97436-5-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181008163216.97436-1-swboyd@chromium.org> References: <20181008163216.97436-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This doesn't support nested anymore, so drivers shouldn't call it with the handler set to NULL. Cc: Evan Green Cc: Thierry Reding Cc: Grygorii Strashko Signed-off-by: Stephen Boyd --- drivers/gpio/gpiolib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 37c6fc73b179..1729d0f698e7 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1693,8 +1693,7 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip, * @parent_irq: the irq number corresponding to the parent IRQ for this * chained irqchip * @parent_handler: the parent interrupt handler for the accumulated IRQ - * coming out of the gpiochip. If the interrupt is nested rather than - * cascaded, pass NULL in this handler argument + * coming out of the gpiochip. */ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, struct irq_chip *irqchip,