From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752693AbcHQJq0 (ORCPT ); Wed, 17 Aug 2016 05:46:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:47379 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbcHQJqV (ORCPT ); Wed, 17 Aug 2016 05:46:21 -0400 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: Johannes Thumshirn To: James Bottomley , "Martin K . Petersen" Cc: Hannes Reinecke , Linux Kernel Mailinglist , Linux SCSI Mailinglist , Johannes Thumshirn , 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 Message-Id: <34f1f359e3a7c5ca573c3ca52b110c13666fc22e.1471426748.git.jthumshirn@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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