Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3616647rdb; Wed, 27 Dec 2023 13:29:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdD2x2njhjuAajcejjgECHY2+cSkI8GOZfYsWavy+RJDp8ASaYzDY6ONtKjZlvt1MlkqxA X-Received: by 2002:a05:622a:138f:b0:427:edba:246 with SMTP id o15-20020a05622a138f00b00427edba0246mr1176244qtk.104.1703712576262; Wed, 27 Dec 2023 13:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703712576; cv=none; d=google.com; s=arc-20160816; b=hZ6fubHiGfFnRFrXe/XoOV6zdudBR3niLDAl7p0JyEYNQ7OF+dbHG7qsX9Qb0Xd0qW LPQr1QPz9bYheOwV3pXG+sSrEq82P/j+5tn3pWn6r8EOAPoV9GwHHO31/2dNlwibx1sU /ovP14BCxPZIfid9JiFYgz5wE7BvScIXskyaYuEfSI6UTuWPjjCU7VpOoZLObvVckQAY F4p+1OH7Tlgm4EZFAq8bnMJwEs76M0sI9hpwwr5WJUtYb03hzC7OStZrObccwM1WYUlT sy6L4pCbbtQs9yc8/FBPcygc/ir/p4OUWeatoaneB6htHoLdIYze3pXLElq4fZr3R3Wg wlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=m7oxoJfsTMUP9iwmnTMSD6RQtzTxmt4yZyVBW24Hw70=; fh=nzbaygAG81jRPsSuGc1ENimu2KjxrqH2lKH9lYOpjko=; b=AHdK++8ETD2++678sWYV9IqhJbVhkuPTCoWMx3Z56nR0f+DcpwsnC7+q3lYX97V9uf GWon3CsHJZja/Lrvf3FHcyZM3SpWat/JIyLGz7bROd5H+XqDhnV45tOOLncG8DW9J2HP xQQmo8NjKsUgbkzNTUdeabePb78FFF62VwfRS8eP/qILHmSoe18ewbgi75Xe2+isAZq0 RNBitUN8jjTu15zzlfb2u5pkKwopyyOO1yGjfgBXZLmqBThg5F1JsPH6QluwsmAKoh+L 6bZMBVNWM5QcKQ7xen/mcWCLy/ziYvxwhA/uycOv2h9RBhRM0HQmGwr0I9bZKb/yy0a7 CF8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="A0kTe/ge"; spf=pass (google.com: domain of linux-kernel+bounces-12274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u21-20020ac858d5000000b00423988a9868si15293014qta.15.2023.12.27.13.29.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="A0kTe/ge"; spf=pass (google.com: domain of linux-kernel+bounces-12274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 06D461C21A1C for ; Wed, 27 Dec 2023 21:29:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D60B481C1; Wed, 27 Dec 2023 21:29:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A0kTe/ge" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21388481B1 for ; Wed, 27 Dec 2023 21:29:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-5e7467eb93aso34539297b3.1 for ; Wed, 27 Dec 2023 13:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703712567; x=1704317367; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m7oxoJfsTMUP9iwmnTMSD6RQtzTxmt4yZyVBW24Hw70=; b=A0kTe/geseHObzVRa1x4hl96FH2oZTm8qPOcRLcrYkeOMEyg8Nc74L/vvhCrvYVWLS tBflfEP3dtAvpa2+0OBF9cr1AmlPXpt6ovL+sb7qwZxJ589ppByTagdGCIzjkYxzADuQ BvHIEgCu+kQLdNf15BQ9BvKqUUCOg6VKkHCx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703712567; x=1704317367; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m7oxoJfsTMUP9iwmnTMSD6RQtzTxmt4yZyVBW24Hw70=; b=WYhEesV60RDFWxVkFHowDWO75NPmhPjsSIwxwISXsRf/DHSJct+VOdlDXfI1Rfoyyw D+qbzzdLbnWqb0w8OIzW0eXDSiCWg/Dc+s7sbZf9Xn61KnHo9qoFTiEqQ/V9RwQDofMP v7UhOlAh1PWzpxojxJI/HEsM9vq8ZwjsQElhBuxxaZRHeDntZzqnxrPIyS84q9fNx6o2 dcpaYpXTjyL6+84c9JMcw8qaa5lQPU9O6ymT8CVQuyrqmynzEu2FKu1qrWnN6BwePOOP tM4qv5B5PvG+OIEH+7hCNZSaMdk+eBESXtNE4GqULdsoIBxCc2yeRiW0wJj0s8/R7Wmr e3iA== X-Gm-Message-State: AOJu0YxEyehbIzkZPiWBbeS1ZhH3A5NCL2w4/TfWnfYW+pTHLiwZZbDo hzT0TxYn99VfvxGMwd8aDG1dP2ZwA5S8Bsvq4jO1pAnnAe7zKnNDOuEZEhGojQ== X-Received: by 2002:a05:690c:4606:b0:5ea:5340:fb0e with SMTP id gw6-20020a05690c460600b005ea5340fb0emr2233415ywb.4.1703712567158; Wed, 27 Dec 2023 13:29:27 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231226192149.1830592-1-markhas@chromium.org> <20231226122113.v3.24.Ieee574a0e94fbaae01fd6883ffe2ceeb98d7df28@changeid> In-Reply-To: From: Mark Hasemeyer Date: Wed, 27 Dec 2023 14:29:16 -0700 Message-ID: Subject: Re: [PATCH v3 24/24] platform/chrome: cros_ec: Use PM subsystem to manage wakeirq To: Andy Shevchenko Cc: LKML , AngeloGioacchino Del Regno , Krzysztof Kozlowski , Rob Herring , Konrad Dybcio , Sudeep Holla , Raul Rangel , Tzung-Bi Shih , Benson Leung , Bhanu Prakash Maiya , Chen-Yu Tsai , Guenter Roeck , Lee Jones , Prashant Malani , Rob Barnes , Stephen Boyd , chrome-platform@lists.linux.dev Content-Type: text/plain; charset="UTF-8" > > - irq = platform_get_irq_optional(pdev, 0); > > - if (irq > 0) > > + irq = platform_get_irq_resource_optional(pdev, 0, &irqres); > > + if (irq > 0) { > > ec_dev->irq = irq; > > - else if (irq != -ENXIO) { > > + if (should_force_irq_wake_capable()) > > + ec_dev->irq_wake = true; > > + else > > + ec_dev->irq_wake = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE; > > + } else if (irq != -ENXIO) { > > dev_err(dev, "couldn't retrieve IRQ number (%d)\n", irq); > > return irq; > > } > > Still I do not like ambiguity behind irq > 0 vs. irqres.start. > > For this, and if needed others, return plain error. > Seems I gave the tag for the previous patch, consider > that tag conditional (it seems I missed this). What "others" do you mean? Modify platform_get_irq_resource_optional() to return success/err? Or do you mean to modify all irq resource based functions? of_irq_to_resource() already existed and returns the irq number on success. Modifying it would mean updating all references to it, in addition to modifying the fwnode abstraction layer (and its references). I'm open to modifying platform_get_irq_resource_optional(), but would like to avoid blowing up this patch train any further. > ... > > > u16 proto_version; > > void *priv; > > int irq; > > + bool irq_wake; > > u8 *din; > > u8 *dout; > > int din_size; > > int dout_size; > > - bool wake_enabled; > > bool suspended; > > int (*cmd_xfer)(struct cros_ec_device *ec, > > struct cros_ec_command *msg); > > Have you run pahole on this (before and after)? Yes I did. The structure is not fully optimized, but this change keps the overall size unchanged (328 bytes).