From patchwork Sun Jan 13 21:58:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Suereth X-Patchwork-Id: 211656 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 15E732C0107 for ; Mon, 14 Jan 2013 08:58:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755869Ab3AMV6r (ORCPT ); Sun, 13 Jan 2013 16:58:47 -0500 Received: from mail-qc0-f173.google.com ([209.85.216.173]:34092 "EHLO mail-qc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755690Ab3AMV6q (ORCPT ); Sun, 13 Jan 2013 16:58:46 -0500 Received: by mail-qc0-f173.google.com with SMTP id b12so2152690qca.18 for ; Sun, 13 Jan 2013 13:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=K/4/XplswTKm8fuqxqlIVYMcSV25CvMbsaHHXQIFD1Y=; b=yLgTk99vE9tLH5gaJ592TKtPQZBF9j5aMvqvxqXsIwO8Ug4aoPQz/Wzr9mpGUD0UY0 EEFRa4cHzZa5JdsuQcEMg1L0ZLlwlU425c6E5i0bTvOR2e+eSrHjXw5aPgLNrUl2GdyJ k+FVZ2GMDqxp3Sn+auGkkVHoEcenpeU9HF0oIh6ppOal+/Nc7hqktmbcNy9CdCYTqtgn wYXAaV5BpxSdpjO5VQ6LsnyMKkGYSNxhafY1guFIdV7mHwCLFXzXU6FVw2zemJ1vMXWP mtxmAvMD0v+gk1gDgRHmoebRDGMEBgZiM0Q5Pyu4za+g+PB+OOJyBpiXmupZ/7v0hbH8 0ZlA== MIME-Version: 1.0 Received: by 10.224.18.136 with SMTP id w8mr70888012qaa.2.1358114325929; Sun, 13 Jan 2013 13:58:45 -0800 (PST) Received: by 10.49.17.230 with HTTP; Sun, 13 Jan 2013 13:58:45 -0800 (PST) Date: Sun, 13 Jan 2013 13:58:45 -0800 Message-ID: Subject: libata-pmp.c patch for Silicon Image 3826 port multiplier From: Terry Suereth To: linux-ide@vger.kernel.org Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hello linux-ide mailing list, I recently purchased and equipped one of my Slackware boxes with a Rosewill RAID enclosure (RSV-S8), which claimed to use a Sil3726 PMP chipset, but which actually uses a Sil3826 chipset. This appears to be some relatively new silicon, and (presumably) a replacement for the 3726 going forward. I had some difficulties using this hardware at first - excessively long delays linking to the PMP at startup - but once I discovered the chipset version issue, it was simple to fix -- libata just needs to apply the same PMP quirks that are currently used on the 3726, to the 3826. I've done this in a local kernel build and it's working great so far. The same bug/fix has been posted to the Red Hat bug tracker: https://bugzilla.redhat.com/show_bug.cgi?id=890237 -- although the patch noted there (in the PDF (!?) attachment) appears incomplete. My somewhat-redundant patch, based on the current linux-stable version from git, is pasted inline below. It should be very simple and unsurprising. Best, Terry Suereth terry.suereth@gmail.com --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- libata-pmp.c.old 2013-01-13 13:42:56.582780772 -0800 +++ libata-pmp.c 2013-01-13 13:43:33.670964680 -0800 @@ -289,24 +289,24 @@ /* Disable sending Early R_OK. * With "cached read" HDD testing and multiple ports busy on a SATA - * host controller, 3726 PMP will very rarely drop a deferred + * host controller, 3x26 PMP will very rarely drop a deferred * R_OK that was intended for the host. Symptom will be all * 5 drives under test will timeout, get reset, and recover. */ - if (vendor == 0x1095 && devid == 0x3726) { + if (vendor == 0x1095 && (devid == 0x3726 || devid == 0x3826)) { u32 reg; err_mask = sata_pmp_read(&ap->link, PMP_GSCR_SII_POL, ®); if (err_mask) { rc = -EIO; - reason = "failed to read Sil3726 Private Register"; + reason = "failed to read Sil3x26 Private Register"; goto fail; } reg &= ~0x1; err_mask = sata_pmp_write(&ap->link, PMP_GSCR_SII_POL, reg); if (err_mask) { rc = -EIO; - reason = "failed to write Sil3726 Private Register"; + reason = "failed to write Sil3x26 Private Register"; goto fail; } } @@ -383,8 +383,8 @@ u16 devid = sata_pmp_gscr_devid(gscr); struct ata_link *link; - if (vendor == 0x1095 && devid == 0x3726) { - /* sil3726 quirks */ + if (vendor == 0x1095 && (devid == 0x3726 || devid == 0x3826)) { + /* sil3x26 quirks */ ata_for_each_link(link, ap, EDGE) { /* link reports offline after LPM */ link->flags |= ATA_LFLAG_NO_LPM;