linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Don Brace <brace77070@gmail.com>
To: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
Cc: scott.teel@pmcs.com, Kevin.Barnett@pmcs.com,
	scott.benesh@pmcs.com, james.bottomley@parallels.com,
	hch@infradead.org, Justin.Lindley@pmcs.com, elliott@hpe.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 20/27] hpsa: generalize external arrays
Date: Thu, 5 Nov 2015 13:51:41 -0600	[thread overview]
Message-ID: <563BB34D.60805@pmcs.com> (raw)
In-Reply-To: <9FDA9021-7F35-44B6-B3CA-04604EA89D31@linux.vnet.ibm.com>

On 11/05/2015 10:23 AM, Matthew R. Ochs wrote:
>> On Nov 4, 2015, at 3:51 PM, Don Brace <don.brace@pmcs.com> wrote:
>>
>> From: Scott Teel <scott.teel@pmcs.com>
>>
>> External array LUNs must use target and lun numbers assigned by the
>> external array. So the driver must treat these differently from
>> local LUNs when assigning lun/target.
>>
>> LUN's 'model' field has been used to detect Lun types that need
>> special treatment, but the desire is to eliminate the need to reference
>> specific array models, and support any external array.
>>
>> Pass-through RAID (PTRAID) luns are not luns of the local controller,
>> so they are not reported in LUN count of command 'ID controller'.
>> However, they ARE reported in "Report logical Luns" command.
>> Local luns are listed first, then PTRAID LUNs.
>>
>> The number of luns from "Report LUNs" in excess of those reported by
>> 'ID controller' are therefore the PTRAID LUNS.
>>
>> We can now remove function is_ext_target, and the 'white list'
>> array of supported model names.
>>
>> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
>> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
>> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
>> Signed-off-by: Don Brace <don.brace@pmcs.com>
>> ---
>> drivers/scsi/hpsa.c     |  139 ++++++++++++++++++++++++++++++++++++++---------
>> drivers/scsi/hpsa.h     |    1
>> drivers/scsi/hpsa_cmd.h |   11 ++++
>> 3 files changed, 125 insertions(+), 26 deletions(-)
>>
>> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
>> index 0af4c67..1a67d63 100644
>> --- a/drivers/scsi/hpsa.c
>> +++ b/drivers/scsi/hpsa.c
>> @@ -275,7 +275,6 @@ static int hpsa_scsi_ioaccel_queue_command(struct ctlr_info *h,
>> static void hpsa_command_resubmit_worker(struct work_struct *work);
>> static u32 lockup_detected(struct ctlr_info *h);
>> static int detect_controller_lockup(struct ctlr_info *h);
>> -static int is_ext_target(struct ctlr_info *h, struct hpsa_scsi_dev_t *device);
>>
>>
>> }
>>
>> @@ -6414,6 +6484,23 @@ static int fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
>> 			c->Request.CDB[7] = (size >> 16) & 0xFF;
>> 			c->Request.CDB[8] = (size >> 8) & 0XFF;
>> 			break;
>> +		case BMIC_IDENTIFY_CONTROLLER:
>> +			c->Request.CDBLen = 10;
>> +			c->Request.type_attr_dir =
>> +				TYPE_ATTR_DIR(cmd_type, ATTR_SIMPLE, XFER_READ);
>> +			c->Request.Timeout = 0;
>> +			c->Request.CDB[0] = BMIC_READ;
>> +			c->Request.CDB[1] = 0;
>> +			c->Request.CDB[2] = 0;
>> +			c->Request.CDB[3] = 0;
>> +			c->Request.CDB[4] = 0;
>> +			c->Request.CDB[5] = 0;
>> +			c->Request.CDB[6] = BMIC_IDENTIFY_CONTROLLER;
>> +			c->Request.CDB[7] = (size >> 16) & 0xFF;
>> +			c->Request.CDB[8] = (size >> 8) & 0XFF;
>> +			c->Request.CDB[9] = 0;
>> +			break;
>> +
> For consistency with the other fill_cmd() cases these unnecessary zeroing statements
> should be removed, either now or at some point in the future.
>
> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

