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,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 7E538C11F66 for ; Tue, 29 Jun 2021 06:19:03 +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 4E72861DC1 for ; Tue, 29 Jun 2021 06:19:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E72861DC1 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=4yNb5pZ6vlGjWHePRC91zuDgJnk0SuDYLUVuVGI0fxU=; b=xL3uASVMiYx51IzSSvmTQlXjI1 I3bTfuWT0QjPQ8Jh8kXOuuyLGud1iZcAieOWaoOEmdJSR7Ee4PfV030TR2f1ToJvprGuwMWPBTf9W nn1R1e5mipb11stVwkcea0oMefBoBQTREkWLTrWN2jfYYSfG1e4PtL9no/bFqcYIz60mWIP6vVw5K p9zahEfq/mNuD3te9CYXR83LezLjxDHqxuzzx+t77oXC+sRpcbJO54DViC/VXPMb+alaC68yQty1Y qNzZoH01q9S6xwpwyapMenYSIRvHWuob0wF1I58vpcgeZ/i5cFe+RK5F0Gaj2j+HUKx6eBxUXRqL6 oGa6sQGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly73e-009uGr-H4; Tue, 29 Jun 2021 06:17:18 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly73Z-009uE6-Mt for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 06:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624947428; 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=r5rtMzus3P+lVYlXRaQspruCr0CNxzJODyOUb0KYDic=; b=S4jYasSXpYz+F9i/7yFv1dH0mXTrVYmwZoT1ViSLgpiwTdhqLUAdN9tau016huvcb9SACj CD1GCljy7CHSd8CaIsoB6vs4EuVUVnf2djP0oF7MJHkX512NK9BMiFYX4IibsuJMYQJ77d MnfxIYi4lBFWLjoI5vSTSys1PgFtu40= 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-218-ubBfcvoiNGCLV8Wx1HYahw-1; Tue, 29 Jun 2021 02:17:06 -0400 X-MC-Unique: ubBfcvoiNGCLV8Wx1HYahw-1 Received: by mail-wm1-f69.google.com with SMTP id 13-20020a1c010d0000b02901eca51685daso872874wmb.3 for ; Mon, 28 Jun 2021 23:17:06 -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=r5rtMzus3P+lVYlXRaQspruCr0CNxzJODyOUb0KYDic=; b=BOVCkEaQ7DNJ3I3D4v3/fQE7i0zWOdTJDMM6R9QekGoaDpjBIZmvcaGrUCJSUaBmnQ w4+IC2fHPGguJOAXW8xbiWtpm6gOZTNu82K8bhKz2bCGE+hVDXt35d298ZR68qhW8ixA xa8jPkj6ZzShGH129+nL4F84/rYqs0sr0Bma7hLbwhHhHumkm/OddCIsNj7WWN/rRnoa AhTQxsUjnLIlkYKlm20BXG+pw86qPRP69TY+Kfvz75KLKy/7vtyrH3DlbiZg4PKjkX47 Oq7AMpTiwfljymYBKLeWMkWXNABU3sqDTCtxyzJLEDyn90dc9rVMfy25atjqqlYz4m0u oxiw== X-Gm-Message-State: AOAM531HHW67+GUMoHoX4SiOL1NxboIeXewmUEErKr8N8vqS3uiulqcL QntbnpFb8KGSvpEq6GaMUdI66WUntzxdkXNxMxUXYOSbhk02FjGzRwG6C+eoybkZmYor7zTuI6b bxlyC43whEBGrPskh+vAyRR8haEMUbgDsE3A= X-Received: by 2002:a1c:9884:: with SMTP id a126mr9898391wme.59.1624947425690; Mon, 28 Jun 2021 23:17:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwENZ0HLqQb4ZwkvvzpA0iQ3ffLbLA5shQGhTj0xUToPMfioID+ETv8jiuPJgiveOwkf+pTyA== X-Received: by 2002:a1c:9884:: with SMTP id a126mr9898344wme.59.1624947425375; Mon, 28 Jun 2021 23:17:05 -0700 (PDT) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id h8sm1801392wrt.85.2021.06.28.23.17.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Jun 2021 23:17:04 -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 , Ley Foon Tan , rfi@lists.rocketboards.org, Jingoo Han , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org References: <20210629003829.GA3978248@bjorn-Precision-5520> From: Javier Martinez Canillas Message-ID: <2317a4bc-bd4d-53a7-7fa6-87728d5393cd@redhat.com> Date: Tue, 29 Jun 2021 08:17:03 +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: <20210629003829.GA3978248@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-20210628_231713_895729_75AEE551 X-CRM114-Status: GOOD ( 23.51 ) 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/29/21 2:38 AM, Bjorn Helgaas wrote: > On Thu, Jun 24, 2021 at 05:40:40PM -0500, Bjorn Helgaas wrote: [snip] >>> >>> So let's just move all the IRQ init before the pci_host_probe() call, that >>> will prevent issues like this and seems to be the correct thing to do too. >> >> Previously we registered rockchip_pcie_subsys_irq_handler() and >> rockchip_pcie_client_irq_handler() before the PCIe clocks were >> enabled. That's a problem because they depend on those clocks being >> enabled, and your patch fixes that. >> >> rockchip_pcie_legacy_int_handler() depends on rockchip->irq_domain, >> which isn't initialized until rockchip_pcie_init_irq_domain(). >> Previously we registered rockchip_pcie_legacy_int_handler() as the >> handler for the "legacy" IRQ before rockchip_pcie_init_irq_domain(). >> >> I think your patch *also* fixes that problem, right? > > The lack of consistency in how we use > irq_set_chained_handler_and_data() really bugs me. > > Your patch fixes the ordering issue where we installed > rockchip_pcie_legacy_int_handler() before initializing data > (rockchip->irq_domain) that it depends on. > > But AFAICT, rockchip still has the problem that we don't *unregister* > rockchip_pcie_legacy_int_handler() when the rockchip-pcie module is > removed. Doesn't this mean that if we unload the module, then receive > an interrupt from the device, we'll try to call a function that is no > longer present? > Good question, I don't to be honest. I'll have to dig deeper on this but my experience is that the module removal (and device unbind) is not that well tested on ARM device drivers in general. 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