From patchwork Fri Oct 16 07:54:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 7412371 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3BDE59F36A for ; Fri, 16 Oct 2015 07:54:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3461920A48 for ; Fri, 16 Oct 2015 07:54:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3E5A20A40 for ; Fri, 16 Oct 2015 07:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753587AbbJPHyx (ORCPT ); Fri, 16 Oct 2015 03:54:53 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:32840 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbbJPHyv (ORCPT ); Fri, 16 Oct 2015 03:54:51 -0400 Received: by lffv3 with SMTP id v3so74342749lff.0 for ; Fri, 16 Oct 2015 00:54:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:content-type:mime-version; bh=J2/WYpyX7r62u2Eq3ZnZZNOePKIKcbH1MAHyXxe8vao=; b=KpSl5cPO55i5Hy4565ajA1ZlVHItKs0GTtufnqTAXJGvv9/b4XS7vw/TS0vQ2f1d8/ GoH7zH6fjOT9B2B9CPHxEXCLwbOeXQaci0nPoBTmh4EJFBlALWaZjiVSwOWXNIm1uldl CasBaZ23Z2O/iNAWD5bwvyTzwEnCyd8rJT42TjDjVHdMv9iWCpD83ms00NKj0azyWzDW 9BHFMfwPSOJWamkCmRHKIXUkeEtYtdwz4E/d/2znItI2/W4Hr9K0y5i7GWLCF2TZYN73 NtdG260NzoDq4OMBdNF8mCiWdPT5t53vcyY2MJapN2C6wKqILp1Ec7tsnu3gKJhSpZDe x+QQ== X-Gm-Message-State: ALoCoQldoGwtoSLZHKqXNz87DNTOwDCuGBwpWMepOczfObCZ869j0rICreauWiA7edEOPi5HubNU X-Received: by 10.180.187.244 with SMTP id fv20mr3031928wic.23.1444982089281; Fri, 16 Oct 2015 00:54:49 -0700 (PDT) Received: from gm-debian.fritz.box (pd95c96d1.dip0.t-ipconnect.de. [217.92.150.209]) by smtp.gmail.com with ESMTPSA id ds10sm2155897wib.24.2015.10.16.00.54.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 00:54:48 -0700 (PDT) Message-ID: <1444982077.2350.0.camel@giantmonkey.de> Subject: Re: NULL pointer dereference: IP: [] sr_runtime_suspend+0xc/0x20 [sr_mod] From: Paul Menzel To: "James E. J. Bottomley" , linux-scsi@vger.kernel.org Cc: submit@bugs.debian.org Date: Fri, 16 Oct 2015 09:54:37 +0200 In-Reply-To: <1444957547.1325.2.camel@giantmonkey.de> References: <1444957547.1325.2.camel@giantmonkey.de> Organization: Giant Monkey Software Engineering GmbH X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Package: linux-image-4.2.0-1-686-pae Version: 4.2.3-2 Severity: important Dear Linux SCSI folks, please don’t include the address submit@bugs.debian.org in your reply. Am Freitag, den 16.10.2015, 03:05 +0200 schrieb Paul Menzel: > using Debian Sid/unstable with Linux 4.2.3-1 upgrading from systemd > 227-1 to 227-2 [1] and other packages, the system doesn’t start up > anymore and the /dev/md1 device doesn’t seem to be found and I am > dropped into shell from initramfs (BusyBox). > > Only having wireless LAN and no serial or USB debug capabilities, and > mount a USB storage device did not work, I manually copied the beginning > of the Oops. > > ``` > BUG: unable to handle kernel NULL pointer dereference at 00000014 > IP: [] sr_runtime_suspend+0xc/0x20 [sr_mod] > *pdpt = 000000003696e001 *pde = 000000000000000000 > Oops: 0000 [#1] SMB > Modules linked in: sd_mod(+) sr_mod(+) cdrom ata_generic ohci_pci ahci libahci pata_amd firwire_ohci firewire_core crc_iti_t forcedeth libata scsi_mod ohci_hcd ehci_pci ehci_hcd usbcore usb_common fan thermal thermal_sys floppy(+) > CPU: 1 PID: 73 Comm: systemd-udevd Not tainted 4.2.0-1-686-pae #1 Debian 4.2.3-1 > Hardware name: Packard Bell imedia S3210/WMCP78M, BIOs P01-B2 11/06/2009 > task: f68dd040 ti: f6988000 task.ti: f6988000 > EIP: 0060:[] EFLAGS: 00010246 CPU: 1 > EIP is at sr_runtime_suspend+0xc/0x20 [sr_mod] > EAX: 00000000 EBX: f6a30cd8 ECX: f6c03d2c EDX: 00000000 > ESI: 00000000 EDI: f828e100 EBP: f6989ba8 ESP: f6989b88 > DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 > CR0: 8005003b CR2: 00000014 CR3: 3696d780 CR4: 000006f0 > Stack: > af83346c3 00000000 00000001 fffffff5 f6a7d150 f6a30cd8 f6a30d3c 00000000 > f6989bbc c1390cb7 f6a30cd8 f8334660 00000000 f6989bd0 c1390d0f f6a30cd8 > f8334660 00000000 f6989c0c c13916cb f694a614 f68dd040 00000000 00000008 > Call Trace: > […] ? scsi_runtime_suspend+0x63/0xa0 [scsi_mod] > […] ? __rpm_callback+0x27/0x60 > […] > ``` > > I tried also to boot with Linux 4.1 and it fails the same way. > > Is that a known problem and has been fixed in the mean time? It’d be > great if you helped me getting the system to boot again. Please tell me > if you need more information to debug this issue and I’ll do my best to > get it. Ben Hutchings asked me to test the patch below to get more debug information. ``` ``` I’ll try that as soon as a spare drive has arrived, where I can copy the data to as a backup. More thoughts are welcome! Especially, if that error suggests a failing drive or not. Thanks, Paul > [1] http://metadata.ftp-master.debian.org/changelogs//main/s/systemd/systemd_227-2_changelog diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 8bd54a6..dd5b5b2 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -144,6 +144,12 @@ static int sr_runtime_suspend(struct device *dev) { struct scsi_cd *cd = dev_get_drvdata(dev); + if (WARN_ON(!cd)) { + pr_info("%s: cd == NULL; power.usage_count = %d\n", + __func__, atomic_read(&dev->power.usage_count)); + return 0; + } + if (cd->media_present) return -EBUSY; else @@ -652,7 +658,13 @@ static int sr_probe(struct device *dev) struct scsi_cd *cd; int minor, error; - scsi_autopm_get_device(sdev); + error = scsi_autopm_get_device(sdev); + if (error) { + pr_err("%s: scsi_autopm_get_device returned %d\n", + __func__, error); + return error; + } + error = -ENODEV; if (sdev->type != TYPE_ROM && sdev->type != TYPE_WORM) goto fail; @@ -719,6 +731,9 @@ static int sr_probe(struct device *dev) if (register_cdrom(&cd->cdi)) goto fail_put; + pr_info("%s: power.usage_count = %d\n", + __func__, atomic_read(&dev->power.usage_count)); + /* * Initialize block layer runtime PM stuffs before the * periodic event checking request gets started in add_disk.