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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58268FA3740 for ; Mon, 31 Oct 2022 05:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbiJaFOt (ORCPT ); Mon, 31 Oct 2022 01:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiJaFOq (ORCPT ); Mon, 31 Oct 2022 01:14:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2173C9581 for ; Sun, 30 Oct 2022 22:14:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A207460FBB for ; Mon, 31 Oct 2022 05:14:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C338C433D6; Mon, 31 Oct 2022 05:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667193285; bh=p5ZgX/IINCaomygMkreoSZQxx18wOxhDfxTDxfcD1Sc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NOryPj0o78YN9JMibuTqEm+q6JA32KGrhtQ5/QJunBFKVRJhCmH8K5ofCsclLn1lv nC28YrjTsoo1qVYHDa26OzYNwiT0YZeqETBd6volezRMa2nziFGI3jP8Qjij7yozX3 DsfzSs3elqEzECzTkJq7SFJlf9OKv9tSxAh2Bhr8S68/V4uYjsU6jJ9q9gruhKEcnu aRGF7Tj2YZrOc/5IYgKmuyIvHSe7pxQ7U06rMIO3JEOPOOFlfHMQiAsl6q1hhuf3ZS Yk30/k2lZLnfP5ZBSsg2guNXtO3du2ENkE6u7nHZywlokgOACLywhOB2ljqOUzJwT0 pM5hvJU1lNZUw== Date: Mon, 31 Oct 2022 13:14:41 +0800 From: Tzung-Bi Shih To: Brian Norris Cc: Benson Leung , Guenter Roeck , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] platform/chrome: cros_ec_lpc: Move mec_init/destroy to device probe/remove Message-ID: References: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 12:55:57PM +0800, Tzung-Bi Shih wrote: > On Fri, Oct 28, 2022 at 02:14:45PM -0700, Brian Norris wrote: > > Disregarding the weird global state hiding in this cros_ec_lpc_mec_*() > > stuff, it belongs in device probe/remove. We shouldn't assume we can > > access hardware resources when the device isn't attached to the driver. > > It's also weird that cros_ec_lpc_mec_destroy() destroies a statically > allocated mutex[1]. How about let's remove it? If it makes sense: https://patchwork.kernel.org/project/chrome-platform/patch/20221031050657.3899359-1-tzungbi@kernel.org/