All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mukker Atul <atulm@lsil.com>,
	"'alan@redhat.com'" <alan@redhat.com>,
	"'James.Bottomley@steeleye.com'" <James.Bottomley@steeleye.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>,
	"'linux-megaraid-devel@dell.com'" <linux-megaraid-devel@dell.com>,
	"'linux-megaraid-announce@dell.com'"
	<linux-megaraid-announce@dell.com>
Subject: Re: [ANNOUNCE]: version 2.00.3 megaraid driver for 2.4.x and 2.5.67 kernels
Date: Thu, 17 Apr 2003 08:52:16 -0400 (EDT)	[thread overview]
Message-ID: <200304171252.h3HCqG909973@devserv.devel.redhat.com> (raw)
In-Reply-To: <20030417133820.A12503@infradead.org> from "Christoph Hellwig" at Ebr 17, 2003 01:38:20

>     a) please avoid typedefs for structs.  Also adapter_t is a bit
>     too generic.  What about struct mega_adapter instead?
>     b) please don't use such global arrays but always use the
>     ->hostdata field.

a) megaraid always used a set of basic typedefs. Seems to be your personal
view not general comment

b) Probably right

> static struct notifier_block mega_notifier = {
> 	.notifier_call = megaraid_reboot_notify
> };
> 
>     Do you really need this?  Why can you use
>     struct device_driver->shutdown?

Not on 2.2

> 	if( max_mbox_busy_wait > MBOX_BUSY_WAIT )
> 		max_mbox_busy_wait = MBOX_BUSY_WAIT;
> }
> 
>     Please run the whole driver through scripts/Lindent

Looks fine to me anyway

> megaraid_detect(Scsi_Host_Template *host_template)
> 
>     Please get rid of ->detect and use the new-style pci API +
>     scsi_add_host instead.

Doesnt work on 2.4

> static void internal_done (Scsi_Cmnd *cmd)
> {
> 	internal_done_errcode = cmd->result;
> 	internal_done_flag++;
> 	wake_up (&internal_wait);
> }
> 
> /* shouldn't be used, but included for completeness */

>     This looks horribly racy.

Its ok on older kernels 2.2/2.4 wont afaik ever use it.

> 	return FALSE;
> 
>     Please don't use TRUE/FALSE but 1/0 directly.

TRUE/FALSE is IMHO perfectly clear

> 	if (!try_module_get(THIS_MODULE)) {
> 		return -ENXIO;
> 	}
> 
>    This is broken as hell (and I fixed it in the old megraid driver
>    ages ago!)  Just set ->owner in the file_operation.

Definitely wants fixing
 
> 	while( atomic_read(&adapter->pend_cmds) > 0 ||
> 			!list_empty(&adapter->pending_list) ) {
> 
> 		sleep_on_timeout( &wq, 1*HZ );	/* sleep for 1s */
> 	}
> 
>   Again racy.  You need to opencode this (similar to wait_event, maybe
>   just add wait_even_timeout).

Actually the timeout means the worst that occurs is you wait a 
second, and the code is portable to old 2.2/2.4

> static Scsi_Host_Template driver_template = MEGARAID;
> 
>     Get rid of the ugly macro and add the members right here.
> 
> While we're at it:  Please also get rid of all those prototypes in
> megaraid.h

2.2

WARNING: multiple messages have this Message-ID (diff)
From: Alan Cox <alan@redhat.com>
To: hch@infradead.org (Christoph Hellwig)
Cc: atulm@lsil.com (Mukker Atul), alan@redhat.com ('alan@redhat.com'),
	James.Bottomley@steeleye.com ('James.Bottomley@steeleye.com'),
	linux-kernel@vger.kernel.org ('linux-kernel@vger.kernel.org'),
	linux-scsi@vger.kernel.org ('linux-scsi@vger.kernel.org'),
	linux-megaraid-devel@dell.com ('linux-megaraid-devel@dell.com'),
	linux-megaraid-announce@dell.com
	('linux-megaraid-announce@dell.com')
