linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Greg KH <gregkh@linuxfoundation.org>, Jolly Shah <JOLLYS@xilinx.com>
Cc: "ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"matt@codeblueprint.co.uk" <matt@codeblueprint.co.uk>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
	Michal Simek <michals@xilinx.com>, Rajan Vaja <RAJANV@xilinx.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] firmware: xilinx: Add sysfs interface
Date: Fri, 24 Jan 2020 11:32:39 +0000	[thread overview]
Message-ID: <20200124113239.GB40307@bogus> (raw)
In-Reply-To: <20200124060339.GB2906795@kroah.com>

Hi Greg,

Thanks for raising various issues that I have repeatedly asked and
constantly ignored.

On Fri, Jan 24, 2020 at 07:03:39AM +0100, Greg KH wrote:
> On Thu, Jan 23, 2020 at 11:47:57PM +0000, Jolly Shah wrote:
> > Hi Greg,
> >

[...]

> > Firmware driver was changed later to be platform driver but these
> > interfaces were defined earlier and are in use.
>
> Defined and in use where?  Not in the upstream kernel tree, right?  Or
> am I missing them somewhere else?
>

Exactly and they keep saying there partners are using these for 3-4 years
and they want to retain that. I have told them to change several times.

> > > > +	ret = kstrtol(tok, 16, &value);
> > > > +	if (ret) {
> > > > +		ret = -EFAULT;
> > > > +		goto err;
> > > > +	}
> > > > +
> > > > +	ret = eemi_ops->ioctl(0, read_ioctl, reg, 0, ret_payload);
> > >
> > > This feels "tricky", if you tie this to the device you have your driver
> > > bound to, will this make it easier instead of having to go through the
> > > ioctl callback?
> > >
> >
> > GGS(general global storage) registers are in PMU space and linux doesn't have access to it
> > Hence ioctl is used.
>
> Why not just a "real" call to the driver to make this type of reading?
> You don't have ioctls within the kernel for other drivers to call,
> that's not needed at all.
>

Oh yes, this is so broken in design. This firmware is designed to abstract
the power and configuration management on their platform, but they decided
to add direct register access to some registers anyway. Weird use case,
don't even ask. But I strongly objected such interface in sysfs even if
they moved under platform device. If they need this at any cost, I have
suggested debugfs.


[...]

> >
> > Agree it will be simpler but to as firmware driver was changed to be
> > platform driver, to keep paths same, we used sysfs.
>
> Keep them same from what?  Use the platform device as that is what it is
> there for, do not go create new apis when they are not needed at all.
>

+1, and please don't add any sysfs that can read/write those GGS registers
directly from userspace. Move them to debugfs if you are desperate to have
something.

--
Regards,
Sudeep

  reply	other threads:[~2020-01-24 11:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 23:54 [PATCH v2 0/4] firmware: xilinx: Add xilinx specific sysfs interface Jolly Shah
2020-01-08 23:54 ` [PATCH v2 1/4] firmware: xilinx: Add " Jolly Shah
2020-01-14 14:52   ` Greg KH
2020-01-23 23:47     ` Jolly Shah
2020-01-24  6:03       ` Greg KH
2020-01-24 11:32         ` Sudeep Holla [this message]
2020-01-27 22:46           ` Jolly Shah
2020-01-27 23:01         ` Jolly Shah
2020-01-28  6:28           ` Greg KH
2020-01-30 23:59             ` Jolly Shah
2020-01-31  6:10               ` Greg KH
2020-01-31  9:05                 ` Rajan Vaja
2020-01-31  9:36                   ` 'Greg KH'
2020-02-11  0:57                     ` Jolly Shah
2020-02-14 17:10                       ` 'Greg KH'
2020-02-15  0:37                         ` Jolly Shah
2020-02-15  0:52                           ` 'Greg KH'
2020-02-19 22:50                             ` Jolly Shah
2020-03-06 23:55                             ` Jolly Shah
2020-03-07  8:47                               ` 'Greg KH'
2020-01-08 23:54 ` [PATCH v2 2/4] firmware: xilinx: Add system shutdown API interface Jolly Shah
2020-01-08 23:54 ` [PATCH v2 3/4] firmware: xilinx: Add sysfs to set shutdown scope Jolly Shah
2020-01-08 23:54 ` [PATCH v2 4/4] firmware: xilinx: Add sysfs and IOCTL to set boot health status Jolly Shah

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=20200124113239.GB40307@bogus \
    --to=sudeep.holla@arm.com \
    --cc=JOLLYS@xilinx.com \
    --cc=RAJANV@xilinx.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=michals@xilinx.com \
    --cc=mingo@kernel.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).