From: Tomas Henzl <thenzl@redhat.com>
To: Don Brace <don.brace@pmcs.com>,
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
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1 16/25] hpsa: refactor hpsa_figure_bus_target_lun
Date: Thu, 29 Oct 2015 17:27:32 +0100 [thread overview]
Message-ID: <563248F4.3040105@redhat.com> (raw)
In-Reply-To: <20151028220607.5323.19347.stgit@brunhilda>
On 28.10.2015 23:06, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@pmcs.com>
>
> setup for sas transport. Need to set the
> bus and target accordingly.
>
> 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 | 25 ++++++++++++-------------
> drivers/scsi/hpsa.h | 5 +++++
> 2 files changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 1361414..24b3c8c 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -3521,38 +3521,37 @@ static int is_ext_target(struct ctlr_info *h, struct hpsa_scsi_dev_t *device)
> return 0;
> }
>
> -/* Helper function to assign bus, target, lun mapping of devices.
> - * Puts non-external target logical volumes on bus 0, external target logical
> - * volumes on bus 1, physical devices on bus 2. and the hba on bus 3.
> +/*
> + * Helper function to assign bus, target, lun mapping of devices.
> * Logical drive target and lun are assigned at this time, but
> * physical device lun and target assignment are deferred (assigned
> * in hpsa_find_target_lun, called by hpsa_scsi_add_entry.)
> - */
> +*/
> static void figure_bus_target_lun(struct ctlr_info *h,
> u8 *lunaddrbytes, struct hpsa_scsi_dev_t *device)
> {
> - u32 lunid = le32_to_cpu(*((__le32 *) lunaddrbytes));
> + u32 lunid = get_unaligned_le32(lunaddrbytes);
>
> if (!is_logical_dev_addr_mode(lunaddrbytes)) {
> /* physical device, target and lun filled in later */
> if (is_hba_lunid(lunaddrbytes))
> - hpsa_set_bus_target_lun(device, 3, 0, lunid & 0x3fff);
> + hpsa_set_bus_target_lun(device,
> + HPSA_HBA_BUS, 0, lunid & 0x3fff);
> else
> /* defer target, lun assignment for physical devices */
> - hpsa_set_bus_target_lun(device, 2, -1, -1);
> + hpsa_set_bus_target_lun(device,
> + HPSA_PHYSICAL_DEVICE_BUS, -1, -1);
> return;
> }
> /* It's a logical device */
> if (is_ext_target(h, device)) {
> - /* external target way, put logicals on bus 1
> - * and match target/lun numbers box
> - * reports, other smart array, bus 0, target 0, match lunid
> - */
> hpsa_set_bus_target_lun(device,
> - 1, (lunid >> 16) & 0x3fff, lunid & 0x00ff);
> + HPSA_EXTERNAL_RAID_VOLUME_BUS, (lunid >> 16) & 0x3fff,
> + lunid & 0x00ff);
> return;
> }
> - hpsa_set_bus_target_lun(device, 0, 0, lunid & 0x3fff);
> + hpsa_set_bus_target_lun(device, HPSA_RAID_VOLUME_BUS,
> + 0, lunid & 0x3fff);
> }
>
> /*
> diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> index 808b520..38d5534 100644
> --- a/drivers/scsi/hpsa.h
> +++ b/drivers/scsi/hpsa.h
> @@ -367,6 +367,11 @@ struct offline_device_entry {
> #define IOACCEL2_INBOUND_POSTQ_64_LOW 0xd0
> #define IOACCEL2_INBOUND_POSTQ_64_HI 0xd4
>
> +#define HPSA_PHYSICAL_DEVICE_BUS 0
> +#define HPSA_RAID_VOLUME_BUS 1
> +#define HPSA_EXTERNAL_RAID_VOLUME_BUS 2
> +#define HPSA_HBA_BUS 3
Some of the numbers changed their values from what they used
to be before. It probably doesn't matter, but users may be used
to certain numbers assigned and this will change the scheme.
If there is no reason for the change, please keep the numbering
stable.
-tm
> +
> /*
> Send the command to the hardware
> */
>
> --
> 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
next prev parent reply other threads:[~2015-10-29 16:27 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 22:04 [PATCH 1 00/25] hpsa updates Don Brace
2015-10-28 22:04 ` [PATCH 1 01/25] hpsa: stop zeroing reset_cmds_out and ioaccel_cmds_out during rescan Don Brace
2015-10-29 13:25 ` Tomas Henzl
2015-10-30 7:45 ` Hannes Reinecke
2015-10-28 22:04 ` [PATCH 1 02/25] hpsa: remove unused hpsa_tag_discard_error_bits Don Brace
2015-10-29 13:26 ` Tomas Henzl
2015-10-29 14:37 ` Manoj Kumar
2015-10-29 14:49 ` Don Brace
2015-10-30 7:46 ` Hannes Reinecke
2015-10-28 22:04 ` [PATCH 1 03/25] hpsa: check for null arguments to dev_printk Don Brace
2015-10-29 13:41 ` Tomas Henzl
2015-10-29 14:41 ` Manoj Kumar
2015-10-30 7:47 ` Hannes Reinecke
2015-10-30 14:16 ` Don Brace
2015-10-28 22:04 ` [PATCH 1 04/25] hpsa: fix null device issues Don Brace
2015-10-29 14:06 ` Tomas Henzl
2015-10-30 7:49 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 05/25] hpsa: allow driver requested rescans Don Brace
2015-10-30 7:51 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 06/25] hpsa: abandon rescans on memory alloaction failures Don Brace
2015-10-30 7:53 ` Hannes Reinecke
2015-10-30 20:44 ` Don Brace
2015-10-28 22:05 ` [PATCH 1 07/25] hpsa: correct transfer length for 6 byte read/write commands Don Brace
2015-10-30 7:54 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 08/25] hpsa: fix hpsa_adjust_hpsa_scsi_table Don Brace
2015-10-29 14:23 ` Tomas Henzl
2015-10-30 7:57 ` Hannes Reinecke
2015-10-30 20:46 ` Don Brace
2015-10-28 22:05 ` [PATCH 1 09/25] hpsa: fix physical target reset Don Brace
2015-10-29 14:30 ` Tomas Henzl
2015-10-29 15:29 ` Don Brace
2015-10-29 15:52 ` Tomas Henzl
2015-10-30 7:59 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 10/25] hpsa: correct check for non-disk devices Don Brace
2015-10-29 14:37 ` Tomas Henzl
2015-10-30 8:01 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 11/25] hpsa: correct ioaccel2 sg chain len Don Brace
2015-10-29 15:01 ` Tomas Henzl
2015-10-30 8:01 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 12/25] hpsa: simplify check for device exposure Don Brace
2015-10-29 15:03 ` Tomas Henzl
2015-10-30 8:04 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 13/25] hpsa: simplify update scsi devices Don Brace
2015-10-29 15:53 ` Tomas Henzl
2015-10-29 16:43 ` Matthew R. Ochs
2015-10-29 19:01 ` Don Brace
2015-10-29 20:28 ` Matthew R. Ochs
2015-10-30 8:05 ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 14/25] hpsa: add function is_logical_device Don Brace
2015-10-29 15:53 ` Tomas Henzl
2015-10-29 16:46 ` Matthew R. Ochs
2015-10-30 8:05 ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 15/25] hpsa: enhance hpsa_get_device_id Don Brace
2015-10-29 16:04 ` Tomas Henzl
2015-10-29 17:04 ` Matthew R. Ochs
2015-10-30 8:08 ` Hannes Reinecke
2015-10-30 20:59 ` Don Brace
2015-10-28 22:06 ` [PATCH 1 16/25] hpsa: refactor hpsa_figure_bus_target_lun Don Brace
2015-10-29 16:27 ` Tomas Henzl [this message]
2015-10-30 8:09 ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 17/25] hpsa: move scsi_add_device and scsi_remove_device calls to new function Don Brace
2015-10-29 16:37 ` Tomas Henzl
2015-10-29 17:21 ` Matthew R. Ochs
2015-10-29 20:30 ` Don Brace
2015-10-30 15:56 ` Matthew R. Ochs
2015-10-30 8:09 ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 18/25] External array LUNs must use target and lun numbers assigned by the Don Brace
2015-10-29 19:41 ` Matthew R. Ochs
2015-10-30 8:11 ` Hannes Reinecke
2015-10-30 14:11 ` Tomas Henzl
2015-10-28 22:06 ` [PATCH 1 19/25] hpsa: eliminate fake lun0 enclosures Don Brace
2015-10-29 20:05 ` Matthew R. Ochs
2015-10-30 8:12 ` Hannes Reinecke
2015-10-30 14:12 ` Tomas Henzl
2015-10-28 22:06 ` [PATCH 1 20/25] hpsa: add discovery polling for PT RAID devices Don Brace
2015-10-29 20:20 ` Matthew R. Ochs
[not found] ` <563286B7.8070200@pmcs.com>
2015-10-29 20:59 ` Matthew R. Ochs
2015-10-30 14:08 ` Don Brace
2015-10-30 15:58 ` Matthew R. Ochs
2015-10-30 8:15 ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 21/25] hpsa: disable report lun data caching Don Brace
2015-10-30 8:16 ` Hannes Reinecke
2015-10-30 14:25 ` Tomas Henzl
2015-10-30 21:18 ` Don Brace
2015-10-30 16:27 ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 22/25] hpsa: enhance device messages Don Brace
2015-10-30 8:16 ` Hannes Reinecke
2015-10-30 14:32 ` Tomas Henzl
2015-11-02 16:54 ` Don Brace
2015-11-03 13:12 ` Tomas Henzl
2015-10-30 16:53 ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 23/25] hpsa: fix multiple issues in path_info_show Don Brace
2015-10-30 8:18 ` Hannes Reinecke
2015-10-30 14:33 ` Tomas Henzl
2015-10-30 17:07 ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 24/25] hpsa: add in sas transport class Don Brace
2015-10-30 8:21 ` Hannes Reinecke
2015-10-30 14:40 ` Tomas Henzl
2015-10-30 20:07 ` Matthew R. Ochs
2015-10-30 22:00 ` Don Brace
2015-10-30 23:23 ` Matthew R. Ochs
2015-11-03 0:40 ` kbuild test robot
2015-10-28 22:07 ` [PATCH 1 25/25] hpsa: bump the driver version Don Brace
2015-10-30 8:22 ` Hannes Reinecke
2015-10-30 14:44 ` Tomas Henzl
2015-10-30 20:08 ` Matthew R. Ochs
2015-11-03 4:49 ` [PATCH 1 00/25] hpsa updates 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=563248F4.3040105@redhat.com \
--to=thenzl@redhat.com \
--cc=Justin.Lindley@pmcs.com \
--cc=Kevin.Barnett@pmcs.com \
--cc=don.brace@pmcs.com \
--cc=elliott@hpe.com \
--cc=hch@infradead.org \
--cc=james.bottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
--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).