On Sun, Jan 8, 2012 at 5:57 PM, Jack Wang <jack_wang@xxxxxxxxx> wrote: >> +int isci_ata_check_ready(struct domain_device *dev) >> +{ >> + struct isci_port *iport = dev->port->lldd_port; >> + struct isci_host *ihost = dev_to_ihost(dev); >> + struct isci_remote_device *idev; >> + unsigned long flags; >> + int rc = 0; >> + >> + spin_lock_irqsave(&ihost->scic_lock, flags); >> + idev = isci_lookup_device(dev); >> + spin_unlock_irqrestore(&ihost->scic_lock, flags); >> + >> + if (!idev) >> + goto out; >> + >> + if (test_bit(IPORT_RESET_PENDING, &iport->state)) >> + goto out; >> + >> + /* snapshot active phy mask */ >> + spin_lock_irqsave(&ihost->scic_lock, flags); >> + rc = !!iport->active_phy_mask; > [Jack Wang] > Hi Dan, > > Could you explain why here you not directly use " > rc = !!iport->active_phy_mask; You are right, it can look at the field outside the lock... and since we have already taken the lock to get a device reference we know we have flushed any recent port events. -- Dan -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html