From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759774AbcCDQDn (ORCPT ); Fri, 4 Mar 2016 11:03:43 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:60708 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759766AbcCDQDj (ORCPT ); Fri, 4 Mar 2016 11:03:39 -0500 Message-Id: <20160304153001.494308890@1wt.eu> User-Agent: quilt/0.63-1 Date: Fri, 04 Mar 2016 16:30:18 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tejun Heo , Andy Lutomirski , Sergei Shtylyov , Ben Hutchings , Willy Tarreau Subject: [PATCH 2.6.32 18/55] libata: disable forced PORTS_IMPL for >= AHCI 1.3 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 In-Reply-To: <148ee355b419e9976ca727513a1405c8@local> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.32-longterm review patch. If anyone has any objections, please let me know. ------------------ From: Tejun Heo commit 566d1827df2ef0cbe921d3d6946ac3007b1a6938 upstream. Some early controllers incorrectly reported zero ports in PORTS_IMPL register and the ahci driver fabricates PORTS_IMPL from the number of ports in those cases. This hasn't mattered but with the new nvme controllers there are cases where zero PORTS_IMPL is valid and should be honored. Disable the workaround for >= AHCI 1.3. Signed-off-by: Tejun Heo Reported-by: Andy Lutomirski Link: http://lkml.kernel.org/g/CALCETrU7yMvXEDhjAUShoHEhDwifJGapdw--BKxsP0jmjKGmRw@mail.gmail.com Cc: Sergei Shtylyov Signed-off-by: Ben Hutchings [wt: file is drivers/ata/ahci.c in 2.6.32] Signed-off-by: Willy Tarreau --- drivers/ata/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 6787aab..c075664 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -924,8 +924,8 @@ static void ahci_save_initial_config(struct pci_dev *pdev, } } - /* fabricate port_map from cap.nr_ports */ - if (!port_map) { + /* fabricate port_map from cap.nr_ports for < AHCI 1.3 */ + if (!port_map && vers < 0x10300) { port_map = (1 << ahci_nr_ports(cap)) - 1; dev_printk(KERN_WARNING, &pdev->dev, "forcing PORTS_IMPL to 0x%x\n", port_map); -- 1.7.12.2.21.g234cd45.dirty