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 E3BF4C433F5 for ; Wed, 27 Apr 2022 15:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239695AbiD0Pem (ORCPT ); Wed, 27 Apr 2022 11:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239694AbiD0Pel (ORCPT ); Wed, 27 Apr 2022 11:34:41 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 137A9D3AC3; Wed, 27 Apr 2022 08:31:30 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2ADC532008FD; Wed, 27 Apr 2022 11:31:28 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute2.internal (MEProxy); Wed, 27 Apr 2022 11:31:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1651073487; x=1651159887; bh=c0 1znxB8PdUfA3BPO/q7MBKS/blJFAlfcryVXAK3B5E=; b=SwRwqf8PBqfNwsWAXl x/3rqJ7hgBLqIvkK2fTj1cqb3hUssNH05UsWdmVwo7my0m3J/l3EOsGP1hfikN9U SCYsEmpkTf/VROe8CvdHRGZqsqg8GlcXYfofmzgWe1OcCpJtQ3OR7BLXtvGKztbh 0L+knZdHKhWDlr62o5KJoGxSUIiC7ioBuxhQlsYxgsNoCjq7Ealh0bgWqNski8H2 0yH0jF7SdEASF+Wmc1f8xwVIzwfTCMjkIYXs/kknqVUcySsO9UmzyUerfbqVv2+A XW4ymTycsJxWGxpVBdGlHAeGapabUaoMpVMZ6Vr5enB/XvDcARbff38smwnpSx+6 /CFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1651073487; x= 1651159887; bh=c01znxB8PdUfA3BPO/q7MBKS/blJFAlfcryVXAK3B5E=; b=m x/LwMkU27wcpM1kqEN74v5WbGct6EZRNGKfjGvxZZD04RjBxmhagHeel06jB7Y3n DEAqtaUoQS9LmmNZwaN5kJ/0RFT803aDX09rfQz8cQB6OElRHAqxAi7IRtEmHaLZ yWknuYb9WbH+OjkagvKN4fsmdTdVASRTlObnjiIzzgspVIvUxNV9CTwBVtROWdC+ CTBmYoXO3FF/ATkGbPMLW63MvrPfx1qzQrcH9NQXzfaDRzY/NTlTA41yBF5FEKpO QrSqArfJDh9WzpbL/ywbQf29oth6OhqhIPNmbXJJLrbn1HlaxU454FCr3umRRjnA fKjzKVzipK3bMjhACSL0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudehgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfuvhgv nhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtffrrg htthgvrhhnpeelvefggeffheevtdeivefhkeehfeettdejteduveeiheevveeilefghfei veeiueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6704E2740386; Wed, 27 Apr 2022 11:31:26 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-569-g7622ad95cc-fm-20220421.002-g7622ad95 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20220426201539.12829-1-sven@svenpeter.dev> <20220426201539.12829-6-sven@svenpeter.dev> Date: Wed, 27 Apr 2022 17:31:06 +0200 From: "Sven Peter" To: "Arnd Bergmann" Cc: "Hector Martin" , "Alyssa Rosenzweig" , "Rob Herring" , "Krzysztof Kozlowski" , "Keith Busch" , "axboe@fb.com" , "hch@lst.de" , "sagi@grimberg.me" , "Marc Zyngier" , "Janne Grunau" , DTML , "Linux ARM" , "Linux Kernel Mailing List" , linux-nvme@lists.infradead.org Subject: Re: [PATCH v3 5/6] soc: apple: Add RTKit IPC library Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Apr 26, 2022, at 23:01, Arnd Bergmann wrote: > On Tue, Apr 26, 2022 at 10:15 PM Sven Peter wrote: >> >> Apple SoCs such as the M1 come with multiple embedded co-processors >> running proprietary firmware. Communication with those is established >> over a simple mailbox using the RTKit IPC protocol. >> >> This cannot be implement inside the mailbox subsystem since on top >> of communication over channels we also need support for starting, >> hibernating and resetting these co-processors. We also need to >> handle shared memory allocations differently depending on the >> co-processor and don't want to split that across multiple drivers. >> >> Signed-off-by: Sven Peter > > Reviewed-by: Arnd Bergmann > thanks! >> +bool apple_rtkit_is_running(struct apple_rtkit *rtk) >> +{ >> + if (rtk->crashed) >> + return false; >> + if ((rtk->iop_power_state & 0xff) != APPLE_RTKIT_PWR_STATE_ON) >> + return false; >> + if ((rtk->ap_power_state & 0xff) != APPLE_RTKIT_PWR_STATE_ON) >> + return false; >> + return true; >> +} >> +EXPORT_SYMBOL_GPL(apple_rtkit_is_running); >> + >> +bool apple_rtkit_is_crashed(struct apple_rtkit *rtk) >> +{ >> + return rtk->crashed; >> +} >> +EXPORT_SYMBOL_GPL(apple_rtkit_is_crashed); > > I noticed that you use EXPORT_SYMBOL_GPL() here, but a more permissive > EXPORT_SYMBOL() in the SART driver. Is that intentional? No idea why I used both but it wasn't intentional. I'll change all exports to EXPORT_SYMBOL_GPL. > >> + >> +#if IS_ENABLED(CONFIG_APPLE_RTKIT) >> + > > Same comment about the #if as for the SART driver: I'd prefer it without the > conditional compilation. Ok, will remove those #ifs as well. Sven