Re: [PATCH v3 03/14] libsas: prevent domain rediscovery competing with ata error handling

Dan Williams
2012-01-09T19:14:51Z

On Thu, Jan 5, 2012 at 4:59 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> +void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev)
> +{
> +       if (!list_empty(&dev->disco_list_node)) {
> +               /* this rphy never saw sas_rphy_add */
> +               list_del_init(&dev->disco_list_node);
> +               sas_rphy_free(dev->rphy);
> +               dev->rphy = NULL;
> +               sas_unregister_common_dev(port, dev);
> +       }
> +
> +       if (dev->rphy) {
> +               sas_rphy_unlink(dev->rphy);
> +
> +               spin_lock_irq(&port->dev_list_lock);
> +               list_move_tail(&dev->dev_list_node, &port->destroy_list);
> +               spin_unlock_irq(&port->dev_list_lock);

This is too early to make the device appear removed from the domain.
Will revise the patch to re-use disco_list_node to for
port->destroy_list.

> +
> +               sas_discover_event(dev->port, DISCE_DESTRUCT);
>        }
> -       sas_unregister_common_dev(port, dev);
>  }
>