public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: David Milburn <dmilburn@redhat.com>
Cc: "james.bottomley@suse.de" <james.bottomley@suse.de>,
	"Fan, Haipao" <haipao.fan@intel.com>,
	"Jiang, Dave" <dave.jiang@intel.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Danecki, Jacek" <jacek.danecki@intel.com>,
	"Trela, Maciej" <Maciej.Trela@intel.com>,
	"Skirvin, Jeffrey D" <jeffrey.d.skirvin@intel.com>,
	"Nadolski, Edmund" <edmund.nadolski@intel.com>,
	"Darrick J. Wong" <djwong@us.ibm.com>
Subject: Re: [PATCH] libsas: fix/amend device gone notification in sas_deform_port()
Date: Fri, 04 Mar 2011 14:53:22 -0800	[thread overview]
Message-ID: <1299279202.15839.4.camel@dwillia2-linux> (raw)
In-Reply-To: <4D716B65.20007@redhat.com>

On Fri, 2011-03-04 at 14:44 -0800, David Milburn wrote:
> Dan Williams wrote:
> >> Dan,
> >>
> >> So, you are seeing sas_ata_task_done() trying to get the ata_port lock,
> >> but it has already been taken earlier in the code path?
> >>
> >> ata_scsi_queuecmd (spin_lock_irqsave(ap->lock, irq_flags)
> >>     __ata_scsi_queuecmd
> >>       ata_scsi_translate
> >>         ata_qc_issue
> >>           sas_ata_qc_issue
> >>             isci_task_execute_task
> >>               isci_task_complete_for_upper_layer
> >>                 sas_ata_task_done
> >> (spin_lock_irqsave(dev->sata_dev.ap->lock, flags)
> > 
> > Exactly.
> > 
> > sas_device_gone() should prevent an lldd from ever attempting an i/o to 
> > a missing sata device (one that has been notified via lldd_dev_gone). 
> > Although, I have only had time to verify the simple unplug case and 
> > sync-cache commands at driver unload.  We'll still need to handle 
> > missing ssp devices, but there are no lldd-external locking concerns in 
> > that path.
> > 
> 
> Dan,
> 
> One other question, should sas_device_gone() be sync'ing with sata io
> thru ata port lock instead of the Scsi_Host lock?
> 
> Looking at sas_queuecommand, the host_lock is released and the ata
> port lock is taken before calling ata_sas_queuecmd, and ata port lock is 
> held
> down the __ata_scsi_queuecmd path.
> 
> Should sas_device_gone get the ap->lock from the domain_device->
> sata_dev to better sync against sata io?

Unless I am mistaken they are one in the same, see ata_sas_port_alloc:

struct ata_port *ata_sas_port_alloc(struct ata_host *host,
                                    struct ata_port_info *port_info,
                                    struct Scsi_Host *shost)
{
        struct ata_port *ap;

        ap = ata_port_alloc(host);
        if (!ap)
                return NULL;

        ap->port_no = 0;
        ap->lock = shost->host_lock;
        ap->pio_mask = port_info->pio_mask;
        ap->mwdma_mask = port_info->mwdma_mask;
        ap->udma_mask = port_info->udma_mask;
        ap->flags |= port_info->flags;
        ap->ops = port_info->port_ops;
        ap->cbl = ATA_CBL_SATA;

        return ap;
}

--
Dan



  reply	other threads:[~2011-03-04 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17  3:11 [PATCH] libsas: fix/amend device gone notification in sas_deform_port() Dan Williams
2011-02-17 23:36 ` David Milburn
2011-02-18  0:19   ` Dan Williams
2011-03-04 22:44     ` David Milburn
2011-03-04 22:53       ` Dan Williams [this message]
2011-03-04 23:08         ` David Milburn
2011-03-26 22:27 ` Dan Williams

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=1299279202.15839.4.camel@dwillia2-linux \
    --to=dan.j.williams@intel.com \
    --cc=Maciej.Trela@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=djwong@us.ibm.com \
    --cc=dmilburn@redhat.com \
    --cc=edmund.nadolski@intel.com \
    --cc=haipao.fan@intel.com \
    --cc=jacek.danecki@intel.com \
    --cc=james.bottomley@suse.de \
    --cc=jeffrey.d.skirvin@intel.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