linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REPOST][PATCH 1/6] mpt fusion - fibre channel target discovery prematurely terminates
@ 2006-05-24 20:06 Michael Reed
  2006-05-29 17:38 ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Reed @ 2006-05-24 20:06 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Bottomley, Moore, Eric Dean

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

Reset processing sets ioc->active to zero.  This causes target discovery
to be unable to read configuration pages which can result in fewer
than the total number of targets being discovered.  This patch skips
target discovery if ioc->active is zero.  The driver reschedules
target discovery once ioc->active becomes non-zero.

This situation occurs when the lsiutil program is being used to reset
the board.

(Logic change from previously posted 01-mptfc_eagain.patch.)

Signed-off-by: Michael Reed <mdr@sgi.com>


[-- Attachment #2: 01-mptfc_ioc_active.patch --]
[-- Type: text/x-patch, Size: 1207 bytes --]

Reset processing sets ioc->active to zero.  This causes target discovery
to be unable to read configuration pages which can result in fewer
than the total number of targets being discovered.  This patch skips
target discovery if ioc->active is zero.  The driver reschedules
target discovery once ioc->active becomes non-zero.

This situation occurs when the lsiutil program is being used to reset
the board.

Signed-off-by: Michael Reed <mdr@sgi.com>


--- rc4u/drivers/message/fusion/mptfc.c	2006-05-18 16:43:54.968309949 -0500
+++ rc4/drivers/message/fusion/mptfc.c	2006-05-24 14:08:58.999830952 -0500
@@ -639,6 +639,14 @@
 	struct mptfc_rport_info *ri;
 
 	do {
+		/*
+		 * if the ioc isn't active, cannot fetch config pages
+		 * if it becomes active, work count will increment and
+		 * another pass will occur or work will be rescheduled
+		 */
+		if (ioc->active == 0)
+			goto check_work_remaining;
+
 		/* start by tagging all ports as missing */
 		list_for_each_entry(ri, &ioc->fc_rports, list) {
 			if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) {
@@ -676,6 +684,7 @@
 			}
 		}
 
+ check_work_remaining:
 		/*
 		 * allow multiple passes as target state
 		 * might have changed during scan

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: [REPOST][PATCH 1/6] mpt fusion - fibre channel target discovery prematurely terminates
@ 2006-06-14 22:27 Moore, Eric
  2006-06-15 14:51 ` Michael Reed
  0 siblings, 1 reply; 9+ messages in thread
From: Moore, Eric @ 2006-06-14 22:27 UTC (permalink / raw)
  To: Michael Reed, James Bottomley, linux-scsi

On Wednesday, June 14, 2006 1:00 PM, Mike Reed wrote: 
> 
> James Bottomley wrote:
> > 
> > I was still thinking of something that made mpt_config() 
> never return
> > -EAGAIN.  How does the following work out?  It's my first pass at
> > sorting out the frame and active logic in mptbase:
> 
> 
> pCfg->wait_done needs to be initialized to zero before sleeping.
> 

agreed

> It takes seven to ten seconds for the ioc->active value to become
> non-zero and the wake up to occur.
> 
> It appears that the order of execution during "lsiutil 99" testing
> has changed.  Once the driver marks the fibre targets missing, they
> never return.  Hmmm....  Until this is resolved, this patch cannot
> be applied.  I'll see if I can sort out how the execution order
> has changed.

not clear what you mean by "they never return"

> 
> Another comment, for every i/o, this patch introduces overhead.
> spinlock and checking a list which is empty 99.99[...]% of the time.
> I'll have to perform an iop measurement to see if there is a
> measurable impact on system performance.
> 

What overhead?  We don't read config pages on every I/O.  James
patch only effects the reading of config pages when there is
a host reset.

One concern on this patch.  A possible deadlock situation could
occur if we run out of message frames.  Meaning there is another way
that  mpt_get_msg_frame() could return NULL, and that is becuase
the ioc->FreeQ list is empty.  This patch only addresses the case
when there is a host reset.   Utimatley we need to address both
cases when NULL is returned.  Id rather try to come  up with a
solution where the fix is isolated inside of mpt_get_msg_frame().

Eric Moore

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: [REPOST][PATCH 1/6] mpt fusion - fibre channel target discovery prematurely terminates
@ 2006-06-15 15:22 Moore, Eric
  2006-06-15 15:41 ` Michael Reed
  0 siblings, 1 reply; 9+ messages in thread
From: Moore, Eric @ 2006-06-15 15:22 UTC (permalink / raw)
  To: Michael Reed; +Cc: James Bottomley, linux-scsi

On Thursday, June 15, 2006 8:51 AM, Michael Reed wrote: 

> > What overhead?  We don't read config pages on every I/O.  James
> > patch only effects the reading of config pages when there is
> > a host reset.
> 
> I think you're mistaken about James' patch.
> 
> Doesn't every i/o use a message frame?  James' patch to sleep on frame
> exhaustion requires a wakeup every time a msg frame is released,
> which is performed at the end of mpt_put_msg_frame().  Am I missing
> something?
> 
> 

Ok, my mistake.  I overlooked the wake_up() at the end of
mpt_put_msg_frame().

BTW, this is incorrect.  The wake_up() should been in
mpt_free_msg_frame(), 
instead of mpt_put_msg_frame().   The _put_ function is sending the mf
to 
the firmware.   The mf is not freed untill the command is completd by
firmware,
and the _free_function is called.  Meaning this issue can be solved by
moving 
wake_up() to mpt_free_msg_frame(), and only calling wake_up() when the
list_empty(&ioc->FreeQ) was empty going into this call.

Eric Moore

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-06-15 17:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-24 20:06 [REPOST][PATCH 1/6] mpt fusion - fibre channel target discovery prematurely terminates Michael Reed
2006-05-29 17:38 ` James Bottomley
2006-06-14 18:59   ` Michael Reed
2006-06-15 15:39     ` Michael Reed
  -- strict thread matches above, loose matches on Subject: below --
2006-06-14 22:27 Moore, Eric
2006-06-15 14:51 ` Michael Reed
2006-06-15 15:22 Moore, Eric
2006-06-15 15:41 ` Michael Reed
2006-06-15 17:49   ` Michael Reed

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).