Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp694703imm; Thu, 4 Oct 2018 01:36:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV60/pxhIbA8gequrq7cBQK7NMw2eDwuMIbNl5qj9Big20unC+jHHrkU9LgqrzmBE7yejn7bo X-Received: by 2002:a63:27c1:: with SMTP id n184-v6mr4837689pgn.278.1538642195879; Thu, 04 Oct 2018 01:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538642195; cv=none; d=google.com; s=arc-20160816; b=Jl1UR0kyXAXsvpJOzBoJ/H2HphSjf1Q4QumUVG3Y3TN0XhL2WqqACzip51n+reO9Ln 2f9MhVK3jggA/DK27jOQc+tylnSoyOHJwHS4igXuGXpaviG6PPpDU2n9/L4jV4aZ9Aky 7TEDxpSCZjMhZMOL/ynnzr/eMLMQJlKQay3DpapsXyxswR+fbY/h0CRgkSOc5jAlS5AH mXcu7mdSsfcZbYka8MuhCRvuP+OjBSrK8HiDeyF0oUoDSLaU2aSTBPUgiJj6V891Gy5w F3ejC7HQdGRWh3QHSlyGRycAVF0D30XU7EPqJJn4j1duHPLOCyPJE5sNPTCUSzapPGk9 BEBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2/WUmzkdF/fk4ktL33DmDmI0KxA3V7GEhh9xis7amoM=; b=JyJERPODySWrbJ3F7HOcx4EwauTjf4FefjA84C+RivfnIM8LLtv1MGi3fzntmHzsNQ FPipWL1UX3NMPMCBC6yLVIJU2bCXR9eDjAQL7gwuhiPTFW0SqbmFzeTZBTYHRnuSFaCn g6a9j+7e9ZoGwafAqDGy7JwCevjR27Emka9AvrXs34ReS0HP33Jl6hUyY5v8DN7gHsVw i6IBuhwVLQSSX/8k8c5qfiCzf7ZyfzbQH/sdsOZzNC5Xw9Q5NHto2oKU4Ft+/KM2mfnI s/D4kRyAbNU8eLK0TKMNZQQ/BhDv7EUIuIAAuUde/BVbabOJA2dMnQk1QbpOxqj3Y6uR FliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P4fXPgq/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si3606906pgi.178.2018.10.04.01.36.19; Thu, 04 Oct 2018 01:36:35 -0700 (PDT) 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=@linaro.org header.s=google header.b="P4fXPgq/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbeJDP0X (ORCPT + 99 others); Thu, 4 Oct 2018 11:26:23 -0400 Received: from mail-io1-f44.google.com ([209.85.166.44]:40689 "EHLO mail-io1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbeJDP0X (ORCPT ); Thu, 4 Oct 2018 11:26:23 -0400 Received: by mail-io1-f44.google.com with SMTP id w16-v6so7226833iom.7 for ; Thu, 04 Oct 2018 01:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2/WUmzkdF/fk4ktL33DmDmI0KxA3V7GEhh9xis7amoM=; b=P4fXPgq/JhwUfpIhImG/08BZV5FTR/HDqDMiLFFhd0UToAVUVmrhbGpF54texp90eb HzPGG4lnjqj02Fistx9oE7MFpHsg4UwJQ3oDDs8Cmz8hbuKBPfEhvghXckjY6WYvJGAb QjgA8Q9osldhAGEzgLqbL0Uc9pm81HzLIzM74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2/WUmzkdF/fk4ktL33DmDmI0KxA3V7GEhh9xis7amoM=; b=I9lIGLch/XXOkj1eFheSH6Z7gmk/JhsxqwYmyrKbZyw3LBfgiVBaQvCTpH++sfo7C0 aWq+xhDVpmx5lerShqn+oAA8wY23fiWHuJjvW0SJCysQLL14F4dGygfBAJkkkDsAYOcH GqkAFVCreOIMUsp2R3DOmVeNYsGzgpygZuejdc1HuYbEVt31dw6kKiIVyHsDAqlAPmRP rzQugswXZ9CCfRAoRKu9AfT9gCiQPKY00QTamShFo+jtSdUGxcNEK0w9fWUb/64/Qzr5 4WYmZRjk3jaIDcPoKWomx4QWliZQluwfr53hDia+14Hcw8sYneb/fr1k2a3SFsXflkEw qIew== X-Gm-Message-State: ABuFfog9k0QxUY7hOhxj+ZbbRt4li5l727qPar1qPiXZ/x+t8EUk8kmj WE18HLuQidWUKF16x/3KSHl49Kt9VEx1AFE/YJRimQ== X-Received: by 2002:a6b:630a:: with SMTP id p10-v6mr3738422iog.175.1538642054940; Thu, 04 Oct 2018 01:34:14 -0700 (PDT) MIME-Version: 1.0 References: <9aec322678417753fe4022691f4bfdbe@codeaurora.org> In-Reply-To: <9aec322678417753fe4022691f4bfdbe@codeaurora.org> From: Linus Walleij Date: Thu, 4 Oct 2018 10:34:03 +0200 Message-ID: Subject: Re: protected pins and debugfs To: psodagud@codeaurora.org Cc: Stephen Boyd , "open list:GPIO SUBSYSTEM" , Bjorn Andersson , "linux-kernel@vger.kernel.org" , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 3, 2018 at 2:38 PM Sodagudi Prasad wrote: > This is regarding the protected pins configuration reading and printing > from non-secure operating systems. I do not think anyone with security in mind should have debugfs enabled. But maybe that is beside the point. > GPIO framework is checking whether pin is in use(flag FLAG_REQUESTED) or > not in gpiolib_dbg_show(). > > If GPIO chip drivers are overriding the dbg_show callback, drivers are > not checking whether a pin is really in use or not to print > configuration details. > if (chip->dbg_show) > chip->dbg_show(s, chip); > else > gpiolib_dbg_show(s, gdev); Ah that is right. Because some drivers can inspect all pins whether they are requested or not. > Can we use a simple/common solution like below? It will check whether a > pin is in use or not before printing configuration data with the help of > gpiochip_is_requested(). In the msm case I think maybe you want to inspect the valid_mask instead, so you display debugfs info for all pins you can inspect in hardware but avoid the "invalid" ones which I half-guess is used by ACPI in your case. Yours, Linus Walleij