From patchwork Thu Mar 1 15:27:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130286 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2952513edc; Thu, 1 Mar 2018 07:38:37 -0800 (PST) X-Google-Smtp-Source: AG47ELvKcdHWgISILqEGvkrWRtbp057558ZN23fmyd1JJ7LfPdZoXY6gh+jGnjuU+U4J/i6g46kd X-Received: by 2002:a17:902:6c4f:: with SMTP id h15-v6mr2276020pln.435.1519918717871; Thu, 01 Mar 2018 07:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918717; cv=none; d=google.com; s=arc-20160816; b=WzAvzHvmyZD513AAawCh9hJzbRj75sA5hGxUbMTslPpjXCBbwJm9e46NkqxLG1wP+F u11orWuLyaXusMGtROrxy5TuYudrG4soZeUb4yO9vH/Zk2SOlaNvqOGtkRmqZSM/Sq9I MMdypu4U/3ZBtGK6lS9037beR2Sd/nUeGjLqFC6SAXbRW/+aul8cm2T7C/Fht3TbcdiA oQb696oY/WEI5YpnkRlRcvSipL7YtQQtcC49cAtBJ33u4amjtHlRSAI79t6BIyBUS+Z0 yFjGerkBecCsqN8SYGxMwyfHWtBOI7diT2g9iOH/N+o95amJf16A2KPRo7B6Gp1Odwfd mXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=v/26EefdxDbCawAD1g8ruB+kwrDzfkI4LF1dBcyOPBo=; b=kwNbbAJsJ/jjgYkVyDrbSMi4ZcJtXfFZrvnsFpxLdN1W3/FPGK2fBNlk4XrWEWWQAf jJbUTBL0tG585jkeoi2tFMzsO8vzHPxEzZ26dlySHjmsOv77/aAc6rb3b8QK+EpfZHHL ZgSWaqB6xrqz8H33hLHqN8GASqzvUloxmJhba0DrFHqtNhG0z6hrHYfkUVoeGcGJ7BEc h1e9uSM0yKawE/v1aLJhG4HHHDb8ANtX8/hdpdX4O3qdFJaeXB3dmn4f2slT7PFVToD8 pK1xb7UDEsvFWaXJA3EqRL72zLBdBoQG6bm+MuqfcRZ73dksHKYN/rZsdZdEhLhsPLxj subw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Iw25uxw9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si2586092pgs.318.2018.03.01.07.38.37; Thu, 01 Mar 2018 07:38:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@microsoft.com header.s=selector1 header.b=Iw25uxw9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032552AbeCAPig (ORCPT + 10 others); Thu, 1 Mar 2018 10:38:36 -0500 Received: from mail-sn1nam02on0127.outbound.protection.outlook.com ([104.47.36.127]:60979 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032558AbeCAPib (ORCPT ); Thu, 1 Mar 2018 10:38:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=v/26EefdxDbCawAD1g8ruB+kwrDzfkI4LF1dBcyOPBo=; b=Iw25uxw9aI3zK7AyZ3GlgfeyjrSTQ4HYPAXvVDkznGcaw1QsB30PLydthyDnQwPHyxDNZ5HyX+VG5VGKFNOzt5LQNnMuVwpTYVMupGMbbXQDAFtOgIwMbySaPUu5fkSo7nKkxlhSXcNgXSvCg5hmPCI/Mjh8grIMkZyIFCUAF6A= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1016.namprd21.prod.outlook.com (52.132.133.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:38:26 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:38:26 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Felipe Balbi , Sasha Levin Subject: [added to the 4.1 stable tree] usb: musb/ux500: remove duplicate check for dma_is_compatible Thread-Topic: [added to the 4.1 stable tree] usb: musb/ux500: remove duplicate check for dma_is_compatible Thread-Index: AQHTsXHLUtRFhN2AyEu3g4xZwp6//w== Date: Thu, 1 Mar 2018 15:27:23 +0000 Message-ID: <20180301152116.1486-458-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1016; 6:RXYPWwQWFTCJLbVDFcuP2dB2ILN3tYJByzKpykKkpgaNbl2SxxFcKxlH0NrPnHBNKZD3h2hfNslKmnpxlqY3hv7AhJNjoswF2ZKEWSebY+zJuojeOjaeVTViBgv/eR01wZECOXD2PzcVB08yjdkIz5yEWlK8lBiU9X33v51HZvQohPLwhiWhBT4f4MG0e/qACMP1LKkHxA/9gVfqg62PgtTVpvoTt8W1aludWcOqgdN+9S6V57wTukMl7Yk0aPoCQ4DymRMNN4VEcBKApQuZ0PsRe/83Guv5R68pUmiNOmx/8Vmyzqk5cto7d/r6bXRp+h1kRtUo/pL4elZTW59RGIFvl1JPrT/6Bz48Cy3pPQZc5C1GwJbEeBBhh7JGdyqz; 5:xfmkx0FmEsabccO4s8FemkwCuKiBAflnBTokb4JEJyM9lF98ZRpZl0eUlTvzL9uIgUMKgXXdMMQWdJI4eYCFu9NJ1Vtihr2nc3eVVXLG5DdkTiPYmso3piaZIRxpMC1aA6z23Q+D4pSDiFvesCoYUtwxy5JTCDiswSiJMaP7qYI=; 24:L09qb8IUUa7rutFfs2GP70LqeyndQ9mo3LFYZPtwb3bQ+l4j0dMA0zv0kKqEwlK8qIMoEdSV/CXGqf1cM7hOBq1XF3lhYf0f2hV+OidK3ik=; 7:LXJPyidysMNMgXT+sqyUs9JKVCrOINnhjQP9UolckaOXeq9KBKv3deXjXkMSFAmQVOzM269bqkSeJGAPuntMSVpIY+RBJYFfBwxK9XOSc8gaWTKot4XoCIotF202ESr4RX1fNPBtU6TOwP///awvjU/+7tYoYo9iG7XLWPOzGAppV/hQ3l23cl+DH4wfnDswAJXhCGilp7BUuTQqKGMU8MvnfxC0jktgDNo2nBqdCWzm+P8h8l4gNnVnFEG/0qZB x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1f68cf49-33fd-4b8a-7693-08d57f8a7970 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB1016; x-ms-traffictypediagnostic: DM5PR2101MB1016: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501229)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1016; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1016; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(39860400002)(39380400002)(376002)(396003)(189003)(199004)(22452003)(6436002)(8676002)(81156014)(81166006)(53936002)(68736007)(6486002)(6512007)(97736004)(5660300001)(86362001)(59450400001)(6506007)(102836004)(6346003)(2906002)(26005)(186003)(4326008)(10290500003)(8936002)(76176011)(478600001)(105586002)(3280700002)(14454004)(54906003)(110136005)(3660700001)(2950100002)(305945005)(7736002)(6116002)(72206003)(1076002)(3846002)(6666003)(316002)(2900100001)(25786009)(36756003)(2501003)(66066001)(107886003)(106356001)(5250100002)(86612001)(99286004)(10090500001)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1016; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: HUsrqYJ9PdzhlcnRYHaEyTQ6m8enL3NE0NJT9y/Ti6xCNGWVRZKyN3PqTQF6scRg8VYzXsT8Nte6PJn+PP1wgapEkfvbHrRxFbqC06uky6N9z5E/fzBxWn7bDWEUb4TrnVaaYJ0u7Au/sY6FnJe//bpXZooq+d6Pjf2xsMZte34= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f68cf49-33fd-4b8a-7693-08d57f8a7970 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:23.3973 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1016 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit 62a6abdd427b5fc4d8aad5dac874904e96273e6d ] When dma_addr_t is 64-bit, we get a warning about an invalid cast in the call to ux500_dma_is_compatible() from ux500_dma_channel_program(): drivers/usb/musb/ux500_dma.c: In function 'ux500_dma_channel_program': drivers/usb/musb/ux500_dma.c:210:51: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) The problem is that ux500_dma_is_compatible() is called from the main musb driver on the virtual address, but here we pass in a DMA address, so the types are fundamentally different but it works because the function only checks the alignment of the buffer and that is the same. We could work around this by adding another cast, but I have checked that the buffer we get passed here is already checked before it gets mapped, so the second check seems completely unnecessary and removing it must be the cleanest solution. Signed-off-by: Arnd Bergmann Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/musb/ux500_dma.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index e93845c26bdb..c17495e7fcc5 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -207,9 +207,6 @@ static int ux500_dma_channel_program(struct dma_channel *channel, BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN || channel->status == MUSB_DMA_STATUS_BUSY); - if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) - return false; - channel->status = MUSB_DMA_STATUS_BUSY; channel->actual_len = 0; ret = ux500_configure_channel(channel, packet_sz, mode, dma_addr, len);