* [PATCH] Let DAC960 supply entropy to random pool
@ 2006-02-23 16:44 Anders K. Pedersen
2006-02-27 0:05 ` Matt Mackall
0 siblings, 1 reply; 5+ messages in thread
From: Anders K. Pedersen @ 2006-02-23 16:44 UTC (permalink / raw)
To: Dave Olien; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]
Hello,
We have a couple of servers with Mylex RAID controllers (handled by the
DAC960 block device driver). There's normally no keyboard or mouse
attached, and neither the DAC960 nor the NIC driver (e100) provides
entropy to the random pool, so it was impossible to get any data from
/dev/random.
The patch below lets the DAC960 IRQ provide entropy to the random pool,
and after applying this (to 2.6.15.4), /dev/random is able to provide
data on these servers. I fear, that my mailer may line wrap the patch,
so it is also attached to this mail.
--- drivers/block/DAC960.c~ 2006-02-23 16:34:47.000000000 +0100
+++ drivers/block/DAC960.c 2006-02-23 16:34:47.000000000 +0100
@@ -3024,7 +3024,7 @@ DAC960_DetectController(struct pci_dev *
Acquire shared access to the IRQ Channel.
*/
IRQ_Channel = PCI_Device->irq;
- if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ,
+ if (request_irq(IRQ_Channel, InterruptHandler,
SA_SHIRQ|SA_SAMPLE_RANDOM,
Controller->FullModelName, Controller) < 0)
{
DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
--
Med venlig hilsen - Best regards
Anders K. Pedersen
Network Engineer
[-- Attachment #2: DAC960.random.patch --]
[-- Type: text/x-patch, Size: 555 bytes --]
--- drivers/block/DAC960.c~ 2006-02-23 16:34:47.000000000 +0100
+++ drivers/block/DAC960.c 2006-02-23 16:34:47.000000000 +0100
@@ -3024,7 +3024,7 @@ DAC960_DetectController(struct pci_dev *
Acquire shared access to the IRQ Channel.
*/
IRQ_Channel = PCI_Device->irq;
- if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ,
+ if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ|SA_SAMPLE_RANDOM,
Controller->FullModelName, Controller) < 0)
{
DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let DAC960 supply entropy to random pool
2006-02-23 16:44 [PATCH] Let DAC960 supply entropy to random pool Anders K. Pedersen
@ 2006-02-27 0:05 ` Matt Mackall
2006-03-06 11:25 ` Anders K. Pedersen
0 siblings, 1 reply; 5+ messages in thread
From: Matt Mackall @ 2006-02-27 0:05 UTC (permalink / raw)
To: Anders K. Pedersen; +Cc: Dave Olien, linux-kernel
On Thu, Feb 23, 2006 at 05:44:38PM +0100, Anders K. Pedersen wrote:
> Hello,
>
> We have a couple of servers with Mylex RAID controllers (handled by the
> DAC960 block device driver). There's normally no keyboard or mouse
> attached, and neither the DAC960 nor the NIC driver (e100) provides
> entropy to the random pool, so it was impossible to get any data from
> /dev/random.
Doesn't the add_disk_randomness call in ll_rw_blk.c suffice? This is
the proper path for disks to add entropy.
I intend to kill the SA_SAMPLE_RANDOM path. It's part of a fast path
and all of its users are bogus.
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let DAC960 supply entropy to random pool
2006-02-27 0:05 ` Matt Mackall
@ 2006-03-06 11:25 ` Anders K. Pedersen
2006-03-06 17:44 ` Matt Mackall
0 siblings, 1 reply; 5+ messages in thread
From: Anders K. Pedersen @ 2006-03-06 11:25 UTC (permalink / raw)
To: Matt Mackall; +Cc: linux-kernel
On Mon, 2006-02-27 at 01:05, Matt Mackall wrote:
> On Thu, Feb 23, 2006 at 05:44:38PM +0100, Anders K. Pedersen wrote:
> > We have a couple of servers with Mylex RAID controllers (handled by the
> > DAC960 block device driver). There's normally no keyboard or mouse
> > attached, and neither the DAC960 nor the NIC driver (e100) provides
> > entropy to the random pool, so it was impossible to get any data from
> > /dev/random.
>
> Doesn't the add_disk_randomness call in ll_rw_blk.c suffice? This is
> the proper path for disks to add entropy.
Apparently the add_disk_randomness call in ll_rw_blk.c isn't invoked for
my setup. There were absolutely no data available from /dev/random for
more than an hour (with heavy disk activity) before applying the
dac960.c patch, and after applying it, random data were instantly
available.
--
Med venlig hilsen - Best regards
Anders K. Pedersen
Network Engineer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let DAC960 supply entropy to random pool
2006-03-06 11:25 ` Anders K. Pedersen
@ 2006-03-06 17:44 ` Matt Mackall
2006-03-07 13:18 ` Anders K. Pedersen
0 siblings, 1 reply; 5+ messages in thread
From: Matt Mackall @ 2006-03-06 17:44 UTC (permalink / raw)
To: Anders K. Pedersen; +Cc: linux-kernel
On Mon, Mar 06, 2006 at 12:25:24PM +0100, Anders K. Pedersen wrote:
> On Mon, 2006-02-27 at 01:05, Matt Mackall wrote:
> > On Thu, Feb 23, 2006 at 05:44:38PM +0100, Anders K. Pedersen wrote:
> > > We have a couple of servers with Mylex RAID controllers (handled by the
> > > DAC960 block device driver). There's normally no keyboard or mouse
> > > attached, and neither the DAC960 nor the NIC driver (e100) provides
> > > entropy to the random pool, so it was impossible to get any data from
> > > /dev/random.
> >
> > Doesn't the add_disk_randomness call in ll_rw_blk.c suffice? This is
> > the proper path for disks to add entropy.
>
> Apparently the add_disk_randomness call in ll_rw_blk.c isn't invoked for
> my setup. There were absolutely no data available from /dev/random for
> more than an hour (with heavy disk activity) before applying the
> dac960.c patch, and after applying it, random data were instantly
> available.
Ok, we probably want this patch. Please test.
Add disk entropy in DAC960 request completions.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Index: 2.6/drivers/block/DAC960.c
===================================================================
--- 2.6.orig/drivers/block/DAC960.c 2006-03-01 23:32:32.000000000 -0600
+++ 2.6/drivers/block/DAC960.c 2006-03-06 11:41:45.000000000 -0600
@@ -41,6 +41,7 @@
#include <linux/timer.h>
#include <linux/pci.h>
#include <linux/init.h>
+#include <linux/random.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include "DAC960.h"
@@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessComp
Command->SegmentCount, Command->DmaDirection);
if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) {
-
+ add_disk_randomness(Request->rq_disk);
end_that_request_last(Request, UpToDate);
if (Command->Completion) {
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Let DAC960 supply entropy to random pool
2006-03-06 17:44 ` Matt Mackall
@ 2006-03-07 13:18 ` Anders K. Pedersen
0 siblings, 0 replies; 5+ messages in thread
From: Anders K. Pedersen @ 2006-03-07 13:18 UTC (permalink / raw)
To: Matt Mackall; +Cc: linux-kernel
On Mon, 2006-03-06 at 18:44, Matt Mackall wrote:
> On Mon, Mar 06, 2006 at 12:25:24PM +0100, Anders K. Pedersen wrote:
> > Apparently the add_disk_randomness call in ll_rw_blk.c isn't invoked for
> > my setup. There were absolutely no data available from /dev/random for
> > more than an hour (with heavy disk activity) before applying the
> > dac960.c patch, and after applying it, random data were instantly
> > available.
>
> Ok, we probably want this patch. Please test.
>
> Add disk entropy in DAC960 request completions.
Adding this patch (and removing mine) also provides random data, so I'm
happy with either solution.
--
Med venlig hilsen - Best regards
Anders K. Pedersen
Network Engineer
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-07 13:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 16:44 [PATCH] Let DAC960 supply entropy to random pool Anders K. Pedersen
2006-02-27 0:05 ` Matt Mackall
2006-03-06 11:25 ` Anders K. Pedersen
2006-03-06 17:44 ` Matt Mackall
2006-03-07 13:18 ` Anders K. Pedersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome