* [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
@ 2011-06-19 11:48 Bart Van Assche
2011-06-20 11:40 ` Christoph Hellwig
2011-06-20 19:06 ` Brian King
0 siblings, 2 replies; 5+ messages in thread
From: Bart Van Assche @ 2011-06-19 11:48 UTC (permalink / raw)
To: linux-scsi; +Cc: Brian King, Fujita Tomonori
Avoid that SCSI scanning triggers creation of targets with a non-zero
channel number.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: <stable@kernel.org>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
Note: this patch hasn't been tested yet.
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 3d391dc..c31adf5 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -498,6 +498,11 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code)
spin_unlock_irqrestore(hostdata->host->host_lock, flags);
}
+static int ibmvscsi_target_alloc(struct scsi_target *starget)
+{
+ return starget->channel == 0 ? 0 : -ENODEV;
+}
+
/**
* ibmvscsi_reset_host - Reset the connection to the server
* @hostdata: struct ibmvscsi_host_data to reset
@@ -1803,6 +1808,7 @@ static struct scsi_host_template driver_template = {
.module = THIS_MODULE,
.name = "IBM POWER Virtual SCSI Adapter " IBMVSCSI_VERSION,
.proc_name = "ibmvscsi",
+ .target_alloc = ibmvscsi_target_alloc,
.queuecommand = ibmvscsi_queuecommand,
.eh_abort_handler = ibmvscsi_eh_abort_handler,
.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
2011-06-19 11:48 [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning Bart Van Assche
@ 2011-06-20 11:40 ` Christoph Hellwig
2011-06-20 17:58 ` Bart Van Assche
2011-06-20 19:06 ` Brian King
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2011-06-20 11:40 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-scsi, Brian King, Fujita Tomonori
On Sun, Jun 19, 2011 at 01:48:40PM +0200, Bart Van Assche wrote:
> Avoid that SCSI scanning triggers creation of targets with a non-zero
> channel number.
Same comment as for the SRP one applies here as well.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
2011-06-20 11:40 ` Christoph Hellwig
@ 2011-06-20 17:58 ` Bart Van Assche
2011-06-20 19:10 ` Brian King
0 siblings, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2011-06-20 17:58 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, Brian King, Fujita Tomonori
On Mon, Jun 20, 2011 at 1:40 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Sun, Jun 19, 2011 at 01:48:40PM +0200, Bart Van Assche wrote:
>> Avoid that SCSI scanning triggers creation of targets with a non-zero
>> channel number.
>
> Same comment as for the SRP one applies here as well.
If no kernel module parameters have been specified, max_channel is set
to three in the ibmvscsi driver. It's not clear to me why.
Bart.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
2011-06-20 17:58 ` Bart Van Assche
@ 2011-06-20 19:10 ` Brian King
0 siblings, 0 replies; 5+ messages in thread
From: Brian King @ 2011-06-20 19:10 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Christoph Hellwig, linux-scsi, Fujita Tomonori
On 06/20/2011 12:58 PM, Bart Van Assche wrote:
> On Mon, Jun 20, 2011 at 1:40 PM, Christoph Hellwig <hch@infradead.org> wrote:
>> On Sun, Jun 19, 2011 at 01:48:40PM +0200, Bart Van Assche wrote:
>>> Avoid that SCSI scanning triggers creation of targets with a non-zero
>>> channel number.
>>
>> Same comment as for the SRP one applies here as well.
>
> If no kernel module parameters have been specified, max_channel is set
> to three in the ibmvscsi driver. It's not clear to me why.
It could be set as high as 16 in order to support the full 3 bits worth
of bus values as defined in Logical Unit Addressing model in SAM, but
3 is generally sufficient for most users as it allows for 64 targets *
3 buses = 192 virtual scsi targets.
Thanks,
Brian
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
2011-06-19 11:48 [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning Bart Van Assche
2011-06-20 11:40 ` Christoph Hellwig
@ 2011-06-20 19:06 ` Brian King
1 sibling, 0 replies; 5+ messages in thread
From: Brian King @ 2011-06-20 19:06 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-scsi, Fujita Tomonori
On 06/19/2011 06:48 AM, Bart Van Assche wrote:
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index 3d391dc..c31adf5 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -498,6 +498,11 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code)
> spin_unlock_irqrestore(hostdata->host->host_lock, flags);
> }
>
> +static int ibmvscsi_target_alloc(struct scsi_target *starget)
> +{
> + return starget->channel == 0 ? 0 : -ENODEV;
> +}
> +
This will break existing IBM Power users who have more than 64 virtual disks assigned
to a single virtual scsi adapter. The IBM VSCSI target uses Logical Unit Addressing (10b)
and does bus/id/lun -> vscsi LUN mapping as defined in SAM. The 65'th virtual scsi
disk would show up on bus 1 as target 0.
Thanks,
Brian
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-20 19:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-19 11:48 [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning Bart Van Assche
2011-06-20 11:40 ` Christoph Hellwig
2011-06-20 17:58 ` Bart Van Assche
2011-06-20 19:10 ` Brian King
2011-06-20 19:06 ` Brian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox