Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567AbdF1Keg (ORCPT ); Wed, 28 Jun 2017 06:34:36 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:36229 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbdF1Ke3 (ORCPT ); Wed, 28 Jun 2017 06:34:29 -0400 MIME-Version: 1.0 In-Reply-To: <20170628051815.GA4748@kroah.com> References: <20170626093123.23838-1-orson.zhai@spreadtrum.com> <8f919e212d5149e286422d58a5732356@SHMBX02.spreadtrum.com> <20170627062917.GA10376@kroah.com> <20170628015431.GA32195@spreadtrum.com> <20170628051815.GA4748@kroah.com> From: Arnd Bergmann Date: Wed, 28 Jun 2017 12:34:28 +0200 X-Google-Sender-Auth: H2F-pkOVqce2r9EhwtDe_3I1WDU Message-ID: Subject: Re: [RFC PATCH] char: misc: Init misc->list in a safe way To: Greg Kroah-Hartman Cc: =?UTF-8?B?WmhvbmdwaW5nIFRhbiAo6LCt5Lit5bmzKQ==?= , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 28 On Wed, Jun 28, 2017 at 7:18 AM, Greg Kroah-Hartman wrote: > On Wed, Jun 28, 2017 at 09:54:32AM +0800, Orson Zhai wrote: >> We found the device is "fm". We highly suspect that fm driver call >> misc_register twice and reinitialize list to make ->pre & ->next >> pointing to himself. >> >> Meanwhile, we checked fm driver and found nothing obviously wrong in the code. > > Do you have a pointer to this driver? Is it in the kernel tree? I found a version of some spreadtrum FM driver in the sources for the Samsung Galaxy J3, this is the driver https://pastebin.com/p7Y7xQNE The driver has a single static 'misc_device' structure that will get registered each time the probe() function is called. The driver also supports both a static platform_device definition (which a proper driver should not have, the device should always be created either from platform code or from DT), and probing from device tree. If the DT has multiple "sprd,sprd_fm" device nodes, or a driver is lacking the "#ifndef CONFIG_OF" guard around the static platform device, it should always crash with the described symptom, but I don't see why it would only happen after many hours of boot testing. Arnd