Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp166567rwo; Tue, 1 Aug 2023 14:58:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlFH6UWCMTNOIS7CYgvMZcI0MFprocaCRt4gl/rx0CB7Y32W7Fy0jl0dXegVLyLf2QOPvX/Z X-Received: by 2002:a17:902:ecd2:b0:1bb:141c:3034 with SMTP id a18-20020a170902ecd200b001bb141c3034mr15637331plh.12.1690927109984; Tue, 01 Aug 2023 14:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690927109; cv=none; d=google.com; s=arc-20160816; b=m3Y4JIhBnhjlAFxhCyo8D085rou+8CnqzQezty61ztR3CYbIjsXP2qlvrEThr+zvTL EkafT+Lxd4JCrStuGWLQWVRTmLiOGxpdToOnT+oilFrqhIPnKvNcJjAm0lKdGc2cMepG n47pCcPd+WKtrZSdbyCcY/n0smprlECUTPUW8V+K0cUCfVD5kotQnxz5Ly6PNVLWZEPg mCUGyYhwUqen9+XlaEGIKhZ680E2VVFr8uZ2a91vNWP9tgDlz9P00sR7OF+QWwH6xsCl 5F2wxhIg2NVHZOlipoOa/ESOSkPO0EjNYvFUFXxkgPLMmn5grvjYt+5iPJA8UUhnSoR/ eggA== 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=EmKT/3Oo08LVt2NMcE4zYHICX9fi+Y9rB10UuqFHh6o=; fh=rCqKS5Wgxyvu9nhWEkn7CU+OTiPpAXAWtEe1ogm7zOc=; b=xEx8IhW8mww8dJcXe+UU9zDtFIf8GU6sPv7B5ftCshdnEaf2EPzjolt8ROUNwzoq1S getrXQmoKn5tGLFmqlsgdppZkc8fsfJdjyDAeNnnY39T4SJrl3G7qGoTyVcbe6pJgJuZ Lu9bzuICXD6+0qF5SIErm6MDpmN0riDgguFAfjNjYiv8z7CmXL7Txcouo/g/gGpMmAhP gb0aMMPSBqMjlDmbc06+LGTwAkMmENagUmhBZGviCg1xpVTSvOPT9RazFTotC+l1JCle Eien7Ch0GkQuFqZQA1vM32NvQ4mNVA8YnkbWGZBpq0oL6l1d7oNCWvd3VsvE1HCDojfP u9qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=3XmUC0Q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kx15-20020a170902f94f00b001b81fe65fa3si9573179plb.569.2023.08.01.14.58.16; Tue, 01 Aug 2023 14:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=3XmUC0Q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230349AbjHATKW (ORCPT + 99 others); Tue, 1 Aug 2023 15:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjHATKL (ORCPT ); Tue, 1 Aug 2023 15:10:11 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E397F1BF5 for ; Tue, 1 Aug 2023 12:10:07 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b9dc1bff38so53851371fa.1 for ; Tue, 01 Aug 2023 12:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1690917006; x=1691521806; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EmKT/3Oo08LVt2NMcE4zYHICX9fi+Y9rB10UuqFHh6o=; b=3XmUC0Q8brIbSP5QuPUb5aCeMXEYVuPPHRsqiVwfMw7t0L0vSOAtXNu/IpKQWrgZcp XdAZIrwx251SEbk2Gs228dtggMwI2b6Wbqlga3hBpQZ690/YjN+nLvCFQ91Ji/6NjAMM GkOAguMx8smqBM5ca1oGT3YvIzfTuE20vpU/PECgVBNFDcrV+Xkky0iaZgh6T8jvftqi yM2Vt1bZ1ZjKwoU9OUQ6SRU40tU9D4ORF+kuHQGJrv2fv/sxcaFeuMKqRFL6sTdDVKZC EoBerXZWbyZ8GOiLWCmLEycttWfScXxFqyAHEj9E/R1JvZYa8XjwWCXRZemEoHoC+esM IPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690917006; x=1691521806; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EmKT/3Oo08LVt2NMcE4zYHICX9fi+Y9rB10UuqFHh6o=; b=EPXnX71xmhluPF73SCuvHsTTfTaP+0prL8BPHm7b++biPXMNSuIdtZtE0mkI3u3deK qfYjlMfC7VIJbDoDKxVP27zXiyo92ekEoMh9WJ1J5OfB5oljVD0OUjN10WgcqzM3iKB8 /OZSdj3WqfNQMi+ROCpV4wT4oaNbXPgYut3zXD4OrUOcWys3bA6MJZr9eh9PWK2f95lE tBl4Fj/4u0Bl3ARl1JtaH8NdHRWv1BVsX4uF9cUyKDnP3g+VCBLvMIbzbsb9jNpvLj2L szYoTVEDmbxj+xDGHnZvFklo9aQXU4eV6zFIx1mrmL7JspzWDwAFXHVTy8qmxflezgQA 9AqQ== X-Gm-Message-State: ABy/qLYXEJcvPtV6nwO/Kd9WZa281Jk2v8Kyx5hNGBXya4X1VyG8WGcj f+j9trYP+JN9JYhMYNTrfzUlRg== X-Received: by 2002:a2e:9903:0:b0:2b9:b904:74d7 with SMTP id v3-20020a2e9903000000b002b9b90474d7mr3219510lji.18.1690917006011; Tue, 01 Aug 2023 12:10:06 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:f283:106b:b69e:b5a]) by smtp.gmail.com with ESMTPSA id l27-20020a05600c1d1b00b003fe1b3e0852sm5075713wms.0.2023.08.01.12.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 12:10:05 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Kent Gibson Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] gpio: sim: mark the GPIO chip as a one that can sleep Date: Tue, 1 Aug 2023 21:09:51 +0200 Message-Id: <20230801190951.51818-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski 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. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index cfbdade841e8..5f8723ad0048 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -429,6 +429,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev) 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) -- 2.39.2