public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	Bean Huo <huobean@gmail.com>, Avri Altman <avri.altman@wdc.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Can Guo <cang@codeaurora.org>,
	Asutosh Das <asutoshd@codeaurora.org>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH V2] scsi: ufs: Fix runtime PM messages never-ending cycle
Date: Mon, 14 Feb 2022 22:29:04 -0500	[thread overview]
Message-ID: <yq14k50n7b0.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20220214121941.296034-1-adrian.hunter@intel.com> (Adrian Hunter's message of "Mon, 14 Feb 2022 14:19:41 +0200")


Adrian,

> Kernel messages produced during runtime PM can cause a never-ending
> cycle because user space utilities (e.g. journald or rsyslog) write the
> messages back to storage, causing runtime resume, more messages, and so
> on.
>
> Messages that tell of things that are expected to happen, are arguably
> unnecessary, so suppress them.

I don't have a major objection to the sd_suspend changes although I
wonder if there is a log level configuration problem with these systems?
Would KERN_INFO instead of KERN_NOTICE help?

I do not like the report sense change. We see this message all the time
in the field and it is very useful for debugging problems. So that
message should be made conditional based on PM state.

> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 60a6ae9d1219..e177dc5cc69a 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -484,8 +484,14 @@ static void scsi_report_sense(struct scsi_device *sdev,
>  
>  		if (sshdr->asc == 0x29) {
>  			evt_type = SDEV_EVT_POWER_ON_RESET_OCCURRED;
> -			sdev_printk(KERN_WARNING, sdev,
> -				    "Power-on or device reset occurred\n");
> +			/*
> +			 * Do not print a message here because reset can be an
> +			 * expected side-effect of runtime PM. Do not print
> +			 * messages due to runtime PM to avoid never-ending
> +			 * cycles of messages written back to storage by user
> +			 * space causing runtime resume, causing more messages
> +			 * and so on.
> +			 */
>  		}
>  
>  		if (sshdr->asc == 0x2a && sshdr->ascq == 0x01) {

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2022-02-15  3:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 12:19 [PATCH V2] scsi: ufs: Fix runtime PM messages never-ending cycle Adrian Hunter
2022-02-14 19:32 ` Bart Van Assche
2022-02-15  3:29 ` Martin K. Petersen [this message]
2022-02-16  7:56   ` Adrian Hunter

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=yq14k50n7b0.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=huobean@gmail.com \
    --cc=jejb@linux.ibm.com \
    --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