Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8608263ybl; Thu, 16 Jan 2020 20:48:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzINu4zZmTxWCg/Bj9zjY6OAkT27mWKRgvs5TxUo7y41EjhYgEMkSp4lP49ypgOcLjrgECR X-Received: by 2002:a9d:4c81:: with SMTP id m1mr4623791otf.31.1579236538264; Thu, 16 Jan 2020 20:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579236538; cv=none; d=google.com; s=arc-20160816; b=jzC8KUYX7xh77eBDtzxu26hskEZJMKC9HP2DTzRALK/9e+HkXoR6coyxoBNpdwuuzb 8VpnhdoBljVm7bvweO5L5QS1cwmqhWX87l1cmRxkQ//glkfhawbzKmb8Hfg64pVX+jpG Fra0/vR6p8aMMuMFF/Lu7Gn/imsXJv3kjnc2r+Kju2P+W0gSPeQKySbYFuUxjSFradx4 7r2HGXWgnKHe3RGBEFI/iMpsab6OA47gKE+LwEQ1hc5CKQ9Lrha2mWR1YbsHq9QH+6g/ iPudgezupRRrP4y4vJbhCkyjaXbEP8VubPIOrvv/hLrwv0pwIOIFWQ/hbOd1gAADswPs vAqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MvicUQBcWMUt1Or3MGvBrA0LuGs0AXEaHRIOCqSi/uc=; b=l/TCXE5cOa+0yV+psC2v0lCbsIVB0zdQGJW4PNFshKB6iB0abad+MUj0femlnwEHrC JowN/1tj15YPSDUrvv1zSpaUqPF+ZtJPt19XwPiZ/JBt2IWGxteMqj00PcdsxArhiku4 AjO48+RXQqrpbVr0Xo85Qo/wMC2nsXUvjsfAUKWyO++ArUpCfeX4G5zuKz4+IytL1g+B IE/kNuFlLfiv0PXo8LWuY3e3Ufo/UUZStiA17hdLAGh19gSqX2n2C+1KOAIn7sl5CMiR IO9/Hnoc8wBmMiWh+9eLvCBkd96qLmP6/en9zMZcjEnFMyvAlomEnmpqwypujF3VuuI9 bztg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si15038280otp.139.2020.01.16.20.48.47; Thu, 16 Jan 2020 20:48:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387971AbgAQBXj (ORCPT + 99 others); Thu, 16 Jan 2020 20:23:39 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:34446 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729345AbgAQBXj (ORCPT ); Thu, 16 Jan 2020 20:23:39 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 689F05436AC3D3CC8747; Fri, 17 Jan 2020 09:23:36 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Fri, 17 Jan 2020 09:23:27 +0800 Subject: Re: [PATCH] irqchip/mbigen: Set driver .suppress_bind_attrs to avoid remove problems To: John Garry , , , CC: , References: <1579196323-180137-1-git-send-email-john.garry@huawei.com> From: Hanjun Guo Message-ID: <1cd162d0-c66e-8107-fc09-f3cacb88f3a8@huawei.com> Date: Fri, 17 Jan 2020 09:21:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1579196323-180137-1-git-send-email-john.garry@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/1/17 1:38, John Garry wrote: > The following crash can be seen for setting > CONFIG_DEBUG_TEST_DRIVER_REMOVE=y for DT FW (which some people still use): > > Hisilicon MBIGEN-V2 60080000.interrupt-controller: Failed to create mbi-gen irqdomain > Hisilicon MBIGEN-V2: probe of 60080000.interrupt-controller failed with error -12 > > [...] > > Unable to handle kernel paging request at virtual address 0000000000005008 > Mem abort info: > ESR = 0x96000004 > EC = 0x25: DABT (current EL), IL = 32 bits > SET = 0, FnV = 0 > EA = 0, S1PTW = 0 > Data abort info: > ISV = 0, ISS = 0x00000004 > CM = 0, WnR = 0 > user pgtable: 4k pages, 48-bit VAs, pgdp=0000041fb9990000 > [0000000000005008] pgd=0000000000000000 > Internal error: Oops: 96000004 [#1] PREEMPT SMP > Modules linked in: > CPU: 7 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc6-00002-g3fc42638a506-dirty #1622 > Hardware name: Huawei Taishan 2280 /D05, BIOS Hisilicon D05 IT21 Nemo 2.0 RC0 04/18/2018 > pstate: 40000085 (nZcv daIf -PAN -UAO) > pc : mbigen_set_type+0x38/0x60 > lr : __irq_set_trigger+0x6c/0x188 > sp : ffff800014b4b400 > x29: ffff800014b4b400 x28: 0000000000000007 > x27: 0000000000000000 x26: 0000000000000000 > x25: ffff041fd83bd0d4 x24: ffff041fd83bd188 > x23: 0000000000000000 x22: ffff80001193ce00 > x21: 0000000000000004 x20: 0000000000000000 > x19: ffff041fd83bd000 x18: ffffffffffffffff > x17: 0000000000000000 x16: 0000000000000000 > x15: ffff8000119098c8 x14: ffff041fb94ec91c > x13: ffff041fb94ec1a1 x12: 0000000000000030 > x11: 0101010101010101 x10: 0000000000000040 > x9 : 0000000000000000 x8 : ffff041fb98c6680 > x7 : ffff800014b4b380 x6 : ffff041fd81636c8 > x5 : 0000000000000000 x4 : 000000000000025f > x3 : 0000000000005000 x2 : 0000000000005008 > x1 : 0000000000000004 x0 : 0000000080000000 > Call trace: > mbigen_set_type+0x38/0x60 > __setup_irq+0x744/0x900 > request_threaded_irq+0xe0/0x198 > pcie_pme_probe+0x98/0x118 > pcie_port_probe_service+0x38/0x78 > really_probe+0xa0/0x3e0 > driver_probe_device+0x58/0x100 > __device_attach_driver+0x90/0xb0 > bus_for_each_drv+0x64/0xc8 > __device_attach+0xd8/0x138 > device_initial_probe+0x10/0x18 > bus_probe_device+0x90/0x98 > device_add+0x4c4/0x770 > device_register+0x1c/0x28 > pcie_port_device_register+0x1e4/0x4f0 > pcie_portdrv_probe+0x34/0xd8 > local_pci_probe+0x3c/0xa0 > pci_device_probe+0x128/0x1c0 > really_probe+0xa0/0x3e0 > driver_probe_device+0x58/0x100 > __device_attach_driver+0x90/0xb0 > bus_for_each_drv+0x64/0xc8 > __device_attach+0xd8/0x138 > device_attach+0x10/0x18 > pci_bus_add_device+0x4c/0xb8 > pci_bus_add_devices+0x38/0x88 > pci_host_probe+0x3c/0xc0 > pci_host_common_probe+0xf0/0x208 > hisi_pcie_almost_ecam_probe+0x24/0x30 > platform_drv_probe+0x50/0xa0 > really_probe+0xa0/0x3e0 > driver_probe_device+0x58/0x100 > device_driver_attach+0x6c/0x90 > __driver_attach+0x84/0xc8 > bus_for_each_dev+0x74/0xc8 > driver_attach+0x20/0x28 > bus_add_driver+0x148/0x1f0 > driver_register+0x60/0x110 > __platform_driver_register+0x40/0x48 > hisi_pcie_almost_ecam_driver_init+0x1c/0x24 > > The specific problem here is that the mbigen driver real probe has failed > as the mbigen_of_create_domain()->of_platform_device_create() call fails, > the reason for that being that we never destroyed the platform device > created during the remove test dry run and there is some conflict. > > Since we generally would never want to unbind this driver, and to save > adding a driver tear down path for that, just set the driver > .suppress_bind_attrs member to avoid this possibility. > > Signed-off-by: John Garry > > diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c > index 3f09f658e8e2..6b566bba263b 100644 > --- a/drivers/irqchip/irq-mbigen.c > +++ b/drivers/irqchip/irq-mbigen.c > @@ -374,6 +374,7 @@ static struct platform_driver mbigen_platform_driver = { > .name = "Hisilicon MBIGEN-V2", > .of_match_table = mbigen_of_match, > .acpi_match_table = ACPI_PTR(mbigen_acpi_match), > + .suppress_bind_attrs = true, > }, > .probe = mbigen_device_probe, > }; Reviewed-by: Hanjun Guo