Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5408054rwl; Tue, 11 Apr 2023 05:10:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZleNJBVXXf1ORRB7kqvLVW13xuP4Z+FMCFCqVCy6igBBhCkoWK4KB0HYhCWMLj4JG9I6sz X-Received: by 2002:a05:6a20:4924:b0:ea:e896:e98 with SMTP id ft36-20020a056a20492400b000eae8960e98mr3082599pzb.58.1681215058510; Tue, 11 Apr 2023 05:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681215058; cv=none; d=google.com; s=arc-20160816; b=dbrCk0XX7TqROkgm/WGYZlk8J0pX84+md5MuXkok0fM/LN1fctElW++fnanva0oUcG CzRUK720gSwtvuIVQvwSSb7anCENNylHhvBFqpR6EnrA+GuMlhvBhyt2as/0lJjFCnkh /vujOszJMSv0SnbxLEej4rfW4g31wg9iYaQc6KlHfDknXfWWzc/EjCzlXK3n21v3amr3 9GPYWmcknsLxFFipdVHzIdBHN+/Y4UQxUP/7FFlgyNo/e035ISbvr7lcj5ccpLrb3om4 bui+T0OeiEJ65Sq+CLc+eEDhsb8hWsmxCDsd95Affa8jE64U6F2Zi6427Y6DNj1ycdjR Wzmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=WDVeTJwyTcw7grlTUYQdYuxVD5Hgg6hWlZAY1CZ2ux4=; b=zElntMKyY49yFID7goLDGzukUwCFlASXl04mT/Jx3LG/9OVDxjvjaA6f3oxC+8PVII NYaf7E2VHOJ9Z96AqOmMDEtksc/IgySrC64f7ftsj+Axh1PoaZxvTSVXcTquthBDB15w a7jNqxMIQ3ZMWPBjYO6sGJlhIL1a0vc/old0oIDAxpXNb8sjbgywtMN3rwDFiLngIAqx TQzg6WxJYlZw5Rh0uD1VoriUB2zORMgDuchdq/LgD86tFk41X0HjyoRdxdSjWtUY/7Wx VHq9iieMWiP7DLtMWLVcERWw49KX9Qm/zlX+oUsLJa/Vkcneylu5s92mcqAxsuDU6Jt4 aclQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=M7AOHNIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020aa79d86000000b00625fa16b6bdsi13167172pfq.73.2023.04.11.05.10.23; Tue, 11 Apr 2023 05:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=M7AOHNIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbjDKMEI (ORCPT + 99 others); Tue, 11 Apr 2023 08:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbjDKMEG (ORCPT ); Tue, 11 Apr 2023 08:04:06 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB442D48; Tue, 11 Apr 2023 05:04:05 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33BC3muM120374; Tue, 11 Apr 2023 07:03:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681214628; bh=WDVeTJwyTcw7grlTUYQdYuxVD5Hgg6hWlZAY1CZ2ux4=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=M7AOHNIKSecw/WaL/PSLQFfQkBYN5KtXRJLtdSccMIqMrJrN6EhEIsxx4XnrSGfPn nosNuz3cenAzErwKsEA9/eO8gYaqp/15RnPY3trE9KRXJ1B1jx4S84uOyPubGp86Xm 7PCMXUwH7r4pOhGLFGa4Wxu/svH18eMoQweRcodg= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33BC3mQI000471 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Apr 2023 07:03:48 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 11 Apr 2023 07:03:48 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 11 Apr 2023 07:03:48 -0500 Received: from [10.24.69.114] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33BC3hgd008848; Tue, 11 Apr 2023 07:03:43 -0500 Message-ID: Date: Tue, 11 Apr 2023 17:33:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [EXTERNAL] Re: [PATCH v7 1/4] soc: ti: pruss: Add pruss_get()/put() API Content-Language: en-US To: Mathieu Poirier , MD Danish Anwar CC: "Andrew F. Davis" , Suman Anna , Roger Quadros , Vignesh Raghavendra , Tero Kristo , Bjorn Andersson , Santosh Shilimkar , Nishanth Menon , , , , , , , References: <20230404115336.599430-1-danishanwar@ti.com> <20230404115336.599430-2-danishanwar@ti.com> <20230410170927.GA4129213@p14s> From: Md Danish Anwar Organization: Texas Instruments In-Reply-To: <20230410170927.GA4129213@p14s> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu On 10/04/23 22:39, Mathieu Poirier wrote: > On Tue, Apr 04, 2023 at 05:23:33PM +0530, MD Danish Anwar wrote: >> From: Tero Kristo >> >> Add two new get and put API, pruss_get() and pruss_put() to the >> PRUSS platform driver to allow client drivers to request a handle >> to a PRUSS device. This handle will be used by client drivers to >> request various operations of the PRUSS platform driver through >> additional API that will be added in the following patches. >> >> The pruss_get() function returns the pruss handle corresponding >> to a PRUSS device referenced by a PRU remoteproc instance. The >> pruss_put() is the complimentary function to pruss_get(). >> >> Co-developed-by: Suman Anna >> Signed-off-by: Suman Anna >> Signed-off-by: Tero Kristo >> Co-developed-by: Grzegorz Jaszczyk >> Signed-off-by: Grzegorz Jaszczyk >> Signed-off-by: Puranjay Mohan >> Reviewed-by: Roger Quadros >> Reviewed-by: Tony Lindgren >> Signed-off-by: MD Danish Anwar >> --- >> drivers/remoteproc/pru_rproc.c | 2 +- >> drivers/soc/ti/pruss.c | 64 ++++++++++++++++++- >> .../{pruss_driver.h => pruss_internal.h} | 7 +- >> include/linux/remoteproc/pruss.h | 19 ++++++ >> 4 files changed, 87 insertions(+), 5 deletions(-) >> rename include/linux/{pruss_driver.h => pruss_internal.h} (90%) >> > > Throughout this patchset an API to access resources required by the PRUSS > is added to pruss.c but all the function declarations are added to > remoteproc/pruss.h. Is this something you were asked to do or is this how the > original implementation was? > Previously in v3 [1] remoteproc/pruss.h had pruss_get() / pruss_put(), pruss_request_mem_region() / pruss_release_mem_region() and pruss_cfg_read() / update() API declaration in it. These APIs were defined in pruss.c. The APIs were defined in pruss.c. The other APIs [pruss_cfg_get_gpmux()/set(), pruss_cfg_gpimode, pruss_cfg_miirt_enable, pruss_cfg_xfr_enable] were declared as well as defined in linux/pruss_driver.h. But in order to make pruss_cfg_read() / update() API internal to PRUSS as asked by Roger, the other APIs' [pruss_cfg_get_gpmux()/set(), pruss_cfg_gpimode, pruss_cfg_miirt_enable, pruss_cfg_xfr_enable] declaration was moved to pruss.c and definition was moved to remoteproc/pruss.h and pruss_cfg_read() / update() API's declaration as well as definition was moved to drivers/soc/ti/pruss.h So now remoteproc/pruss.h has declaration of below APIs. pruss_get pruss_put pruss_request_mem_region pruss_release_mem_region pruss_cfg_get_gpmux pruss_cfg_set_gpmux pruss_cfg_gpimode pruss_cfg_miirt_enable pruss_cfg_xfr_enable All these APIs are defined in drivers/soc/ti/pruss.c > Other than pruss_get() nothing in there is related to the remoteproc > subsystem, the bulk of the work is all about PRUSS. > > In my opinion all the function declaration should go in pruss_driver.h, which > should stay as it is and not made internal. The code looks good now but it > needs to be added where it belongs. >> Thanks, > Mathieu > There was discussion on moving these declaration to pruss_driver.h but Andrew and Roger agreed on keeping these in remoteproc/pruss.h only in v4 [2]. Also Andrew suggested in v4 to rename pruss_driver.h to internal. Please let me know if I should keep them as it is or try to move APIs from remoteproc/pruss.h to pruss_driver.h. Earlier in v3 below APIs were there in remoteproc/pruss.h pruss_get pruss_put pruss_request_mem_region pruss_release_mem_region Should I keep all these in remoteproc/pruss.h or only pruss_get/put() as mentioned by you in this email. [1] https://lore.kernel.org/all/20230306110934.2736465-1-danishanwar@ti.com/ [2] https://lore.kernel.org/all/67dd1d04-147d-0e40-c06b-6e1e0dd05f13@kernel.org/ -- Thanks and Regards, Danish.