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


Groups > linux.kernel > #1461242

Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain address.

From James Bottomley <jejb@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain address.
Date 2016-08-12 16:40 +0200
Message-ID <s5lMU-2Ra-75@gated-at.bofh.it> (permalink)
References (1 earlier) <s4ZW1-5uM-11@gated-at.bofh.it> <s51l7-6jV-33@gated-at.bofh.it> <s52Az-7iZ-21@gated-at.bofh.it> <s5hzA-if-15@gated-at.bofh.it> <s5kxs-26U-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2016-08-12 at 15:11 +0200, Johannes Thumshirn wrote:
> On Fri, Aug 12, 2016 at 12:08:54PM +0200, Johannes Thumshirn wrote:
> > Ok, we can't use the rphy because of wide-ports. We can't fix it to 
> > an end device either, as this makes some peoples systems 
> > unbootable. Now let's find a third option satisfying the needs of 
> > SAS wide-ports and my customers (and others running 4.5+ with a SAS
> > enclosure).
> > 
> > I'm digging...
> 
> 
> To answer myself, Hannes suggested doing it like this:
> 
> 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) {
> 
> 
> The reasoning behind this is, we only read the address if we have an
> actual sas_rphy.
> 
> Would this be OK for you?

Could you please debug the why? first before we start throwing patches
around.  is_sas_attached(sdev) returns true if the sdev is the child of
a SAS controller.  What is this thing you've found that has a sdev
attached to a SAS controller but isn't and end device?

if is_sas_attached() passes but scsi_is_sas_rphy() doesn't you've got a
device that is the child of a SAS host which has an rphy but which
isn't an expander or end device.  That's pretty much the end of the
list of things which can lie at the end of rphys since we lump the SATA
possibilities in with end devices.

James

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


Thread

[PATCH] SAS: use sas_rphy instead of sas_end_device to obtain address. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-11 10:00 +0200
  Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. James Bottomley <jejb@linux.vnet.ibm.com> - 2016-08-11 17:20 +0200
    Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-11 18:50 +0200
      Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. James Bottomley <jejb@linux.vnet.ibm.com> - 2016-08-11 20:10 +0200
        Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-12 12:10 +0200
          Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-12 15:20 +0200
            Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. James Bottomley <jejb@linux.vnet.ibm.com> - 2016-08-12 16:40 +0200
              Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. Hannes Reinecke <hare@suse.de> - 2016-08-12 16:50 +0200
                Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. James Bottomley <jejb@linux.vnet.ibm.com> - 2016-08-12 17:00 +0200
                Re: [PATCH] SAS: use sas_rphy instead of sas_end_device to obtain  address. Johannes Thumshirn <jthumshirn@suse.de> - 2016-08-12 17:00 +0200

csiph-web