From: Dennis Dalessandro <dennis.dalessandro@intel.com>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access
Date: Fri, 22 Apr 2016 14:38:45 -0400 [thread overview]
Message-ID: <20160422183844.GB21996@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <20160420203616.GA28991@obsidianresearch.com>
On Wed, Apr 20, 2016 at 02:36:16PM -0600, Jason Gunthorpe wrote:
>On Thu, Apr 14, 2016 at 01:52:44PM -0400, Dennis Dalessandro wrote:
>> The eprom device is for low level programming of the eprom on the
>> chip. We do not use i2c for this because the eprom is directly
>> attached to the chip and not accessible via i2c, requires register
>> access.
>
>Okay, but the twsi.c is still not acceptable in a driver, use the i2c
>subsystem to talk to the qsfps. Open coding i2c is not OK.
Yeah, I mentioned this at OFA. We are looking at reworking this.
>The char dev(s) are also done wrong, there is no set to 'kobj.parent'
>and there are empty release functions. There are certainly
>use-after-free bugs between close and device removal, someone needs to
>audit all of this carefully.
>
>The patch forgets compat_ioctl.
We will take a look at this.
>Stuff like this should be a build bug:
> /* NOTE: assumes unsigned long is 8 bytes */
Our Kconfig depends on X86_64. Should we add a BUILD_BUG_ON or something?
>The 'goto on success' in hfi1_cdev_init is an anti-pattern, don't do it.
Can fix.
>Even if the char dev stays, creating two whole sysfs classes seems
>really unnecessary. Surely there is a better place to attach the cdev.
>
>And this is just outrageous:
>
> if (atomic_inc_return(&user_count) == 1) {
> ret = hfi1_cdev_init(0, class_name(), &hfi1_file_ops,
> &wildcard_cdev, &wildcard_device,
> true);
> if (ret)
>
>I can see an argument for a per-device char dev (as Christoph says,
>that is not entirely uncommon) but this is a multi-device char dev????
We are discussing what can be done about this internally. On that note we
are also looking at what we can do about the twsi as mentioned above, also
the eprom, ui, and snoop. We'll send the actual plan for each issue to
linux-rdma for feedback soon.
We are certainly not opposed to improving these areas of the code. So long
as we can maintain the same functionality, which seems doable. It's just
that no one has spoken up about these things in the 9+ months since the
driver was added. We need a bit of time to get it all sorted out.
-Denny
next prev parent reply other threads:[~2016-04-22 18:38 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 15:41 [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Dennis Dalessandro
2016-04-14 15:41 ` [PATCH 1/7] IB/hfi1: Export drivers user sw version via sysfs Dennis Dalessandro
2016-04-18 13:05 ` Christoph Hellwig
2016-04-14 15:41 ` [PATCH 2/7] IB/hfi1: Remove unused user command Dennis Dalessandro
2016-04-18 13:05 ` Christoph Hellwig
2016-04-14 15:41 ` [PATCH 3/7] IB/hfi1: Add ioctl() interface for user commands Dennis Dalessandro
2016-04-14 15:41 ` [PATCH 4/7] IB/hfi1: Remove write(), use ioctl() for user cmds Dennis Dalessandro
2016-04-14 15:42 ` [PATCH 5/7] IB/hfi1: Add trace message in user IOCTL handling Dennis Dalessandro
2016-04-14 15:42 ` [PATCH 6/7] IB/hfi1: Consolidate IOCTL defines Dennis Dalessandro
2016-04-14 15:42 ` [PATCH 7/7] IB/hfi1: Move eprom to its own device Dennis Dalessandro
2016-04-14 16:45 ` [PATCH 0/7] IB/hfi1: Remove write() and use ioctl() for user access Jason Gunthorpe
2016-04-14 17:48 ` Ira Weiny
2016-04-14 18:05 ` Jason Gunthorpe
2016-04-14 18:42 ` Dennis Dalessandro
2016-04-14 18:56 ` Jason Gunthorpe
2016-04-15 4:01 ` Leon Romanovsky
2016-04-15 16:17 ` Ira Weiny
2016-04-15 17:30 ` Leon Romanovsky
2016-04-15 17:34 ` Christoph Hellwig
2016-04-15 17:44 ` Woodruff, Robert J
2016-04-15 21:03 ` Leon Romanovsky
2016-04-15 17:46 ` Hefty, Sean
2016-04-15 21:23 ` Leon Romanovsky
2016-04-15 23:28 ` Ira Weiny
2016-04-16 6:09 ` Leon Romanovsky
2016-04-16 15:29 ` Dennis Dalessandro
2016-04-15 23:37 ` Jason Gunthorpe
2016-04-16 6:00 ` Leon Romanovsky
2016-04-16 19:19 ` Al Viro
2016-04-18 12:00 ` Dennis Dalessandro
2016-04-14 17:52 ` Dennis Dalessandro
2016-04-14 18:46 ` Jason Gunthorpe
2016-04-20 20:36 ` Jason Gunthorpe
2016-04-22 18:38 ` Dennis Dalessandro [this message]
2016-04-26 15:23 ` Jason Gunthorpe
2016-04-18 13:09 ` Christoph Hellwig
2016-04-18 17:40 ` Jason Gunthorpe
2016-04-18 18:24 ` Christoph Hellwig
2016-04-19 3:45 ` Ira Weiny
2016-04-19 18:40 ` Christoph Hellwig
2016-04-19 17:38 ` Jason Gunthorpe
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=20160422183844.GB21996@phlsvsds.ph.intel.com \
--to=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.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).