Re: [PATCH 40/47] IB/qib: Make qib_inc_eeprom_err() macro more safe to use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 10, 2017 at 05:59:51PM +0000, Bart Van Assche wrote:
> On Tue, 2017-10-10 at 15:36 +0000, Marciniszyn, Mike wrote:
> > Bart wrote:
> > > How about dropping this patch and replacing it with a patch that removes all
> > > uses of qib_inc_eeprom_err()?
> >
> > I'm fine with that too.
>
> How about the patch below?
>
> Thanks,
>
> Bart.
>
>
> Subject: [PATCH] IB/qib: Remove the qib_inc_eeprom_err() macro
>
> Since the body of the qib_inc_eeprom_err() macro is empty, remove
> the invocations of this macro.
>
> References: commit 18c0b82a3e45 (" IB/qib: Do not write EEPROM")
> Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx>
> Cc: Mike Marciniszyn <infinipath@xxxxxxxxx>
> ---
>  drivers/infiniband/hw/qib/qib.h         |  1 -
>  drivers/infiniband/hw/qib/qib_iba6120.c | 11 -----------
>  drivers/infiniband/hw/qib/qib_iba7220.c | 10 ----------
>  drivers/infiniband/hw/qib/qib_iba7322.c |  6 +-----
>  4 files changed, 1 insertion(+), 27 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
> index 1167a9c1776b..1869fce0ba00 100644
> --- a/drivers/infiniband/hw/qib/qib.h
> +++ b/drivers/infiniband/hw/qib/qib.h
> @@ -1297,7 +1297,6 @@ int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
>  int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
>  		    const void *buffer, int len);
>  void qib_get_eeprom_info(struct qib_devdata *);
> -#define qib_inc_eeprom_err(dd, eidx, incr)
>  void qib_dump_lookup_output_queue(struct qib_devdata *);
>  void qib_force_pio_avail_update(struct qib_devdata *);
>  void qib_clear_symerror_on_linkup(unsigned long opaque);
> diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c
> index c4a4c57e0f0a..e0b52bab6f34 100644
> --- a/drivers/infiniband/hw/qib/qib_iba6120.c
> +++ b/drivers/infiniband/hw/qib/qib_iba6120.c
> @@ -748,7 +748,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -770,11 +769,6 @@ static void qib_handle_6120_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)

Does it mean that you can get rid of eep_st_masks and QIB_EEP_LOG_CNT too?

> -			qib_inc_eeprom_err(dd, log_idx, 1);
> -
>  	/*
>  	 * Make sure we get this much out, unless told to be quiet,
>  	 * or it's occurred within the last 5 seconds.
> @@ -1004,7 +998,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1015,10 +1008,6 @@ static void handle_6120_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_handle_6120_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & ~IB_E_BITSEXTANT)
>  		qib_dev_err(dd,
> diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c
> index 78ce79be4120..75f2cfd0d272 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7220.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7220.c
> @@ -1094,7 +1094,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	char *msg;
>  	u64 ignore_this_time = 0;
>  	u64 iserr = 0;
> -	int log_idx;
>  	struct qib_pportdata *ppd = dd->pport;
>  	u64 mask;
>
> @@ -1105,10 +1104,6 @@ static void handle_7220_errors(struct qib_devdata *dd, u64 errs)
>  	/* do these first, they are most important */
>  	if (errs & ERR_MASK(HardwareErr))
>  		qib_7220_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
>
>  	if (errs & QLOGIC_IB_E_SDMAERRS)
>  		sdma_7220_errors(ppd, errs);
> @@ -1302,7 +1297,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>  	u32 bits, ctrl;
>  	int isfatal = 0;
>  	char *bitsmsg;
> -	int log_idx;
>
>  	hwerrs = qib_read_kreg64(dd, kr_hwerrstatus);
>  	if (!hwerrs)
> @@ -1326,10 +1320,6 @@ static void qib_7220_handle_hwerrors(struct qib_devdata *dd, char *msg,
>
>  	hwerrs &= dd->cspec->hwerrmask;
>
> -	/* We log some errors to EEPROM, check if we have any of those. */
> -	for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -		if (hwerrs & dd->eep_st_masks[log_idx].hwerrs_to_log)
> -			qib_inc_eeprom_err(dd, log_idx, 1);
>  	if (hwerrs & ~(TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC |
>  		       RXE_PARITY))
>  		qib_devinfo(dd->pcidev,
> diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
> index 4d02cffe4e03..77217fae9c06 100644
> --- a/drivers/infiniband/hw/qib/qib_iba7322.c
> +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
> @@ -1644,7 +1644,6 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	u64 iserr = 0;
>  	u64 errs;
>  	u64 mask;
> -	int log_idx;
>
>  	qib_stats.sps_errints++;
>  	errs = qib_read_kreg64(dd, kr_errstatus);
> @@ -1662,10 +1661,7 @@ static noinline void handle_7322_errors(struct qib_devdata *dd)
>  	if (errs & QIB_E_HARDWARE) {
>  		*msg = '\0';
>  		qib_7322_handle_hwerrors(dd, msg, sizeof(dd->cspec->emsgbuf));
> -	} else
> -		for (log_idx = 0; log_idx < QIB_EEP_LOG_CNT; ++log_idx)
> -			if (errs & dd->eep_st_masks[log_idx].errs_to_log)
> -				qib_inc_eeprom_err(dd, log_idx, 1);
> +	}
>
>  	if (errs & QIB_E_SPKTERRS) {
>  		qib_disarm_7322_senderrbufs(dd->pport);
> N?????r??y????b?X??ǧv?^?)޺{.n?+????{??ٚ?{ay?ʇڙ?,j??f???h???z??w??????j:+v???w?j?m????????zZ+?????ݢj"??!

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux