Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2406490pxb; Tue, 9 Mar 2021 01:30:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnCc7E6dvkOGQxZNT7cE3Tq8rBUfIZ2QRK3bYvt0paNuFgDF5yUuG5caEKpiw/2O7tjBi6 X-Received: by 2002:a17:906:af84:: with SMTP id mj4mr19635561ejb.84.1615282207513; Tue, 09 Mar 2021 01:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615282207; cv=none; d=google.com; s=arc-20160816; b=wKYa7BCAOH2WgpDdkQBcnBUtLWGpt2x33E5HyNRwaAby/0NqOvYhNqgYs7Wy9qswnd ozx+dwaY/mDceGSV2HOjpROi7ReiIS+GOuZ2c/eYhTq8JCyed6oIZVOwhpATGeTbiw8e jo6C6BDSSpngKN48DuMwW9SyofIlPWSZ37HivdnAv6WqWaK57Y8H23EnIT51US04nmA/ 61EjddqEnAQx0ai9oRxt8K4mAdEeY8RUjM70gwwuwHedCWIZWG5GLQDmgL2SiLn4AiXF bicu42+jQIS5VqQGH1ZzjxxI+KqOEdlknZDqpsuAP9J9JcXAGpq49ey9bhiXxMpSRGRY DAYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TeDLK0Rk12FTIyPCKoKkTCZzXQMFNcyT1sCUu+HO6mk=; b=kki8wCwfNBQqNL0Qn8aM8+7FyOhZAFnD1n8kIemDzYkm+RLEtyBks+jRbOTWqP/I3A Ok3GxyzvDqQwCE8rPDkIbYSgUj+UaVnXNwf/iWzGa+LgqEAiCzvzv2PwmCaF0w9XxHnE vOyF0QZniuP8oqDmAkRacLaXQFJanHu1FMq7GVDIgLL1o/z42+FHrr6O3QtsRDnuaQk0 W7lVhnpbSwKnhH4c7BWkPDFpafHCgIcL6O+rwbDLVWeb/khiNp4+sznCjyq2wQh+vfJ4 +SpeMWy6Gi4ZVwMAK5UesZBHlYbptrLFO5Zn60tgLkxHd1MijIBnyLkMCLYVEOue7dj+ zM5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qHmYZkKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si8703697ejg.509.2021.03.09.01.29.44; Tue, 09 Mar 2021 01:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qHmYZkKf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbhCIJ2m (ORCPT + 99 others); Tue, 9 Mar 2021 04:28:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbhCIJ2O (ORCPT ); Tue, 9 Mar 2021 04:28:14 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6183C06174A; Tue, 9 Mar 2021 01:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TeDLK0Rk12FTIyPCKoKkTCZzXQMFNcyT1sCUu+HO6mk=; b=qHmYZkKfCsSMxdycWOwzAXy3kE Q4QMaiUl/PWS+7L4QK21Yc4arVaYHDQostGzfzsHT7uB8ZdhbBuECBshuUarsoWWVMb4ddg4g4XIj hCIKeKPlw3QtLU8Vi8bzeiv8R13HCO2UVABDEQOqUW5ouw5IYHs2VLoWiNBfw6Wy3xxMiZrd2wfQd T1OJfQaqECs3hfY/ClHKuc577scgY8+CprWSqJokVe/NWFrxXSxi0TNTVz9s28h2DJsjsiaQQoRud USdQKNWqFzIwBKJSPMdUqw0COAUr1ijMUNiiGOUEC4AnO+01J1rU8yArnQzb3wDZZrGs/k1D+K/TL XefqhlRA==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lJYeq-000Lnv-Bl; Tue, 09 Mar 2021 09:28:04 +0000 Date: Tue, 9 Mar 2021 09:28:04 +0000 From: Christoph Hellwig To: Sanket Parmar Cc: peter.chen@kernel.org, pawell@cadence.com, a-govindraju@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kurahul@cadence.com, gregkh@linuxfoundation.org, kishon@ti.com Subject: Re: [PATCH 2/2] usb: cdns3: Optimize DMA request buffer allocation Message-ID: <20210309092804.GA76839@infradead.org> References: <1615267180-9289-1-git-send-email-sparmar@cadence.com> <1615267180-9289-2-git-send-email-sparmar@cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1615267180-9289-2-git-send-email-sparmar@cadence.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 09, 2021 at 06:19:40AM +0100, Sanket Parmar wrote: > dma_alloc_coherent() might fail on the platform with a small DMA region. > > To avoid such failure in cdns3_prepare_aligned_request_buf(), > dma_alloc_coherent() is replaced with kmalloc and dma_map API to > allocate aligned request buffer of dynamic length. dma_alloc_noncoherent is the proper API instead of using kmalloc, which can lead to unaddressable memory that might require bounce buffering.