Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760252AbbEEQLY (ORCPT ); Tue, 5 May 2015 12:11:24 -0400 Received: from cmrelayp1.emulex.com ([138.239.112.140]:60992 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2993467AbbEEPuY (ORCPT ); Tue, 5 May 2015 11:50:24 -0400 X-Greylist: delayed 1021 seconds by postgrey-1.27 at vger.kernel.org; Tue, 05 May 2015 11:50:24 EDT Message-ID: <5548E2C1.3070209@emulex.com> Date: Tue, 05 May 2015 11:33:21 -0400 From: James Smart Reply-To: james.smart@emulex.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alexey Kardashevskiy CC: linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , "James E . J . Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Herbszt Subject: Re: [PATCH kernel] commit 4fbdf9cb ("lpfc: Fix for lun discovery issue with saturn adapter.") References: <1430209582-23925-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1430209582-23925-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 May 2015 15:33:23.0544 (UTC) FILETIME=[D2A92580:01D08748] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3921 Lines: 103 Reviewed-By: James Smart Alexey, Sebastian, Yes - this section needs to be reverted. This patch is good. -- james s On 4/28/2015 4:26 AM, Alexey Kardashevskiy wrote: > This reverts 4fbdf9cb is breaks LPFC on POWER7 machine, big endian kernel. > > This is the hardware used for verification: > 0005:01:00.0 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03) > 0005:01:00.1 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03) > > Signed-off-by: Alexey Kardashevskiy > --- > drivers/scsi/lpfc/lpfc_scsi.c | 41 +++++++++++++++++++++-------------------- > 1 file changed, 21 insertions(+), 20 deletions(-) > > diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c > index cb73cf9..c140f99 100644 > --- a/drivers/scsi/lpfc/lpfc_scsi.c > +++ b/drivers/scsi/lpfc/lpfc_scsi.c > @@ -1130,25 +1130,6 @@ lpfc_release_scsi_buf(struct lpfc_hba *phba, struct lpfc_scsi_buf *psb) > } > > /** > - * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB > - * @data: A pointer to the immediate command data portion of the IOCB. > - * @fcp_cmnd: The FCP Command that is provided by the SCSI layer. > - * > - * The routine copies the entire FCP command from @fcp_cmnd to @data while > - * byte swapping the data to big endian format for transmission on the wire. > - **/ > -static void > -lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd) > -{ > - int i, j; > - > - for (i = 0, j = 0; i < sizeof(struct fcp_cmnd); > - i += sizeof(uint32_t), j++) { > - ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]); > - } > -} > - > -/** > * lpfc_scsi_prep_dma_buf_s3 - DMA mapping for scsi buffer to SLI3 IF spec > * @phba: The Hba for which this call is being executed. > * @lpfc_cmd: The scsi buffer which is going to be mapped. > @@ -1283,7 +1264,6 @@ lpfc_scsi_prep_dma_buf_s3(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd) > * we need to set word 4 of IOCB here > */ > iocb_cmd->un.fcpi.fcpi_parm = scsi_bufflen(scsi_cmnd); > - lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd); > return 0; > } > > @@ -4147,6 +4127,24 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, > } > > /** > + * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB > + * @data: A pointer to the immediate command data portion of the IOCB. > + * @fcp_cmnd: The FCP Command that is provided by the SCSI layer. > + * > + * The routine copies the entire FCP command from @fcp_cmnd to @data while > + * byte swapping the data to big endian format for transmission on the wire. > + **/ > +static void > +lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd) > +{ > + int i, j; > + for (i = 0, j = 0; i < sizeof(struct fcp_cmnd); > + i += sizeof(uint32_t), j++) { > + ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]); > + } > +} > + > +/** > * lpfc_scsi_prep_cmnd - Wrapper func for convert scsi cmnd to FCP info unit > * @vport: The virtual port for which this call is being executed. > * @lpfc_cmd: The scsi command which needs to send. > @@ -4225,6 +4223,9 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, > fcp_cmnd->fcpCntl3 = 0; > phba->fc4ControlRequests++; > } > + if (phba->sli_rev == 3 && > + !(phba->sli3_options & LPFC_SLI3_BG_ENABLED)) > + lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd); > /* > * Finish initializing those IOCB fields that are independent > * of the scsi_cmnd request_buffer -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/