All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kiwoong Kim" <kwmad.kim@samsung.com>
To: "'Adrian Hunter'" <adrian.hunter@intel.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<alim.akhtar@samsung.com>, <avri.altman@wdc.com>,
	<bvanassche@acm.org>, <jejb@linux.ibm.com>, <beanhuo@micron.com>,
	<sc.suh@samsung.com>, <hy50.seo@samsung.com>,
	<sh425.lee@samsung.com>, <kwangwon.min@samsung.com>,
	<junwoo80.lee@samsung.com>, <wkon.kim@samsung.com>,
	"'Martin K. Petersen'" <martin.petersen@oracle.com>
Subject: RE: [RESEND PATCH v3 0/2] change UIC command handling
Date: Mon, 11 Sep 2023 15:32:01 +0900	[thread overview]
Message-ID: <001001d9e479$ac74c5d0$055e5170$@samsung.com> (raw)
In-Reply-To: <7dc56344-ee1c-43d4-9751-ded8f76d5852@intel.com>

> >> ufs: poll HCS.UCRDY before issuing a UIC command
> >
> > [ 4671.226480] [3: kworker/u20:29:17140] BUG: scheduling while atomic:
> > kworker/u20:29/17140/0x00000002
> > ..
> > [ 4671.228723] [3: kworker/u20:29:17140]  panic+0x16c/0x388 [
> > 4671.228745] [3: kworker/u20:29:17140]  check_panic_on_warn+0x60/0x94
> > [ 4671.228764] [3: kworker/u20:29:17140]  __schedule_bug+0x6c/0x94 [
> > 4671.228786] [3: kworker/u20:29:17140]  __schedule+0x6f4/0xa64 [
> > 4671.228806] [3: kworker/u20:29:17140]  schedule+0x7c/0xe8 [
> > 4671.228824] [3: kworker/u20:29:17140]
> > schedule_hrtimeout_range_clock+0x98/0x114
> > [ 4671.228841] [3: kworker/u20:29:17140]
> > schedule_hrtimeout_range+0x14/0x24
> > [ 4671.228856] [3: kworker/u20:29:17140]  usleep_range_state+0x60/0x94
> > [ 4671.228871] [3: kworker/u20:29:17140]
> > __ufshcd_send_uic_cmd+0xa0/0x1c4 [ 4671.228893] [3:
> > kworker/u20:29:17140]  ufshcd_uic_pwr_ctrl+0x15c/0x390 [ 4671.228908]
> > [3: kworker/u20:29:17140] ufshcd_uic_hibern8_enter+0x9c/0x25c
> > [ 4671.228922] [3: kworker/u20:29:17140]
> > ufshcd_link_state_transition+0x34/0xb0
> > [ 4671.228939] [3: kworker/u20:29:17140]
> > __ufshcd_wl_suspend+0x3f0/0x4b4
> 
> Do you know what is in that path that makes it an atomic context?

Hi,
This made that.

static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
..
        bool reenable_intr = false;

        mutex_lock(&hba->uic_cmd_mutex); <<<<


At first, I was willing to post together w/ the following patch but I've got a suggestion to split the patch set because of different topic and I split the patch set.
- This patch removes the mutex, so it can fix the issue.
https://lore.kernel.org/linux-scsi/1694051306-172962-1-git-send-email-kwmad.kim@samsung.com/


But now I'm thinking again that simply removing the mutex could hurt atomicity of UIC command process
that the original code intended for the first time.
So I think this polling UCRDY should be modified rather than applying removal of the mutex.




  reply	other threads:[~2023-09-11  6:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230904014146epcas2p37d6690a5eb3a5652571bb00e358231a3@epcas2p3.samsung.com>
2023-09-04  1:30 ` [RESEND PATCH v3 0/2] change UIC command handling Kiwoong Kim
2023-09-04  1:30   ` [RESEND PATCH v3 1/2] ufs: make __ufshcd_send_uic_cmd not wrapped by host_lock Kiwoong Kim
2023-09-04  8:23     ` Chanwoo Lee
2023-09-04  1:30   ` [RESEND PATCH v3 2/2] ufs: poll HCS.UCRDY before issuing a UIC command Kiwoong Kim
2023-09-04  8:27     ` [RESEND,v3,2/2] " Chanwoo Lee
2023-09-05 10:10   ` [RESEND PATCH v3 0/2] change UIC command handling Martin K. Petersen
2023-09-11  1:35     ` Kiwoong Kim
2023-09-11  5:55       ` Adrian Hunter
2023-09-11  6:32         ` Kiwoong Kim [this message]
2023-09-11  7:10           ` Adrian Hunter
2023-09-11  7:23             ` Kiwoong Kim
     [not found] <CGME20230802013848epcas2p3a896970d5bdc8e3f3e422c84c282a151@epcas2p3.samsung.com>
2023-08-02  1:28 ` Kiwoong Kim

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='001001d9e479$ac74c5d0$055e5170$@samsung.com' \
    --to=kwmad.kim@samsung.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=hy50.seo@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=kwangwon.min@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sc.suh@samsung.com \
    --cc=sh425.lee@samsung.com \
    --cc=wkon.kim@samsung.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.