public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: Jianpeng Ma <majianpeng@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Xi Wang <xi.wang@gmail.com>, Xiangliang Yu <yuxiangl@marvell.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mvsas: fix unaligned-access kernel panic under heavy disk testing
Date: Tue, 23 Jul 2013 14:00:04 -0700	[thread overview]
Message-ID: <1374613204.2290.49.camel@dabdike> (raw)
In-Reply-To: <201307232053.r6NKrkOh032171@farm-0012.internal.tilera.com>

On Tue, 2013-07-23 at 16:50 -0400, Chris Metcalf wrote:
> The slot->response value may not be aligned, so should be read
> using the appropriate kernel "unaligned" accessor.

Hm, institutional memory re-presenting the wrong patch?  However, I am
reminded to push the right one in spite of no ack from marvell.

James

> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
> ---
>  drivers/scsi/mvsas/mv_sas.c | 5 +++--
>  drivers/scsi/mvsas/mv_sas.h | 1 +
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
> index f14665a..66aaa87 100644
> --- a/drivers/scsi/mvsas/mv_sas.c
> +++ b/drivers/scsi/mvsas/mv_sas.c
> @@ -1858,10 +1858,11 @@ int mvs_slot_complete(struct mvs_info *mvi, u32 rx_desc, u32 flags)
>  	}
>  
>  	/* error info record present */
> -	if (unlikely((rx_desc & RXQ_ERR) && (*(u64 *) slot->response))) {
> +	if (unlikely((rx_desc & RXQ_ERR) &&
> +		     get_unaligned_le64((u64 *) slot->response))) {
>  		mv_dprintk("port %d slot %d rx_desc %X has error info"
>  			"%016llX.\n", slot->port->sas_port.id, slot_idx,
> -			 rx_desc, (u64)(*(u64 *)slot->response));
> +			rx_desc, get_unaligned_le64((u64 *)slot->response));
>  		tstat->stat = mvs_slot_err(mvi, task, slot_idx);
>  		tstat->resp = SAS_TASK_COMPLETE;
>  		goto out;
> diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h
> index 60e2fb7..d6b19dc 100644
> --- a/drivers/scsi/mvsas/mv_sas.h
> +++ b/drivers/scsi/mvsas/mv_sas.h
> @@ -39,6 +39,7 @@
>  #include <linux/irq.h>
>  #include <linux/slab.h>
>  #include <linux/vmalloc.h>
> +#include <asm/unaligned.h>
>  #include <scsi/libsas.h>
>  #include <scsi/scsi.h>
>  #include <scsi/scsi_tcq.h>




  reply	other threads:[~2013-07-23 21:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 20:50 [PATCH] mvsas: fix unaligned-access kernel panic under heavy disk testing Chris Metcalf
2013-07-23 21:00 ` James Bottomley [this message]
2013-07-23 21:17   ` Chris Metcalf
2013-07-23 22:33     ` James Bottomley
2013-07-23 22:40       ` Chris Metcalf
2013-07-23 22:55         ` James Bottomley

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=1374613204.2290.49.camel@dabdike \
    --to=james.bottomley@hansenpartnership.com \
    --cc=cmetcalf@tilera.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    --cc=xi.wang@gmail.com \
    --cc=yuxiangl@marvell.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