From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751344AbdBWQU5 (ORCPT ); Thu, 23 Feb 2017 11:20:57 -0500 Received: from mga03.intel.com ([134.134.136.65]:57038 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbdBWQU4 (ORCPT ); Thu, 23 Feb 2017 11:20:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,198,1484035200"; d="scan'208";a="937318840" Subject: Re: [RFC PATCH] xhci: Use Cached ring during endpoint ring allocation To: Anurag Kumar Vulisha , mathias.nyman@intel.com, gregkh@linuxfoundation.org References: <1487775954-16258-1-git-send-email-anuragku@xilinx.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com, punnaia@xilinx.com, Anurag Kumar Vulisha From: Mathias Nyman Message-ID: <58AF0A85.3080503@linux.intel.com> Date: Thu, 23 Feb 2017 18:15:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1487775954-16258-1-git-send-email-anuragku@xilinx.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.02.2017 17:05, Anurag Kumar Vulisha wrote: > Currently during endpoint initialization, a new endpoint ring is alloacte > using xhci_ring_alloc(), if this function fails to allocate ring a cached > ring(if available) is assigned to endpoint ring. > This patch modifies the code that during endpoint initialization, if cached > ring is available it is assigned to the endpoint ring. If cached rings are > not available then xhci_ring_alloc() is called to allocate a new ring. > Doing so will avoid unncessary memory allocations if cached ring is already > available for use. This also fixes endpoint "Ring expansion failed" error > which occurs due to insufficient memory during ring expansion. > > Signed-off-by: Anurag Kumar Vulisha Thanks for bringing this to my attention. Your approach certainly makes more sense than the current way. I need to check history why this type of ring cache was created in the first place. It's possible that the whole ring cache is not really useful anymore -Mathias