Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbdLFOXu (ORCPT ); Wed, 6 Dec 2017 09:23:50 -0500 Received: from mail-db5eur01on0086.outbound.protection.outlook.com ([104.47.2.86]:42832 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752212AbdLFOXt (ORCPT ); Wed, 6 Dec 2017 09:23:49 -0500 From: Laurentiu Tudor To: Bharat Bhushan , Nipun Gupta , "stuyoder@gmail.com" , "gregkh@linuxfoundation.org" , "cakturk@gmail.com" , "bretth256@gmail.com" , "arnd@arndb.de" CC: "linux-kernel@vger.kernel.org" , "devel@driverdev.osuosl.org" Subject: Re: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC objects Thread-Topic: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC objects Thread-Index: AQHTbnlt2BNJ65h210adI9tnCdVqlqM2T7oAgAAJMQCAAAXGAA== Date: Wed, 6 Dec 2017 14:23:45 +0000 Message-ID: <5A27FD70.7040208@nxp.com> References: <1512577087-5345-1-git-send-email-nipun.gupta@nxp.com> <5A27F0E2.6010403@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=laurentiu.tudor@nxp.com; x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2431;6:LgfQTD446X+r0J2sE56jY1Rsi5kKVT4TnayBxPJVp0ajIYRfkgNy5Fco9JDXCxuwkEGT2ISOJbPibYnS7nJkOHP/kZC1elaoi+3xRFke/XXurlSvFLI9p24a5DhpwCCzk7Sta7Z3LULw5ehjkrmthVwH7WRTYe7iFbqbtUZRap8/78gChGPZuJXiZUbXi/eMZzAKSwdRH019p7D0ZfKx7tPzRa2d/bXPxOo2852KutwprMV8KloBi1Nkk1sOUs7Q2a2OsI0ZQhHa9ovsUMcHahcw1spNo7z40UBpNiQgEJnU8XyAjt0MY7iBd6Ma5QncmMF3UJ1Q+UpAjv13i6XvB0r1OdEIXeHShW7T8/ofors=;5:Q9XXx58p7sCKoypPY/cod3BoC5NPp0a/4Ts7ojZPGCN09hdno1EGFXzEjtV6MHY7zYwCij+FxkUejILgLs4+Kxxkyh+YeI6ZkrywoX7XkTygKgnoRXU/A4IxJUFCmFhQADG4DNJN4RrbllCBbO+zSzg4ZtKAdicflrqdcdxEMWc=;24:Lta/Oat6XwMRqYgKcI0kUs+wTY3GR2lVkTcHkT8YHhMKkMB3z/hsuRTYGENJJR4f3753cY/okbgvYmjlmd8idg7HrtyQovZpPa7h4Dzf4Wg=;7:Jo+wzwvvt+AICBE260vfr1ya66w4B62Q//hCn+Ezhz+uCXEDMF/fMxJm/9znsBll3LXsWa5JR2Vxyss+j2jQI4hlqvlADWyf74Q/dXeSUbdtz6YOhRHBK0jkT4uEhcr73kGdv3dhmYryxMlqKHlQrloax+HdGuhyF+i1g07xwXUUILsEJGpptf6pepqjqWSj1Ogd+sP7Yn0d+8YBmKuK1fryohy01aCHLVtHdHhSKqMQXPu/9EI66DwfwDmbZFmf x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(366004)(346002)(376002)(39860400002)(24454002)(189003)(199004)(13464003)(5250100002)(65816011)(76176011)(97736004)(110136005)(14454004)(87266011)(54906003)(478600001)(8676002)(81166006)(81156014)(6246003)(5660300001)(39060400002)(4326008)(2201001)(2900100001)(86362001)(3280700002)(2906002)(2950100002)(99286004)(3660700001)(101416001)(6436002)(6486002)(2501003)(25786009)(36756003)(229853002)(53546010)(102836003)(3846002)(8936002)(6116002)(6506006)(6512007)(66066001)(316002)(59896002)(80316001)(7736002)(68736007)(105586002)(305945005)(33656002)(106356001)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2431;H:VI1PR0401MB1856.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 27b246a2-9788-446b-ea7e-08d53cb4f57c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286);SRVR:VI1PR0401MB2431; x-ms-traffictypediagnostic: VI1PR0401MB2431: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011);SRVR:VI1PR0401MB2431;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VI1PR0401MB2431; x-forefront-prvs: 05134F8B4F spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: <4B22303A953DF44595821094AB4538ED@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27b246a2-9788-446b-ea7e-08d53cb4f57c X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2017 14:23:45.1458 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2431 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vB6ENsjQ015207 Content-Length: 2982 Lines: 74 Hi Bharat, On 12/06/2017 04:03 PM, Bharat Bhushan wrote: > Hi Laurentiu, > >> -----Original Message----- >> From: Laurentiu Tudor >> Sent: Wednesday, December 06, 2017 7:00 PM >> To: Nipun Gupta ; stuyoder@gmail.com; Bharat >> Bhushan ; gregkh@linuxfoundation.org; >> cakturk@gmail.com; bretth256@gmail.com; arnd@arndb.de >> Cc: linux-kernel@vger.kernel.org; devel@driverdev.osuosl.org >> Subject: Re: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC >> objects >> >> Hi Nipun, >> >> Can you polish a bit this commit message? It doesn't seem to explain why this >> is needed. >> >> On 12/06/2017 06:18 PM, Nipun Gupta wrote: >>> When DPRC probing is deferred (such as where IOMMU is not probed >>> before the fsl-mc bus), all the devices in the DPRC containers gets >>> initialized one after another. >> >> Are you referring to dprc probing being deferred (do we ever do that?) or >> devices inside the dprc deferring the probe? >> >>> As IRQ's were allocated only once the >>> DPRC scanning is completed, the devices like DPIO which uses these >>> IRQ's at initalization fails. This patch allocates the IRQ resources >> >> s/initalization/initialization >> >>> before scanning all the objects in the DPRC container. >>> >>> Signed-off-by: Nipun Gupta >>> --- >>> drivers/staging/fsl-mc/bus/dprc-driver.c | 49 ++++++++++++++++++------ >> -------- >>> 1 file changed, 27 insertions(+), 22 deletions(-) >>> >>> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c >>> b/drivers/staging/fsl-mc/bus/dprc-driver.c >>> index 06df528..7265431 100644 >>> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c >>> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c >>> @@ -206,7 +206,8 @@ static void dprc_add_new_devices(struct >> fsl_mc_device *mc_bus_dev, >>> * dprc_scan_objects - Discover objects in a DPRC >>> * >>> * @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC >>> object >>> - * @total_irq_count: total number of IRQs needed by objects in the DPRC. >>> + * @total_irq_count: If argument is provided the function populates >>> + the >>> + * total number of IRQs created by objects in the DPRC. >> >> As a side node, after a cursory look i noticed that this total_irq_count >> parameter is used only for some sanity checks. I'm thinking of dropping it in a >> follow-up cleanup patch. > > How you will ensure that number of IRQ needed are not sufficient for devices in the container? > Do you think we need to either not enable additional devices or add irqs to irq-pool ? In the current implementation we allocate a pool of FSL_MC_IRQ_POOL_MAX_TOTAL_IRQS (= 256) no mater what total_irq_count is. I think this is enough for our current scenarios, but if in the future we ever hit this limit we can think of a mechanism along the lines of your example. Adding another chunk of irqs to the pool seems to me like a good idea in the future. --- Best Regards, Laurentiu