Received: by 10.192.165.148 with SMTP id m20csp1100582imm; Sat, 5 May 2018 04:55:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0Q4s7OQuAvXHUi5IfR0l0trR2M4is1z9CGUtmA/XiT9jIIwwjZvOr5pu8wMY4N7OF4lOq X-Received: by 2002:a63:b80a:: with SMTP id p10-v6mr24782962pge.250.1525521351059; Sat, 05 May 2018 04:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525521351; cv=none; d=google.com; s=arc-20160816; b=GFqYwgvyjCHeeWFgWVeGLS5Kg0mRE4e+7w+cRb6+BEcuWiq4c1xhpfsta1+qLakpit U8mxpiItjjfhCUZaxo3UZxcPfjF7sJSCM5p+1/hul2WGgYVhaqHv2idx0FJhJQFL4hJy x62bGmwT0KEvsGuiVQxbWnZ01B50A/eHAG4XQ/g7fOlbVmCElMsMmHYmw9nWYRSPYbVi s0FElMxuXwAaFm0o0xBXc2zsCC52uB6fbEnNc7MIyVmIW3CZXnAte3H1D4XAwhgLZYk/ p7oiQDKKy30EzSyHpTb84fWYm6Q8MblzA8y1x+LWu0HMoBvyruo76kCcGg9Ejr1b7IGL RQwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from:reply-to :mime-version:dkim-signature:arc-authentication-results; bh=8HrkX3GI+ygn63NtX4NOf8NmvSxakBuqpTvPfiYpAJY=; b=I38naxBkhKLUmmKEzClF1iCXCmNA3l5mUZ42PgzIAsqr2Bc72tzhuSLp5s3Uk906QA ygIGAN6u/GFQ2JUZoCMcbQoRIEr28gofG3P6nsdxTzCb1A5dmQTjd29vXUKbqdRCqAuG skwakoMaOiPWJuo+WTa7+disTOqbP5Vemuz8m4bWvRKiHQngQ6YHQzFFA8DrAqzmbJR1 RD8KHV21IyZAOEPVF3bHFzlpFn6jhJOwX/SjRlGWqu4KGSMtk1U6YaqgGJi8ufFv4kJr cuLbOpy16bw5gAx+KzY2abP+YlTLcvxz53kxQKg7T4Kz4Ukh2o8h1s3HQB16HcXJTZVQ Ze1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DV2p4P5X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h64-v6si14996317pge.206.2018.05.05.04.55.36; Sat, 05 May 2018 04:55:51 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DV2p4P5X; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbeEELz0 (ORCPT + 99 others); Sat, 5 May 2018 07:55:26 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:36779 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbeEELzY (ORCPT ); Sat, 5 May 2018 07:55:24 -0400 Received: by mail-vk0-f66.google.com with SMTP id i185-v6so9744503vkg.3 for ; Sat, 05 May 2018 04:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=8HrkX3GI+ygn63NtX4NOf8NmvSxakBuqpTvPfiYpAJY=; b=DV2p4P5XXVeF1AE3o/SqYkI3pjKqEDdgUzF5lgDlgdSDsSovjrfHKr4LOdVj2pCHKD yIN6pDU1I7NbxhDLNyn7IoZ4PMElo5j+QHejK4GzjhLH7/F8dvSqhBZ1gSUS2G+cZgUg hSWNKY+1v9qrBb8fsuNOBHpEETxIGqyWqMRsSWo3I2ojxm0FHlZs+K4Ijtf+HUjVwAXl wkvWKynwT0R4slTuPDaxWfbdGCZNBkubro8yvDyUfmWfzEivX+uCu5CpX2WriEfR+D4B +T0SJjD6cmgejXIQRQftYEc1DjNIeiWJ3Dn60KQ990TLdLBqEwqqPmCViaKXWHXPemwI /4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=8HrkX3GI+ygn63NtX4NOf8NmvSxakBuqpTvPfiYpAJY=; b=Mw//jJFmrulmobD3QYWaBU0bErF//4nGh72oOyfPwPt74F3ZPUW7J4wUObJKc0Vag/ NP41sTeUJT/c+FZUPmmtCPVxWeP+jFvzT0rxX2KWxNrU5oV7f33OgiBjGIwdlH+/Z0nb rwEkc+YqtgARN72/fKfkokCW1dVkEQNEYjHBdGzwiT90LjG+p3HamGUC3oS6G1lcpVaU mXjQLDQUiNqLkOASNFiBEOjEyXkZMeVwiXjjfPqd+PLfxbq18LwXvLHneNpcHTfxKIJi NpP0ZypLLToQka4dWScABCU1p9jeJpyY9HV3NI/h0phUrb+Rx3LnwezP4sOhYIwYW1ZL 9v/w== X-Gm-Message-State: ALQs6tAb3UaJ3cyHmhkGmO7KdftQGei9b7+QE2MNTNhVkCD/bm4VFiZ1 aNtfMKX4+j0v+ybRgIm+uN3ZoccuujmG0pO3sQ== X-Received: by 2002:a1f:430a:: with SMTP id q10-v6mr27311432vka.115.1525521324051; Sat, 05 May 2018 04:55:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.92.5 with HTTP; Sat, 5 May 2018 04:55:03 -0700 (PDT) Reply-To: whiteheadm@acm.org From: tedheadster Date: Sat, 5 May 2018 07:55:03 -0400 Message-ID: Subject: PCI: Regression in remove NULL device handling from PCI DMA API To: Christoph Hellwig , Bjorn Helgaas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christoph, I bisected the following kernel panic to the patch "PCI: Remove NULL device handling from PCI DMA API". It seems we still need NULL checking for some older drivers, in my case the 3c59x driver for PCI/EISA cards. I am pretty sure the panic arises in the driver here (drivers/net/ethernet/3com/3c59x.c: vortex_probe1() ): /* Makes sure rings are at least 16 byte aligned. */ vp->rx_ring = pci_alloc_consistent(pdev, sizeof(struct boom_rx_desc) * RX_RING_SIZE + sizeof(struct boom_tx_desc) * TX_RING_SIZE, &vp->rx_ring_dma); Here is the panic backtrace: eisa 00:08: EISA: slot 8: TCM5970 detected 3c59x: Donald Becker and others. 00:08: 3Com EISA 3c597 EISA Fast Demon/Vortex at 4d2ccbd3. BUG: unable to handle kernel NULL pointer dereference at 000000e8 IP: get_dma_ops+0x7/0x18 *pde = 00000000 Oops: 0000 [#1] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc4.i486-netinstall-14+ #47 EIP: get_dma_ops+0x7/0x18 EFLAGS: 00010202 CPU: 0 EAX: 00000064 EBX: c01844a0 ECX: 00000000 EDX: 00000020 ESI: c0182708 EDI: ffffffff EBP: c0015cc8 ESP: c0015cc8 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 CR0: 80050033 CR2: 000000e8 CR3: 01348000 CR4: 00000000 Call Trace: vortex_probe1+0x31b/0xc6f ? node_tag_clear+0x2f/0x71 ? radix_tree_iter_tag_clear+0x14/0x1a ? idr_alloc_cmn+0x77/0x8d ? slob_page_alloc+0x12b/0x172 ? __kmalloc+0x2e/0x56 ? __request_region+0x82/0xdf ? do_task_dead+0x21/0x21 vortex_eisa_probe+0x6a/0xa1 driver_probe_device+0x18c/0x316 __device_attach_driver+0xa7/0xb6 bus_for_each_drv+0x57/0x63 __device_attach+0x68/0xbb ? driver_allows_async_probing+0xc/0xc device_initial_probe+0xd/0xf bus_probe_device+0x1f/0x5f device_add+0x387/0x442 device_register+0x12/0x15 eisa_register_device+0x12/0x7c eisa_root_register+0x1e8/0x25c ? eisa_root_register+0x25c/0x25c virtual_eisa_root_init+0x2f/0x42 do_one_initcall+0x7c/0x106 ? parse_args+0x1ac/0x2a0 ? kernel_init_freeable+0xba/0x156 kernel_init_freeable+0xda/0x156 ? rest_init+0x70/0x70 kernel_init+0x8/0xc6 ret_from_fork+0x19/0x30 Code: 04 74 17 68 8b b7 2c c1 68 b8 a4 2b c1 68 b8 52 30 c1 e8 a4 4f fa ff 83 c4 0c 89 d8 8d 65 f4 5b 5e 5f 5d c3 55 89 e5 85 c0 74 0a <8b> 80 84 00 00 00 85 c0 75 05 a1 a8 69 2e c1 5d c3 55 89 e5 53 EIP: get_dma_ops+0x7/0x18 SS:ESP: 0068:c0015cc8 CR2: 00000000000000e8 ---[ end trace 8d36496943468a6f ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 Kernel Offset: disabled - Matthew Whitehead