Received: by 10.223.176.46 with SMTP id f43csp49662wra; Thu, 25 Jan 2018 17:15:30 -0800 (PST) X-Google-Smtp-Source: AH8x224lTPG2AUaEdN+OrDkPcq8rTFJXUfaCMgqSKawO4gCxUkSlUplRsWazfWA7oZD++WTLL7cg X-Received: by 10.99.36.68 with SMTP id k65mr14756512pgk.345.1516929330155; Thu, 25 Jan 2018 17:15:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516929330; cv=none; d=google.com; s=arc-20160816; b=X2dZz9y2F+rvDaLCvkac1eLznSOQAjiWVfmkNxRk/gDw2weeRmD/p1qLmSfk61wPjT pxIJ2G+ucHZYqzZX+t6DcYgpCz6aknawW7iuPaBEOvwj53aApYS8JP6qsWLONnQI0o2e 5M5/uzxjOGnPasE3xohx1/7zyQilDdGqWE4HJatG660aXQJEz+0jTqwDrElU9cwV1jWm fs8WyTgnES3zb7u5lEpTs3z/eAtvrsakpBWMCkek622DVj5IswaS3Yi5OOIrmF16Kwwu uh9cv7o2Mi0LKsSpst1tpBsskydoZBb4aNvnETQw9MFOL3BMXAHV15XKjQk1gc2hcBJo Y9RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=7eKDCzZfk4sGLwmOZbs1eoR4Akg6YPdbDGRFv1eSx14=; b=xHVab+UEJUHZHky85280OLKSJ6ZnIzJLKXFtQWIolD2/2XKnsxcLUwnD5HI7s47u5K LJ+LzEm9nmLE+sYEVIN/BMxqM0TkX1U7t9fnE4i4mv6b3N0Hiw9VIgDDkYPujftGbqXl hblvM6F09GY04uc8gCT5lZOEFx9fcZH8GREA8QqicGJR9bftabW7NxrfzwKEFY2Cw3v/ Q+b55ETFgrbFnZabbFFn9wxz2asGmYs1lFY9dbcSdPlkBCY0eVmIsh+ibYoFOkRF/zvc guzkuHNVArL5Rv53WM9jHxMhsCS27Q4KeOT4UxUX3C6p/QmyOYv1PPv3mkF05MDG35uT J1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IjPiTEoG; dkim=pass header.i=@codeaurora.org header.s=default header.b=XrD1ZzUP; 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 l7si2274271pgs.316.2018.01.25.17.15.15; Thu, 25 Jan 2018 17:15:30 -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=@codeaurora.org header.s=default header.b=IjPiTEoG; dkim=pass header.i=@codeaurora.org header.s=default header.b=XrD1ZzUP; 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 S1751667AbeAZBOF (ORCPT + 99 others); Thu, 25 Jan 2018 20:14:05 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39214 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeAZBOC (ORCPT ); Thu, 25 Jan 2018 20:14:02 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4B30960A63; Fri, 26 Jan 2018 01:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516929242; bh=+2e71OnH57Maj0Ev+SlTN7HJIbr0TqQXalIBWFqXUfY=; h=From:To:Cc:Subject:Date:From; b=IjPiTEoG1wkxNkYTiD1+QvFOBLYFt/eaboy3T59Li4I46D9xqt7JYNOv5jTtwN0X4 yEEDC090VGlUAJsAtZ1DaEZzR/z98XzNL3XgSoAoKAmjvIrmNa0ESAUYhBDEHk00Z9 xLjgOuj6Rn1vE3jxx34sxB7zBk//DYkLATsEJY9w= 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 442686032C; Fri, 26 Jan 2018 01:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516929241; bh=+2e71OnH57Maj0Ev+SlTN7HJIbr0TqQXalIBWFqXUfY=; h=From:To:Cc:Subject:Date:From; b=XrD1ZzUPOAkuk7bMHiC/UM7YZmXenAJGNVpfCYeR9cOYp30pk2glt2xHLkrlMJyLn I0aDKL3mEpy6qj5apo09Xw1LLqncoVihZ4FpM6HnHbwm+FBvhadBkOo3MzaFkzXGI9 0pNTCnO3DE54z3dLGB0Qyj8Kg29BbN8E6U4bR4oU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 442686032C 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, Grant Likely , devicetree@vger.kernel.org Subject: [PATCH v2 0/3] Support qcom pinctrl protected pins Date: Thu, 25 Jan 2018 17:13:57 -0800 Message-Id: <20180126011400.2191-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.15.0.374.g5f9953d2c365 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Changes from v1: * Pushed into gpiolib-of core under irq valid line logic * Fixed up qcom driver patch to free stuff properly and remove custom code * Dropped export patch as it got picked up * Renamed binding to 'reserved-gpio-ranges' Stephen Boyd (3): dt-bindings: pinctrl: Add a reserved-gpio-ranges property gpiolib-of: Support 'reserved-gpio-ranges' property pinctrl: qcom: Don't allow protected pins to be requested Documentation/devicetree/bindings/gpio/gpio.txt | 7 +-- drivers/gpio/gpiolib-of.c | 28 ++++++++++ drivers/gpio/gpiolib.c | 9 ++++ drivers/pinctrl/qcom/pinctrl-msm.c | 69 +++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 7 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project