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


Groups > linux.kernel > #1464420 > unrolled thread

[PATCH v3 0/3] Fix panic when a SES device is attached to a hpsa logical volume.

Started byJohannes Thumshirn <jthumshirn@suse.de>
First post2016-08-17 11:00 +0200
Last post2016-08-17 11:00 +0200
Articles 4 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/3] Fix panic when a SES device is attached to a hpsa logical volume. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-17 11:00 +0200
    [PATCH v3 1/3] sas: provide stub implementation for scsi_is_sas_rphy Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-17 11:00 +0200
    [PATCH v3 3/3] sas: remove is_sas_attached() Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-17 11:00 +0200
    [PATCH v3 2/3] ses: use scsi_is_sas_rphy instead of is_sas_attached Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-17 11:00 +0200

#1464420 — [PATCH v3 0/3] Fix panic when a SES device is attached to a hpsa logical volume.

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-08-17 11:00 +0200
Subject[PATCH v3 0/3] Fix panic when a SES device is attached to a hpsa logical volume.
Message-ID<s74RA-75h-15@gated-at.bofh.it>
The first patch provides stub implementations for scsi_is_sas_phy()
and sas_get_address() for the case that CONFIG_SCSI_SAS_ATTRS is not
defined.

The second patch implements the actual fix in ses.c by changing the
is_sas_attached() call to scsi_is_sas_rphy().

The third and last patch removes is_sas_attached() as it doesn't have
any more consumers left.

Changes from v2:
* Fix phy vs. rphy typo in patch 1/3.
  Verified with config from http://www.spinics.net/lists/linux-scsi/msg99067.html

Johannes Thumshirn (3):
  sas: provide stub implementation for scsi_is_sas_rphy
  ses: use scsi_is_sas_rphy instead of is_sas_attached
  sas: remove is_sas_attached()

 drivers/scsi/scsi_transport_sas.c | 16 ----------------
 drivers/scsi/ses.c                |  2 +-
 include/scsi/scsi_transport_sas.h |  5 ++---
 3 files changed, 3 insertions(+), 20 deletions(-)

-- 
1.8.5.6

[toc] | [next] | [standalone]


#1464421 — [PATCH v3 1/3] sas: provide stub implementation for scsi_is_sas_rphy

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-08-17 11:00 +0200
Subject[PATCH v3 1/3] sas: provide stub implementation for scsi_is_sas_rphy
Message-ID<s74RA-75h-13@gated-at.bofh.it>
In reply to#1464420
Provide a stub implementation for scsi_is_sas_rphy for kernel
configurations which do not have CONFIG_SCSI_SAS_ATTRS defined.

Reported-by: kbuild test robot <lkp@intel.com>
Suggested-by: James Bottomley <jejb@linux.vnet.ibm.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 include/scsi/scsi_transport_sas.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 13c0b2b..8d0d2fb 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -15,8 +15,14 @@ static inline int is_sas_attached(struct scsi_device *sdev)
 {
 	return 0;
 }
+
+static inline int scsi_is_sas_rphy(const struct device *sdev)
+{
+	return 0;
+}
 #else
 extern int is_sas_attached(struct scsi_device *sdev);
+extern int scsi_is_sas_rphy(const struct device *);
 #endif
 
 static inline int sas_protocol_ata(enum sas_protocol proto)
@@ -187,7 +193,6 @@ extern struct sas_phy *sas_phy_alloc(struct device *, int);
 extern void sas_phy_free(struct sas_phy *);
 extern int sas_phy_add(struct sas_phy *);
 extern void sas_phy_delete(struct sas_phy *);
-extern int scsi_is_sas_phy(const struct device *);
 
 u64 sas_get_address(struct scsi_device *);
 unsigned int sas_tlr_supported(struct scsi_device *);
-- 
1.8.5.6

[toc] | [prev] | [next] | [standalone]


#1464424 — [PATCH v3 3/3] sas: remove is_sas_attached()

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-08-17 11:00 +0200
Subject[PATCH v3 3/3] sas: remove is_sas_attached()
Message-ID<s74RA-75h-29@gated-at.bofh.it>
In reply to#1464420
As there are no more users of is_sas_attached() left, remove it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/scsi_transport_sas.c | 16 ----------------
 include/scsi/scsi_transport_sas.h |  6 ------
 2 files changed, 22 deletions(-)

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 3f0ff07..60b651b 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -341,22 +341,6 @@ static int do_sas_phy_delete(struct device *dev, void *data)
 }
 
 /**
- * is_sas_attached - check if device is SAS attached
- * @sdev: scsi device to check
- *
- * returns true if the device is SAS attached
- */
-int is_sas_attached(struct scsi_device *sdev)
-{
-	struct Scsi_Host *shost = sdev->host;
-
-	return shost->transportt->host_attrs.ac.class ==
-		&sas_host_class.class;
-}
-EXPORT_SYMBOL(is_sas_attached);
-
-
-/**
  * sas_remove_children  -  tear down a devices SAS data structures
  * @dev:	device belonging to the sas object
  *
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 8d0d2fb..4d287cb 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -11,17 +11,11 @@ struct sas_rphy;
 struct request;
 
 #if !IS_ENABLED(CONFIG_SCSI_SAS_ATTRS)
-static inline int is_sas_attached(struct scsi_device *sdev)
-{
-	return 0;
-}
-
 static inline int scsi_is_sas_rphy(const struct device *sdev)
 {
 	return 0;
 }
 #else
-extern int is_sas_attached(struct scsi_device *sdev);
 extern int scsi_is_sas_rphy(const struct device *);
 #endif
 
-- 
1.8.5.6

[toc] | [prev] | [next] | [standalone]


#1464426 — [PATCH v3 2/3] ses: use scsi_is_sas_rphy instead of is_sas_attached

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-08-17 11:00 +0200
Subject[PATCH v3 2/3] ses: use scsi_is_sas_rphy instead of is_sas_attached
Message-ID<s74RA-75h-27@gated-at.bofh.it>
In reply to#1464420
Use scsi_is_sas_rphy() instead of is_sas_attached() to decide whether
we should obtain the SAS address from a scsi device or not. This will
prevent us from tripping on the BUG_ON() in sas_sdev_to_rdev() if the
rphy isn't attached to the SAS transport class, like it is with hpsa's
logical devices.

Fixes: 3f8d6f2a0 ('ses: fix discovery of SATA devices in SAS enclosures')
Cc: stable@vger.kernel.org # v4.5+
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/ses.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 53ef1cb6..1d82053 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -587,7 +587,7 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
 
 	ses_enclosure_data_process(edev, to_scsi_device(edev->edev.parent), 0);
 
-	if (is_sas_attached(sdev))
+	if (scsi_is_sas_rphy(&sdev->sdev_gendev))
 		efd.addr = sas_get_address(sdev);
 
 	if (efd.addr) {
-- 
1.8.5.6

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web