Subject: Re: [ANNOUNCE]: version 2.00.3 megaraid driver for 2.4.x and 2.5.67 kernels
Date: Thu, 17 Apr 2003 08:52:16 -0400 (EDT)	[thread overview]
Message-ID: <200304171252.h3HCqG909973@devserv.devel.redhat.com> (raw)
In-Reply-To: <20030417133820.A12503@infradead.org> from "Christoph Hellwig" at Ebr 17, 2003 01:38:20

>     a) please avoid typedefs for structs.  Also adapter_t is a bit
>     too generic.  What about struct mega_adapter instead?
>     b) please don't use such global arrays but always use the
>     ->hostdata field.

a) megaraid always used a set of basic typedefs. Seems to be your personal
view not general comment

b) Probably right

> static struct notifier_block mega_notifier = {
> 	.notifier_call = megaraid_reboot_notify
> };
> 
>     Do you really need this?  Why can you use
>     struct device_driver->shutdown?

Not on 2.2

> 	if( max_mbox_busy_wait > MBOX_BUSY_WAIT )
> 		max_mbox_busy_wait = MBOX_BUSY_WAIT;
> }
> 
>     Please run the whole driver through scripts/Lindent

Looks fine to me anyway

> megaraid_detect(Scsi_Host_Template *host_template)
> 
>     Please get rid of ->detect and use the new-style pci API +
>     scsi_add_host instead.

Doesnt work on 2.4

> static void internal_done (Scsi_Cmnd *cmd)
> {
> 	internal_done_errcode = cmd->result;
> 	internal_done_flag++;
> 	wake_up (&internal_wait);
> }
> 
> /* shouldn't be used, but included for completeness */

>     This looks horribly racy.

Its ok on older kernels 2.2/2.4 wont afaik ever use it.

> 	return FALSE;
> 
>     Please don't use TRUE/FALSE but 1/0 directly.

TRUE/FALSE is IMHO perfectly clear

> 	if (!try_module_get(THIS_MODULE)) {
> 		return -ENXIO;
> 	}
> 
>    This is broken as hell (and I fixed it in the old megraid driver
>    ages ago!)  Just set ->owner in the file_operation.

Definitely wants fixing
 
> 	while( atomic_read(&adapter->pend_cmds) > 0 ||
> 			!list_empty(&adapter->pending_list) ) {
> 
> 		sleep_on_timeout( &wq, 1*HZ );	/* sleep for 1s */
> 	}
> 
>   Again racy.  You need to opencode this (similar to wait_event, maybe
>   just add wait_even_timeout).

Actually the timeout means the worst that occurs is you wait a 
second, and the code is portable to old 2.2/2.4

> static Scsi_Host_Template driver_template = MEGARAID;
> 
>     Get rid of the ugly macro and add the members right here.
> 
> While we're at it:  Please also get rid of all those prototypes in
> megaraid.h

2.2

  reply	other threads:[~2003-04-17 12:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16 20:34 [ANNOUNCE]: version 2.00.3 megaraid driver for 2.4.x and 2.5.67 kernels Mukker, Atul
2003-04-17 12:38 ` Christoph Hellwig
2003-04-17 12:52   ` Alan Cox [this message]
2003-04-17 12:52     ` Alan Cox
2003-04-17 12:57     ` Christoph Hellwig
2003-04-17 13:23       ` Alan Cox
2003-04-17 13:23         ` Alan Cox
2003-04-17 13:56         ` Christoph Hellwig
2003-04-17 14:41   ` James Bottomley
2003-04-17 17:25   ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2003-04-25 23:04 Mukker, Atul
2003-04-26 19:42 Mukker, Atul

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=200304171252.h3HCqG909973@devserv.devel.redhat.com \
    --to=alan@redhat.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=atulm@lsil.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-megaraid-announce@dell.com \
    --cc=linux-megaraid-devel@dell.com \
    --cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.