From patchwork Tue Oct 6 21:24:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7340111 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 782959F2F7 for ; Tue, 6 Oct 2015 21:25:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A74ED20383 for ; Tue, 6 Oct 2015 21:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3E1920374 for ; Tue, 6 Oct 2015 21:25:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbbJFVZM (ORCPT ); Tue, 6 Oct 2015 17:25:12 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:57608 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752760AbbJFVZK (ORCPT ); Tue, 6 Oct 2015 17:25:10 -0400 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0M9XvL-1ZuFu42fVP-00CzNg; Tue, 06 Oct 2015 23:24:31 +0200 From: Arnd Bergmann To: James Bottomley , linux-scsi@vger.kernel.org Cc: Hannes Reinecke , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Matthew Wilcox Subject: [PATCH] scsi: advansys: fix big-endian builds Date: Tue, 06 Oct 2015 23:24:28 +0200 Message-ID: <5468884.cIlSBUgeTB@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:PlS+G9K4oAYq3bkS01MpLA5ZZrCQGgSA03v86DFyIJdUy2vP60g tNxBz5/LgndeJYwE6YDmy7Ep+zyDc7XpMRzneBAE4B6Bczkx8sJVBLBt9FmRWrliz6snCnJ gfhLSGpPvamezeD7ARZC17SyFO7yPJS0AH3c9J+6Pf9NjzzFLu7+YflSCmqUw1bfBLAdsoE vn91IVE/XSK4ekXbd16UQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:uO9YPp/ElWg=:UpdgSEcuOaYJpxOykli6dm Ypmedb/y0TRSzBhnOsGon2axMv9MW+ciWK1i6jzgJNd7F/mr6A03e76a8StxAJjZNAw+P6VtZ NzCojx3fRT7xKWvAfqYd+egLNg4v8KtTUwvibY/BAq9p0uXs9fHj1to0RpkMxljDGWnEYZU2/ NJHmhx7giXVmnbHWfd7Pa5bcQ4XOs2jcOgxQZypxbT6zJyfFOUFlt9otgEN8q0OFgUy6LRY8S D56VzXIX6qz4uYpUTGdAj2pfdxijTESLMmmnVLPSNfYZxuQgKD2yL0Fmhb40wk6hl4mNS7aGn cJ1FdwDXvj/TPLuYjFVxFRV9WwFs7OjLtZeKyj/0NFZBaWcsgHwKhzQxjF6rzPD3ZTBgpbtm9 biydu4mZDZHQjjx//gx0Izz3Y2jy+/lY3czh4qG2d5XIqFByeHtcVs5USmEkMdiilchcG5dqa NZyXyEA389YbfA5J2NjVjkuushZfl7ZScap8kyaafwdOAKmgE6B2xWqEUv8L0nQDdY8TCnNQz g7xo6PN06uNtyid/S1t+DA+gTpGsI9PCKn0Ga0Lw8NhfXBk1jU2NxK/wddwgLIFyuDJLIgLBL 9iRMoj9LdaCZdwLeNpTPoDPogWZ648YkWkTK6Mf1PlAJhXi/g+2gPwq7EwtKpXiXpdOBAIk/I M5Z9KmUgjYKwTTxHeqA6OHGq9GPbGXpmcJmp78DtgqW2Q0RrLNnQZDZXWFKd3217p+REPYe1g 8lI5VJfzOej968ng 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=unavailable 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 Building the advansys driver in a big-endian configuration such as ARM allmodconfig shows a warning: drivers/scsi/advansys.c: In function 'adv_build_req': include/uapi/linux/byteorder/big_endian.h:32:26: warning: large integer implicitly truncated to unsigned type [-Woverflow] #define __cpu_to_le32(x) ((__force __le32)__swab32((x))) drivers/scsi/advansys.c:7806:22: note: in expansion of macro 'cpu_to_le32' scsiqp->sense_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); It turns out that the commit that introduced this used the cpu_to_le32() incorrectly on an 8-bit field, which results in the sense_len to always be set to zero, as the SCSI_SENSE_BUFFERSIZE value gets moved to upper byte of the 32-bit intermediate. This removes the cpu_to_le32() call to restore the original version. I found this only by looking at the compiler output and have not done a full review for possible further endianess bugs in the same driver. Signed-off-by: Arnd Bergmann Fixes: 811ddc057aac ("advansys: use DMA-API for mapping sense buffer") --- Using willy@linux.intel.com, as the address listed in MAINTAINERS failed: Failed to transport message. Message sending failed since the following recipients were rejected by the server: matthew@wil.cx (The server responded: Requested action not taken: mailbox unavailable invalid DNS MX or A/AAAA resource record) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 4305178e4e01..1c1cd657c380 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -7803,7 +7803,7 @@ adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp, return ASC_BUSY; } scsiqp->sense_addr = cpu_to_le32(sense_addr); - scsiqp->sense_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); + scsiqp->sense_len = SCSI_SENSE_BUFFERSIZE; /* Build ADV_SCSI_REQ_Q */