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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1491EC433EF for ; Mon, 15 Nov 2021 19:11:14 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78B8063275 for ; Mon, 15 Nov 2021 19:11:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 78B8063275 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HtJgz62j1z2yPN for ; Tue, 16 Nov 2021 06:11:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uWDI6azB; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=uWDI6azB; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HtJgB5hCLz2xY4; Tue, 16 Nov 2021 06:10:29 +1100 (AEDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id E5FEC63715; Mon, 15 Nov 2021 19:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637003426; bh=DtHrB66HXLmxewymT8yGeifJxpPVREBisB7HVDuwLYk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uWDI6azBQctDhxtdF1G9iKbhqkN2qYhQctn9Q95ee03P+8wXH7qRA3GAepSUdZg2n uKk6RWow7OZupqCCke9iIi2MeT8WkPYc4AvR4GCkYQP6OBFfqIRBToDvoJHxCRdtmJ raMFBms7HRLxupcaecmEaqky9XClk8sQ0odpZa3o= Date: Mon, 15 Nov 2021 19:49:57 +0100 From: Greg Kroah-Hartman To: Iwona Winiarska Subject: Re: [PATCH v3 06/13] peci: Add device detection Message-ID: References: <20211115182552.3830849-1-iwona.winiarska@intel.com> <20211115182552.3830849-7-iwona.winiarska@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211115182552.3830849-7-iwona.winiarska@intel.com> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aspeed@lists.ozlabs.org, linux-doc@vger.kernel.org, Dave Hansen , Zev Weiss , Jae Hyun Yoo , Jonathan Corbet , openbmc@lists.ozlabs.org, Pierre-Louis Bossart , Guenter Roeck , devicetree@vger.kernel.org, Jean Delvare , Arnd Bergmann , Rob Herring , Borislav Petkov , Dan Williams , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, Tony Luck , Andrew Jeffery , Randy Dunlap , linux-kernel@vger.kernel.org, Olof Johansson Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Mon, Nov 15, 2021 at 07:25:45PM +0100, Iwona Winiarska wrote: > +void peci_device_destroy(struct peci_device *device) > +{ > + bool killed; > + > + device_lock(&device->dev); > + killed = kill_device(&device->dev); Eeek, why call this? > + device_unlock(&device->dev); > + > + if (!killed) > + return; What happened if something changed after you unlocked it? Why is kill_device() required at all? That's a very rare function to call, and one that only one "bus" calls today because it is very special (i.e. crazy and broken...) thanks, greg k-h