linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: James Bottomley <jejb@linux.vnet.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Hannes Reinecke <hare@suse.de>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	stable@vger.kernel.org, #@suse.de, v4.5+@suse.de
Subject: [PATCH v4 2/3] ses: use scsi_is_sas_rphy instead of is_sas_attached
Date: Wed, 17 Aug 2016 11:46:17 +0200	[thread overview]
Message-ID: <34f1f359e3a7c5ca573c3ca52b110c13666fc22e.1471426748.git.jthumshirn@suse.de> (raw)
In-Reply-To: <cover.1471426748.git.jthumshirn@suse.de>
In-Reply-To: <cover.1471426748.git.jthumshirn@suse.de>

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

  parent reply	other threads:[~2016-08-17  9:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17  9:46 [PATCH v4 0/3] Fix panic when a SES device is attached to a hpsa logical volume Johannes Thumshirn
2016-08-17  9:46 ` [PATCH v4 1/3] sas: provide stub implementation for scsi_is_sas_rphy Johannes Thumshirn
2016-08-17  9:46 ` Johannes Thumshirn [this message]
2016-08-18 15:41   ` [PATCH v4 2/3] ses: use scsi_is_sas_rphy instead of is_sas_attached James Bottomley
2016-08-18 16:08     ` James Bottomley
2016-08-19  6:53       ` Johannes Thumshirn
2016-08-22  8:57   ` kbuild test robot
2016-08-24  7:22     ` Johannes Thumshirn
2016-08-17  9:46 ` [PATCH v4 3/3] sas: remove is_sas_attached() Johannes Thumshirn
2016-08-19  2:24 ` [PATCH v4 0/3] Fix panic when a SES device is attached to a hpsa logical volume Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34f1f359e3a7c5ca573c3ca52b110c13666fc22e.1471426748.git.jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=#@suse.de \
    --cc=hare@suse.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=v4.5+@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).