Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbbKPQuM (ORCPT ); Mon, 16 Nov 2015 11:50:12 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:59621 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbbKPQuJ (ORCPT ); Mon, 16 Nov 2015 11:50:09 -0500 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 , Geert Uytterhoeven , "Martin K. Petersen" Subject: [PATCH, resend] scsi: advansys: fix big-endian builds Date: Mon, 16 Nov 2015 17:49:23 +0100 Message-ID: <4411376.blKgWIg75B@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:zwiXbqQZbLjPdigqj5ze/rQh62l25LPMArfYPzQUXEAMUWe9IaR 4Zc/SffD64qoh3OwOzGnxKSaG62Q2SCvKy/Aj3wv8SgU2hKE8Laa7ksQPngA9ryoZuCAaEQ 79ny6CZKOnycVLUS+8OTlMAkt7WPuLXJM36//vH4U1cfIQB2RFHov5CzEgkJX10HxRXUJWG gQTwFKCvj9nZspnh62ZLA== X-UI-Out-Filterresults: notjunk:1;V01:K0:AJjikRXz4hc=:ZAaQAc2oA84yxtsCVfUik1 wa8O4MdoTuUUeXtmNUb2AJFdVu/bLCMxY6ojGOqR/569K0/xvbolAzH7SGu36YdRVwh8YmpdQ ylH+aURWfx5dTV8buPhx4ZHMi9ZAeHFGAyd7vWYhfsL80PsMvsRQHn2lWmGURfPMsnz54UV7Z 7NmNabYfGhACMr57zLznjmAgTKlmIVMj+jlg/5HnmJygaTfPYJ2AEmDaczU9TFzpkvT0XIz6j BIcvckURjrZHEktVeJwZX8FkkJ7bSs9DhIcSHuIaJOWGmOgxc2evo9OUqRWZSg5Cqhwzgs1ej Dcnyfwsx4F2Uz2PeAiJJJWJ2BBmnb9f4d8FvbLRsCkDiVjWeA71kgniMdUhiho/lo5HWGTe45 jCmHvDfK2hlEsBbJGqM5gxznR5PYTPF1P6O+ImC7UbuOgWaXkqS29HpOzHp7p7Z0WFah1hPaU HuodWX/yn7y7BxjtqjUIVhUEGuJcHODACzR6B60v24EYUbtxT607NmO2Ev/tfo6SJKwTB7M2R hUdBnTKcWW5YYZ0nDiRTqXeQUXjEra4mxbxs/okWB8ufrnROSGMVY0Krrvi3FUrRa1SN045sY 40nrIHEVojwEoAMPcSGEGf/5PJSFeuhiauMeOk/f9SdlRv2I0YRoLPad9NADAtpTK/mmvOO02 7gTEv4+olYNirKo5ypEtxz1cjuYjQfIEjrwQB35cmoCg7kiL/oTqcfLWF3tC5YM3WhUmjzztu T5MiyHQ2YmPg6JBg Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2300 Lines: 52 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") Cc: stable@vger.kernel.org # v4.2+ --- 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) Geert found the same bug and submitted the same patch earlier: https://lkml.org/lkml/2015/6/24/89 Neither one has been reviewed or accepted so far. Can we get one of the two merged please? 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 */ -- 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/