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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBCAFEB64DD for ; Sun, 13 Aug 2023 21:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231929AbjHMVcJ (ORCPT ); Sun, 13 Aug 2023 17:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231919AbjHMVcI (ORCPT ); Sun, 13 Aug 2023 17:32:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D27D1BE6 for ; Sun, 13 Aug 2023 14:31:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B288262B65 for ; Sun, 13 Aug 2023 21:31:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C703CC433C8; Sun, 13 Aug 2023 21:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691962289; bh=RhN5dxa9dAVE0lIPdwm029qDqOJf0KaPlahGeiu5+2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QfIxX1Z7BXdjYOlzVUITPmAjsUE/Mer+L5qNt2GChFcqqOkYChwZ95GRpkAQatJ5g 1P/krkwSptakxYmcgVSLeEJzaRs7wiPPZU5fIDtPpTxBHfRKFEacQzJJ7FDNvZnTeC WAn2Y/+StWvWiBDrAH/R4wsXrLOM9HzSWGqPToNc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bartosz Golaszewski , Andy Shevchenko , Linus Walleij Subject: [PATCH 6.4 181/206] gpio: sim: mark the GPIO chip as a one that can sleep Date: Sun, 13 Aug 2023 23:19:11 +0200 Message-ID: <20230813211730.203404591@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230813211724.969019629@linuxfoundation.org> References: <20230813211724.969019629@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bartosz Golaszewski commit 5a78d5db9c90c9dc84212f40a5f2687b7cafc8ec upstream. Simulated chips use a mutex for synchronization in driver callbacks so they must not be called from interrupt context. Set the can_sleep field of the GPIO chip to true to force users to only use threaded irqs. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-sim.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -429,6 +429,7 @@ static int gpio_sim_add_bank(struct fwno gc->set_config = gpio_sim_set_config; gc->to_irq = gpio_sim_to_irq; gc->free = gpio_sim_free; + gc->can_sleep = true; ret = devm_gpiochip_add_data(dev, gc, chip); if (ret)