From: bugzilla-daemon@kernel.org
To: linux-scsi@vger.kernel.org
Subject: [Bug 216059] Scsi host number of Adaptec RAID controller changes upon a PCIe hotplug and re-insert
Date: Thu, 02 Jun 2022 16:58:41 +0000 [thread overview]
Message-ID: <bug-216059-11613-1VzdShcw2R@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-216059-11613@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=216059
--- Comment #1 from Sagar (sagar.biradar@microchip.com) ---
(In reply to Sagar from comment #0)
> Created attachment 301088 [details]
> The attachments contain the log files which capture before and after cases
> for a hotplug host number change
>
> Summary:
> This issue talks of the smartpqi driver for Adaptec controller, PCIe hotplug
> and the corresponding SCSI host number
>
>
> The Linux message log shows the host number (e.g. [14:2:0:0] storage -
> /dev/sg27) unexpectedly changing when PCIe hot remove is rapidly followed by
> PCIe hot add. The problem appears when the two PCIe events occur in quick
> succession (i.e. less than 2 minutes). Because of the timing factor, the
> issue can appear to be intermittent. The problem has been root caused as a
> kernel issue.
>
>
>
> Investigation:
> Kernel (4.18.11-hotplug-patch) debug prints were added in the
> “scsi_add_host( )” and “scsi_remove_host ( )” routines. Per the debug prints
> in the log, the scsi host number is released after the PCIe hot add event,
> which forces the kernel use a different host number.
>
> (debug prints)
> Line 48: [ 1811.461055] smartpqi 0000:b3:00.0: Debuggg . . .
> pqi_unregister_scsi function, before scsi_remove_host, shost->host_num=14
> //smartpqi requests host num 14 to be removed
> Line 83: [ 2012.125750] (null): Debuggg . . shost->host_no before
> dev_set_name = host15
> Line 84: [ 2012.126709] smartpqi 0000:b3:00.0: Debuggg . . . before
> scsi_add_host, shost->host_num=15 //upon hot add, kernel allocates host
> number 15, it should be 14
> Line 132: [ 2014.181784] scsi host14: Debuggg . . in scsi_host_dev_release
> function shost_host_no to be removed = 14 //kernel finally frees host number
> 14, but it’s too late
>
>
>
> Conclusion:
> The kernel is not releasing the host number immediately when the smartpqi
> driver calls the scsi_remove_host() routine. If the PCIe cable is added back
> within 2 minutes, the kernel can unexpectedly return a different host
> number. This can lead to applications accessing the wrong device.
> This is a Linux kernel issue and we will be raising a bugzilla on the linux
> kernel.
>
>
>
> Consequence:
> Application accesses wrong device. Rebooting system may still result in
> wrong host number.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
next prev parent reply other threads:[~2022-06-02 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-216059-11613@https.bugzilla.kernel.org/>
2022-06-02 16:47 ` [Bug 216059] Scsi host number of Adaptec RAID controller changes upon a PCIe hotplug and re-insert bugzilla-daemon
2022-06-02 16:58 ` bugzilla-daemon [this message]
2022-06-02 17:09 ` bugzilla-daemon
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=bug-216059-11613-1VzdShcw2R@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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