From mboxrd@z Thu Jan 1 00:00:00 1970 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 9EF80C11F66 for ; Wed, 30 Jun 2021 22:10:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81E6461476 for ; Wed, 30 Jun 2021 22:10:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232936AbhF3WMf (ORCPT ); Wed, 30 Jun 2021 18:12:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22180 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbhF3WMc (ORCPT ); Wed, 30 Jun 2021 18:12:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625091002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=KAkRhiD8lqEvL133a/SsRTuJ3V3X6QTJbHgZDmSbP5Fo4A9hp4Rg8tb+AximmvOuFzsUrH XVggwiAQVukZO+7MhQJ/1ceKftRhCprdXfPu1UecDbuC8RWTrt7HPooQ6XTcK5F5rjmohq haIbDGgRzphVCvhpPbVn3gi026jO7JE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-HKJg-v_xNK-tXuCScQNCQw-1; Wed, 30 Jun 2021 18:10:01 -0400 X-MC-Unique: HKJg-v_xNK-tXuCScQNCQw-1 Received: by mail-wm1-f69.google.com with SMTP id k16-20020a7bc3100000b02901d849b41038so3547859wmj.7 for ; Wed, 30 Jun 2021 15:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=ic8/EUSISs0N3Fmr9yBeZwBPBlSqCUvjtQVR6YCL41r2rzvZClaQ6Q8RVGRvQywy+f D6qJJ5H2trQef0GBWuwPFNjYhEX1Hqsv7mTpYI7ZqoVoi3wGFeCm/qborIi8ELAo7FeZ xArByMQhoR5cmm9RUvZTsNlgi8jVBZ+prJwdh+1FPaV4uWQ1/TIxuxLtKRlPV9xCwl6r L1Jd7up0TLzQ5kR6gnQ5re6GyYBIWULPhsE4T3BAPBu5U1a9Cn3J1EMv4PXWTf5ktNvb 7XVCU8G88uIpQGUpBIIk3OPuMkMSkkEZXEU0rBQ4NGMF/oKB6wW86iCVcPlnvUQlDlnS V89g== X-Gm-Message-State: AOAM533w0/KLicGoUrG+o5hjd6fgNR2k3kbj4c6IcWdZHoHTIG2NpYGV Ve4qpUG/m1HtTIFSQleDy4bCMmumar25tjz4mSPOB3dFPWmzroSWFWnxQavESNQkV5bxYfVYcTx EQv7/LcDbhBp7W351vCULdIb0 X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882650wmg.117.1625091000111; Wed, 30 Jun 2021 15:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlU5TtFXVLyohpWwUCLVR70qKXp8D+c6+g8CDe44j7e9CNHSYRynn3Hnx7Cwjxfz20NWN+Rw== X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882631wmg.117.1625090999901; Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id d17sm9611715wro.93.2021.06.30.15.09.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Subject: Re: [PATCH v2] PCI: rockchip: Avoid accessing PCIe registers with clocks gated To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, Peter Robinson , Shawn Lin , Bjorn Helgaas , Heiko Stuebner , Lorenzo Pieralisi , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, Michal Simek , Jingoo Han , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org References: <20210630203030.GA4178852@bjorn-Precision-5520> From: Javier Martinez Canillas Message-ID: <51276875-658e-e6fe-5433-b5d795b253ff@redhat.com> Date: Thu, 1 Jul 2021 00:09:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630203030.GA4178852@bjorn-Precision-5520> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/30/21 10:30 PM, Bjorn Helgaas wrote: > On Wed, Jun 30, 2021 at 09:59:58PM +0200, Javier Martinez Canillas wrote: [snip] >> >> But maybe you can also add a paragraph that mentions the CONFIG_DEBUG_SHIRQ >> option and shared interrupts? That way, other driver authors could know that >> by enabling this an underlying problem might be exposed for them to fix. > > Good idea, thanks! I added this; is it something like what you had in > mind? > Thanks a lot for doing this rewording. I just have a small nit for the text. > Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handler when it > is being unregistered. An error during the probe path might cause this > unregistration and IRQ handler execution before the device or data > structure init has finished. > The IRQ handler is not called when unregistered, but it is called when another handler for the shared IRQ is unregistered. In this particular driver, both a "pcie-sys" and "pcie-client" handlers are registered, then an error leads to "pcie-sys" being unregistered and the handler for "pcie-client" being called. So maybe the following instead? Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handlers when a handler for the shared IRQ is unregistered. An error during the probe path might cause this unregistration and handler execution before the device or data structure init has finished. Best regards, -- Javier Martinez Canillas Software Engineer New Platform Technologies Enablement team RHEL Engineering From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 E439CC11F65 for ; Wed, 30 Jun 2021 22:10:26 +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 9A4E661476 for ; Wed, 30 Jun 2021 22:10:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A4E661476 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8jf3sRPOu59lHkmgR7UkQeEhHMiPmwQkvQvnXbo0oOk=; b=sE9DWijXJhCppJBCl+wQmLMO25 r6syjLZGOhf24CrcbQqau7mrcCdD9+B935j1Ukq1jDt6McaAabJdHhMbAJT99Q8qI2DOC60LMPBZN uWYwr9HPzZ0Jjfz4xRTvRRloPY9yFsAGDOfiIxuxaqlZvo0yDEW0iXz9efLwzmKEPUKEXSiMHSleC q2r7u8grmFq9I9U2iHdrhrRV0tLXlblKdTmzJjfyuo478LOyS/9sz9JlfBqgG2d44Uvv+4eruS+49 DAlSrmQCUEiq3ccTY40lyF/c4NmjYk6yV1jmrbbLfiHaW2eF29keKQwzzZR+LaaAATJd3xCHAz7+A LOHcYryQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyiPT-00FMOj-Tr; Wed, 30 Jun 2021 22:10:19 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyiPF-00FMN1-2h for linux-rockchip@lists.infradead.org; Wed, 30 Jun 2021 22:10:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625091002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=KAkRhiD8lqEvL133a/SsRTuJ3V3X6QTJbHgZDmSbP5Fo4A9hp4Rg8tb+AximmvOuFzsUrH XVggwiAQVukZO+7MhQJ/1ceKftRhCprdXfPu1UecDbuC8RWTrt7HPooQ6XTcK5F5rjmohq haIbDGgRzphVCvhpPbVn3gi026jO7JE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-129-pBV1I1fcP3-_QieX3x5QPA-1; Wed, 30 Jun 2021 18:10:01 -0400 X-MC-Unique: pBV1I1fcP3-_QieX3x5QPA-1 Received: by mail-wr1-f70.google.com with SMTP id d9-20020adffbc90000b029011a3b249b10so1601357wrs.3 for ; Wed, 30 Jun 2021 15:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=Fwg/MJtwaVWt3goxQAZPyJ+LlOltfB/PSLZu614OiIpqJTsZfYqMcuC6WPhjWX/Gki jmzTFSG2FDXq52Cxyn2s77Sxl2bIzERybpA2ErtwEIx8DhF2P3rloXMpDgOwyYXKmCAc U1JDjHhVEL2Rauc5XAO9KQTzOYj7AWwJzt2lnADpV267IjoNMdAsQkJ8ge+Lwe98Imwh gPeqO0X+7e1Ql9N3/n7LJiJgucbdYWogjn1mLZb8d9kiCGYEpQBuGOosFzTfwkoRnJV0 8EXsHykQQcKlBFOYo88JG8192hz2I79/Z+U/MZH6zIiUMDL1rV2cr3yT+YDp2g+7on9r jGtA== X-Gm-Message-State: AOAM531LnXUcNFPQDUQOUy+YOyQL9WEiMP/S3LyCzwg2xQCE35k0J5DS wCcFYEKowwrL7hdvSgz4M+ulSNobYxto2ZLacVrgxdgMxXQpJLOvTElLLJf+NeCVqWfFUprimsz oCGe7+IxDNXaa6cFxNdQNiaHzBrOxzxni X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882647wmg.117.1625091000111; Wed, 30 Jun 2021 15:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlU5TtFXVLyohpWwUCLVR70qKXp8D+c6+g8CDe44j7e9CNHSYRynn3Hnx7Cwjxfz20NWN+Rw== X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882631wmg.117.1625090999901; Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id d17sm9611715wro.93.2021.06.30.15.09.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Subject: Re: [PATCH v2] PCI: rockchip: Avoid accessing PCIe registers with clocks gated To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, Peter Robinson , Shawn Lin , Bjorn Helgaas , Heiko Stuebner , Lorenzo Pieralisi , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, Michal Simek , Jingoo Han , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org References: <20210630203030.GA4178852@bjorn-Precision-5520> From: Javier Martinez Canillas Message-ID: <51276875-658e-e6fe-5433-b5d795b253ff@redhat.com> Date: Thu, 1 Jul 2021 00:09:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630203030.GA4178852@bjorn-Precision-5520> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210630_151005_300852_D153F34A X-CRM114-Status: GOOD ( 18.24 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 6/30/21 10:30 PM, Bjorn Helgaas wrote: > On Wed, Jun 30, 2021 at 09:59:58PM +0200, Javier Martinez Canillas wrote: [snip] >> >> But maybe you can also add a paragraph that mentions the CONFIG_DEBUG_SHIRQ >> option and shared interrupts? That way, other driver authors could know that >> by enabling this an underlying problem might be exposed for them to fix. > > Good idea, thanks! I added this; is it something like what you had in > mind? > Thanks a lot for doing this rewording. I just have a small nit for the text. > Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handler when it > is being unregistered. An error during the probe path might cause this > unregistration and IRQ handler execution before the device or data > structure init has finished. > The IRQ handler is not called when unregistered, but it is called when another handler for the shared IRQ is unregistered. In this particular driver, both a "pcie-sys" and "pcie-client" handlers are registered, then an error leads to "pcie-sys" being unregistered and the handler for "pcie-client" being called. So maybe the following instead? Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handlers when a handler for the shared IRQ is unregistered. An error during the probe path might cause this unregistration and handler execution before the device or data structure init has finished. Best regards, -- Javier Martinez Canillas Software Engineer New Platform Technologies Enablement team RHEL Engineering _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 2E249C11F66 for ; Wed, 30 Jun 2021 22:12:21 +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 E739D6141A for ; Wed, 30 Jun 2021 22:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E739D6141A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=lREj52bHO2nga7A90W1VnmaBSmACGJrneHDSc4UnmZM=; b=1RcAFYyQwM69ZUw3JJC102V+y2 jLmAAVbM25iwvcGGYTT4N4uws/88IBaKNG6H3NtSisk/wYJ5YypEqTzpgP6ya/m0ezFGVsU4aNlVe BxVE1StlHAlOy4zDRGuBAvnIRAoKwyvnYQeEstzK5rrRfKuwTUjGqce9VJWl+BbQXyg8yXwYUG6pL EA3vUXI46DlYsFQfp9Q3mVKuvs3gKlsN0S7H7VfG4fUJHFT1cz3C/h5fw+omk4KHRz7wm3SrBbxt9 oGHwGCd9g/Fc8qZFjwvcQXMevfJZ/0MFpVVOzh9pMDbhk788njf98DwcfX045oRD9TVefr/0Hkimt vnG4olKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyiPI-00FMNt-Cw; Wed, 30 Jun 2021 22:10:08 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyiPF-00FMN3-2X for linux-arm-kernel@lists.infradead.org; Wed, 30 Jun 2021 22:10:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625091002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=KAkRhiD8lqEvL133a/SsRTuJ3V3X6QTJbHgZDmSbP5Fo4A9hp4Rg8tb+AximmvOuFzsUrH XVggwiAQVukZO+7MhQJ/1ceKftRhCprdXfPu1UecDbuC8RWTrt7HPooQ6XTcK5F5rjmohq haIbDGgRzphVCvhpPbVn3gi026jO7JE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-c4iuUYEoP8aoSgotPVqgwQ-1; Wed, 30 Jun 2021 18:10:01 -0400 X-MC-Unique: c4iuUYEoP8aoSgotPVqgwQ-1 Received: by mail-wm1-f72.google.com with SMTP id z127-20020a1c7e850000b02901e46e4d52c0so3555850wmc.6 for ; Wed, 30 Jun 2021 15:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ReCbrtMP/cxLMRe/lZJL4GXF42nMx1vpMXEPSI0hvQ=; b=Spy4iWSgoAKErf/7ujG96DA5tGYAhxHj9sNvd2bP0ifLYbIIQ8AnnsouBas+3yOpM6 ZakHEvEpDGcZY6NFqquEOwsASm6+RT0HurS68Ig/PEizo/kXL6dvTKGY1r14EY2hejIm YqqIDJxoHLnfmMLeznrLzVJGcs3sfiAgpMNXO8HfFaGfHn3LNmlBwZjhTiDLgKI2j9LS Q56XMQRVbMSsF6JGN8hsB7j8goB+HzsdTsJ83VfQTpV5NgSAaN43S5uf7uLersjx9bp8 EBr9jAsLFCqf+ZNLe7U0+EUUyntb7OymG5Jn86D6dcN4DhJfTYk/2VfDVgx9Jn/8Dkfn HTww== X-Gm-Message-State: AOAM531pwdrTsdrxVguF3jRiobiVBtl61sH9QWIoiqTvFgrqnMYI7P5V HDZr4Vwas8y83AZpY2ckpTIllKIbDbYURYtN1AWwF/xjQAfle6yIWZHK6UZY92BNvu8nyXHm50v jrTO7S9ODMkFN8GZdFI8f349HVJ4aM9WJrfY= X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882660wmg.117.1625091000146; Wed, 30 Jun 2021 15:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlU5TtFXVLyohpWwUCLVR70qKXp8D+c6+g8CDe44j7e9CNHSYRynn3Hnx7Cwjxfz20NWN+Rw== X-Received: by 2002:a7b:cf3a:: with SMTP id m26mr16882631wmg.117.1625090999901; Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id d17sm9611715wro.93.2021.06.30.15.09.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 15:09:59 -0700 (PDT) Subject: Re: [PATCH v2] PCI: rockchip: Avoid accessing PCIe registers with clocks gated To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, Peter Robinson , Shawn Lin , Bjorn Helgaas , Heiko Stuebner , Lorenzo Pieralisi , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, Michal Simek , Jingoo Han , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org References: <20210630203030.GA4178852@bjorn-Precision-5520> From: Javier Martinez Canillas Message-ID: <51276875-658e-e6fe-5433-b5d795b253ff@redhat.com> Date: Thu, 1 Jul 2021 00:09:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630203030.GA4178852@bjorn-Precision-5520> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210630_151005_301078_2C73BE95 X-CRM114-Status: GOOD ( 19.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/30/21 10:30 PM, Bjorn Helgaas wrote: > On Wed, Jun 30, 2021 at 09:59:58PM +0200, Javier Martinez Canillas wrote: [snip] >> >> But maybe you can also add a paragraph that mentions the CONFIG_DEBUG_SHIRQ >> option and shared interrupts? That way, other driver authors could know that >> by enabling this an underlying problem might be exposed for them to fix. > > Good idea, thanks! I added this; is it something like what you had in > mind? > Thanks a lot for doing this rewording. I just have a small nit for the text. > Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handler when it > is being unregistered. An error during the probe path might cause this > unregistration and IRQ handler execution before the device or data > structure init has finished. > The IRQ handler is not called when unregistered, but it is called when another handler for the shared IRQ is unregistered. In this particular driver, both a "pcie-sys" and "pcie-client" handlers are registered, then an error leads to "pcie-sys" being unregistered and the handler for "pcie-client" being called. So maybe the following instead? Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handlers when a handler for the shared IRQ is unregistered. An error during the probe path might cause this unregistration and handler execution before the device or data structure init has finished. Best regards, -- Javier Martinez Canillas Software Engineer New Platform Technologies Enablement team RHEL Engineering _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel