From patchwork Tue Jul 21 00:14:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6831461 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 6DDA09F380 for ; Tue, 21 Jul 2015 00:14:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0A632064E for ; Tue, 21 Jul 2015 00:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2882F206A0 for ; Tue, 21 Jul 2015 00:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757239AbbGUAOe (ORCPT ); Mon, 20 Jul 2015 20:14:34 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:34221 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756481AbbGUAOd (ORCPT ); Mon, 20 Jul 2015 20:14:33 -0400 Received: by iebmu5 with SMTP id mu5so129467529ieb.1 for ; Mon, 20 Jul 2015 17:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=jfona8HyVqMVWATHs2EzEHvEAavzhN3SFolNfxPKZWw=; b=IsJmJrt4BDsyDEO0Twh247phXUwUerVdH6/D9gwnFTt+gu/SO3nfTw/3x0Uog8x+6y TF+fI5pvuDmHgmX3fHfTm3xJTgAVvaLFUh+HZAmp+dxOy2jf8PMOtzhOC9tlqi2+RFUc w4DSv9Mo4wO2vQ7AjQf8nLvIVuDuO33+RzViItHwohMPANJawoSkx7Lwq11ZjG7byZ8t S7eYnJPut6V2ByDC543h7yothAE8tQ+lidsDyNhd6z0GYp/vz+LbJiDUbZUpssPHR9rK eaWNUnOng7b+ns9xeO8hvhXCsghKGZ+xj96Ig5P6+v1Uw7iMzQuh6z4IW1I4CjO6BNzd xTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=jfona8HyVqMVWATHs2EzEHvEAavzhN3SFolNfxPKZWw=; b=RA4HIwmwbctuNvQc1KeM79dC80YhDms3I9n6D5MFQQio2j4OIji1hrljfjiR50H7IW 01Idf3pZoUA02pEzWY+ruYL6VTD9TRTJ8Q4tEwohlr3KlvzL4jqr0HRsFyVyUsNduPb1 X1jqfWpFZ1ev2G45Z0T9rPWlA3xf4yCzo7TgWGccOA+AAg4nq9uieCsLuMUttagEi8d6 pugaCmqGeQKZ9AgFluss18qv3QnruG0ecxMfHT/MN/3HoOLkhtE8gN4j20PTxgzobASO E9lFEdIe0YHbi2g+n7fQRwe4NdLV1fWDlIelqmLCykmilvlRFGLpENFKwgZg1SMwRDJU JrXA== X-Gm-Message-State: ALoCoQnsqTMfcIM5UQFHgz8AH+w5BRkC34lWA0cHtptQmzcRiKB/p4PH1wAHGgFTi/MECpmWAdWq X-Received: by 10.107.37.142 with SMTP id l136mr45427173iol.126.1437437672891; Mon, 20 Jul 2015 17:14:32 -0700 (PDT) Received: from localhost ([69.71.1.1]) by smtp.gmail.com with ESMTPSA id 69sm14748497ioz.10.2015.07.20.17.14.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 20 Jul 2015 17:14:31 -0700 (PDT) Subject: [PATCH v2 05/11] PCI: Rationalize pci_ats_queue_depth() error checking To: linux-pci@vger.kernel.org, Joerg Roedel , David Woodhouse From: Bjorn Helgaas Cc: iommu@lists.linux-foundation.org, Gregor Dick Date: Mon, 20 Jul 2015 19:14:30 -0500 Message-ID: <20150721001429.28145.76331.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150721001243.28145.81610.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150721001243.28145.81610.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-8.0 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=unavailable 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 We previously returned -ENODEV for devices that don't support ATS (except that we always returned 0 for VFs, whether or not they support ATS). For consistency, always return -EINVAL (not -ENODEV) if the device doesn't support ATS. Return zero for VFs that support ATS. Signed-off-by: Bjorn Helgaas Reviewed-by: Joerg Roedel --- drivers/pci/ats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index 690ae6e..9a98b3a 100644 --- a/drivers/pci/ats.c +++ b/drivers/pci/ats.c @@ -136,13 +136,13 @@ EXPORT_SYMBOL_GPL(pci_restore_ats_state); */ int pci_ats_queue_depth(struct pci_dev *dev) { + if (!dev->ats_cap) + return -EINVAL; + if (dev->is_virtfn) return 0; - if (dev->ats_cap) - return dev->ats_qdep; - - return -ENODEV; + return dev->ats_qdep; } EXPORT_SYMBOL_GPL(pci_ats_queue_depth);