Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6548476imu; Wed, 30 Jan 2019 17:21:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rZgwZqcQHW9pwsiZhaHi0JB+cMZFDD22LxLq85KQS9EWg4w8V6uQ3WpozBTvQxt9St7Zo X-Received: by 2002:a63:d208:: with SMTP id a8mr29201940pgg.77.1548897683879; Wed, 30 Jan 2019 17:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548897683; cv=none; d=google.com; s=arc-20160816; b=vkyQzTloD6af9IAREkgIFpAaLMuN5oBvh2M7jEJuF3M/o69/6eOZLJfnyvp6wu9Wpt F4FxEJ2RhTzNG205EU0Is+3wVGOWxPGvK9zh/qvMUWqeG+el50kMhJXLLSOHLXObM8RT izz2/BCT/W6r2hryBwRjxifhTk5b1iQZ/XZBLwIU+fUsoF56GUkp02Ut2uL3PQK2QZH7 Q/iH36QmrPYaIrpFaBr+5r+N0NJIqkz0gNd1xNmcfLAimGbyEXJYbYSeMJ3irlGALIAL azIzL6V+aw5uySuREkCs+lfaENpoGm5y/fUH5i5q1sz/bt+LlaPxNK5KXE3nfHz69AT7 0SLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=bDUz59CnLxnUz7wZS5ylAeX3EjHhlj5J0Ab3kLlY8/Y=; b=KandLqD6Bf/piFpjFXozSg1xX0IxDtinOXQlyVfkOdueFFWypSc8McDSTAjbInmnxF mb7bLoYJCAXyuxbUDJXEIMNVg/WQ2fIa2tu075pNK3R/O/7oKX6S/G4upxeG21pebUt1 oascb+uBgW2+3Ix0jW7BnmLl+Cve0JwoeRkMSDvceYrVITjiqS4WxTXvCxthl5Ixmywg YDQ9ZWemWsHyfrGbgJn2WvZeQc6GfsZxTEB4oamjEINPFCdu7fepbBR27zWSmmTpVbk4 oF6L+LkUhksBWmReG/7rUUY+gTi0oCgl1QbnAcxvryunly9I0qEiQsb8ePjCyV7rY/3f Wo+g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si2795384pgt.293.2019.01.30.17.21.08; Wed, 30 Jan 2019 17:21:23 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729388AbfAaBVD (ORCPT + 99 others); Wed, 30 Jan 2019 20:21:03 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38692 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725535AbfAaBVC (ORCPT ); Wed, 30 Jan 2019 20:21:02 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 861B6D3390F1A4A550F3; Thu, 31 Jan 2019 09:21:00 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.408.0; Thu, 31 Jan 2019 09:20:50 +0800 Subject: Re: [RFC PATCH] USB: PCI: set 32bit DMA mask for PCI based USB controllers To: Christoph Hellwig CC: Greg Kroah-Hartman , Robin Murphy , Lorenzo Pieralisi , "Rafael J. Wysocki" , Bjorn Helgaas , , , , , , John Garry , Jonathan Cameron , , Hanjun Guo References: <1548831714-3706-1-git-send-email-guohanjun@huawei.com> <20190130074059.GA29458@lst.de> From: Hanjun Guo Message-ID: Date: Thu, 31 Jan 2019 09:19:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20190130074059.GA29458@lst.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On 2019/1/30 15:40, Christoph Hellwig wrote: > On Wed, Jan 30, 2019 at 03:01:54PM +0800, Hanjun Guo wrote: >> This is the RFC version, I'm not sure this is the best solution, >> comments are warmly welcomed. >> >> Thanks >> Hanjun >> >> drivers/usb/core/hcd-pci.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c >> index 0343246..a9c33e6 100644 >> --- a/drivers/usb/core/hcd-pci.c >> +++ b/drivers/usb/core/hcd-pci.c >> @@ -188,6 +188,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) >> if (pci_enable_device(dev) < 0) >> return -ENODEV; >> >> + retval = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); >> + if (retval) >> + return retval; > > dma_coerce_mask_and_coherent is only for platform devices (and I'm > not sure it is a good idea to start with, but that is a different > story). Yes, that's why this is the RFC version. > > PCI device should have the dma_mask pointer set already, so you should > use dma_set_mask_and_coherent here. I will wait for a while to see if more comments, if not, I will update my patch as you suggested. Thanks Hanjun