From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762088AbcINMtx (ORCPT ); Wed, 14 Sep 2016 08:49:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:54982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761484AbcINMts (ORCPT ); Wed, 14 Sep 2016 08:49:48 -0400 Subject: Re: [PATCH 11/15] hisi_sas: fix HBA SAS addr endianness for v1 hw To: John Garry , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com References: <1473176185-217808-1-git-send-email-john.garry@huawei.com> <1473176185-217808-12-git-send-email-john.garry@huawei.com> Cc: linuxarm@huawei.com, zhangfei.gao@linaro.org, xuwei5@hisilicon.com, john.garry2@mail.dcu.ie, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Xiang Chen From: Hannes Reinecke Message-ID: <6f17638e-9cae-023a-03b0-38c11100522e@suse.de> Date: Wed, 14 Sep 2016 14:49:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <1473176185-217808-12-git-send-email-john.garry@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2016 05:36 PM, John Garry wrote: > The endianness for the SAS address in the TX_ID_DWORD > registers is set incorrectly. > We see errors like this in the boot log for v2 hw (which would > have the same issue as v1 hw): > [ 7.583284] sas: target proto 0x0 at 50000d1108e7923f:0x1f not handled > > This is due to the host SAS addr not matching the PHY SAS > addr in the expander host-attached phy discovery responses. > > To fix, we byte swap the SAS addr from BE to LE (which is > the endianness of the SAS controller). > > Signed-off-by: John Garry > Signed-off-by: Xiang Chen > --- > drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c > index b537464..c030df0 100644 > --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c > +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c > @@ -490,13 +490,13 @@ static void config_id_frame_v1_hw(struct hisi_hba *hisi_hba, int phy_no) > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD0, > __swab32(identify_buffer[0])); > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD1, > - identify_buffer[2]); > + __swab32(identify_buffer[1])); > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD2, > - identify_buffer[1]); > + __swab32(identify_buffer[2])); > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD3, > - identify_buffer[4]); > + __swab32(identify_buffer[3])); > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD4, > - identify_buffer[3]); > + __swab32(identify_buffer[4])); > hisi_sas_phy_write32(hisi_hba, phy_no, TX_ID_DWORD5, > __swab32(identify_buffer[5])); > } > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)