From: Timur Tabi <timur@codeaurora.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-gpio@vger.kernel.org, Andy Gross <andy.gross@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: Sparse GPIO maps with pinctrl-msm.c?
Date: Fri, 16 Jun 2017 10:49:33 -0500 [thread overview]
Message-ID: <bac5136c-e98f-d6ef-bf30-0c22b01c1ac7@codeaurora.org> (raw)
In-Reply-To: <20170616154125.GK20170@codeaurora.org>
On 6/16/17 10:41 AM, Stephen Boyd wrote:
> On 06/16, Timur Tabi wrote:
>> On 6/16/17 10:07 AM, Stephen Boyd wrote:
>>> I'm not aware of anything in pinctrl-msm to support this.
>>
>> It seems to me like the 'npins' field in msm_pingroup should be
>> deleted, because it can only ever be 1.
>
> Ok. But does that change anything about this problem?
No, but at least no one would ever be fooled into thinking that you can
have sparse GPIO maps when using pinctrl-msm.
>> Unfortunately, thanks to https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pinctrl/qcom?id=8e51533780ba223a3562ff4382c6b6f350c7e9a4
>> we now read the direction of every pin at boot, and so we always get
>> an XPU violation early in the boot process.
>
> Oops. Why not allow read to work, but write to fail? Can the XPU
> be configured so it doesn't blow up when we read registers?
We debated that, and decided we really want to reject access to any
GPIOs that are "off limits". Our TLMM memory map was designed
specifically to allow this to be enforced.
> Otherwise, it sounds like some driver surgery is needed to
> indicate that the gpio number space has plenty of holes in it and
> that we should return failures for those protected pins.
I was thinking about adding support for "npins == 0", but I don't know
how to tell the pinctrl/gpio core that specific pins don't actually
exist. Is there a place where I can do something like this:
if (!g->npins)
return -ENODEV;
> We've already run into this problem on mobile platforms where
> certain pins are locked down and the approach has been to not
> care. But I don't think we have your patch yet, so you're the
> first one to run into this problem.
For now, I've decided that I'm just going to expose the qdss_tracedata[]
pins as GPIOs, numbered 0 .. n-1. However, there's no consensus on
that, either.
Being able to designate specific pins as absent would make everyone happy.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
next prev parent reply other threads:[~2017-06-16 15:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 23:35 Sparse GPIO maps with pinctrl-msm.c? Timur Tabi
2017-06-14 18:59 ` Timur Tabi
2017-06-16 15:07 ` Stephen Boyd
2017-06-16 15:15 ` Timur Tabi
2017-06-16 15:41 ` Stephen Boyd
2017-06-16 15:49 ` Timur Tabi [this message]
2017-06-16 16:06 ` Bjorn Andersson
2017-06-16 16:17 ` Timur Tabi
2017-06-16 16:21 ` Andy Gross
2017-06-16 16:26 ` Timur Tabi
2017-06-16 17:44 ` Bjorn Andersson
2017-06-16 18:10 ` Timur Tabi
2017-06-16 18:50 ` Bjorn Andersson
2017-06-16 19:07 ` Timur Tabi
2017-06-29 4:59 ` Bjorn Andersson
2017-06-20 23:10 ` Timur Tabi
2017-06-16 15:55 ` Bjorn Andersson
2017-06-16 16:07 ` Timur Tabi
2017-06-16 16:35 ` Bjorn Andersson
2017-06-16 18:42 ` Timur Tabi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bac5136c-e98f-d6ef-bf30-0c22b01c1ac7@codeaurora.org \
--to=timur@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).