Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3787926imm; Mon, 18 Jun 2018 04:11:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKAl+do297Wzl95j/8vmSElNXI/YFhe8Wxw2RvvFJ51Pn9kKkZSh0PWL1UfWWkG7y1BwORP X-Received: by 2002:a63:980a:: with SMTP id q10-v6mr10431196pgd.50.1529320278564; Mon, 18 Jun 2018 04:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320278; cv=none; d=google.com; s=arc-20160816; b=mO5GEaEYoC9FUZnutLsmwV9zprAMZvkZM1kRVZbqo9VbV23eXWMTGE6BYvX0JAzi4l RxLDDxi9Wid0mUkcZGzU07JF7Vqp2DOfXWpB8wDotuzskljIAfIn4m9H78Od+1Su313E FBswYdogscSNy9HGHR6ymqh9atMpEGaSwlKuUZ3+g9M/GCnwGYCPYT38qYHE0IfeTJGm wOVSdxwd7qRT+MYC7dmXYme14vrFU0gYu6XxILoQDjdk1h+bnEUtt71vFBYfQVFytTPL Qd6lmeWcFHXu/Oti3aAP2oBosbQpksk2Fp95QTJZ7RcYtgZ7YTshq3wYFk3bwzsKgMVr 7ctA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=U0hZ+TKB8XaQcESnDEU8k+qrHkry2w7qH2MS3hdf60M=; b=VfDh8BZhco76KEnXPWHTHokC3jptvUuwchuS3c8+KonVI8Z+KT7HTmwGmBfs22uYtz xN5RlcvMxGdy0RR1XyPeCalbtjGF6/Cglq3R7JT5tQp3fo82gTN9sp3RCEJU5EvkNujt 47p+ZJRFpJ/LrdSa9UOn7v6Zt4aX78K+iVtmKPLTePPKW4zXDSqk2Sox/WrHTVbUfGqV jw550Z4k+Xj5teruhDgi6hoiIBMJ/bB9miT4ia+tkw3Awqtm4dJizQs2wLSzc6F6BgUO xkysTIOUp3BnI2g7APb0SNYXJy+2swlD1BQlHek2/OEQYx18okaxQkScRLcB0wIaBWM8 xZkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v198-v6si12346986pgb.113.2018.06.18.04.11.04; Mon, 18 Jun 2018 04:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935995AbeFRLHe (ORCPT + 99 others); Mon, 18 Jun 2018 07:07:34 -0400 Received: from mga14.intel.com ([192.55.52.115]:37633 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933504AbeFRLHd (ORCPT ); Mon, 18 Jun 2018 07:07:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 04:07:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,238,1526367600"; d="scan'208";a="47923184" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 18 Jun 2018 04:07:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 7DE66FA; Mon, 18 Jun 2018 14:07:31 +0300 (EEST) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , "Rafael J. Wysocki" , Christian Kellner , Mario Limonciello , Mika Westerberg Subject: [PATCH 1/5] thunderbolt: Use 64-bit DMA mask if supported by the platform Date: Mon, 18 Jun 2018 14:07:27 +0300 Message-Id: <20180618110731.57427-2-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618110731.57427-1-mika.westerberg@linux.intel.com> References: <20180618110731.57427-1-mika.westerberg@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PCI defaults to 32-bit DMA mask but this device is capable of full 64-bit addressing, so make sure we first try 64-bit DMA mask before falling back to the default 32-bit. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/nhi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index f5a33e88e676..e3b7695fe37e 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -1015,6 +1015,14 @@ static int nhi_probe(struct pci_dev *pdev, const struct pci_device_id *id) spin_lock_init(&nhi->lock); + res = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (res) + res = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (res) { + dev_err(&pdev->dev, "failed to set DMA mask\n"); + return res; + } + pci_set_master(pdev); tb = icm_probe(nhi); -- 2.17.1