public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Pranav Prasad <pranavpp@google.com>,
	Jack Wang <jinpu.wang@cloud.ionos.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Changyuan Lyu <changyuanl@google.com>
Subject: Re: [PATCH 1/2] scsi: pm80xx: Add fatal error check for pm8001_phy_control()
Date: Wed, 24 May 2023 16:53:28 +0900	[thread overview]
Message-ID: <96ea8d7a-2dca-76b5-4f41-1de3c211d35c@kernel.org> (raw)
In-Reply-To: <20230523214127.4006891-2-pranavpp@google.com>

On 5/24/23 06:41, Pranav Prasad wrote:
> From: Changyuan Lyu <changyuanl@google.com>
> 
> This patch adds a fatal error check for the pm8001_phy_control() function.
> 
> Signed-off-by: Changyuan Lyu <changyuanl@google.com>
> Signed-off-by: Pranav Prasad <pranavpp@google.com>
> ---
>  drivers/scsi/pm8001/pm8001_sas.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index e5673c774f66..b153f0966e5d 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -167,6 +167,16 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,
>  	pm8001_ha = sas_phy->ha->lldd_ha;
>  	phy = &pm8001_ha->phy[phy_id];
>  	pm8001_ha->phy[phy_id].enable_completion = &completion;
> +
> +	if (PM8001_CHIP_DISP->fatal_errors(pm8001_ha)) {
> +		/* If the controller is in fatal error state,
> +		 *  we will not get a response from the controller
> +		 */

Multi-line comment style: must start with an empty "/*" line.

> +		pm8001_dbg(pm8001_ha, FAIL,
> +				"Phy control failed due to fatal errors\n");

Please align the args together.

> +		return -EFAULT;
> +	}
> +
>  	switch (func) {
>  	case PHY_FUNC_SET_LINK_RATE:
>  		rates = funcdata;

-- 
Damien Le Moal
Western Digital Research


  parent reply	other threads:[~2023-05-24  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 21:41 [PATCH 0/2] scsi: pm80xx: Fatal error checks Pranav Prasad
2023-05-23 21:41 ` [PATCH 1/2] scsi: pm80xx: Add fatal error check for pm8001_phy_control() Pranav Prasad
2023-05-24  6:34   ` Jinpu Wang
2023-05-24  7:53   ` Damien Le Moal [this message]
2023-05-23 21:41 ` [PATCH 2/2] scsi: pm80xx: Add fatal error check for pm8001_lu_reset() Pranav Prasad
2023-05-24  6:37   ` Jinpu Wang
2023-05-24  7:55   ` Damien Le Moal

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=96ea8d7a-2dca-76b5-4f41-1de3c211d35c@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=changyuanl@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=pranavpp@google.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