Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp313042pxb; Wed, 23 Mar 2022 19:09:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQnetFqBAgOXhxI/BBK8/swtf1lPGEbFKvb7AxuI6M8JlAvEQ5WBElRun+Oic9Plov05/P X-Received: by 2002:a63:4f08:0:b0:34c:6090:603e with SMTP id d8-20020a634f08000000b0034c6090603emr2143089pgb.15.1648087797265; Wed, 23 Mar 2022 19:09:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1648087797; cv=pass; d=google.com; s=arc-20160816; b=Jc1DFOeYRFcl+yhQDnxxKxJWs+wl+ogylKfZXJCxyGMJTg/6gJ19NjSF9KBdXwWRgn KN/N2eZgTSnlN92sg1ibhmvUQ8GKyFGuuyglBUgPIDXJ6oD6AGcT7DV9+qwjTy5rv5NX gQ9b0VCVs9wIi1JVnProB4KyPizhYxteaPmjP5YbTEjSkR+EVMcMk4Ix3SLzz4y89nGf 2WNbqIGs35hMAFoHCYjxdkrwXIz9y+I4YPRnmIpiExDv2ZlxFUeg+abN4dl9Q8lce5qS xLKc5FkljMihWG0URf05tnuLJYU6kbrBv6Me29JuyWsoWPMSrhDbw5A2LbzXCPO8svM3 //5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=X+ptH/ySbCRAaFgGelQ3w3u6Li3mVuhgjDpVgFAiXlE=; b=wx6JvhhdZ17uPH/v+D44UB6oMyrijnaYIvfOsl/hOWsXNWGFMFn+YT1abDXrJtjueu ME2goKyBcbp/3+Zt3x0SA/D+fKgFlCh2zoMIW4tSXA8ky3MlERV00pfqycE4D6U4/jSL OfnBqfiRBYDrYIZSgs/iXGmxfyTIplm9dqBqhH+QIj3uLY6j+EqMlHts7uGJ3Qp3JmfI kW6OF4Qb6M+KhAHgmfW4JgiZl83ye1qlhF2uLlhj7hO2LoR/wsB8XiLZFmUTvSTCb9kT JN+lZtqGT6Heisqu1cXZbydsXS3LTVYej75bjulmjwLSNOEW0eLSiHOlvyDi2QdPMnQk /v2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=S5im8BbX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a170902a40400b00153b2d16665si17939858plq.621.2022.03.23.19.09.43; Wed, 23 Mar 2022 19:09:57 -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=@Nvidia.com header.s=selector2 header.b=S5im8BbX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242769AbiCWIi2 (ORCPT + 99 others); Wed, 23 Mar 2022 04:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiCWIiX (ORCPT ); Wed, 23 Mar 2022 04:38:23 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2088.outbound.protection.outlook.com [40.107.95.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5906D12AFC; Wed, 23 Mar 2022 01:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dpQXLD5DOel4h3bcj6mAM0eAUvcqQLTsYg846reymUxFHaNipbkPhMR5OwGNA3V0FYJGKN05kAr/TbeeiHgGkq3RA0xkJD5ZVVwrkckNRK/nhBXgOLpNIuUALvo+/gxIjVgaMMwb477M4ROiLJ0UooKnze+6fwH3jg78l9hrrPXQMS55LifHfeiGD67y/KPDQhlDRu7NbyX33rZ2qNzu2KvOqtpeFef84dYJJrSHQ2ht8w5A/GUfk3EjPcKKFwsKDmkCYYgElCX6cu1BKXMzvC5ISrGkh/TXf91U0jAUbf2iVG1aXTk6wtLuzlv2N52kN9HPpWHu5ozIqbxQX8c9zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X+ptH/ySbCRAaFgGelQ3w3u6Li3mVuhgjDpVgFAiXlE=; b=ZZErHFR4WWjSrKrqnThxN+3JfH5rRJX/c3V67Z205IqGBKyI3i372PbO6onsrUvC4f8ZNEMn48flaCKSQoIf3RMOrN/hrIT1AqJd+WJXUGnNbDaZVtlQZNrVf+A6Ha82VE1hrZLxTZbclEMsltIb7/Sm3RS65MBHlBnTTZm+BFpM4e+9G5lgOgxYfLmKzDaHMV8UeU2n3IyisE9McMJtuV1EZA7cgapjxUtxce5svg3HgqpO/KfJGkZdO85nrnqPAJXVV9iV991B5A/WlfLH7lgV8DHHKpA0NAljP7EaGmGRUapeTSqP8LhNeeP9ETMHHxAqKOpE92qOEifJ9TGYzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X+ptH/ySbCRAaFgGelQ3w3u6Li3mVuhgjDpVgFAiXlE=; b=S5im8BbXVJKlyN6CCsHj2g4IP71VMm8hap7fmCpnlaObJ9ciALS/CaWe6IDtAiET4zx+xSkb8WMuAL5gh6EGgTICZj7YzjKqSDwDmlIKrCROkMqUks0jPwXbSrLmd409oqVxk2ML3ZonvXhppRqHMxxtX92miraAgoP5ybrgesVFhYURCxVv2thyI3kXmuKThrLYVq/Mclmb9tfFkAebbPo50XQzXij/D4LClKYbGFmQ7LtluKeaTwT/RhOri1B9lnMPTiAM1eA7J7c24eGLCLJMgR0CN1pz1L7bAS6tUiMIHI/Qt7KrO4r5cYzRUbr1Fp1LTvFP3ultB+MF9wAxfQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SA0PR12MB4349.namprd12.prod.outlook.com (2603:10b6:806:98::21) by BYAPR12MB2917.namprd12.prod.outlook.com (2603:10b6:a03:130::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.15; Wed, 23 Mar 2022 08:36:52 +0000 Received: from SA0PR12MB4349.namprd12.prod.outlook.com ([fe80::e15c:41ca:1c76:2ef]) by SA0PR12MB4349.namprd12.prod.outlook.com ([fe80::e15c:41ca:1c76:2ef%3]) with mapi id 15.20.5081.024; Wed, 23 Mar 2022 08:36:52 +0000 Message-ID: <4e07bee8-d3b2-daf4-b107-780e90b5d720@nvidia.com> Date: Wed, 23 Mar 2022 14:06:38 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [Patch v5 2/4] memory: tegra: Add MC error logging on tegra186 onward Content-Language: en-US To: Dmitry Osipenko , krzysztof.kozlowski@canonical.com, robh+dt@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Cc: vdumpa@nvidia.com, Snikam@nvidia.com References: <20220316092525.4554-1-amhetre@nvidia.com> <20220316092525.4554-3-amhetre@nvidia.com> <55ae43f0-a22f-b532-2476-c3afa1e2cb73@gmail.com> From: Ashish Mhetre In-Reply-To: <55ae43f0-a22f-b532-2476-c3afa1e2cb73@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MAXPR01CA0118.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::36) To SA0PR12MB4349.namprd12.prod.outlook.com (2603:10b6:806:98::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b7c292a-bbbd-48e1-5e9d-08da0ca84762 X-MS-TrafficTypeDiagnostic: BYAPR12MB2917:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EQaXC12zrP9+h2yR3B1U/KomF0T6rbVrqGy2UxOTIQw7beCjTbTH86DwJCp567Giha2z4HNivsV7rXtSa2gbQTdBkf3L3gwfjUXNEGVBAeRmu3UzqE4bWXGRyKLj3RJRI5FD3cxPc15yvoEH/4C51woM6/j5xG1ubW0DZDxYilwtzE1Nqb7SwVrrsvHLS/gweRuXnV+pcSGvgm06AunaqszKNfVPeHpWUbNsegv+v1QQLYzcmXmr8tijNBAu37CUo1kUU/lKabuf5Z5ZlFstpM5ilTcGvlK5qUXeeGr8fFC5Isj9ToCl966dUl3JrR+rFiGGKo+QGGauopx2946Ym/Fh50If9nlLfBvJFZAvVKZ7h1d9TcrUI52LDqXn6EG2s+ircA5a2qNNT5zFhKAf8/JWD23gMs6qUgoJPTuufhoyqQtZiot+WThKkZh+AYl7Fkm7luzoHCEVHsP7bAXseAOjRl4R+hBsoFeVER9VsueJBwx2/rPpx7H+r22ynQhWihltpyUk8F+df7fqU9B4ALw8R4/b0v8VhjWiTql6aNrU13jMq6nrui74GkCyAdJI3O9+8U3n7thhhgd/OUVDmUOAdxh9yxjn4+i32LRDGkFT6Dp+31ZjX3oUzcBQUsk+TnNmW/f+gErFzPRKnJFSB59zr7ysvN5ixlu/u7oti7EuxcCiOR1BtVJtL3otP+usN3sje6cpks1F+m6x9MghP8T/aN730nmMZ9YFPg8ilHY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR12MB4349.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(38100700002)(86362001)(2616005)(31696002)(4326008)(36756003)(5660300002)(83380400001)(31686004)(66476007)(8676002)(66556008)(8936002)(508600001)(186003)(26005)(107886003)(2906002)(6666004)(6506007)(6486002)(316002)(53546011)(6512007)(55236004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QU9oZXlndWNNdGRGZllZelZLT1B3bkFzV0ZveFMyL2tPdUkyam1jYVV6THBY?= =?utf-8?B?Mk1yb3BZTXdRZExOOUdSYjcyV3ZXSDFwUklpUUtPa29CeS9HYzFVN3poTEVQ?= =?utf-8?B?QXVCdldhNW9GeDVaU1J1Q2NYcmY1ZlBFVWhiQWZieFhzUkoySUdCSWk5cG82?= =?utf-8?B?TnA1cnhPZm8vQ2d3SzdhZE81SGVQS0ZkbWxDZWo2ODZpbWFDNHNnS2JHempH?= =?utf-8?B?dkkxM1JkdEpSWS9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-08da0ca84762 X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4349.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2022 08:36:51.9889 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SWl9fR7XRjiMEyWe/7OptNyMfxfkBUT3gbIwWBadsN7pFbrGPbQYt07JI3smxS3wyJ46aIuoftvB/4clx6XRoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2917 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 3/20/2022 6:23 PM, Dmitry Osipenko wrote: > External email: Use caution opening links or attachments > > > 16.03.2022 12:25, Ashish Mhetre пишет: >> +static int tegra186_mc_get_channel(const struct tegra_mc *mc, int *mc_channel) >> +{ >> + u32 status; >> + >> + status = mc_ch_readl(mc, MC_BROADCAST_CHANNEL, MC_GLOBAL_INTSTATUS); >> + >> + switch (status & mc->soc->int_channel_mask) { >> + case BIT(0): >> + *mc_channel = 0; >> + break; >> + >> + case BIT(1): >> + *mc_channel = 1; >> + break; >> + >> + case BIT(2): >> + *mc_channel = 2; >> + break; >> + >> + case BIT(3): >> + *mc_channel = 3; >> + break; > > This won't work if multiple bits are set at once. I talked with our HW team and they said that it's technically possible that interrupts can come at multiple channels at same time. SW can take care of this by logging interrupts at first channel and then clearing bit of that. Then take care of interrupts from next channel and so on. I'll update the patches accordingly in next version.