public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: miles.chen@mediatek.com
Cc: jejb@linux.ibm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	martink@posteo.de, matthias.bgg@gmail.com,
	stanley.chu@mediatek.com, wsd_upstream@mediatek.com
Subject: Re: [PATCH] scsi: sd: fix crashes in sd_resume_runtime
Date: Fri, 15 Oct 2021 14:14:35 -0700	[thread overview]
Message-ID: <14930227-aca0-89a0-25ea-727d263f8bf8@acm.org> (raw)
In-Reply-To: <20211015201155.12212-1-miles.chen@mediatek.com>

On 10/15/21 13:11, miles.chen@mediatek.com wrote:
> I hit this in v5.15-rc1 merge, I can still reproduce this with v5.15-rc5.
> I found two ways to avoid the crash:
> 1) revert commit ed4246d37f3b ("scsi: sd: REQUEST SENSE for
> BLIST_IGN_MEDIA_CHANGE devices in runtime_resume()") works for me.
> 2) adding the NULL point check in this patch.
> 
>>From the backtrace, dev_set_drvdata() is called after sd_resume_runtime()
> is called.
> 
> sd_probe()
> {
>   scsi_autopm_get_device()
>     pm_runtime_get_sync()
>       __pm_runtime_resume()
>         rpm_resume()
>          ...
> 	 sd_resume_runtime() // crash here
> 
>    dev_set_drvdata(dev, sdkp); // sdkp is set later
> }
> 
> [    4.861395][  T151]  sd_resume_runtime+0x20/0x14c
> [    4.862025][  T151]  scsi_runtime_resume+0x84/0xe4
> [    4.862667][  T151]  __rpm_callback+0x1f4/0x8cc
> [    4.863275][  T151]  rpm_resume+0x7e8/0xaa4
> [    4.863836][  T151]  __pm_runtime_resume+0xa0/0x110
> [    4.864489][  T151]  sd_probe+0x30/0x428
> [    4.865016][  T151]  really_probe+0x14c/0x500

Thanks for the clarification. Given this clarification I'm fine with 
your patch.

Bart.



  reply	other threads:[~2021-10-15 21:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  7:46 [PATCH] scsi: sd: fix crashes in sd_resume_runtime Miles Chen
2021-10-15  7:55 ` Martin Kepplinger
2021-10-15 13:33 ` Stanley Chu
2021-10-15 17:54 ` Bart Van Assche
2021-10-15 20:11   ` miles.chen
2021-10-15 21:14     ` Bart Van Assche [this message]
2021-10-15 23:18       ` Miles Chen
2021-10-19  3:43 ` Martin K. Petersen

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=14930227-aca0-89a0-25ea-727d263f8bf8@acm.org \
    --to=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=martink@posteo.de \
    --cc=matthias.bgg@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=stanley.chu@mediatek.com \
    --cc=wsd_upstream@mediatek.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