Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2720126imj; Mon, 18 Feb 2019 10:54:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ5maMFKP50ahHgWOE0bNoDQzZYLQSeoL5efpxKRyWPhwWztY3pYe7/OE9lXpq5Qup6PYl7 X-Received: by 2002:a17:902:ba85:: with SMTP id k5mr26678546pls.130.1550516059257; Mon, 18 Feb 2019 10:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550516059; cv=none; d=google.com; s=arc-20160816; b=JI0oSYog6KnzcRwcRoTU9oRXZJrCkinhR3EeHZTajBJSQBHVsbjM4D0K9teoADHOI9 eoZBiMfOtAzttFBeGn8djQvdQw1F545XJFvWadtazc8liMT+/FOO4c7cbNthhLE/WZXu YIE+gUZR75Xbd4Q1nYPmIrTIqiR8+WMJ3PRkDmxaHI11PScco4iW8vwRBec+Y69msFJ9 kyk7vvqp/QAEC4TrLUZJKb1cIvlWOtc+sVoyTbsgjx4HOYS7dOR+hSw9SucCpoA5qQGe B2HYzYcCe6zFBZYnOgwurZXMmfU+anFHyAFNzedchtdOtZJO0RGYm5riwyosBLlJbInh FGYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=67spD6XAyVso08RyDm9g/Aby9TDa5GOGUS0SopZDEuY=; b=E2LOj390j3KkX681teAjqWweony4eGlyFS+ayoF0aSA9JQ7ZJCPSirB5LUG0V0K+F/ uUKdRDMf+gz2zK5tjb1fDhtkj+8Dk+YZZVqoA00rBMyj44Ls/YaJleSHF8mNJpQlmtL7 VKFuPEPW1qwpZMALRnvEIkUiYxnj+sxMnjMwZH/xj+FUnIqQL6zH9pVCJtlO29hXTecE f+16OZcc5hexyts4xRM05b6UxjbiNDdKu52P5hSkOF4pUODzWMtrFykvk5xiNbg8nab2 al2rglbWgTemhwwb2N6DIR70PGZtId0yhZukESe8qKhCm8QM8MqT+Vwi73GFx84DIn/0 wS4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Mvv7Gztu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si14105417plo.59.2019.02.18.10.54.03; Mon, 18 Feb 2019 10:54:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Mvv7Gztu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389816AbfBRQlp (ORCPT + 99 others); Mon, 18 Feb 2019 11:41:45 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53729 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733253AbfBRQlo (ORCPT ); Mon, 18 Feb 2019 11:41:44 -0500 Received: by mail-wm1-f67.google.com with SMTP id d15so18089350wmb.3 for ; Mon, 18 Feb 2019 08:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=67spD6XAyVso08RyDm9g/Aby9TDa5GOGUS0SopZDEuY=; b=Mvv7GztuSOZBiaR/Btm6mFtsfJ7G5KE5SooL+0wCDsxc9FiqaedNEFPASyiNe07f5q qREtMOPSasAhBp9nC2yjfAO85WJU8WOJQ2EICBJO8HV1npBXvrv9fk4aUdVxJfcJbDz+ 5ImKHJBnufSNpvS6OUYiR8amIJhIHknSfdyLc9Elz+Z8Uuew5DKfNytRLF0XlPbAroBw WC9cp3BunSGYGpYwj51KAhrW6f93P6LmS5HGQz2dsfmhgn/i5LaCUtO/4ou5fPAZgaaJ 5AJmSCJEtwIymNX3tRp6GCDnM5NmsDv4ymYPkp2wWTM5faqXUwZzxCb9wrYsE86j52cv g0YQ== 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=67spD6XAyVso08RyDm9g/Aby9TDa5GOGUS0SopZDEuY=; b=OnUPduipUEKDjYX4QsfDk86k8ASYESVWIZAyTinmyYH9Qrwsvg0tpOg2CWxxqZ/vi8 VEGGPq7by6s1+VajT05BH/QBitB6LDUjww/QnuFFfUn+ahpL3OvC+TNtsUd1urKEOiYU 5K4kH9PdEhH2prNahnpug2hTbsV+5MDDoGUx4GTOT91BQA/RLM7sZ6FUnE8bVsPyh5/Y GeGNSCH48Zzq0HGtX/kHLYWZy4wBmngiwiFYY/P67wol0Q/k9i8uoIu0yMLe3z8WxQCL /loVnA6TUNFLn5S+FRfUgIzkAQjfeTfcrj33Z9RC8VMUddapimevCMBhIvRUeveHDnDk 2r4g== X-Gm-Message-State: AHQUAuacffKWSaFd710YU/ufwGIhEM7snhPKksnKpeGEg7NwQZ8qorXT xWRmvpcqDc5eYXRUh34/wtu6dQ== X-Received: by 2002:a1c:a3c3:: with SMTP id m186mr16458016wme.16.1550508102373; Mon, 18 Feb 2019 08:41:42 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-7-43.w90-86.abo.wanadoo.fr. [90.86.124.43]) by smtp.gmail.com with ESMTPSA id w10sm6325442wru.5.2019.02.18.08.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 08:41:41 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Thomas Gleixner , Marc Zyngier , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v5 0/7] gpio: mockup: improve the user-space testing interface Date: Mon, 18 Feb 2019 17:41:31 +0100 Message-Id: <20190218164138.24921-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Hi Marc, please take a look at another, much simpler approach. The only change in irq_sim is calling the irqd_set_trigger_type() in irq_set_type(). We don't care about the actual type - we simply store it and any interested user (for example gpio-mockup in this series) can retrieve it using irq_get_trigger_type() and interpret it on its own. v1 -> v2: - instead of providing the irq_sim_get_type() helper, move the irq type logic into the simulator and provide a helper that allows users to specify the type of the fired interrupt v2 -> v3: - switch back to having irq_sim_type() and put the line state logic into the GPIO testing module v3 -> v4: - drop irq_sim_get_type() and use a notifier chain instead so that any change in type configuration can be pushed out to interested users - change the locking mechanism in gpio-mockup to a spinlock as we can't take a mutex when a hardirq-safe spinlock in irq_desc is being held when the irq_set_type() callback is called - refuse to set any other type than falling or rising edge in irq_set_config v4 -> v5: - drop the notifier, use irqd_set_trigger_type() instead Bartosz Golaszewski (7): irq/irq_sim: add irq_set_type() callback gpio: mockup: add locking gpio: mockup: implement get_multiple() gpio: mockup: don't create the debugfs link named after the label gpio: mockup: change the type of 'offset' to unsigned int gpio: mockup: change the signature of unlocked get/set helpers gpio: mockup: rework debugfs interface drivers/gpio/gpio-mockup.c | 189 +++++++++++++++++++++++++++++++------ kernel/irq/irq_sim.c | 8 ++ 2 files changed, 170 insertions(+), 27 deletions(-) -- 2.20.1