From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4816C43381 for ; Wed, 27 Mar 2019 14:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1B8F2147C for ; Wed, 27 Mar 2019 14:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553698079; bh=rBemlp/MX1KzXUykboFonKVfn2TVOC7ZWpfs5xabjVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=xnkoz671dR8/dSfGKrn8sbY0sFTXzQIVqgUKDecGawEhuTRKJwKB8Wf3BWcSDaBrh iDr18Xrtn8XlXQY4vpqLTtMaIDd+Y1w5FtiDJFTXp9o2TIVwdzFMYxyy5FDY12Xg7P bL+gKPQGa9YjVk/p1NPyOeJk87n1WGpC7p/Z3zKg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfC0Or7 (ORCPT ); Wed, 27 Mar 2019 10:47:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:60580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728066AbfC0Or6 (ORCPT ); Wed, 27 Mar 2019 10:47:58 -0400 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 EBF242087C; Wed, 27 Mar 2019 14:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553698078; bh=rBemlp/MX1KzXUykboFonKVfn2TVOC7ZWpfs5xabjVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OO2pyIhQNle/L5uxwuucEEvaVptLAe//G2QBbWBNY1yz3YCFEV3gZRSla3kUlw8HA QbcP1muePU5ydj9jpwvXYQOciJPht6rSTFidlHf79aYOlhaA8SPjf34mW5fBW1hPE4 UJzBGxMM6l2uS0+wBN/UCzBrQhtpC55DVwuEJXSk= Date: Wed, 27 Mar 2019 10:47:53 -0400 From: Sasha Levin To: minyard@acm.org Cc: stable@vger.kernel.org, cminyard@mvista.com, yangyingliang@huawei.com Subject: Re: [PATCH] ipmi_si: Fix crash when using hard-coded device Message-ID: <20190327144753.GJ25262@sasha-vm> References: <20190326161004.29378-1-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190326161004.29378-1-minyard@acm.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Tue, Mar 26, 2019 at 11:10:04AM -0500, minyard@acm.org wrote: >From: Corey Minyard > >Backport from 41b766d661bf94a364960862cfc248a78313dbd3 > >When excuting a command like: > modprobe ipmi_si ports=0xffc0e3 type=bt >The system would get an oops. > >The trouble here is that ipmi_si_hardcode_find_bmc() is called before >ipmi_si_platform_init(), but initialization of the hard-coded device >creates an IPMI platform device, which won't be initialized yet. > >The real trouble is that hard-coded devices aren't created with >any device, and the fixup is done later. So do it right, create the >hard-coded devices as normal platform devices. > >This required adding some new resource types to the IPMI platform >code for passing information required by the hard-coded device >and adding some code to remove the hard-coded platform devices >on module removal. > >To enforce the "hard-coded devices passed by the user take priority >over firmware devices" rule, some special code was added to check >and see if a hard-coded device already exists. > >The backport required some minor fixups and adding the device >id table that had been added in another change and was used >in this one. > >Reported-by: Yang Yingliang >Cc: stable@vger.kernel.org # v4.15+ >Signed-off-by: Corey Minyard >Tested-by: Yang Yingliang >--- > >This backport is for 4.19, the backport from the main tree >failed. Passes basic tests. Queued for 4.19, thank you. -- Thanks, Sasha