Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp211216lfu; Wed, 30 Mar 2022 21:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRuAv6TixJChvbQu4EN9qhQBhvb7Zzyw+k2SlwkEVWZfslKO4rFGs85rKgmVXz6AKQ88gi X-Received: by 2002:a05:6a00:1a0a:b0:4fc:d6c5:f3f1 with SMTP id g10-20020a056a001a0a00b004fcd6c5f3f1mr3224334pfv.45.1648699595845; Wed, 30 Mar 2022 21:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648699595; cv=none; d=google.com; s=arc-20160816; b=V0oOHd98jUZD/6JpzEIjdtjWDtFgTwnUfRBrExT7HmtveyZr+x3u4EzUAOPET4G/qN nXYS5SE9HCKv4wgsUDIW80J/8zZhr+YN0ZahRkAtDFaOBf3iM6xka5nVkYhCgLoYSKnB Vzs/yYdzs99x8GZmJ+f1nYICv1YpxiYrEZRYi0Lg2v5eoFNT0rNKsA88nL9KXCSz5Sya oOwHIJuC8LUNwAuYIDezPOLQmtGMc9a8kAAltIN46wA3hQUX0XvzoryqUshH18pBr7Xo G+sVWAGnldKgsc9Es+xL7wanVKZlVTOCl4hKkO36G7CbW/qMUAjwg55P2zZWsiHYJebH +c/A== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z/ezlOM1oD5UBXdqomRa7z395TvvZljuHMXwhmKJtf8=; b=Dyat6Ktdt5U8B7sdXGvcYa5xORr2xf4sSJRIpwFGqiVq3ZCRy6ba5xPO9jbUB0MICJ vQY1ylsFf1IltDUPkM3rQVv6zPGcEgkNaQaHRD7VvLVj4t0hz781y4il8NbGvczbGxL0 W2DfB1nyXymYVJNEphu+39lN2dX5hE9QJZRSdUh/wR9jfVswJ1S2OzGVS1jJhyxQqBOU DIkABQaRuZnT08sb4dI/P4EXSZfqUtPzs1hrIee1ARls43AIDkE6nmzDtQ3yezeq66k2 SUG9Pyu9zWZlG69WJFs7HL+RJXdDVDVukTeTARMAGVKNfX2sFIoNhLqBaLH5qTR6EL9j aoJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MwoXtJ8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nl12-20020a17090b384c00b001bd14e01fb0si2209772pjb.158.2022.03.30.21.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:06:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MwoXtJ8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 566F7187B9C; Wed, 30 Mar 2022 20:12:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241621AbiC3ADb (ORCPT + 99 others); Tue, 29 Mar 2022 20:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241358AbiC3ACu (ORCPT ); Tue, 29 Mar 2022 20:02:50 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E85CB3204B; Tue, 29 Mar 2022 17:01:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id D7F6C1F41FAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648598464; bh=Z/ezlOM1oD5UBXdqomRa7z395TvvZljuHMXwhmKJtf8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MwoXtJ8EXu7GNgiEhgmmcAj9jpKltoggNGv7gA4f3wSbXkbN5A4XxZeR/mU+PRBh4 IZ6LqCyvIVDUTT8MVuiHkNHPIu3KBYC3D4snAkPGb5NNi5p+Z1krkq3Gb7DbKcwLah ebelDCKIGFVBfloK3aquLs8pQr4evInsQNvBDPd76n6qHnduecIi8sB4Eq/KW9A5l1 PROyITxnLurQ3IRTGQWl83VKdGOFClfOAMMJOwwuHKECE7CiJBN8skwiIifaI6JrpL GFjl8rE3cJZ8Nh4+aagqSG+rMWZw1shCCxYu/iSsSs3ZQ26z9I3moyExH/HulvYMuL LTLUmKDRX+Yjg== Message-ID: <4ea801f4-7929-148d-4e69-d4126a9dfbf7@collabora.com> Date: Wed, 30 Mar 2022 03:01:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; 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: Ashish Mhetre , 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> <9ab1a77c-82e6-39be-9b90-b394037fb574@gmail.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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/22/22 20:34, Ashish Mhetre wrote: >>> +     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; >>> + >>> +     case BIT(24): >>> +             *mc_channel = MC_BROADCAST_CHANNEL; >>> +             break; >>> + >>> +     default: >>> +             pr_err("Unknown interrupt source\n"); >> >> dev_err_ratelimited("unknown interrupt channel 0x%08x\n", status) and >> should be moved to the common interrupt handler. >> > So return just error from default case and handle error in common > interrupt handler with this print, right? I'll update this in next > version. Yes, just move out the common print. Although, you could parameterize the shift per SoC and then have a common helper that does "status >> intmask_chan_shift", couldn't you?