Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4631010pxj; Wed, 12 May 2021 09:37:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDIdI91Ciko9xFS4Jc1YW81VGn7x4OMHe70nVtPqKHI/uMUtygj6HfPvKN7tYjmuhuajOd X-Received: by 2002:a05:6402:1354:: with SMTP id y20mr44865832edw.115.1620837449312; Wed, 12 May 2021 09:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837449; cv=none; d=google.com; s=arc-20160816; b=GUoJNxMy4PAvQ6NakLGbm6f6/8iprS+4blJTNcqXd9BFBBMzZeZjTSKzJSxETM9rOf CGdlkBVbAiaP+R5IOQKIaesn+gTc5XehjMvj/KG1eWUuA2SKYVfp+/N+EqAUXLcyoh2n rrMQua3QYqP8/qJrV8emhND+LlRmCFUosyO9Ggh3CefrPTcn8qO4Dj0g2z+a7JMTkxOZ a1RxMTKZpv2focLkowqkRuNmD7nb8cEd7Bv64LQxTemvvdjihy/obz+Q4rob5iyNtiF/ YM+h57zBYHfZRmhSr1Mcsji00BQayL7ndPbRvDJbT+ndvKBxh2zF1T1MXgytLbT7Ifxx 0BPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R9F4X+L6MQC9KmXtPM4JiCnBKTmngu7K69T4od9gW3I=; b=wGbHoa+aPfOBCM3AYJwaagOyFk2t54WXewL1ZTz4USZkkgyuYVqn4EmQcYLqwIfidN LOgSAQQDOcaOiIck83PGXgx0sTKjRYoxWD17bdjZoIeQ/0cA3svJyRehOccBlypnQadY LFXRHZdd9eqKNAYuiMmcfmBkXlWwIRibuGbRnXsMM4m3yPQJMKYGRR08kz4uHqAdef2g 0JTwV4a5tTULJr7wLL4XMXYIVJ37Y9sF7QsG9M39/VFZcDN9EVLd/oKuvaLfv3Tzbgix Vp4ULZle3VgZINMwi+E2Aob2cDNhMgM8n1e7OQ1NOMg8zS2Ygbu6y9WlqpviLqe3WIfl +ePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IMgwreN+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 2si190971edv.313.2021.05.12.09.37.05; Wed, 12 May 2021 09:37:29 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IMgwreN+; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242568AbhELQfI (ORCPT + 99 others); Wed, 12 May 2021 12:35:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:41274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232939AbhELPm5 (ORCPT ); Wed, 12 May 2021 11:42:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4775761C82; Wed, 12 May 2021 15:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832927; bh=ClXZvF4w4PI3rknLkvGXehUOYoaOzScjUUeVAdPFjc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMgwreN+tFsBQVm/U53t69QlVanGidePgHXEDKtDr4bkLQggNCuwACZKopGhpjQKJ DztNAGndvB55TYn/39mTywwnJGbO2K4iPF51tBoaYMOc82Nf/dh7JvrPIG906/+bLA G+T/P7b+lGGHfqDcpmnvd+nglAIXTYi6FsALUO4w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 444/530] powerpc/xive: Drop check on irq_data in xive_core_debug_show() Date: Wed, 12 May 2021 16:49:14 +0200 Message-Id: <20210512144834.366984583@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cédric Le Goater [ Upstream commit a74ce5926b20cd0e6d624a9b2527073a96dfed7f ] When looping on IRQ descriptor, irq_data is always valid. Fixes: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Cédric Le Goater Reviewed-by: Greg Kurz Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210331144514.892250-6-clg@kaod.org Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/common.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index a80440af491a..5899ffb28c58 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1606,6 +1606,8 @@ static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data u32 target; u8 prio; u32 lirq; + struct xive_irq_data *xd; + u64 val; if (!is_xive_irq(chip)) return; @@ -1619,17 +1621,14 @@ static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data seq_printf(m, "IRQ 0x%08x : target=0x%x prio=%02x lirq=0x%x ", hw_irq, target, prio, lirq); - if (d) { - struct xive_irq_data *xd = irq_data_get_irq_handler_data(d); - u64 val = xive_esb_read(xd, XIVE_ESB_GET); - - seq_printf(m, "flags=%c%c%c PQ=%c%c", - xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ', - xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ', - xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ', - val & XIVE_ESB_VAL_P ? 'P' : '-', - val & XIVE_ESB_VAL_Q ? 'Q' : '-'); - } + xd = irq_data_get_irq_handler_data(d); + val = xive_esb_read(xd, XIVE_ESB_GET); + seq_printf(m, "flags=%c%c%c PQ=%c%c", + xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ', + xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ', + xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ', + val & XIVE_ESB_VAL_P ? 'P' : '-', + val & XIVE_ESB_VAL_Q ? 'Q' : '-'); seq_puts(m, "\n"); } -- 2.30.2