From: Greg KH <gregkh@linuxfoundation.org>
To: Kumaravel.Thiagarajan@microchip.com
Cc: michael@walle.cc, Tharunkumar.Pasumarthi@microchip.com,
UNGLinuxDriver@microchip.com, arnd@arndb.de,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
srinivas.kandagatla@linaro.org
Subject: Re: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch
Date: Thu, 16 Feb 2023 12:49:15 +0100 [thread overview]
Message-ID: <Y+4YO7HSmETanIU2@kroah.com> (raw)
In-Reply-To: <BN8PR11MB3668C37EFBB42FB3FFC7618FE9A09@BN8PR11MB3668.namprd11.prod.outlook.com>
On Thu, Feb 16, 2023 at 11:39:12AM +0000, Kumaravel.Thiagarajan@microchip.com wrote:
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Wednesday, February 15, 2023 5:15 PM
> > To: Kumaravel Thiagarajan - I21417 <Kumaravel.Thiagarajan@microchip.com>
> > Subject: Re: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add
> > OTP/EEPROM driver for the pci1xxxx switch
What is this header for?
Please fix your email client to not add this to the body of the text...
> > > > Greg & Michael, I do not want to expose the entire or even partial
> > > > set of device registers to the user space access directly for safety
> > reasons.
> >
> > But that's all exposed here through this block device, right?
> The block device created by this driver does not expose the device registers to the user space applications.
What is it exposing?
And please use line-wrapping :)
> The device hardware provides separate set of registers to read and write into the OTP memory and EEPROM.
> The driver uses these hardware registers and abstracts the programming logic inside and exposes the only the memory as devices to the user space.
What memory is being exposed? And how?
> I don't have any user program to program the device. I use the Linux dd command only.
> If I want to view the contents of the memory, I can use any hex editor tool in Linux this way.
Exposing the memory of a device as a block device is not normal, it
should just be mmapped, right?
> > And this is already exposed to userspace today, no need to add anything the
> > kernel already provides this.
> Can you explain this? Are you referring to any sysfs directories / files? What is the necessity to do this? I am trying to understand this.
PCI device accesses can go through userspace directly. Is this just
memory mapped in your PCI device?
> If this is for any debug purpose and whether kernel does this under some conditional compilation or is that the default behavior?
Is this only for debugging? If so, please document it as such so that
no one accidentally enables it as a valid build option.
> Even if the user is a super user, should he be allowed to access the device hardware registers mandatorily. It should depend on the policy the system owner want to adopt. Right?
Again, is this PCI memory that can be accessed directly?
And again, a block device is very odd, that is not the normal way to
access a device's memory.
thanks,
greg k-h
next prev parent reply other threads:[~2023-02-16 11:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-12 3:57 [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch Tharun Kumar P
2023-02-12 7:09 ` Greg KH
2023-02-12 7:52 ` Tharunkumar.Pasumarthi
2023-02-13 12:00 ` Michael Walle
2023-02-14 6:25 ` Tharunkumar.Pasumarthi
2023-02-12 8:02 ` Christophe JAILLET
2023-02-14 6:37 ` Tharunkumar.Pasumarthi
2023-02-14 6:52 ` Tharunkumar.Pasumarthi
2023-02-14 8:28 ` Michael Walle
2023-02-15 4:37 ` Kumaravel.Thiagarajan
2023-02-15 8:20 ` Michael Walle
2023-02-15 8:58 ` Greg KH
2023-02-15 9:48 ` Kumaravel.Thiagarajan
2023-02-15 9:56 ` Kumaravel.Thiagarajan
2023-02-15 10:15 ` Michael Walle
2023-02-15 11:44 ` Greg KH
2023-02-16 11:39 ` Kumaravel.Thiagarajan
2023-02-16 11:49 ` Greg KH [this message]
2023-02-17 8:57 ` Kumaravel.Thiagarajan
2023-02-17 9:22 ` Greg KH
2023-02-20 9:31 ` Kumaravel.Thiagarajan
2023-02-20 9:45 ` Greg KH
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=Y+4YO7HSmETanIU2@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Kumaravel.Thiagarajan@microchip.com \
--cc=Tharunkumar.Pasumarthi@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=arnd@arndb.de \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=srinivas.kandagatla@linaro.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