From patchwork Wed Jan 10 01:58:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 857874 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="V9xHxxx+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="kuSiuxW0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zGXHL412Bz9s7v for ; Wed, 10 Jan 2018 12:58:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933256AbeAJB6w (ORCPT ); Tue, 9 Jan 2018 20:58:52 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:42172 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933042AbeAJB6u (ORCPT ); Tue, 9 Jan 2018 20:58:50 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2772760BE5; Wed, 10 Jan 2018 01:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1515549530; bh=CSoHL4riaxUb5Lrr3WIr2g8ZZ+HNRvCbEq2moLjjl50=; h=From:To:Cc:Subject:Date:From; b=V9xHxxx+wCLASEnU5ei36dfEuNAIemHXqPd4WImkLHWIh2KrKLXQARmVPUZBotiSo VDM7LZlxgqzgLNK7g8OCWfOzg9Frv2cNaGqnUqW0tHIe55+Y/kB73dExJ3I9P8Zjo9 m2ttyTGAZQNOdrooiATd4weMTR2tXq/FRrEeXrcI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 43752605A2; Wed, 10 Jan 2018 01:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1515549529; bh=CSoHL4riaxUb5Lrr3WIr2g8ZZ+HNRvCbEq2moLjjl50=; h=From:To:Cc:Subject:Date:From; b=kuSiuxW0G70dyBU7cm32++q2rXwbtdXkCp9jftc85BCgTJG1MwHKODH+ifVDU2ndD lKO3Hjuv21KQeZAkduCLDbVjH2xNvAgMz0m28hXvsumZ5oJ3NiNJNwKlNdgqLQtJqN 4VZXGgb6HqOnau5XDcjhtxTNR6xRdD7IYnQRmRwA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 43752605A2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Timur Tabi , Andy Shevchenko , Bjorn Andersson , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 0/3] Support qcom pinctrl protected pins Date: Tue, 9 Jan 2018 17:58:45 -0800 Message-Id: <20180110015848.11480-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.15.0.374.g5f9953d2c365 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This patchset proposes a solution to describing the valid pins for a pin controller in a semi-generic way so that qcom platforms can expose the pins that are really available. Typically, this has been done by having drivers and firmware descriptions only use pins they know they have access to, and that still works now because we no longer read the pin direction at boot. But there are still some userspace drivers and debugfs facilities that don't know what pins are available and attempt to read everything they can. On qcom platforms, this may lead to a system hang, which isn't very nice behavior, even if root is the only user that can trigger it. The proposal is to describe the valid pins and then not allow things to cause problems by using the invalid pins. Obviously, the firmware may mess this up, so this is mostly a nice to have feature or a safety net so that things don't blow up easily. Stephen Boyd (3): gpiolib: Export gpiochip_irqchip_irq_valid() to drivers dt-bindings: pinctrl: Add a ngpios-ranges property pinctrl: qcom: Don't allow protected pins to be requested .../bindings/pinctrl/qcom,msm8996-pinctrl.txt | 6 ++ drivers/gpio/gpiolib.c | 5 +- drivers/pinctrl/qcom/pinctrl-msm.c | 98 +++++++++++++++++++++- include/linux/gpio/driver.h | 3 + 4 files changed, 106 insertions(+), 6 deletions(-)