Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1178407yba; Tue, 2 Apr 2019 04:04:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/QfDQqr6a81ZyGaMOhvHP1SPAejfcY9cTpZFsPYaCbTD4fsgMDDO7xkBxAliK7rk31P1G X-Received: by 2002:a63:b811:: with SMTP id p17mr35712991pge.219.1554203050100; Tue, 02 Apr 2019 04:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554203050; cv=none; d=google.com; s=arc-20160816; b=obUr+u54oR+a4p9/4upn1jhIvDaTKH/W2mmgnwlex8JWTKfRPFLi0eD2RGAeie6wHY /kfNsm7OPw5M8xHWekfTg6ZCXvS21Y5uMga1hoDlWuZGU3LmKOKHjdff0FXxb8xzHcG5 Vhxr1erFD/o6iK5iMyfQLmTmhcheEhcD04O6l1wKizeXkuW6HFfwHmNfiIdgNTHzjbgR Q3HfiOt96DHEg7nepMSuE8n7laSidd5b19CZD5haXk2yTWrLGq+MbyURNFanMczzFZNp 36Cb5cZdQMQ3J4rmnkcV3whJ8N2zpiCPoNjR3qtx2/QIjHkINyIiLiuNh/lmJPJ86PTb /S5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=sV+wHCIx2omDN0w8NI11YAW5YNllVBoH56lTezfI8F8=; b=fmYXyHPzd2hWOoTRyXpSADmS/TR2C8OLHzye5jHk46PxdK/2EcWkn4h7RksVl6eQJf QcewXjPj6R/d6aGNvemyGVPYHnEZbmUimFfpTo2tRf6LZMX49HnMkfW6H4YeoNi1nYaU sMNybZ1gNbsrBAP6C18N4w8qllgSa+5QiBCmfGs1xB6u9i5rGr8oBmgd2r9xxnuupolY QFod7BnZNJ+m+p14K4MIFCWsrmfbN65Lp00yH/kaIIDwh8DqW9+sB0zEEJF94PgryK2X BJvjhnar/kJTt7zeU4xziGW1oMkAAKt6Ye9zPTCWMYei+Pvedpaa81yKd2DcEonR2KDP XCUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TPrScBUA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si5114190pgc.51.2019.04.02.04.03.52; Tue, 02 Apr 2019 04:04:10 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TPrScBUA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728684AbfDBJmv (ORCPT + 99 others); Tue, 2 Apr 2019 05:42:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:33279 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbfDBJmu (ORCPT ); Tue, 2 Apr 2019 05:42:50 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190402094246epoutp0496c81e936c4baa51f7c096829bb650a6~Rnv_PI0yr1465314653epoutp04M; Tue, 2 Apr 2019 09:42:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190402094246epoutp0496c81e936c4baa51f7c096829bb650a6~Rnv_PI0yr1465314653epoutp04M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1554198166; bh=sV+wHCIx2omDN0w8NI11YAW5YNllVBoH56lTezfI8F8=; h=From:To:Cc:Subject:Date:References:From; b=TPrScBUA989c2YHZrxs2c7rdIZqaCER7E7RdawsA+XD9sgUDO+LBWCQkFMd8mzfLT uikvAn2dvlThXwaYb8xX0nZA4gdhfNEpBfFa+lXR2c0kjrGyJmAlpN4HXSmMxCW19w ggsArMMD3h35MO9MR0RZRj+RbvQgOAlCxs+eK4ok= Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190402094246epcas1p358f76052d9ac8112b189f2bb6f2d1a41~Rnv_BJZvN1616816168epcas1p3p; Tue, 2 Apr 2019 09:42:46 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 5B.8D.04257.69E23AC5; Tue, 2 Apr 2019 18:42:46 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190402094246epcas1p1f43795d840b4c3a1f7efddc0523b2c89~Rnv90CZKu0669806698epcas1p1y; Tue, 2 Apr 2019 09:42:46 +0000 (GMT) X-AuditID: b6c32a38-5e3ff700000010a1-6f-5ca32e96f7b3 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 29.3E.03598.69E23AC5; Tue, 2 Apr 2019 18:42:46 +0900 (KST) Received: from ubuntu.sa.corp.samsungelectronics.net ([107.116.255.97]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PPB003NUUZ2H540@mmp2.samsung.com>; Tue, 02 Apr 2019 18:42:46 +0900 (KST) From: Pankaj Dubey To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org, jingoohan1@gmail.com, krzk@kernel.org, mgautam@codeaurora.org, robin.murphy@arm.com, felipe.balbi@linux.intel.com, Sriram Dash , Pankaj Dubey Subject: [PATCH] usb: xhci: inherit dma_mask from bus if set correctly Date: Tue, 02 Apr 2019 15:10:11 +0530 Message-id: <1554198011-24342-1-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsWy7bCmru40vcUxBt8OKVvMv5lk0bx4PZvF ii8z2S3On9/AbnF51xw2i0XLWpktmjdNYbX4/HESkLv1C7vFwQ9PWC1urGd34PZYM28No8fl vl4mj52z7rJ7LN7zkslj06pONo95JwM99s9dw+7Rt2UVo8fnTXIBnFFcNimpOZllqUX6dglc Gf2XzrMW7OOsuN5e28D4gr2LkZNDQsBEYva+VsYuRi4OIYEdjBIn/h9hhnC+M0os3f0QrmrP tGUsILaQwAZGid/f3SGKOpkkXj1vZQZJsAnoSjx5PxfI5uAQEbCW6DsYBFLDLNDAJPF9Whcb SI2wgJvE83X9YINYBFQljvz/wQRi8wp4SGxYc5MVYpmcxM1znWBXSAisYJOYNnEu1BUuEmsO n2YEWSAhIC1x6agtRDhf4sfiSVD1LYwSk4/PhRpkL3HgyhywZcwCfBLvvvawQvTySnS0CUGU eEj87HjBCPFYrETT2YvsExjFFzAyrGIUSy0ozk1PLTYsMNErTswtLs1L10vOz93ECI5JLYsd jHvO+RxiFOBgVOLhjRBaFCPEmlhWXJl7iFGCg1lJhPdM/4IYId6UxMqq1KL8+KLSnNTiQ4zS HCxK4rzrHZxjhATSE0tSs1NTC1KLYLJMHJxSDYy61/cpRl1UlA2Qd985O8VQf8X1QE3HoG8v X2Uvv5xvZeTDcUdU5+R7gdVH8+wV/zsycd+Ywcmx9/WBzjPS+5ibnQT+ioVVG2RmLXu1Vowl aW+F8XG/9fPkby1qypmSaPlGI3FzXd//gLWuVfNsji3+avLXbgJTuZEuq9lDJ4XoR61XtbfN 3K/EUpyRaKjFXFScCAAqn3KIxQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBLMWRmVeSWpSXmKPExsVy+t9jQd1peotjDHr/iljMv5lk0bx4PZvF ii8z2S3On9/AbnF51xw2i0XLWpktmjdNYbX4/HESkLv1C7vFwQ9PWC1urGd34PZYM28No8fl vl4mj52z7rJ7LN7zkslj06pONo95JwM99s9dw+7Rt2UVo8fnTXIBnFFcNimpOZllqUX6dglc Gf2XzrMW7OOsuN5e28D4gr2LkZNDQsBEYs+0ZSxdjFwcQgLrGCV+7GtghnC6mSR+vukDq2IT 0JV48n4uUIKDQ0TAWqLvYBBIDbNAA5PEh54PzCA1wgJuEs/X9bOA2CwCqhJH/v9gArF5BTwk Nqy5yQqxTU7i5rlO5gmMXAsYGVYxSqYWFOem5xYbFRjmpZbrFSfmFpfmpesl5+duYgSG17bD Wn07GO8viT/EKMDBqMTDmyC5KEaINbGsuDL3EKMEB7OSCO+Z/gUxQrwpiZVVqUX58UWlOanF hxilOViUxHlv5x2LFBJITyxJzU5NLUgtgskycXBKNTDmVhz8LHrmyCIjx/TqJb+8w1JFI6cu P8pSczX1t352zoMN4WkvF2+Nqb0msnjeGo3vt14+iruzqXaDSXOC1QS79s1MZ5e7ONd83Vay iE1U7h2X14/MMmtvw6Vy5hWyZ3l5FH9OXRJye+cDi8eH/Cf6ZxW9CfzLsHGze9Fq71fGz67q P9jRLdagxFKckWioxVxUnAgAAEykaysCAAA= X-CMS-MailID: 20190402094246epcas1p1f43795d840b4c3a1f7efddc0523b2c89 CMS-TYPE: 101P X-CMS-RootMailID: 20190402094246epcas1p1f43795d840b4c3a1f7efddc0523b2c89 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sriram Dash The xhci forcefully converts the dma_mask to either 64 or 32 and the dma-mask set by the bus is somewhat ignored. If the platform sets the correct dma_mask, then respect that. Signed-off-by: Pankaj Dubey Signed-off-by: Sriram Dash --- drivers/usb/host/xhci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 005e659..55cf89e 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5119,6 +5119,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); } + /* + * A platform may require coherent masks other than 64/32 bit, and we + * should respect that. If the firmware has already requested for a + * dma-range, we inherit the dma_mask presuming the platform knows + * what it is doing. + */ + + if (dev->bus_dma_mask) + dma_set_mask_and_coherent(dev, dev->bus_dma_mask); + xhci_dbg(xhci, "Calling HCD init\n"); /* Initialize HCD and host controller data structures. */ retval = xhci_init(hcd); -- 2.7.4