Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2616423pxb; Sun, 17 Oct 2021 20:37:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyH6ZGzx/8iRqPAtLZSnEsbk/RV+uSBIuRmS2VaR8j8mQI41kKrEQ/c3HfmQmOjwEzNCz/ X-Received: by 2002:a65:564e:: with SMTP id m14mr21419881pgs.113.1634528234956; Sun, 17 Oct 2021 20:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634528234; cv=none; d=google.com; s=arc-20160816; b=XpwH1CkEXXatE9qqxZCzQ2AqgJhEbmKG0w4cp+hcbYWvjim34n/az+Uxoct1xm0woY EO+Gczo/k4NQbHMA6WHbFkl8GjK/9fdlaqat/qf6tmvF0TajsPQxOK+TNS0PCofEe4de diK2xFjo0ciBAg1Vs/vkAzKoIQaGd6ORx55517NhaMkZAup5FLPsOhD356ECHspDYC+N WaHOPldveeFHHJ2+tXApjU3lqw+jjy/8hfcEauxLBJ9pBMcL0/vT11tlx6r+C4YAfhmn 6o13XzssnQrSIfkEz9vNmaw47g/FIwKyOrJRr4Xm/nRgHlURnskEieQ0UDiK8uHPvbHc SeKQ== 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=SRWmouyixy+icIz6XXYJbG7SkRzL7hm7Deq8O2dM3jE=; b=L0cK9zyijGyTx2WKlDEm0ctDJh9ruCFzQmHkUy/n5HSgxn2DWc9U10pUd3hyIvGhw4 uBrMYCiJjAexjtVIRxP5OR1V/TaDHXLTM51ibFzAuf48Y+tTQhEtyfgfiaTAzMdmaSkA 0j9KHa5VmpWzghPz7BOziSGg4XQ5a7nbSvkdvYx8Yv2Ut0i1zdYFYtatG72JzcfIwWqc WpHrfVW2Oj4AqmHDEE0XmnnPlQquvMutAFUppvsZSl7i5co8d9OKCRQodgIWvgTBX3MS Cb2wY8prLzuxZKgH58ek/6mGc98EaDzxQQUzhMOI9r9c/F0p+D5iIg0oMjLvts6Xxwfh UncQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XV3xTGX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si21795398plg.352.2021.10.17.20.37.03; Sun, 17 Oct 2021 20:37:14 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b="XV3xTGX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236585AbhJPQdp (ORCPT + 98 others); Sat, 16 Oct 2021 12:33:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:52100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbhJPQdo (ORCPT ); Sat, 16 Oct 2021 12:33:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DEBB6109E; Sat, 16 Oct 2021 16:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634401896; bh=1Guiab883qyByx7tJNaCujwIVNnfBIN3+AL//FDIewM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XV3xTGX/D7OriQ8vXqDgWuVKrd2TQLz9HHwZIvULkytyCqRt5w7WwHXnT+pqzGQUq 86nb8OIutr5oxRMalBCn55As1fQRwm1lkIJjpb5Epy8ViW4Vznuqyo1rdTpc1unxTC VABtCuTnT/1EIxXwBl4r97C8thZ1WjSyb/IPuJiWwQmwJ1dxnjV3GJLbfR7aieDf5L OXSx6+NeDIGlx9RA6+rmhhuknhRLIp7Kz0SfClemAe6BuFthbP10KDmv27I8A6J4Rq Hv/37QSzA7DRq5ifCKSy3rXFAwSLypa/ciyxBNGqKsbTaVvEzxA10pw9sk9mElkHTU CtkNqT6rn8vSg== Date: Sat, 16 Oct 2021 22:01:28 +0530 From: Manivannan Sadhasivam To: Greg KH Cc: Manivannan Sadhasivam , hemantk@codeaurora.org, bbhatt@codeaurora.org, loic.poulain@linaro.org, wangqing@vivo.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Subject: Re: [PATCH 2/3] bus: mhi: Add inbound buffers allocation flag Message-ID: <20211016163128.GC4048@thinkpad> References: <20211016065734.28802-1-manivannan.sadhasivam@linaro.org> <20211016065734.28802-3-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 16, 2021 at 09:39:53AM +0200, Greg KH wrote: > On Sat, Oct 16, 2021 at 12:27:33PM +0530, Manivannan Sadhasivam wrote: > > From: Loic Poulain > > > > Currently, the MHI controller driver defines which channels should > > have their inbound buffers allocated and queued. But ideally, this is > > something that should be decided by the MHI device driver instead, > > which actually deals with that buffers. > > > > Add a flag parameter to mhi_prepare_for_transfer allowing to specify > > if buffers have to be allocated and queued by the MHI stack. > > This is a horrible api. Now one has to go and look up why "0" was added > to a function as a parameter. > > If you don't want to allocate the buffer, then make a function of that > name and call that. As you only have one "flag", don't try to make > something generic here that is obviously not generic at all. > This is the only API that can be used by the client drivers to pass the configurations to the MHI stack. So we wanted to have a flags parameter that could be extended in the future also. Regarding "0", the default behaviour is to not pre allocate the buffer at all. So it made less sense to add a separate flag or an API for that. Thanks, Mani > You all can do better than this. > > thanks, > > greg k-h