Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp159217rwi; Sun, 30 Oct 2022 22:32:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60tJ15E7ci0YwsVMnUfYle1QDrPMa21+wjdiRT6POVFEK/5gwf7Qq6E/M6jLSmL3EDPaQf X-Received: by 2002:a63:2a86:0:b0:46a:eaba:f1f3 with SMTP id q128-20020a632a86000000b0046aeabaf1f3mr11070592pgq.79.1667194341528; Sun, 30 Oct 2022 22:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667194341; cv=none; d=google.com; s=arc-20160816; b=Tj9FKF7A7YadYFG+zghpubUTXeFfcXbY7yV1wbvyURP24jpHyVjlZdpx/wUhWxyEu0 gr52ysyz8yp3qSZMTjryK6W8k8P/hYKlifIVlATiK0sZLdkrUwN5dCmG49NjbTsYLmjK ebuSp1l/RAkStQWYaD+EnSqAXZzkD43ZhPNokMynObdSGZaekP5rtmkmAA1RaO/0D1ak HINRWQtGTUGuC0Vr/OVBlJos5fYFUUKm3Lf4roIUcloCHQrWY4RSm98hfpmQl3GMCA61 01/ysF4wYxlo53j/namqW6y0FnxrKCzwuTf4INFLkl4b1fgdgKjPRdmX0V5Y7xS8w3xP t4OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=053lng/QP8tY14RmJoIHvElaNjtogyKf8awfH5Vo6dU=; b=UTEH86mKWGIrEB+yAfoAnQLJJzF7HlgdR/XvdzHrQYZAQ8/ivWpvMoWwiDGs+sMaCV xAGcoCnYhRkOfu52iqkD9pic1v3jKkF0NJOa3691AfnGMk9UkySFYhguDOSHoOCwG1Jw KZItTxB27c3O9WMSPBQWtqNgj7T44jjn8Ybqgalb8H4zaMIYeCoTcT0svdBsBY+6I0hA 5FNy6ON7DM2e4hEAXflf+o2x3jn8LZT1YSYawkkOiuj5swymFhq8LgGQZ//jkYmOfmS2 nzEZ8T4iWXtYfbuqmrsFzUWZGG2nSr6JaDsbO4rBnAYFUY5Dixw7+PC3HIe6tO/2zQxO 5YfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NOryPj0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf9-20020a17090b1d8900b0020f8385ca87si7372374pjb.94.2022.10.30.22.32.08; Sun, 30 Oct 2022 22:32:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NOryPj0o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiJaFOs (ORCPT + 99 others); Mon, 31 Oct 2022 01:14:48 -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: X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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/