All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid@gonehiking.org>
To: 王文涛 <witallwang@gmail.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Elaine Zhao <yzhao@vmware.com>
Subject: Re: [PATCH] Fix 64-bit system enumeration error for Buslogic
Date: Thu, 22 Apr 2021 20:35:51 -0600	[thread overview]
Message-ID: <218eeece-e471-748b-6083-aa666997118e@gonehiking.org> (raw)
In-Reply-To: <AC748808-586E-469C-BBC1-1CB86D5B4686@gmail.com>

On 4/22/21 12:09 AM, 王文涛 wrote:
> From: matt <wwentao@vmware.com>
> Date: Tue, 20 Apr 2021 15:27:48 +0800
> Subject: [PATCH] Fix 64-bit system enumeration error for Buslogic

I would update this to "scsi: BusLogic: Fix 64-bit system enumeration
error for Buslogic". Martin, if you can do that when applying it to
scsi-staging,

Acked-by: Khalid Aziz <khalid@gonehiking.org>

> 
>  Commit 391e2f25601e("BusLogic: Port driver to 64-bit") in Buslogic
>  driver introduced a serious issue for 64-bit systems. With this
>  commit, 64-bit kernel will enumerate 8*15 non-existing disks.  This
>  is caused by the broken CCB structure. The change from u32 data to
>  void *data increased CCB length on 64-bit system, which introduced
>  an extra 4 byte offset of the CDB. This leads to incorrect response
>  to Inquiry commands during enumeration.
> 
>  This patch fixes the error.
> 
> Signed-off-by: matt <wwentao@vmware.com>
> ---
>  drivers/scsi/BusLogic.c | 6 +++---
>  drivers/scsi/BusLogic.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
> index ccb061ab0a0a..7231de2767a9 100644
> --- a/drivers/scsi/BusLogic.c
> +++ b/drivers/scsi/BusLogic.c
> @@ -3078,11 +3078,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command,
>  		ccb->opcode = BLOGIC_INITIATOR_CCB_SG;
>  		ccb->datalen = count * sizeof(struct blogic_sg_seg);
>  		if (blogic_multimaster_type(adapter))
> -			ccb->data = (void *)((unsigned int) ccb->dma_handle +
> +			ccb->data = (unsigned int) ccb->dma_handle +
>  					((unsigned long) &ccb->sglist -
> -					(unsigned long) ccb));
> +					(unsigned long) ccb);
>  		else
> -			ccb->data = ccb->sglist;
> +			ccb->data = virt_to_32bit_virt(ccb->sglist);
>  
>  		scsi_for_each_sg(command, sg, count, i) {
>  			ccb->sglist[i].segbytes = sg_dma_len(sg);
> diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h
> index 6182cc8a0344..e081ad47d1cf 100644
> --- a/drivers/scsi/BusLogic.h
> +++ b/drivers/scsi/BusLogic.h
> @@ -814,7 +814,7 @@ struct blogic_ccb {
>  	unsigned char cdblen;				/* Byte 2 */
>  	unsigned char sense_datalen;			/* Byte 3 */
>  	u32 datalen;					/* Bytes 4-7 */
> -	void *data;					/* Bytes 8-11 */
> +	u32 data;					/* Bytes 8-11 */
>  	unsigned char:8;				/* Byte 12 */
>  	unsigned char:8;				/* Byte 13 */
>  	enum blogic_adapter_status adapter_status;	/* Byte 14 */
> 


      reply	other threads:[~2021-04-23  2:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  6:09 [PATCH] Fix 64-bit system enumeration error for Buslogic 王文涛
2021-04-23  2:35 ` Khalid Aziz [this message]

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=218eeece-e471-748b-6083-aa666997118e@gonehiking.org \
    --to=khalid@gonehiking.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=witallwang@gmail.com \
    --cc=yzhao@vmware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.