Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933792AbcCGXzq (ORCPT ); Mon, 7 Mar 2016 18:55:46 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44271 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932654AbcCGXqa (ORCPT ); Mon, 7 Mar 2016 18:46:30 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harvey Hunt , Tejun Heo Subject: [PATCH 3.14 10/36] libata: Align ata_devices id on a cacheline Date: Mon, 7 Mar 2016 15:45:53 -0800 Message-Id: <20160307234601.878743333@linuxfoundation.org> X-Mailer: git-send-email 2.7.2 In-Reply-To: <20160307234600.344036091@linuxfoundation.org> References: <20160307234600.344036091@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1271 Lines: 39 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harvey Hunt commit 4ee34ea3a12396f35b26d90a094c75db95080baa upstream. The id buffer in ata_device is a DMA target, but it isn't explicitly cacheline aligned. Due to this, adjacent fields can be overwritten with stale data from memory on non coherent architectures. As a result, the kernel is sometimes unable to communicate with an ATA device. Fix this by ensuring that the id buffer is cacheline aligned. This issue is similar to that fixed by Commit 84bda12af31f ("libata: align ap->sector_buf"). Signed-off-by: Harvey Hunt Cc: linux-kernel@vger.kernel.org Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- include/linux/libata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -712,7 +712,7 @@ struct ata_device { union { u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ - }; + } ____cacheline_aligned; /* DEVSLP Timing Variables from Identify Device Data Log */ u8 devslp_timing[ATA_LOG_DEVSLP_SIZE];