All of lore.kernel.org
 help / color / mirror / Atom feed
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, Jianzhou Zhao <luckd0g@163.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumit Saxena <sumit.saxena@broadcom.com>,
	Shivasharan S <shivasharan.srikanteshwara@broadcom.com>,
	Chandrakanth patil <chandrakanth.patil@broadcom.com>,
	Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	Ranjan Kumar <ranjan.kumar@broadcom.com>,
	Nilesh Javali <njavali@marvell.com>,
	Manish Rangankar <mrangankar@marvell.com>,
	GR-QLogic-Storage-Upstream@marvell.com
Subject: Re: [PATCH v5 5/6] scsi: core: Protect host state changes with the host lock
Date: Fri, 7 Aug 2026 09:21:47 +0100	[thread overview]
Message-ID: <caa3b35b-2ce7-4710-931c-35c5884a8ef9@oracle.com> (raw)
In-Reply-To: <b861a237-eb60-45a9-b932-1bdaa29abc46@acm.org>

On 06/08/2026 18:19, Bart Van Assche wrote:
>>> +int scsi_host_set_state(struct Scsi_Host *shost, enum scsi_host_state 
>>> state)
>>> +    __must_hold(shost->host_lock);
>> 
>> How come we have this in the prototype and not the actual function itself?
> 
> Adding __must_hold() to the function declaration is sufficient. Adding
> __must_hold() to the function definition is optional if it has already
> been added to the function definition.

Understood, but I would have thought that adding it in the actual 
function would be nice as when developers analyze the code, they look at 
the function and not the prototype (and it is nice to know the locking 
state).

Thanks,
John

  reply	other threads:[~2026-08-07  8:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 21:36 [PATCH v5 0/6] Enable lock context analysis in the SCSI core and UFS driver Bart Van Assche
2026-08-05 21:36 ` [PATCH v5 1/6] ufs: core: Set task state before io_schedule_timeout() Bart Van Assche
2026-08-05 21:36 ` [PATCH v5 2/6] ufs: core: Enable lock context analysis Bart Van Assche
2026-08-05 21:36 ` [PATCH v5 3/6] scsi: core: Pass the SCSI host pointer directly to scanning functions Bart Van Assche
2026-08-06  9:02   ` John Garry
2026-08-05 21:36 ` [PATCH v5 4/6] scsi: core: Add lock context annotations Bart Van Assche
2026-08-05 22:00   ` sashiko-bot
2026-08-06  9:03   ` John Garry
2026-08-05 21:36 ` [PATCH v5 5/6] scsi: core: Protect host state changes with the host lock Bart Van Assche
2026-08-06  9:13   ` John Garry
2026-08-06 17:19     ` Bart Van Assche
2026-08-07  8:21       ` John Garry [this message]
2026-08-07 22:26     ` Bart Van Assche
2026-08-05 21:36 ` [PATCH v5 6/6] scsi: core: Enable lock context analysis Bart Van Assche
2026-08-06  9:16   ` John Garry
2026-08-06 16:58     ` Bart Van Assche
2026-08-06  9:26 ` [PATCH v5 0/6] Enable lock context analysis in the SCSI core and UFS driver John Garry

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=caa3b35b-2ce7-4710-931c-35c5884a8ef9@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bvanassche@acm.org \
    --cc=chandrakanth.patil@broadcom.com \
    --cc=elver@google.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=luckd0g@163.com \
    --cc=martin.petersen@oracle.com \
    --cc=mrangankar@marvell.com \
    --cc=njavali@marvell.com \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=shivasharan.srikanteshwara@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=sumit.saxena@broadcom.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.