public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexis Bruemmer <alexisb@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	"Tarte, Robert" <Robert_Tarte@adaptec.com>
Subject: [PATCH] aic94xx: attaching to the sas transport class
Date: Fri, 17 Mar 2006 17:45:04 -0800	[thread overview]
Message-ID: <1142646304.7462.36.camel@localhost.localdomain> (raw)
In-Reply-To: <1141339085.3238.80.camel@mulgrave.il.steeleye.com>

On Thu, 2006-03-02 at 16:38 -0600, James Bottomley wrote:
> This fairly minimal patch correctly attaches the aic94xx driver to the
> SAS transport class (The driver is available from
> 
> www.kernel.org/git/jgarzik/sas-2.6
> 
> ).  Unfortunately, the driver itself still has the following critical
> issues
> 
> 1. Discovery order is non-deterministic (it starts one thread per port,
> so the threads race for discovery)
> 
> 2. The minimal attachment to the sas transport class doesn't do
> expanders.  This needs to be fixed up by patching better expander
> support into the class.  The way to do this is probably to pull the
> domain_device into the sas transport class.
> 
> 3. The object lifetimes are all basically infinite (this will probably
> fixed by 2)

Here is a proposed solution for 3.  I have tested this patch on an x366
and it seems to have fixed the wired refcnt problem as well as fixing
the problems encountered when trying to load and unload the module. Also
with this fix I was able to remove and add hard drives at will without
the usual I/O buffer errors.

Please let me know what you think.

Regards,

Alexis


Signed-off-by: Mike Anderson <andmike@us.ibm.com>
Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>

diff -pNaur aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_discover.c aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_discover.c
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_discover.c        2006-03-14 08:51:51.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_discover.c     2006-03-17 17:09:43.000000000 -0800
@@ -586,9 +586,6 @@ static void sas_unregister_domain_device
        struct domain_device *dev, *n;
        struct sas_port *port = data;

-       sas_begin_event(DISCE_PORT_GONE, &port->disc.disc_event_lock,
-                       &port->disc.pending);
-
        list_for_each_entry_reverse_safe(dev,n,&port->dev_list,dev_list_node)
                sas_unregister_dev(dev);
 }
diff -pNaur aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_port.c aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_port.c
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_port.c    2006-03-12 14:40:39.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_port.c 2006-03-17 17:10:53.000000000 -0800
@@ -132,12 +132,6 @@ void sas_deform_port(struct asd_sas_phy
        if (port->port_dev)
                port->port_dev->pathways--;

-       if (port->num_phys == 1) {
-               init_completion(&port->port_gone_completion);
-               sas_discover_event(port, DISCE_PORT_GONE);
-               wait_for_completion(&port->port_gone_completion);
-       }
-
        if (sas_ha->lldd_port_deformed)
                sas_ha->lldd_port_deformed(phy);

diff -pNaur aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_scsi_host.c aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_scsi_host.c
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_scsi_host.c       2006-03-12 14:40:39.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_scsi_host.c    2006-03-17 16:48:10.000000000 -0800
@@ -693,6 +693,7 @@ out_err:

 void sas_unregister_scsi_host(struct sas_ha_struct *sas_ha)
 {
+       sas_remove_host(sas_ha->core.shost);
        scsi_remove_host(sas_ha->core.shost);
        scsi_host_put(sas_ha->core.shost);
        sas_ha->core.shost = NULL;
diff -pNaur aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_discover.h aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h
--- aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_discover.h        2006-03-12 14:40:39.000000000 -0800
+++ aic94xx-sas-2.6-patched/include/scsi/sas/sas_discover.h     2006-03-17 17:20:30.000000000 -0800
@@ -128,8 +128,6 @@ static inline int sas_notify_lldd_dev_fo
        int res = 0;
        struct sas_ha_struct *sas_ha = dev->port->ha;

-       if (!try_module_get(sas_ha->lldd_module))
-               return -ENOMEM;
        if (sas_ha->lldd_dev_found) {
                res = sas_ha->lldd_dev_found(dev);
                if (res) {
@@ -146,7 +144,6 @@ static inline void sas_notify_lldd_dev_g


> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  parent reply	other threads:[~2006-03-18  1:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 22:38 [RFC] aic94xx: attaching to the sas transport class James Bottomley
2006-03-02 23:13 ` Mike Anderson
2006-03-03  2:16   ` Mark Rustad
2006-03-03  4:04     ` Randy.Dunlap
2006-03-03 16:51       ` Mark Rustad
2006-03-03 15:51     ` Stefan Richter
2006-03-03 18:24       ` Luben Tuikov
2006-03-03  4:34   ` James Bottomley
2006-03-04  1:47     ` Alexis Bruemmer
2006-03-03 10:26   ` Luben Tuikov
2006-03-03 16:12     ` Stefan Richter
2006-03-03 18:26       ` Luben Tuikov
2006-03-03 10:14 ` Luben Tuikov
2006-03-03 15:23   ` James Bottomley
2006-03-03 15:58     ` Stefan Richter
2006-03-03 16:26       ` James Bottomley
2006-03-03 17:03         ` Mike Anderson
2006-03-03 17:28           ` Jeff Garzik
2006-03-06 18:30       ` Douglas Gilbert
2006-03-03 18:20     ` Luben Tuikov
2006-03-06  8:26 ` Mike Anderson
2006-03-06 15:13   ` James Bottomley
2006-03-06 16:37     ` Jeff Garzik
2006-03-18  1:45 ` Alexis Bruemmer [this message]
2006-03-18  2:05   ` [PATCH] " Alexis Bruemmer
2006-03-18 15:24   ` James Bottomley
2006-03-20  5:53     ` Mike Anderson

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=1142646304.7462.36.camel@localhost.localdomain \
    --to=alexisb@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=Robert_Tarte@adaptec.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox