linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Swen Schillig <swen@vnet.ibm.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	Martin Petermann <martin@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org
Subject: Re: With kernel 2.6.19 no sg devices for devices that return PQ=1, PDT=0x1f
Date: Wed, 06 Aug 2008 11:06:20 +0200	[thread overview]
Message-ID: <4899698C.4050308@torque.net> (raw)
In-Reply-To: <200808061043.35229.swen@vnet.ibm.com>

Swen Schillig wrote:
> On Tuesday 05 August 2008 18:51, James Bottomley wrote:
>> On Tue, 2008-08-05 at 14:40 +0200, Martin Petermann wrote:
>>> With kernel 2.6.19 a change was introduced that no sg device was 
>>> generated if PQ=1, PDT=0x1f was returned from the particular device:
>>>
>>> commit 84961f28e9d13a4b193d0c8545f3c060c1890ff3
>>> Author: dave wysochanski <davidw@netapp.com>
>>> Date:   Wed Aug 9 14:56:32 2006 -0400
>>>
>>>      [SCSI] Don't add scsi_device for devices that return PQ=1, PDT=0x1f
>>>
>>> Before it was possible on Linux 390 in user space to a e.g. LUN 0 to a 
>>> port and to receive a generic device:
>>>
>>> t6345056:/sys/bus/ccw/devices/0.0.5922/0x500507630313c562 # ll
>>> total 0
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 access_denied
>>> -rw-r--r-- 1 root root 4096 Aug  4 12:07 failed
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 in_recovery
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 status
>>> --w------- 1 root root 4096 Aug  4 12:07 uevent
>>> --w------- 1 root root    0 Aug  4 13:46 unit_add
>>> --w------- 1 root root    0 Aug  5 14:24 unit_remove
>>> t6345056:/sys/bus/ccw/devices/0.0.5922/0x500507630313c562 # echo 0 > 
>>> unit_add
>>> t6345056:/sys/bus/ccw/devices/0.0.5922/0x500507630313c562 # ll
>>> total 0
>>> drwxr-xr-x 2 root root    0 Aug  5 14:25 0x0000000000000000
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 access_denied
>>> -rw-r--r-- 1 root root 4096 Aug  4 12:07 failed
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 in_recovery
>>> -r--r--r-- 1 root root 4096 Aug  4 12:07 status
>>> --w------- 1 root root 4096 Aug  4 12:07 uevent
>>> --w------- 1 root root    0 Aug  5 14:25 unit_add
>>> --w------- 1 root root    0 Aug  5 14:24 unit_remove
>>> t6345056:/sys/bus/ccw/devices/0.0.5922/0x500507630313c562 # lsscsi -g
>>> [0:0:0:0]    no dev  IBM      2107900          2.27  -         /dev/sg0
>>>
>>> After this fix there is no /dev/sg0 device generated.
>>>
>>> We are utilizing the possibility to create such a device for the 
>>> sg_utils commands in the case no other LUN has been attached to a port.
>>>
>>> I do not want to put this fix into question. I would like to know if 
>>> someone has an idea how to workaround this problem and to generate a 
>>> generic device in user space using kernel 2.6.19 or a later version.
>> First of all, why is the device returning PQ=1 PTD=0x1f? this should
>> mean its not connected and probably doesn't exist... ie inaccessible
>> without some unspecified action being taken.  If you can use it, it's
>> clearly not behaving like a PQ=1 LUN.  Perhaps the simplest thing would
>> be for something in s390 to fix up the inquiry data ... or we could
>> allow you could have a script to force it to appear (as in if you send a
>> specific scan for this one LUN we could override the catch in the code
>> that throws it out again).
>>
>> James
>>
>>
>> --
>> 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
>>
> 
> James
> 
> I think Martin is saying that this LUN is a non existent one which is just used for scanning
> all available (existing) LUNs on the remote storage port.
> That's why PQ=1 PTD=0x1f are returned and correct !
> 
> So what's required here is the possibility to add a "dummy" LUN which can be used just for this purpose.
> Not sure whether this is covered by anything in the standard

That sounds like a job for the REPORT LUNS well known logical
unit (WLUN or W-LUN). I implemented one in the scsi_debug driver.
See the description of the "no_lun_0" parameter in
http://sg.torque.net/sg/sdebug26.html

You might try:
   echo "- - 49409" > /sys/class/scsi_host/host<n>/scan
where "host<n>" is the controller in question. Then
see if a WLUN has appeared as a sg device node.

Doug Gilbert



  reply	other threads:[~2008-08-06  9:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 12:40 With kernel 2.6.19 no sg devices for devices that return PQ=1, PDT=0x1f Martin Petermann
2008-08-05 16:51 ` James Bottomley
2008-08-06  8:43   ` Swen Schillig
2008-08-06  9:06     ` Douglas Gilbert [this message]
2008-08-06 16:58       ` James Bottomley
2008-08-08  6:52         ` Swen Schillig
2008-08-09 16:50           ` James Bottomley
2008-08-14 19:59             ` Swen Schillig
2008-08-06 17:47       ` Martin Petermann

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=4899698C.4050308@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin@linux.vnet.ibm.com \
    --cc=swen@vnet.ibm.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).