Re: [PATCH v3 08/14] isci: kill iphy->isci_port lookups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 5, 2012 at 4:59 PM, Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> This field is a holdover from the OS abstraction conversion.  The stable
> phy to port lookups are done via iphy->ownining_port under scic_lock.
> After this conversion to use port->lldd_port the only volatile lookup is
> the initial lookup in isci_port_formed().  After that point any lookup
> via a successfully notified domain_device is guaranteed to be valid
> until the domain_device is destroyed.
>
> Delete ->start_complete as it is only set once and is set as a
> consequence of the port going link up, by definition of getting a port
> formed event the port is "ready".
>
> While we are correcting port lookups also move the asd_sas_port table
> out from under the isci_port.  This is to preclude any temptation to use
> container_of() to convert an asd_sas_port to an isci_port, the
> association is dynamic and under libsas control.
>
> Tested-by: Maciej Trela <maciej.trela@xxxxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
[..]
> @@ -1714,24 +1721,55 @@ int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *ipor
>        return ret;
>  }
>
> -/**
> - * isci_port_deformed() - This function is called by libsas when a port becomes
> - *    inactive.
> - * @phy: This parameter specifies the libsas phy with the inactive port.
> - *
> - */
>  void isci_port_deformed(struct asd_sas_phy *phy)
>  {
> -       pr_debug("%s: sas_phy = %p\n", __func__, phy);
> +       struct isci_host *ihost = phy->ha->lldd_ha;
> +       struct isci_port *iport = phy->port->lldd_port;
> +       unsigned long flags;
> +       int i;
> +
> +       /* we got a port notification on a port that was subsequently
> +        * torn down and libsas is just now catching up
> +        */
> +       if (!iport)
> +               return;
> +
> +       spin_lock_irqsave(&ihost->scic_lock, flags);
> +       for (i = 0; i < SCI_MAX_PHYS; i++) {
> +               if (iport->active_phy_mask & 1 << i)
> +                       break;
> +       }
> +       spin_unlock_irqrestore(&ihost->scic_lock, flags);
> +
> +       if (i >= SCI_MAX_PHYS)
> +               dev_dbg(&ihost->pdev->dev, "%s: port: %ld\n",
> +                       __func__, iport - &ihost->ports[0]);
>  }

As spotted by David this causes 32-bit build breakage.  I'll fold in
the fix, rebase, and re-post for the next round of libsas fixups.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux