From: John Garry <john.g.garry@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Marco Elver <elver@google.com>,
linux-scsi@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH v4 3/6] scsi: core: Pass the SCSI host pointer directly
Date: Mon, 3 Aug 2026 17:30:27 +0100 [thread overview]
Message-ID: <69d7dd4a-2c0d-4e1b-984c-732af4e7efb9@oracle.com> (raw)
In-Reply-To: <58b7c76f-6893-44e1-bf0c-e9cbf080a073@acm.org>
On 03/08/2026 17:14, Bart Van Assche wrote:
> On 8/3/26 6: 01 AM, John Garry wrote: > On 31/07/2026 22: 52, Bart Van Assche
> wrote: > > "Pass the SCSI host pointer directly" - that's too vague a title.
> Huh? This patch passes the SCSI host pointer directly to several functions instead
>
>
> On 8/3/26 6:01 AM, John Garry wrote:
>> On 31/07/2026 22:52, Bart Van Assche wrote:
>>
>> "Pass the SCSI host pointer directly" - that's too vague a title.
>
> Huh? This patch passes the SCSI host pointer directly to several
> functions instead of deriving the SCSI host pointer from the SCSI target
> pointer (dev_to_shost(starget->dev.parent)). Hence, I think the title is
> accurate.
>
I wrote vague, as in "Pass the SCSI host pointer directly" to and from
what? I would have "Pass the SCSI host pointer to scan-related
functions" or similar.
>>> In the functions scsi_probe_and_add_lun(), scsi_sequential_lun_scan(),
>>> scsi_report_lun_scan() and __scsi_scan_target() the SCSI host pointer is
>>> derived from the SCSI target pointer. Pass the SCSI host pointer
>>> directly. This patch prepares for enabling lock context analysis.
>>
>> How?
>
> With this patch, lock context annotations can refer to the SCSI host
> pointer directly (__must_hold(&shost->scan_mutex)). Without this patch,
> the following lock context annotation would have to be used instead:
>
> __must_hold(&dev_to_shost(starget->dev.parent)->scan_mutex)
>
> Additionally, in code that locks shost->scan_mutex, the following would
> have to be added to help the compiler understand that shost ==
> dev_to_shost(starget->dev.parent):
>
> __assume_ctx_lock(&dev_to_shost(starget->dev.parent)->scan_mutex);
>
> Christoph Hellwig made it clear during the LSF/MM/BPF summit that he is
> doesn't like __assume_ctx_lock() statements being added and also that he
> prefers to add arguments to functions if that eliminates the need for
> introducing __assume_ctx_lock() statements. Hence this patch.
>
ok, I get it, but it's better to mention the reason briefly, like
"context analysis requires checking on passed argument when using
preferred annotation form"
Thanks!
next prev parent reply other threads:[~2026-08-03 16:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 21:52 [PATCH v4 0/6] Enable lock context analysis in the SCSI core and UFS driver Bart Van Assche
2026-07-31 21:52 ` [PATCH v4 1/6] ufs: core: Set task state before io_schedule_timeout() Bart Van Assche
2026-07-31 21:52 ` [PATCH v4 2/6] ufs: core: Enable lock context analysis Bart Van Assche
2026-08-03 12:38 ` Peter Wang (王信友)
2026-07-31 21:52 ` [PATCH v4 3/6] scsi: core: Pass the SCSI host pointer directly Bart Van Assche
2026-08-03 13:01 ` John Garry
2026-08-03 16:14 ` Bart Van Assche
2026-08-03 16:30 ` John Garry [this message]
2026-08-03 17:15 ` Bart Van Assche
2026-07-31 21:52 ` [PATCH v4 4/6] scsi: core: Add lock context annotations Bart Van Assche
2026-07-31 22:07 ` sashiko-bot
2026-07-31 21:52 ` [PATCH v4 5/6] scsi: core: Protect host state changes with the host lock Bart Van Assche
2026-07-31 22:05 ` sashiko-bot
2026-08-03 17:01 ` John Garry
2026-08-03 17:11 ` Bart Van Assche
2026-08-04 9:16 ` Marco Elver
2026-07-31 21:52 ` [PATCH v4 6/6] scsi: core: Enable lock context analysis Bart Van Assche
2026-07-31 22:05 ` sashiko-bot
2026-08-03 12:19 ` [PATCH v4 1/6] ufs: core: Set task state before io_schedule_timeout() Peter Wang (王信友)
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=69d7dd4a-2c0d-4e1b-984c-732af4e7efb9@oracle.com \
--to=john.g.garry@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bvanassche@acm.org \
--cc=elver@google.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.