linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: skannan@codeaurora.org (Saravana Kannan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC] clk: Introduce userspace clock driver
Date: Fri, 10 May 2013 16:25:45 -0700	[thread overview]
Message-ID: <518D81F9.1090105@codeaurora.org> (raw)
In-Reply-To: <82612ce3-3be2-46fe-925c-3aa6ca743e7d@CO1EHSMHS004.ehs.local>

On 05/10/2013 04:06 PM, S?ren Brinkmann wrote:
> On Fri, May 10, 2013 at 04:01:25PM -0700, Saravana Kannan wrote:
>> On 05/10/2013 03:18 PM, Mike Turquette wrote:

>>> I think that Soren wants something with a stable interface that he can
>>> use for his Zynq use case.  Regarding that, why not write an actual
>>> device driver to do what you want to do from userspace?
>>
>> Exposing clock control to userspace production use is a terrible
>> idea. A misbehaving userspace can easily kill the system. This is
>> not so try for GPIO. So, exposing GPIOs to userspace is relatively
>> less of a concern.
> Well, the FPGA clocks are only used by stuff in the FPGA. They cannot
> mess up the Linux on the A9s. I my use-case is kinda special. And people
> request functionality to easily adjust the frequency for their FPGA
> design in SW from Linux.

How do you talk to the FPGA? What happens if the FPGA clock gets turned 
off when the Linux is communicating with it? At the least the I2C or 
whatever bus you used to talk to it could hang. You need to explain more 
about why it's "special" before people might turn around to give 
userspace ABI for clock control.

> Nevertheless, there is no real protection from taking the driver I'm
> proposing to control the FPGA clocks to control a clock vital to the
> system.

If we are talking about changing the kernel to control different clocks, 
that true for any driver.

If your idea of this driver was something that will take a clock name 
and rate and change that clock's rate, then that's not a good design. 
What Mike probably meant was a FPGA specific driver that will only 
clk_get() the clocks related to the FPGA, and expose options to 
userspace. Not the actual rate or enable/disable capability.

For example, opening the device could cause clk_prepare_enable() and 
closing it would cause clk_disable_unprepare(). You might have ioctls to 
let userspace pick one of different modes of operation with each 
corresponding to a different clock rate and other corresponding FPGA 
configuration changes, etc. That's just a rough sketch. If you write 
such a driver, userspace can't misuse it to mess with other clocks or 
leave the FPGA clock in a bad state.

-Saravana

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

  reply	other threads:[~2013-05-10 23:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 17:31 [PATCH RFC] User space clock driver Soren Brinkmann
2013-05-10 17:31 ` [PATCH RFC] clk: Introduce userspace " Soren Brinkmann
2013-05-10 17:44   ` Emilio López
2013-05-10 18:15     ` Sören Brinkmann
2013-05-10 18:49       ` Emilio López
2013-05-10 22:18         ` Mike Turquette
2013-05-10 23:01           ` Saravana Kannan
2013-05-10 23:06             ` Sören Brinkmann
2013-05-10 23:25               ` Saravana Kannan [this message]
2013-05-10 23:36                 ` Sören Brinkmann
2013-05-11 14:21             ` Mark Brown
2013-05-16  4:23               ` Saravana Kannan
2013-05-16 18:21                 ` Mark Brown
2013-05-10 23:08           ` Sören Brinkmann
2013-05-13  8:31           ` Peter De Schrijver
     [not found]   ` <CAHp75Vcr10d=XesGQvrC_v+ijdp3nK+m=w5E7d6GCo1Z9ogWnw@mail.gmail.com>
2013-05-10 18:03     ` Sören Brinkmann
2013-05-10 21:24   ` Mark Brown
2013-05-11 16:54     ` Sören Brinkmann
2013-05-12 14:33       ` Mark Brown
2013-05-12 19:05         ` Sören Brinkmann
2013-05-13  5:21           ` Mark Brown
2013-05-13 16:09             ` Sören Brinkmann
2013-05-13 16:21               ` Sebastian Hesselbarth
2013-05-13 17:24                 ` Sören Brinkmann
2013-05-13 17:37                   ` Sebastian Hesselbarth
2013-05-13 17:58                     ` Sören Brinkmann
2013-05-13 18:18                       ` Sebastian Hesselbarth
2013-05-14 16:46                       ` Mike Turquette
2013-05-14 18:09                         ` Philip Balister
2013-05-15  4:46                           ` Mark Brown
2013-05-16  4:28                             ` Saravana Kannan
2013-05-16 14:44                               ` Philip Balister
2013-05-16 17:26                                 ` Mark Brown
2013-05-16 18:55                                   ` Sören Brinkmann
2013-05-17 11:02                                     ` Mark Brown
2013-05-13 18:16                 ` Mark Brown
2013-05-13 18:20                   ` Sebastian Hesselbarth
2013-05-13 18:44                     ` Mark Brown

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=518D81F9.1090105@codeaurora.org \
    --to=skannan@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).