* Re: New driver mtipx2xx submission
[not found] ` <4E14D712.9090805@micron.com>
@ 2011-07-26 10:46 ` Alan Cox
2011-07-26 11:44 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alan Cox @ 2011-07-26 10:46 UTC (permalink / raw)
To: asamymuthupa; +Cc: Jeff Moyer, linux-ide, linux-kernel
Sorry this has taken a while - I've been away and also dealing with
various bits of graphics security stuff.
I've now been through the errata, the timing data and the driver code in
somewhat more detail
Overall:
The hardware deviates a bit from AHCI. The AHCI driver could be taught
to support it but even with the longer queue supported it's not clear
this is the right path, and some of the error handling needs deviate a
bit.
The performance numbers are pretty definitive, and the data shows that
is mostly higher up in the queue handling. That's awkward in some ways
because it means there isn't an obvious way to fix it, and we still
want the queue stuff for 'normal' disks.
Looking at other vendors there don't seem to be a pile of them also
planning to do AHCI with extras instead most seem focussed on NVHMCI so
it doesn't look like a pile of near identikit drivers will appear. Also
if they do we would probably want them all to be related to this driver
not to the general AHCI driver.
So having gone over it all I think the case is rather well made for this
being added as its own driver matching their specific PCI idents, but with
some code clean up, and possibly some further compatibility code if it
turns out some general ide/scsi tools don't work on it as expected.
Comments on the driver code
Questions:
Should there be security checks on the ioctl interfaces ?
Code:
Use k[mz]alloc/kfree for small objects like structs, vmalloc has a lot
of ovherad you don't need
- Lots of global function names with general naming. This causes problems
in Linux because all the compiled in drivers share a common namespace.
So they really ought to be something like
mtip_ahci_write()
and so on
- Semaphores. Unless you need the counting properties please use mutexes.
Sempahores really make for problems in hard real time environments if
using the -rt kernel additions
Style:
- Confuses our kernel-doc tools as it has its own different comment
extraction format. That wants pulling into line (it looks like all the
info is there and its a 'perl script from hell' sort of conversion)
- Various struct names in capitals - please search/replace those as for
style we keep capitals for defines
- Various ifdefs and a lot of printk stuff. Some of this is clearly
because its a development driver, but it ought to be tidied for a final
submission. Also use of dev_info/dev_err etc is strongly preferred as
it means a user and tools can clearly identify which device generated
the message (dev_dbg() supports runtime debug switching so may also
deal with stuff you'd otherwise remove later)
- for ata_swap_string look at bswap()
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New driver mtipx2xx submission
2011-07-26 10:46 ` New driver mtipx2xx submission Alan Cox
@ 2011-07-26 11:44 ` Christoph Hellwig
2011-07-26 11:49 ` Alan Cox
2011-07-26 18:50 ` Jeff Garzik
2011-07-29 18:13 ` Asai Thambi S P
2011-08-11 18:36 ` Asai Thambi S P
2 siblings, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2011-07-26 11:44 UTC (permalink / raw)
To: Alan Cox; +Cc: asamymuthupa, Jeff Moyer, linux-ide, linux-kernel
On Tue, Jul 26, 2011 at 11:46:40AM +0100, Alan Cox wrote:
> Sorry this has taken a while - I've been away and also dealing with
> various bits of graphics security stuff.
Alan, where did the mail that you reply to originate from? Care to post
the whole driver to lkml?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New driver mtipx2xx submission
2011-07-26 11:44 ` Christoph Hellwig
@ 2011-07-26 11:49 ` Alan Cox
2011-07-26 18:50 ` Jeff Garzik
1 sibling, 0 replies; 6+ messages in thread
From: Alan Cox @ 2011-07-26 11:49 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: asamymuthupa, Jeff Moyer, linux-ide, linux-kernel
On Tue, 26 Jul 2011 07:44:45 -0400
Christoph Hellwig <hch@infradead.org> wrote:
> On Tue, Jul 26, 2011 at 11:46:40AM +0100, Alan Cox wrote:
> > Sorry this has taken a while - I've been away and also dealing with
> > various bits of graphics security stuff.
>
> Alan, where did the mail that you reply to originate from? Care to post
> the whole driver to lkml?
linux-ide
Alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New driver mtipx2xx submission
2011-07-26 11:44 ` Christoph Hellwig
2011-07-26 11:49 ` Alan Cox
@ 2011-07-26 18:50 ` Jeff Garzik
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2011-07-26 18:50 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Alan Cox, asamymuthupa, Jeff Moyer, linux-ide, linux-kernel
On 07/26/2011 07:44 AM, Christoph Hellwig wrote:
> On Tue, Jul 26, 2011 at 11:46:40AM +0100, Alan Cox wrote:
>> Sorry this has taken a while - I've been away and also dealing with
>> various bits of graphics security stuff.
>
> Alan, where did the mail that you reply to originate from? Care to post
> the whole driver to lkml?
The original, full post was back in April:
http://marc.info/?l=linux-ide&m=130400649131349&w=2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New driver mtipx2xx submission
2011-07-26 10:46 ` New driver mtipx2xx submission Alan Cox
2011-07-26 11:44 ` Christoph Hellwig
@ 2011-07-29 18:13 ` Asai Thambi S P
2011-08-11 18:36 ` Asai Thambi S P
2 siblings, 0 replies; 6+ messages in thread
From: Asai Thambi S P @ 2011-07-29 18:13 UTC (permalink / raw)
To: Alan Cox; +Cc: Jeff Moyer, linux-ide, linux-kernel, Jeff Garzik
On 7/26/2011 4:46 AM, Alan Cox wrote:
> Sorry this has taken a while - I've been away and also dealing with
> various bits of graphics security stuff.
>
> I've now been through the errata, the timing data and the driver code in
> somewhat more detail
>
> Overall:
> The hardware deviates a bit from AHCI. The AHCI driver could be taught
> to support it but even with the longer queue supported it's not clear
> this is the right path, and some of the error handling needs deviate a
> bit.
>
> The performance numbers are pretty definitive, and the data shows that
> is mostly higher up in the queue handling. That's awkward in some ways
> because it means there isn't an obvious way to fix it, and we still
> want the queue stuff for 'normal' disks.
>
> Looking at other vendors there don't seem to be a pile of them also
> planning to do AHCI with extras instead most seem focussed on NVHMCI so
> it doesn't look like a pile of near identikit drivers will appear. Also
> if they do we would probably want them all to be related to this driver
> not to the general AHCI driver.
>
> So having gone over it all I think the case is rather well made for this
> being added as its own driver matching their specific PCI idents, but with
> some code clean up, and possibly some further compatibility code if it
> turns out some general ide/scsi tools don't work on it as expected.
>
> Comments on the driver code
>
> Questions:
> Should there be security checks on the ioctl interfaces ?
>
> Code:
> Use k[mz]alloc/kfree for small objects like structs, vmalloc has a lot
> of ovherad you don't need
>
> - Lots of global function names with general naming. This causes problems
> in Linux because all the compiled in drivers share a common namespace.
> So they really ought to be something like
>
> mtip_ahci_write()
>
> and so on
>
> - Semaphores. Unless you need the counting properties please use mutexes.
> Sempahores really make for problems in hard real time environments if
> using the -rt kernel additions
>
> Style:
> - Confuses our kernel-doc tools as it has its own different comment
> extraction format. That wants pulling into line (it looks like all the
> info is there and its a 'perl script from hell' sort of conversion)
>
> - Various struct names in capitals - please search/replace those as for
> style we keep capitals for defines
>
> - Various ifdefs and a lot of printk stuff. Some of this is clearly
> because its a development driver, but it ought to be tidied for a final
> submission. Also use of dev_info/dev_err etc is strongly preferred as
> it means a user and tools can clearly identify which device generated
> the message (dev_dbg() supports runtime debug switching so may also
> deal with stuff you'd otherwise remove later)
>
> - for ata_swap_string look at bswap()
Thanks for your valuable feedback. We started making changes to the
driver, and expect to complete it soon.
--
Regards,
Asai Thambi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New driver mtipx2xx submission
2011-07-26 10:46 ` New driver mtipx2xx submission Alan Cox
2011-07-26 11:44 ` Christoph Hellwig
2011-07-29 18:13 ` Asai Thambi S P
@ 2011-08-11 18:36 ` Asai Thambi S P
2 siblings, 0 replies; 6+ messages in thread
From: Asai Thambi S P @ 2011-08-11 18:36 UTC (permalink / raw)
To: Alan Cox; +Cc: Jeff Moyer, linux-ide, linux-kernel, Jens Axboe
On 7/26/2011 4:46 AM, Alan Cox wrote:
> Sorry this has taken a while - I've been away and also dealing with
> various bits of graphics security stuff.
>
> I've now been through the errata, the timing data and the driver code in
> somewhat more detail
>
> Overall:
> The hardware deviates a bit from AHCI. The AHCI driver could be taught
> to support it but even with the longer queue supported it's not clear
> this is the right path, and some of the error handling needs deviate a
> bit.
>
> The performance numbers are pretty definitive, and the data shows that
> is mostly higher up in the queue handling. That's awkward in some ways
> because it means there isn't an obvious way to fix it, and we still
> want the queue stuff for 'normal' disks.
>
> Looking at other vendors there don't seem to be a pile of them also
> planning to do AHCI with extras instead most seem focussed on NVHMCI so
> it doesn't look like a pile of near identikit drivers will appear. Also
> if they do we would probably want them all to be related to this driver
> not to the general AHCI driver.
>
> So having gone over it all I think the case is rather well made for this
> being added as its own driver matching their specific PCI idents, but with
> some code clean up, and possibly some further compatibility code if it
> turns out some general ide/scsi tools don't work on it as expected.
Thanks for taking the time to review the errata, performance profiles,
and early driver code. We've cleaned up much of the ugliness in the
version you inspected so it should be easier on the eyes now.
We changed the driver name from mtipx2xx to mtip32xx. Open to a generic
name if other vendors are planning to use this driver.
>
> Comments on the driver code
>
> Questions:
> Should there be security checks on the ioctl interfaces ?
We added capable(CAP_SYS_ADMIN) checks on the ioctls.
>
> Code:
> Use k[mz]alloc/kfree for small objects like structs, vmalloc has a lot
> of ovherad you don't need
All vmallocs were converted to kzallocs.
>
> - Lots of global function names with general naming. This causes problems
> in Linux because all the compiled in drivers share a common namespace.
> So they really ought to be something like
>
> mtip_ahci_write()
>
> and so on
We converted all non-static functions to kernel-compatible nomenclature.
We used the mtip prefix based on your suggestion.
>
> - Semaphores. Unless you need the counting properties please use mutexes.
> Sempahores really make for problems in hard real time environments if
> using the -rt kernel additions
Here we had some trouble. We needed the counting semaphore to put the
make_request calling context to sleep if there are no empty slots. We
also needed the rw semaphore to prioritize internal commands and ioctls
during heavy IO load. There seemed to be a fairness problem that was
best solved through the rw semaphore. If you have another suggestion
for a "fair" semaphore, we'd love to hear it.
>
> Style:
> - Confuses our kernel-doc tools as it has its own different comment
> extraction format. That wants pulling into line (it looks like all the
> info is there and its a 'perl script from hell' sort of conversion)
We did our best to make the comments and format consistent with other
drivers.
>
> - Various struct names in capitals - please search/replace those as for
> style we keep capitals for defines
>
> - Various ifdefs and a lot of printk stuff. Some of this is clearly
> because its a development driver, but it ought to be tidied for a final
> submission. Also use of dev_info/dev_err etc is strongly preferred as
> it means a user and tools can clearly identify which device generated
> the message (dev_dbg() supports runtime debug switching so may also
> deal with stuff you'd otherwise remove later)
We've converted much of the logging to dev_* semantics. The challenge
for us was reconciling all the messages that we feel are important
against the need to not spam the system log. We think we've made a
reasonable compromise, at least compared to the last driver we posted.
We are of course open to removing any logging deemed superfluous.
>
> - for ata_swap_string look at bswap()
We experimented with bswap but in the end felt that be16_to_cpus
was a better choice.
I will post the updated patch shortly.
--
Regards,
Asai Thambi
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-11 18:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <22A973199D2C2F46933448F6E7990A300204F2BC@ntxboimbx31.micron.com>
[not found] ` <20110428230605.78c55c70@lxorguk.ukuu.org.uk>
[not found] ` <22A973199D2C2F46933448F6E7990A300204F728@ntxboimbx31.micron.com>
[not found] ` <20110502184206.25907c5e@lxorguk.ukuu.org.uk>
[not found] ` <22A973199D2C2F46933448F6E7990A300214B0D6@ntxboimbx31.micron.com>
[not found] ` <20110511202013.075b07cc@lxorguk.ukuu.org.uk>
[not found] ` <4DD722DB.8030303@micron.com>
[not found] ` <x49lixuyhhs.fsf@segfault.boston.devel.redhat.com>
[not found] ` <22A973199D2C2F46933448F6E7990A300239EA77@ntxboimbx31.micron.com>
[not found] ` <x49ipsp9voy.fsf@segfault.boston.devel.redhat.com>
[not found] ` <20110601212129.11534c55@lxorguk.ukuu.org.uk>
[not found] ` <4DF80ADE.8020206@micron.com>
[not found] ` <x49ips75f4j.fsf@segfault.boston.devel.redhat.com>
[not found] ` <22A973199D2C2F46933448F6E7990A3002697E77@ntxboimbx31.micron.com>
[not found] ` <x49boxirnl8.fsf@segfault.boston.devel.redhat.com>
[not found] ` <20110628163125.0f2acc94@lxorguk.ukuu.org.uk>
[not found] ` <x4962nqrmp2.fsf@segfault.boston.devel.redhat.com>
[not found] ` <4E14D712.9090805@micron.com>
2011-07-26 10:46 ` New driver mtipx2xx submission Alan Cox
2011-07-26 11:44 ` Christoph Hellwig
2011-07-26 11:49 ` Alan Cox
2011-07-26 18:50 ` Jeff Garzik
2011-07-29 18:13 ` Asai Thambi S P
2011-08-11 18:36 ` Asai Thambi S P
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox