From patchwork Fri Jun 12 01:45:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian King X-Patchwork-Id: 6593801 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28869C0433 for ; Fri, 12 Jun 2015 01:45:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C798205CA for ; Fri, 12 Jun 2015 01:45:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67FDC2065A for ; Fri, 12 Jun 2015 01:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbbFLBpZ (ORCPT ); Thu, 11 Jun 2015 21:45:25 -0400 Received: from e19.ny.us.ibm.com ([129.33.205.209]:56313 "EHLO e19.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbbFLBpW (ORCPT ); Thu, 11 Jun 2015 21:45:22 -0400 Received: from /spool/local by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Jun 2015 21:45:22 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Jun 2015 21:45:20 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 471F16E8047 for ; Thu, 11 Jun 2015 21:37:07 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5C1jKlA60424216 for ; Fri, 12 Jun 2015 01:45:20 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5C1jJAX014886 for ; Thu, 11 Jun 2015 21:45:20 -0400 Received: from localhost.localdomain (sig-9-76-83-202.ibm.com [9.76.83.202]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t5C1jIXa014812; Thu, 11 Jun 2015 21:45:18 -0400 Message-Id: <201506120145.t5C1jIXa014812@d01av05.pok.ibm.com> Subject: [PATCH 2/4] ipr: Byte swapping for device_id attribute in sysfs To: James.Bottomley@HansenPartnership.com Cc: linux-scsi@vger.kernel.org, wenxiong@linux.vnet.ibm.com, gbertazi@linux.vnet.ibm.com, brking@linux.vnet.ibm.com From: Brian King Date: Thu, 11 Jun 2015 20:45:18 -0500 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061201-0057-0000-0000-0000006F1312 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wen Xiong On LE system, users see the wrong device_id attribute. This patch does necessary byte swapping for device_id attribute and works on both of LE and BE systems. Signed-off-by: Wen Xiong Signed-off-by: Brian King --- drivers/scsi/ipr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/scsi/ipr.c~ipr_device_id_swap drivers/scsi/ipr.c --- linux/drivers/scsi/ipr.c~ipr_device_id_swap 2015-06-11 20:18:26.578563454 -0500 +++ linux-bjking1/drivers/scsi/ipr.c 2015-06-11 20:33:52.946558852 -0500 @@ -4449,7 +4449,7 @@ static ssize_t ipr_show_device_id(struct spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); res = (struct ipr_resource_entry *)sdev->hostdata; if (res && ioa_cfg->sis64) - len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->dev_id); + len = snprintf(buf, PAGE_SIZE, "0x%llx\n", be64_to_cpu(res->dev_id)); else if (res) len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->lun_wwn);