Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400990

RE: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects

From "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Newsgroups linux.kernel
Subject RE: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects
Date 2016-05-13 23:20 +0200
Message-ID <rysF5-30M-15@gated-at.bofh.it> (permalink)
References <ryrSH-2fO-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Calvin Owens
> Sent: Friday, May 13, 2016 3:28 PM
...
> Subject: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY
> objects
> 
...
> The issue is that enclosure_remove_device() expects to be able to re-add
> the device that was previously enclosured: so with SES running, the order
> we unwind things matters in a way it otherwise wouldn't.
> 
> Since mpt3sas deletes the SAS objects before the SCSI hosts, enclosure
> ends up trying to re-parent the SCSI device from the enclosure to the SAS
> PHY which has already been deleted. This obviously ends in sadness.
> 
> The fix appears to be simple: just call scsi_remove_host() before we call
> sas_port_delete() and/or sas_remove_host().
> 
...
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -8149,6 +8149,8 @@ void scsih_remove(struct pci_dev *pdev)
>  		_scsih_raid_device_remove(ioc, raid_device);
>  	}
> 
> +	scsi_remove_host(shost);
> +
>  	/* free ports attached to the sas_host */
>  	list_for_each_entry_safe(mpt3sas_port, next_port,
>  	   &ioc->sas_hba.sas_port_list, port_list) {
> @@ -8172,7 +8174,6 @@ void scsih_remove(struct pci_dev *pdev)
>  	}
> 
>  	sas_remove_host(shost);
> -	scsi_remove_host(shost);
>  	mpt3sas_base_detach(ioc);
>  	spin_lock(&gioc_lock);
>  	list_del(&ioc->list);

That change matches the pattern of all other drivers calling
sas_remove_host, except for one:
	drivers/message/fusion/mptsas.c

That consensus means this comment in drivers/scsi/scsi_transport_sas.c
is wrong:

/**
 * sas_remove_host  -  tear down a Scsi_Host's SAS data structures
 * @shost:      Scsi Host that is torn down
 *
 * Removes all SAS PHYs and remote PHYs for a given Scsi_Host.
 * Must be called just before scsi_remove_host for SAS HBAs.
 */

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects Calvin Owens <calvinowens@fb.com> - 2016-05-13 22:30 +0200
  RE: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY  objects "Elliott, Robert (Persistent Memory)" <elliott@hpe.com> - 2016-05-13 23:20 +0200
    Re: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY  objects Calvin Owens <calvinowens@fb.com> - 2016-05-16 22:30 +0200
      RE: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects Sathya Prakash Veerichetty <sathya.prakash@broadcom.com> - 2016-05-17 00:00 +0200
        Re: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY  objects Calvin Owens <calvinowens@fb.com> - 2016-05-17 05:20 +0200
          Re: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects Sreekanth Reddy <sreekanth.reddy@broadcom.com> - 2016-05-18 15:20 +0200
            Re: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY  objects Calvin Owens <calvinowens@fb.com> - 2016-05-18 19:50 +0200
              Re: [PATCH] mpt3sas: Do scsi_remove_host() before deleting SAS PHY objects Sreekanth Reddy <sreekanth.reddy@broadcom.com> - 2016-05-19 06:10 +0200

csiph-web