Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org, Li Zhong <lizhongfs@gmail.com>
Cc: Wenchao Hao <haowenchao@huawei.com>,
	Andrey Melnikov <temnota.am@gmail.com>,
	Martin Wilck <mwilck@suse.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>
Subject: The PQ=1 saga
Date: Tue, 24 Jan 2023 19:01:58 -0500	[thread overview]
Message-ID: <yq1lelrleqr.fsf@ca-mkp.ca.oracle.com> (raw)


I would like to revert commit 948e922fc446 ("scsi: core: map PQ=1,
PDT=other values to SCSI_SCAN_TARGET_PRESENT").

I have been spending quite a bit of time digging through old SCSI and
controller specs. As far as I can tell the original Linux behavior was
correct. Recent SPC specs are very abstract in this department resulting
in unfortunate ambiguity. But originally PQ=1 meant "LUN supports this
peripheral device type but no physical device is currently connected".

Based on this original definition, PQ=1 has been widely used throughout
the industry as a means to avoid associating an ULD driver with a
device. The LUN is accessible (primary commands, etc.) but no media is
present (no physical device connected).

Our original algorithm, which I would like to reinstate, is essentially
the following (in slightly unrolled form):

        if (PQ == 3)
            /* Don't expose device */
        else if ((PQ == 1 || sdev->pdt_1f_for_no_lun) && PDT == 0x1f)
            /* Don't expose device */
        else if (PQ == 1) {
            /* Expose device, don't bind ULD */
        } else /* PQ == 0 */
            /* Expose device, bind ULD if PDT is supported */

I would like to understand why -- in the case of the IBM 2145 --
exposing the sg device caused problems. Li: Can you shed some light on
the problems caused by 2145 LUNs reporting PQ=1?

Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

             reply	other threads:[~2023-01-25  0:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  0:01 Martin K. Petersen [this message]
2023-01-25  1:02 ` The PQ=1 saga Brian Bunker
2023-01-25  4:04   ` Martin K. Petersen
2023-01-25 19:56     ` Brian Bunker
2023-01-25 20:36       ` Bart Van Assche
2023-01-25  1:41 ` Bart Van Assche
2023-01-25  8:33   ` Martin Wilck
2023-01-26  9:01     ` Hannes Reinecke
2023-01-27 19:57       ` Brian Bunker
2023-01-27 20:43         ` Bart Van Assche
2023-01-27 21:33           ` Brian Bunker
2023-01-30 13:35         ` Hannes Reinecke
2023-01-31 21:00           ` Brian Bunker
2025-11-20 16:46             ` Brian Bunker

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=yq1lelrleqr.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=haowenchao@huawei.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lizhongfs@gmail.com \
    --cc=mwilck@suse.com \
    --cc=temnota.am@gmail.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