Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3429448imu; Sun, 11 Nov 2018 14:55:10 -0800 (PST) X-Google-Smtp-Source: AJdET5cxilKIVqR3NBUvuJq6Y2XZcl+JNlcOOmMVCDea+wOZg/SUiEM9AAE4GJaSjMKp+Qfs246i X-Received: by 2002:a62:5615:: with SMTP id k21-v6mr17575314pfb.190.1541976910846; Sun, 11 Nov 2018 14:55:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976910; cv=none; d=google.com; s=arc-20160816; b=TWPVjK4/dnCfZeYLrOsYXnLEXA+8T5GnEZUJPSn7mX8znzlte5imyNSTsRvLHXPddo FVu0MnIV7Eka9sjcwkRJAOtKg/ts/O8+Pr+ifXw7KWQ7mPhnJeYzKj5RLKUG6LKVoSdN MJhz94Z8lnnpj8nOoN0Ofh6BrD2+ewyMv75euS0iE0hk5cINCzqLBjsBXeeJkF9cWE3B AXiF02rp4nlkOs3My0V+OjdV9zhmdeWh+NV3SHlB21Zegv59vn+c1y/mMg4t0aPu7Hnh SxLhxyOREd+ZnNVcfXJ16w9eIknA95sOwoBuEni2yBThR1juGTMlDnlRiu03s294Q8wR 8P7w== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WiJVn7NDkrK5A6SV0jtdPx77hJtJcPVRRXLcG0QT59o=; b=R+XNlnscx0HWPYG6hzKw89SDffSudupUYUHQj3E2Bo3pNChyEN+r5W+oU+zC8uV72o 3PkVn1dfV7C6gJgFEZ56S3P9KEhd8fY2hrO2GAli69fOdyp3wBgG9XURdLX5IcuX+j/+ avlhuYn94pUNW6c9/EuNb7voIqSf+GKufU8fI0SqhnmG7Qgwryu4L6cwx7SA/2HzFKfZ 7AS1E7WTKAc1YXaHpdD1t78uGNnmejda25kuQuS4dqRMovvHAZ/PhUYzJr1yEbibdXsi qW9d3hz77zfz82crg0mzJS9oDgqmVT0vFTQqaZeL3PtoH2ClN4ycN9L463iIgr4zaO99 at2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eX8ODuIt; 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 66-v6si17107323pfv.38.2018.11.11.14.54.55; Sun, 11 Nov 2018 14:55:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b=eX8ODuIt; 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 S2403981AbeKLIW4 (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:54672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403884AbeKLIWz (ORCPT ); Mon, 12 Nov 2018 03:22:55 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D9F06223C8; Sun, 11 Nov 2018 22:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975577; bh=XbBAKkW/4AGdEcXy76GihFmiW//Ys44FuLBWRBgaJIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eX8ODuItjJ/wp1o+lgUalHCxYi10Znj/dPhqeU5EYrfLPZvV4x8mxbyz4Z0ZXkKoR 5kWvgR4BebeiaJGQ16G4nX8nNQ2/bFnfXrsucQldfaURwGLVe/OOqJBtb0A5/fNR43 craCSCol4tj1hifEJukyYkUPMfxqdxdzzr3FB0zk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Kemnade Subject: [PATCH 4.14 163/222] w1: omap-hdq: fix missing bus unregister at removal Date: Sun, 11 Nov 2018 14:24:20 -0800 Message-Id: <20181111221701.871838307@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Kemnade commit a007734618fee1bf35556c04fa498d41d42c7301 upstream. The bus master was not removed after unloading the module or unbinding the driver. That lead to oopses like this [ 127.842987] Unable to handle kernel paging request at virtual address bf01d04c [ 127.850646] pgd = 70e3cd9a [ 127.853698] [bf01d04c] *pgd=8f908811, *pte=00000000, *ppte=00000000 [ 127.860412] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM [ 127.866668] Modules linked in: bq27xxx_battery overlay [last unloaded: omap_hdq] [ 127.874542] CPU: 0 PID: 1022 Comm: w1_bus_master1 Not tainted 4.19.0-rc4-00001-g2d51da718324 #12 [ 127.883819] Hardware name: Generic OMAP36xx (Flattened Device Tree) [ 127.890441] PC is at 0xbf01d04c [ 127.893798] LR is at w1_search_process_cb+0x4c/0xfc [ 127.898956] pc : [] lr : [] psr: a0070013 [ 127.905609] sp : cf885f48 ip : bf01d04c fp : ddf1e11c [ 127.911132] r10: cf8fe040 r9 : c05f8d00 r8 : cf8fe040 [ 127.916656] r7 : 000000f0 r6 : cf8fe02c r5 : cf8fe000 r4 : cf8fe01c [ 127.923553] r3 : c05f8d00 r2 : 000000f0 r1 : cf8fe000 r0 : dde1ef10 [ 127.930450] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 127.938018] Control: 10c5387d Table: 8f8f0019 DAC: 00000051 [ 127.944091] Process w1_bus_master1 (pid: 1022, stack limit = 0x9135699f) [ 127.951171] Stack: (0xcf885f48 to 0xcf886000) [ 127.955810] 5f40: cf8fe000 00000000 cf884000 cf8fe090 000003e8 c05f8d00 [ 127.964477] 5f60: dde5fc34 c05f9700 ddf1e100 ddf1e540 cf884000 cf8fe000 c05f9694 00000000 [ 127.973114] 5f80: dde5fc34 c01499a4 00000000 ddf1e540 c0149874 00000000 00000000 00000000 [ 127.981781] 5fa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000 [ 127.990447] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 127.999114] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 128.007781] [] (w1_search_process_cb) from [] (w1_process+0x6c/0x118) [ 128.016479] [] (w1_process) from [] (kthread+0x130/0x148) [ 128.024047] [] (kthread) from [] (ret_from_fork+0x14/0x2c) [ 128.031677] Exception stack(0xcf885fb0 to 0xcf885ff8) [ 128.037017] 5fa0: 00000000 00000000 00000000 00000000 [ 128.045684] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 128.054351] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 128.061340] Code: bad PC value [ 128.064697] ---[ end trace af066e33c0e14119 ]--- Cc: Signed-off-by: Andreas Kemnade Signed-off-by: Greg Kroah-Hartman --- drivers/w1/masters/omap_hdq.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c @@ -763,6 +763,8 @@ static int omap_hdq_remove(struct platfo /* remove module dependency */ pm_runtime_disable(&pdev->dev); + w1_remove_master_device(&omap_w1_master); + return 0; }