diff mbox series

[10/12] pm80xx : Controller fatal error through sysfs.

Message ID 20191031051241.6762-11-deepak.ukey@microchip.com (mailing list archive)
State Superseded
Headers show
Series pm80xx : Updates for the driver version 0.1.39. | expand

Commit Message

Deepak Ukey Oct. 31, 2019, 5:12 a.m. UTC
From: Deepak Ukey <Deepak.Ukey@microchip.com>

Added support to check controller fatal error through sysfs.

Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
---
 drivers/scsi/pm8001/pm8001_ctl.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Jinpu Wang Nov. 6, 2019, 10:49 a.m. UTC | #1
On Thu, Oct 31, 2019 at 6:12 AM Deepak Ukey <deepak.ukey@microchip.com> wrote:
>
> From: Deepak Ukey <Deepak.Ukey@microchip.com>
>
> Added support to check controller fatal error through sysfs.
>
> Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index 6b85016b4db3..fbdd0bf0e1ab 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -69,6 +69,25 @@ static ssize_t pm8001_ctl_mpi_interface_rev_show(struct device *cdev,
>  static
>  DEVICE_ATTR(interface_rev, S_IRUGO, pm8001_ctl_mpi_interface_rev_show, NULL);
>
> +/**
> + * pm8001_ctl_controller_fatal_err - check controller is under fatal err
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read only' shost attribute.
> + */
> +static ssize_t controller_fatal_error_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
The kernel-doc doesn't match the function name, please fix it.
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +
> +       return snprintf(buf, PAGE_SIZE, "%d\n",
> +                       pm8001_ha->controller_fatal_error);
> +}
> +static DEVICE_ATTR_RO(controller_fatal_error);
> +
>  /**
>   * pm8001_ctl_fw_version_show - firmware version
>   * @cdev: pointer to embedded class device
> @@ -804,6 +823,7 @@ static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
>         pm8001_show_update_fw, pm8001_store_update_fw);
>  struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
> +       &dev_attr_controller_fatal_error,
>         &dev_attr_fw_version,
>         &dev_attr_update_fw,
>         &dev_attr_aap_log,
> --
> 2.16.3
>
With the updated kernel-doc.
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Deepak Ukey Nov. 7, 2019, 6:20 a.m. UTC | #2
On Thu, Oct 31, 2019 at 6:12 AM Deepak Ukey <deepak.ukey@microchip.com> wrote:
>
> From: Deepak Ukey <Deepak.Ukey@microchip.com>
>
> Added support to check controller fatal error through sysfs.
>
> Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c 
> b/drivers/scsi/pm8001/pm8001_ctl.c
> index 6b85016b4db3..fbdd0bf0e1ab 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -69,6 +69,25 @@ static ssize_t 
> pm8001_ctl_mpi_interface_rev_show(struct device *cdev,  static  
> DEVICE_ATTR(interface_rev, S_IRUGO, pm8001_ctl_mpi_interface_rev_show, 
> NULL);
>
> +/**
> + * pm8001_ctl_controller_fatal_err - check controller is under fatal 
> +err
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read only' shost attribute.
> + */
> +static ssize_t controller_fatal_error_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
The kernel-doc doesn't match the function name, please fix it.
--Can you please tell me which function name you are pointing out. Is it about the difference in function description in the  
comment (pm8001_ctl_controller_fatal_err)  and actual function name (controller_fatal_error_show) ?
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +
> +       return snprintf(buf, PAGE_SIZE, "%d\n",
> +                       pm8001_ha->controller_fatal_error);
> +}
> +static DEVICE_ATTR_RO(controller_fatal_error);
> +
>  /**
>   * pm8001_ctl_fw_version_show - firmware version
>   * @cdev: pointer to embedded class device @@ -804,6 +823,7 @@ static 
> DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
>         pm8001_show_update_fw, pm8001_store_update_fw);  struct 
> device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
> +       &dev_attr_controller_fatal_error,
>         &dev_attr_fw_version,
>         &dev_attr_update_fw,
>         &dev_attr_aap_log,
> --
> 2.16.3
>
With the updated kernel-doc.
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Jinpu Wang Nov. 7, 2019, 8:36 a.m. UTC | #3
On Thu, Nov 7, 2019 at 7:20 AM <Deepak.Ukey@microchip.com> wrote:
>
> On Thu, Oct 31, 2019 at 6:12 AM Deepak Ukey <deepak.ukey@microchip.com> wrote:
> >
> > From: Deepak Ukey <Deepak.Ukey@microchip.com>
> >
> > Added support to check controller fatal error through sysfs.
> >
> > Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
> > Signed-off-by: Viswas G <Viswas.G@microchip.com>
> > ---
> >  drivers/scsi/pm8001/pm8001_ctl.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/scsi/pm8001/pm8001_ctl.c
> > b/drivers/scsi/pm8001/pm8001_ctl.c
> > index 6b85016b4db3..fbdd0bf0e1ab 100644
> > --- a/drivers/scsi/pm8001/pm8001_ctl.c
> > +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> > @@ -69,6 +69,25 @@ static ssize_t
> > pm8001_ctl_mpi_interface_rev_show(struct device *cdev,  static
> > DEVICE_ATTR(interface_rev, S_IRUGO, pm8001_ctl_mpi_interface_rev_show,
> > NULL);
> >
> > +/**
> > + * pm8001_ctl_controller_fatal_err - check controller is under fatal
> > +err
> > + * @cdev: pointer to embedded class device
> > + * @buf: the buffer returned
> > + *
> > + * A sysfs 'read only' shost attribute.
> > + */
> > +static ssize_t controller_fatal_error_show(struct device *cdev,
> > +               struct device_attribute *attr, char *buf)
> The kernel-doc doesn't match the function name, please fix it.
> --Can you please tell me which function name you are pointing out. Is it about the difference in function description in the
> comment (pm8001_ctl_controller_fatal_err)  and actual function name (controller_fatal_error_show) ?
Yes.
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index 6b85016b4db3..fbdd0bf0e1ab 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -69,6 +69,25 @@  static ssize_t pm8001_ctl_mpi_interface_rev_show(struct device *cdev,
 static
 DEVICE_ATTR(interface_rev, S_IRUGO, pm8001_ctl_mpi_interface_rev_show, NULL);
 
+/**
+ * pm8001_ctl_controller_fatal_err - check controller is under fatal err
+ * @cdev: pointer to embedded class device
+ * @buf: the buffer returned
+ *
+ * A sysfs 'read only' shost attribute.
+ */
+static ssize_t controller_fatal_error_show(struct device *cdev,
+		struct device_attribute *attr, char *buf)
+{
+	struct Scsi_Host *shost = class_to_shost(cdev);
+	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
+	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
+
+	return snprintf(buf, PAGE_SIZE, "%d\n",
+			pm8001_ha->controller_fatal_error);
+}
+static DEVICE_ATTR_RO(controller_fatal_error);
+
 /**
  * pm8001_ctl_fw_version_show - firmware version
  * @cdev: pointer to embedded class device
@@ -804,6 +823,7 @@  static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
 	pm8001_show_update_fw, pm8001_store_update_fw);
 struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_interface_rev,
+	&dev_attr_controller_fatal_error,
 	&dev_attr_fw_version,
 	&dev_attr_update_fw,
 	&dev_attr_aap_log,