Thanks, unless I have to send up a V3, I'll add this to my next patch set.
It does look cleaner with them removed.
>
>> 		default:
>> 			dev_warn(&h->pdev->dev, "unknown command 0x%c\n", cmd);
>> 			BUG();
>> diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
>> index a4cab12..ffcd4cb 100644
>> --- a/drivers/scsi/hpsa.h
>> +++ b/drivers/scsi/hpsa.h
>> @@ -77,6 +77,7 @@ struct hpsa_scsi_dev_t {
>> 	struct hpsa_scsi_dev_t *phys_disk[RAID_MAP_MAX_ENTRIES];
>> 	int nphysical_disks;
>> 	int supports_aborts;
>> +	int external;   /* 1-from external array 0-not <0-unknown */
>> };
>>
>> struct reply_queue_buffer {
>> diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
>> index c2c0737..c83eaf1 100644
>> --- a/drivers/scsi/hpsa_cmd.h
>> +++ b/drivers/scsi/hpsa_cmd.h
>> @@ -286,6 +286,7 @@ struct SenseSubsystem_info {
>> #define BMIC_FLASH_FIRMWARE 0xF7
>> #define BMIC_SENSE_CONTROLLER_PARAMETERS 0x64
>> #define BMIC_IDENTIFY_PHYSICAL_DEVICE 0x15
>> +#define BMIC_IDENTIFY_CONTROLLER 0x11
>>
>> /* Command List Structure */
>> union SCSI3Addr {
>> @@ -682,6 +683,16 @@ struct hpsa_pci_info {
>> 	u32		board_id;
>> };
>>
>> +struct bmic_identify_controller {
>> +	u8	configured_logical_drive_count;	/* offset 0 */
>> +	u8	pad1[153];
>> +	__le16	extended_logical_unit_count;	/* offset 154 */
>> +	u8	pad2[136];
>> +	u8	controller_mode;	/* offset 292 */
>> +	u8	pad3[32];
>> +};
>> +
>> +
>> struct bmic_identify_physical_device {
>> 	u8    scsi_bus;          /* SCSI Bus number on controller */
>> 	u8    scsi_id;           /* SCSI ID on this bus */
>>
>> --
>> 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
>>
> --
> 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


  reply	other threads:[~2015-11-05 19:51 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 21:49 [PATCH v2 00/27] hpsa updates Don Brace
2015-11-04 21:50 ` [PATCH v2 01/27] hpsa: remove unused parameter hostno Don Brace
2015-11-06 14:22   ` Tomas Henzl
2015-11-04 21:50 ` [PATCH v2 02/27] hpsa: stop zeroing reset_cmds_out and ioaccel_cmds_out during rescan Don Brace
2015-11-04 21:50 ` [PATCH v2 03/27] hpsa: remove unused hpsa_tag_discard_error_bits Don Brace
2015-11-05 15:30   ` Manoj Kumar
2015-11-04 21:50 ` [PATCH v2 04/27] hpsa: change devtype to unsigned Don Brace
2015-11-04 21:50 ` [PATCH v2 05/27] hpsa: check for null arguments to dev_printk Don Brace
2015-11-09  9:37   ` Hannes Reinecke
2015-11-04 21:50 ` [PATCH v2 06/27] hpsa: fix null device issues Don Brace
2015-11-09  9:38   ` Hannes Reinecke
2015-11-04 21:50 ` [PATCH v2 07/27] hpsa: allow driver requested rescans Don Brace
2015-11-04 21:50 ` [PATCH v2 08/27] hpsa: abandon rescans on memory alloaction failures Don Brace
2015-11-09  9:38   ` Hannes Reinecke
2015-11-04 21:50 ` [PATCH v2 09/27] hpsa: correct transfer length for 6 byte read/write commands Don Brace
2015-11-04 21:50 ` [PATCH v2 10/27] hpsa: fix hpsa_adjust_hpsa_scsi_table Don Brace
2015-11-09  9:39   ` Hannes Reinecke
2015-11-04 21:51 ` [PATCH v2 11/27] hpsa: fix physical target reset Don Brace
2015-11-04 21:51 ` [PATCH v2 12/27] hpsa: correct check for non-disk devices Don Brace
2015-11-04 21:51 ` [PATCH v2 13/27] hpsa: correct ioaccel2 sg chain len Don Brace
2015-11-04 21:51 ` [PATCH v2 14/27] hpsa: simplify check for device exposure Don Brace
2015-11-04 21:51 ` [PATCH v2 15/27] hpsa: simplify update scsi devices Don Brace
2015-11-04 21:51 ` [PATCH v2 16/27] hpsa: add function is_logical_device Don Brace
2015-11-04 21:51 ` [PATCH v2 17/27] hpsa: enhance hpsa_get_device_id Don Brace
2015-11-09  9:40   ` Hannes Reinecke
2015-11-04 21:51 ` [PATCH v2 18/27] hpsa: refactor hpsa_figure_bus_target_lun Don Brace
2015-11-05 16:18   ` Matthew R. Ochs
2015-11-04 21:51 ` [PATCH v2 19/27] hpsa: move scsi_add_device and scsi_remove_device calls to new function Don Brace
2015-11-04 21:51 ` [PATCH v2 20/27] hpsa: generalize external arrays Don Brace
2015-11-05 16:23   ` Matthew R. Ochs
2015-11-05 19:51     ` Don Brace [this message]
2015-11-04 21:52 ` [PATCH v2 21/27] hpsa: eliminate fake lun0 enclosures Don Brace
2015-11-04 21:52 ` [PATCH v2 22/27] hpsa: add discovery polling for PT RAID devices Don Brace
2015-11-04 21:52 ` [PATCH v2 23/27] hpsa: disable report lun data caching Don Brace
2015-11-04 21:52 ` [PATCH v2 24/27] hpsa: enhance device messages Don Brace
2015-11-04 21:52 ` [PATCH v2 25/27] hpsa: fix multiple issues in path_info_show Don Brace
2015-11-04 21:52 ` [PATCH v2 26/27] hpsa: add in sas transport class Don Brace
2015-11-04 21:52 ` [PATCH v2 27/27] hpsa: bump the driver version Don Brace
2015-11-06 14:30 ` [PATCH v2 00/27] hpsa updates Tomas Henzl
2015-11-06 15:05   ` Don Brace
2015-11-09 17:46 ` 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=563BB34D.60805@pmcs.com \
    --to=brace77070@gmail.com \
    --cc=Justin.Lindley@pmcs.com \
    --cc=Kevin.Barnett@pmcs.com \
    --cc=elliott@hpe.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mrochs@linux.vnet.ibm.com \
    --cc=scott.benesh@pmcs.com \
    --cc=scott.teel@pmcs.com \
    /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).