Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD82C04AB5 for ; Thu, 6 Jun 2019 05:15:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C17F820872 for ; Thu, 6 Jun 2019 05:15:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V5LMuuEO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="hgYaPvJ8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C17F820872 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4lao8UfivEhsd4KY+rsUf0c4n+hW0UcGlmP6TWZITP4=; b=V5LMuuEOAWhXPV yO/aHGPZu1/jWNMR3a3SranDtezvTt4ABYKycdiw6GWWR2YByhj9bNe7RAsIUsMxmTmGXnFeluBoz fjjRIsl4zy2uH9NvIJuFpdeSM7tD5CgPeUBl5LAlE3U2mIjfFA8eYWrKmswZk/P4BjugfHsSGdSEx gKA2q1iIrmxhspO8G9rmt2R6HBQ46ZNYW0vzmWa5tE9Sx00sZHGUMtpV5faBjKd/70hmupQnJtZqd Bi7vpWtrqo9fqTqmHqt23jECp+Gb0DffHgMRYQIPPeUCdlh0OsuAHjwGNiiL3rCTf+YfkzROHfN2C 4VO3ZmFTcghr7/YcM9Ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYkkS-0001s3-8G; Thu, 06 Jun 2019 05:15:36 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYkkO-0001rk-W4 for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2019 05:15:34 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x565FUiG005265; Thu, 6 Jun 2019 00:15:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559798130; bh=k7NuenukIeKWTpg2h0PMzzOI7x7TPWhM02vhvuDO7Ns=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=hgYaPvJ8Cj1HXUrKxmqjmy0P06JHg6jYjecQs/P9H8RBkZvdijmjSNwCcK9DvbKS1 1VNUt+MhqIKLOe5upmc73KVko0d42T5RGoGe//gtzZchBZoy5rSqPxXTLLSprWfAgn AXbN7DXXkcqWxO/b+lTI4F3AC39slTVBtauVijnc= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x565FUGY111154 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Jun 2019 00:15:30 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 6 Jun 2019 00:15:30 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) 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.1713.5 via Frontend Transport; Thu, 6 Jun 2019 00:15:30 -0500 Received: from [172.24.190.117] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x565FQbC017664; Thu, 6 Jun 2019 00:15:27 -0500 Subject: Re: [PATCH v2] firmware: ti_sci: Parse all resource ranges even if some is not available To: Peter Ujfalusi , , , References: <20190604102823.10166-1-peter.ujfalusi@ti.com> From: Lokesh Vutla Message-ID: <67b7604b-dda6-4907-25a6-a59ef622a7ee@ti.com> Date: Thu, 6 Jun 2019 10:44:52 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190605_221533_156887_711CEB5B X-CRM114-Status: GOOD ( 15.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 05/06/19 12:15 AM, Peter Ujfalusi wrote: > > > On 6/4/19 1:28 PM, Peter Ujfalusi wrote: >> Do not fail if any of the requested subtypes are not availabe, but set the >> number of resources to 0 and continue parsing the resource ranges. >> >> Reviewed-by: Lokesh Vutla >> Signed-off-by: Peter Ujfalusi >> --- >> Hi, >> >> Changes since v1: >> - moved the 'bool valid_set = false;' to avoid 'reverse Christmas tree' >> - Added Reviewed-by from Lokesh >> >> Regards, >> Peter >> >> drivers/firmware/ti_sci.c | 11 +++++++++-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c >> index ef93406ace1b..191939476d64 100644 >> --- a/drivers/firmware/ti_sci.c >> +++ b/drivers/firmware/ti_sci.c >> @@ -2342,6 +2342,7 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, >> struct device *dev, u32 dev_id, char *of_prop) >> { >> struct ti_sci_resource *res; >> + bool valid_set = false; >> u32 resource_subtype; >> int i, ret; >> >> @@ -2374,13 +2375,16 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, >> if (ret) { >> dev_err(dev, "dev = %d subtype %d not allocated for this host\n", >> dev_id, resource_subtype); > > Should we change dev_err() to dev_dbg() as this is no longer a failure? Valid point. Please make it dev_dbg. Thanks and regards, Lokesh > >> - return ERR_PTR(ret); >> + res->desc[i].start = 0; >> + res->desc[i].num = 0; >> + continue; >> } >> >> dev_dbg(dev, "dev = %d, subtype = %d, start = %d, num = %d\n", >> dev_id, resource_subtype, res->desc[i].start, >> res->desc[i].num); >> >> + valid_set = true; >> res->desc[i].res_map = >> devm_kzalloc(dev, BITS_TO_LONGS(res->desc[i].num) * >> sizeof(*res->desc[i].res_map), GFP_KERNEL); >> @@ -2389,7 +2393,10 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle, >> } >> raw_spin_lock_init(&res->lock); >> >> - return res; >> + if (valid_set) >> + return res; >> + >> + return ERR_PTR(-EINVAL); >> } >> >> static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode, >> > > - Peter > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. > Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel