All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] isci: isci: remove SCSI host before detaching from SAS transport
@ 2015-11-04 16:48 Jinpu Wang
  2015-11-05 10:23 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jinpu Wang @ 2015-11-04 16:48 UTC (permalink / raw)
  To: Jej B, linux-scsi, intel-linux-scu; +Cc: hch, brood

From b1fb56b6d98610251253dc4b858df509df08e813 Mon Sep 17 00:00:00 2001
From: Jack Wang <jinpu.wang@profitbricks.com>
Date: Wed, 4 Nov 2015 09:46:05 +0100
Subject: [PATCH 1/3] isci: remove SCSI host before detaching from SAS
 transport

commit cff549e4860f ("scsi: proper state checking and module refcount
handling in scsi_device_get")
, the reference count of scsi device was changed, which could lead to when
rmmod with at least on drive attached, SCSI error handle will
run into infinite loop, and lockup the system.

Fix it by remove scsi host first, this way scsi core will not send
commands down after detaching SAS transport.

This is a follow up fix for Benjamin's fix for pm80xx.

See also:
http://www.spinics.net/lists/linux-scsi/msg90088.html

Signed-off-by: Jack Wang <jinpu.wang@profitbricks.com>
---
 drivers/scsi/isci/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 0dfcabe..9e0d069 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -272,11 +272,11 @@ static void isci_unregister(struct isci_host *isci_host)
  if (!isci_host)
  return;

+ shost = to_shost(isci_host);
+ scsi_remove_host(shost);
  sas_unregister_ha(&isci_host->sas_ha);

- shost = to_shost(isci_host);
  sas_remove_host(shost);
- scsi_remove_host(shost);
  scsi_host_put(shost);
 }

-- 
1.9.1


-- 
Mit freundlichen Grüßen,
Best Regards,

Jack Wang

Linux Kernel Developer Storage
ProfitBricks GmbH  The IaaS-Company.

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Tel: +49 30 5770083-42
Fax: +49 30 5770085-98
Email: jinpu.wang@profitbricks.com
URL: http://www.profitbricks.de

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B.
Geschäftsführer: Andreas Gauger, Achim Weiss.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] isci: isci: remove SCSI host before detaching from SAS transport
  2015-11-04 16:48 [PATCH 1/3] isci: isci: remove SCSI host before detaching from SAS transport Jinpu Wang
@ 2015-11-05 10:23 ` Christoph Hellwig
  2015-11-05 11:36   ` Jinpu Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2015-11-05 10:23 UTC (permalink / raw)
  To: Jinpu Wang; +Cc: Jej B, linux-scsi, intel-linux-scu, hch, brood

Hi Jack,

all three patches look fine to me, but it seems like your mailer mangled
the whitespaces.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] isci: isci: remove SCSI host before detaching from SAS transport
  2015-11-05 10:23 ` Christoph Hellwig
@ 2015-11-05 11:36   ` Jinpu Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jinpu Wang @ 2015-11-05 11:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jej B, linux-scsi, intel-linux-scu, brood

Hi Christoph,

On Thu, Nov 5, 2015 at 11:23 AM, Christoph Hellwig <hch@lst.de> wrote:
> Hi Jack,
>
> all three patches look fine to me, but it seems like your mailer mangled
> the whitespaces.

Thanks, I've resend with git send-email.
Sorry for inconvenient.

-- 
Mit freundlichen Grüßen,
Best Regards,

Jack Wang

Linux Kernel Developer Storage
ProfitBricks GmbH  The IaaS-Company.

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin
Tel: +49 30 5770083-42
Fax: +49 30 5770085-98
Email: jinpu.wang@profitbricks.com
URL: http://www.profitbricks.de

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B.
Geschäftsführer: Andreas Gauger, Achim Weiss.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-05 11:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04 16:48 [PATCH 1/3] isci: isci: remove SCSI host before detaching from SAS transport Jinpu Wang
2015-11-05 10:23 ` Christoph Hellwig
2015-11-05 11:36   ` Jinpu Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.