From patchwork Fri Jun 19 22:13:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6649261 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A78B29F1C1 for ; Fri, 19 Jun 2015 22:14:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4A30208ED for ; Fri, 19 Jun 2015 22:14:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0D0A205E2 for ; Fri, 19 Jun 2015 22:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756751AbbFSWOG (ORCPT ); Fri, 19 Jun 2015 18:14:06 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:36673 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756743AbbFSWOD (ORCPT ); Fri, 19 Jun 2015 18:14:03 -0400 Received: by iecrd14 with SMTP id rd14so83385181iec.3 for ; Fri, 19 Jun 2015 15:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=/97mytrZkMcH+ysFWOTBtaeFgGuhnUdXEte8rvtEbBQ=; b=cAp5yhML7QFz5Wd96qsSBk86lNFGxGtDt9NRO7zmngR4Ng81PonrNEZNgld+9drNBu RE2DK/ye9KKsJ+FeFKAv0nr2tXYAXLkmearVvbQ3wlyfIAP5zwuWXcA0jdv3o5Z50nYI Z31YpoXRTrJWcynTnV0cSsEdgn4ezxpCo6YPVfc1b1nkfSN7IPHSKzjKqIGDMIc04vrY 0VxZ0TzONwJCrABGTaiZQtFONq/2Fm8r4+w6wQNbaphmcKdPYtpftQqtSZqzYHrPmG1/ gfJGU+XCo2IWZ0c6Rl1Czd+XkNc3iu0YU7PllaPu0zarfv4/enQ18xnKbV9ry8PF1a1w ukDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=/97mytrZkMcH+ysFWOTBtaeFgGuhnUdXEte8rvtEbBQ=; b=B9c3BixG7Bmq9kE/A4Njy6H8gUVxR/cM0EaHSEfNDpVCs+yo6maWQ1Tc5FmI9bJmvn HR9eupzBCDRq3lFhkHsmcugdOuSUPX/FrWfzTUFYfumFf1/XdZQll1g3dZxOPz+UV2w3 tb4hb477/7FFCELrcZpkoKiXYsb56d9SvOsVBKrfTO+j7RY55duQAJga2hjzoG7li+CC /ErmtYXkmhcd9f7XwDnROr7IUDjOCbtVNfbjJGmCyJ36WV/MzMCrK7JFjSRDoSGlhy19 TbCq1juMKiLIINHxXD8ZnbAidohY7NGgLClNzF5G40wxzssYPoPy3Z9+fHR+WNMOz+uJ ah/Q== X-Gm-Message-State: ALoCoQntXKZhym9VyAFPRvIdvMA4/MFaSHOjexNZn1kKfIsjc+YK9otxLnPzYos9DFcDMzBf3vUy X-Received: by 10.50.143.99 with SMTP id sd3mr7438418igb.23.1434752042439; Fri, 19 Jun 2015 15:14:02 -0700 (PDT) Received: from google.com ([69.71.1.1]) by mx.google.com with ESMTPSA id b15sm2559096igm.12.2015.06.19.15.14.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 19 Jun 2015 15:14:01 -0700 (PDT) Date: Fri, 19 Jun 2015 17:13:59 -0500 From: Bjorn Helgaas To: Krzysztof =?utf-8?Q?Ha=C5=82asa?= Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards. Message-ID: <20150619221359.GN7710@google.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jun 19, 2015 at 10:00:15AM +0200, Krzysztof Ha?asa wrote: > Intersil/Techwell TW686[4589]-based video capture cards have an empty > (zero) class code. Fix it. > > Signed-off-by: Krzysztof Ha?asa Applied to pci/misc for v4.2, with minor tweak as below to use PCI_CLASS_MULTIMEDIA_OTHER instead of a bare number. Let me know if you see any issues with this. Thanks! commit c1aa4f19cb8f7974126f2da74a35ae4ca1e60017 Author: Krzysztof =?utf-8?Q?Ha=C5=82asa?= Date: Fri Jun 19 10:00:15 2015 +0200 PCI: Add quirk for Intersil/Techwell TW686[4589] AV capture cards Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) class code. Fix it. Signed-off-by: Krzysztof Ha?asa Signed-off-by: Bjorn Helgaas > > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -3662,6 +3662,26 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); > DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); > > /* > + * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) > + * class code. Fix it. > + */ > + > +static void quirk_tw686x_class(struct pci_dev *pdev) > +{ > + /* Use "Multimedia controller" class */ > + pdev->class = 0x048001; > + dev_info(&pdev->dev, "TW686x PCI class workaround enabled\n"); > +} > +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0, > + quirk_tw686x_class); > +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0, > + quirk_tw686x_class); > +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0, > + quirk_tw686x_class); > +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0, > + quirk_tw686x_class); > + > +/* > * AMD has indicated that the devices below do not support peer-to-peer > * in any system where they are found in the southbridge with an AMD > * IOMMU in the system. Multifunction devices that do not support --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 54fa458..cbe0351 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3671,6 +3671,28 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); /* + * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) + * class code. Fix it. + */ +static void quirk_tw686x_class(struct pci_dev *pdev) +{ + u32 class = pdev->class; + + /* Use "Multimedia controller" class */ + pdev->class = (PCI_CLASS_MULTIMEDIA_OTHER << 8) | 0x01; + dev_info(&pdev->dev, "TW686x PCI class overridden (%#08x -> %#08x)\n", + class, pdev->class); +} +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0, + quirk_tw686x_class); +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0, + quirk_tw686x_class); +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0, + quirk_tw686x_class); +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0, + quirk_tw686x_class); + +/* * AMD has indicated that the devices below do not support peer-to-peer * in any system where they are found in the southbridge with an AMD * IOMMU in the system. Multifunction devices that do not support