Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4449788pxb; Mon, 27 Sep 2021 18:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1BHWy6d+nOMJNN6NNyuwERhw7Z721xQEw/FpbN/E8P+AtmPhmGrTRO8ZYQ+N43KLkqAjp X-Received: by 2002:a50:9d0e:: with SMTP id v14mr4286864ede.230.1632790872293; Mon, 27 Sep 2021 18:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632790872; cv=none; d=google.com; s=arc-20160816; b=d8QF0lN36K/KpeHJqnzm7nbFyFiGQBy6mFAku2B+tuOiSZZTs4VK3+CZK//otQgaiq CXn0isUY967/rvSCc/iwZInopO23Ou0VV08ardFKvLiaMLHqZA3OookFfeTX7W7Dj5pu 6Y530z+8VbpuqT6B8+oXXBwc5QPFNzQuTHCgadm+yPLqdsqsDRfESOi2O0j7accq23xS /fhVJsxlmy6QTr2svSyev4QFPUFyUtqXYIeNvhcuvZyyfT1Jiazf7AArasXOrqWacK25 FokcY6CSeoIrKaXty32JEWx2+v8Qu38x62QEnC4PS+6XlShZBGXIqowtX9KMlQP8fMre 3kQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=HtwGtlanLfdQLGvHJtN7aDTnAw3OoxD/DaX8mZRsiWk=; b=o/tjpQBmG6cWTCOV5Brz95Hkc39MEAUqDIBuNROAH0fmxKcpEiiZ2Bw4RLtwMKknZO HHpa8qbDKlBjB3pBA8iG0c+aD4JpaWR5hhIKV7XF1YxKtADxdvNrV8zTWfer6zzsA9Ca CGBmpOfR6yDosvjU/axb++DeyVZIglUyRxaRf4d3ROPIvKjpFuzTGVrGsA1WyUEJ6L2I PYIC2qIj2FNs9k5ZBRiLthpzNYc80TpWRa4QBuZuDJFsi1+BHBYiv+sS6PbjGXwpe59Z W7QUKsN6+IgRW2oF9MBbXKX8VlvRCR3C5u/ZV6AAnm7czWQ4YN5fsM14bZtilH09DVXv GXGw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a71si21604043edf.424.2021.09.27.18.00.48; Mon, 27 Sep 2021 18:01:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238389AbhI1BBM (ORCPT + 99 others); Mon, 27 Sep 2021 21:01:12 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:26911 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238283AbhI1BBM (ORCPT ); Mon, 27 Sep 2021 21:01:12 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HJLdc1gcRzbmr9; Tue, 28 Sep 2021 08:55:16 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 28 Sep 2021 08:59:03 +0800 Received: from [10.174.178.174] (10.174.178.174) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Tue, 28 Sep 2021 08:59:03 +0800 Subject: Re: [PATCH -next] memory: tegra186-emc: Fix error return code in tegra186_emc_probe() To: Mikko Perttunen , , CC: , References: <20210927075107.2882569-1-yangyingliang@huawei.com> <09e28d31-881f-acd0-33d0-565bdc9475ae@kapsi.fi> From: Yang Yingliang Message-ID: <19c2733a-7393-8a65-e188-65c4d750eaa7@huawei.com> Date: Tue, 28 Sep 2021 08:59:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <09e28d31-881f-acd0-33d0-565bdc9475ae@kapsi.fi> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2021/9/27 16:52, Mikko Perttunen wrote: > On 9/27/21 10:51 AM, Yang Yingliang wrote: >> Return the error code when command fails. >> >> Fixes: 13324edbe926 ("memory: tegra186-emc: Handle errors in BPMP >> response") >> Reported-by: Hulk Robot >> Signed-off-by: Yang Yingliang >> --- >>   drivers/memory/tegra/tegra186-emc.c | 1 + >>   1 file changed, 1 insertion(+) >> >> diff --git a/drivers/memory/tegra/tegra186-emc.c >> b/drivers/memory/tegra/tegra186-emc.c >> index abc0c2eeaab7..16351840b187 100644 >> --- a/drivers/memory/tegra/tegra186-emc.c >> +++ b/drivers/memory/tegra/tegra186-emc.c >> @@ -198,6 +198,7 @@ static int tegra186_emc_probe(struct >> platform_device *pdev) >>           goto put_bpmp; >>       } >>       if (msg.rx.ret < 0) { >> +        err = msg.rx.ret; >>           dev_err(&pdev->dev, "EMC DVFS MRQ failed: %d (BPMP error >> code)\n", msg.rx.ret); >>           goto put_bpmp; >>       } >> > > Good catch, but we shouldn't return msg.rx.ret since it is a BPMP > error code that doesn't necessarily map directly to a Linux error > code. So we should set err to something like -EINVAL instead. Please > update, or if you'd prefer, I can fix it. I can send a v2 later. > > Mikko > .