From patchwork Fri Jan 13 12:38:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 91389 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp169998qgi; Fri, 13 Jan 2017 04:40:40 -0800 (PST) X-Received: by 10.98.5.2 with SMTP id 2mr8899330pff.77.1484311240705; Fri, 13 Jan 2017 04:40:40 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [198.137.202.9]) by mx.google.com with ESMTPS id r4si12607009pgr.239.2017.01.13.04.40.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 04:40:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 198.137.202.9 as permitted sender) client-ip=198.137.202.9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 198.137.202.9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cS19q-0006w7-Qh; Fri, 13 Jan 2017 12:40:38 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cS18h-0003rc-Nf for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2017 12:39:31 +0000 Received: by mail-wm0-x233.google.com with SMTP id r126so63372191wmr.0 for ; Fri, 13 Jan 2017 04:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xFcAYh2NWiRwARLne6yy5MGPachNL80s8szXw8G+hy4=; b=ChtupbY0QYHrbpJgxEuT7FEmJZGni698yOMISp+85zeaF80Au94XnqmXaFntM5N0Q2 jdbZpKWki185C66myU/Tkgi+PhIzKnYzWcSAVLDGUYFehAcuE4n13woBcd3hL9B+PUi4 p6ga5UUkhp/Woj3LRx2REiien+VfWDnO7a8PBn9g+bsU9IAywpfqoUBDYfHzUuDFwyQX 6xGd4URznJ1piA7fDmOgr8BzbPZrQcSBg3hH2f/80L8mfRtUSGb9oAJl9VVy6dE7d1WQ WyZ9JeKneZG3w8NHEc8in04YljeJHic+XIoRJY9MG+XZ0ZGgNDHcasiTvZODW791VBIV m7pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xFcAYh2NWiRwARLne6yy5MGPachNL80s8szXw8G+hy4=; b=ZjBFeoExxjHv1md7IHKunl3IKr6p4zMbbHJOoR7+xJ4dzs0cPiZSCqGOlCZW6y6W9o vpGp9hOt0QdqkwjnN1FMSMQ0mLX6x69RAa/wppIJLsZ3r7YIg8ms5Kkqc48DvCIZ1JTe a2rxKejTilLM4qwdfOYQ3iQRm4iNbX+omReIwFm2EEtjwNXKrFqbGZ+gl/dtfJEPVCoV S9pcnRdITpP9HqCKjxFvbf9behZUkpZ7QFOFotuvDqmkTAmS30KfzkKQVyXRExdhbUkz n6f8codRJg6ZdTdJTxR6Gx6zHSnZGIe7hd4KO0t9JPjbIfu67opeDdxkrUZdceoLOtKW sqdQ== X-Gm-Message-State: AIkVDXLvHnHlibPpeEhmVS4kis+ULZkR+r2gPZO85EZWsbDu6hUlroeoBrX3CfJCeZLIX8DX X-Received: by 10.223.161.68 with SMTP id r4mr11877185wrr.73.1484311145935; Fri, 13 Jan 2017 04:39:05 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id y127sm4022680wmg.12.2017.01.13.04.39.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 04:39:05 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Sekhar Nori , Patrick Titiano , Michael Turquette , Tejun Heo , Rob Herring , Mark Rutland , Russell King , David Lechner Subject: [PATCH 06/10] sata: ahci_da850: implement a softreset quirk Date: Fri, 13 Jan 2017 13:38:00 +0100 Message-Id: <1484311084-31547-7-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484311084-31547-1-git-send-email-bgolaszewski@baylibre.com> References: <1484311084-31547-1-git-send-email-bgolaszewski@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_043928_094762_03AAAF2E X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:233 listed in] [list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ide@vger.kernel.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org There's an issue with the da850 SATA controller: if port multiplier support is compiled in, but we're connecting the drive directly to the SATA port on the board, the drive can't be detected. To make SATA work on the da850-lcdk board: first try to softreset with pmp - if the operation fails with -EBUSY, retry without pmp. Signed-off-by: Bartosz Golaszewski --- drivers/ata/ahci_da850.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) -- 2.9.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index 5930af81..bb9eb4c 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -54,11 +54,31 @@ static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg, writel(val, ahci_base + SATA_P0PHYCR_REG); } +static int ahci_da850_softreset(struct ata_link *link, + unsigned int *class, unsigned long deadline) +{ + int pmp, ret; + + pmp = sata_srst_pmp(link); + + ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready); + if (pmp && ret == -EBUSY) + return ahci_do_softreset(link, class, 0, + deadline, ahci_check_ready); + + return ret; +} + +static struct ata_port_operations ahci_da850_port_ops = { + .inherits = &ahci_platform_ops, + .softreset = ahci_da850_softreset, +}; + static const struct ata_port_info ahci_da850_port_info = { .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, - .port_ops = &ahci_platform_ops, + .port_ops = &ahci_da850_port_ops, }; static struct scsi_host_template ahci_platform_sht = {