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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68268C5478A for ; Wed, 21 Feb 2024 19:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/lto/WyT86VUvzkG07HAWKjHxAJA0g3CB5ECJY569Z8=; b=qtfGoqqRHN3Ciw kTwzLU6vpHF4FwbCICxMg8wXeQrFqpLF4aLDMJQLbgaQte0VP9bcnRrEuMAP//8M5wMQQNfgnV7UC Uw8BvLxzw2hIXFb8dNOir5iDYEOF1KU8EbLNE3xTDFcQwyTu40yrrYAWnFtcEdw+Ek99PCnwt9jE7 7pS90s9sSMTIwWtrDqUIjNzd8XzkrySpNcnMNRreEpr2wdVAk51ewllFMYs2z9V5lUUvoKSz1ShI5 BXypnm4h9D453zBrhAknFxxaBvt9yNIdjHqQZeslPHk+AgUK0WaGf8W+GXwHse0UojbuBHrYPmzHw yOinPwK8Z9od2PjNFOZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcsDg-00000002Gav-1YaF; Wed, 21 Feb 2024 19:25:28 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcsCW-00000002GHw-0SHE for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 19:24:17 +0000 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7c029beb8efso4448139f.0 for ; Wed, 21 Feb 2024 11:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1708543454; x=1709148254; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0yFTzTjr3GTZORxDHTHVOaXJnjBMrs5r+BDpbCsO/O0=; b=CyQ1O63XUBfkCUsygl86AHSV3MUZqs5vVqf6499bVPb8HHHrVyHGh2YzZHIoSX33zt zzDvgy0TktPm3mm7ZAQNBw3Y7w6Jzr1ZaKCLYGQFBBhLk2/XIOUm3SqgFYqr1FCHyUSE fVTyP+tL5pfgF5NwrPzgSFKE7qDtRQKXMlN4Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708543454; x=1709148254; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0yFTzTjr3GTZORxDHTHVOaXJnjBMrs5r+BDpbCsO/O0=; b=lr09bOQFLzJmw+S7HKcVXbDiNEMCC4xtMaTqC6EjBMZyZ4r+Kul2Zm3GSd5YW9Jw8X 3OwwJu6A2/T3PDoLw77+iIZOu3LHd0vregMzT7zUjIC2Xd2sVWIbQNXbywNKSlCY+B3e 8pTJSTGrR/So4RJo0cpLpNUoIHqBKyoeMZGCrXu1ykKupq7HyOo8blxiq5ywjvUhH6hp oMNS4WpFwiY5tR85AAvvl3SVU6YAUZzYDx2rjnJkOccjnYVRVdpPjHd9fM80KK+oa+hz olL3UzFS9P5CO0iEe8bn2mwJ4bmEPwEutvhXl9ytZJbr7oI26QsvuR314rK5Bge2JYIy DNwQ== X-Forwarded-Encrypted: i=1; AJvYcCWNO8KWWaS2dvobTEz5iXlpMB3jkN4zij4t1Ern859ATPP9Bk+/cF+xQHydNnDjDFHat579y6Q2S+7YXXBebZEK5cYNxFeypALQ7FoHQ0meX1l5niE= X-Gm-Message-State: AOJu0YwPrGUj81NQVYYVG5Djtpc+xyhdr2d29yPHa10YVOXjVekP/eou p9zdFvxumUuHjx/fsMBqXSy0zCMXpTjLQM67Z0SLVMCI373BIgkfBAmO6zlr9A== X-Google-Smtp-Source: AGHT+IE291cBjzdobD8lyxusA74siOxGXcy/qiDGaMre5yQogt2xjfceKZiBvFi5jaiIFeXbw+8BWA== X-Received: by 2002:a6b:e519:0:b0:7c4:89b2:8084 with SMTP id y25-20020a6be519000000b007c489b28084mr423301ioc.1.1708543453597; Wed, 21 Feb 2024 11:24:13 -0800 (PST) Received: from localhost (147.220.222.35.bc.googleusercontent.com. [35.222.220.147]) by smtp.gmail.com with UTF8SMTPSA id x17-20020a02ac91000000b00473f31f96desm2836260jan.90.2024.02.21.11.24.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Feb 2024 11:24:13 -0800 (PST) Date: Wed, 21 Feb 2024 19:24:12 +0000 From: Matthias Kaehlcke To: Javier Carrasco Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Helen Koike , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Catalin Marinas , Will Deacon , Russell King , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 2/8] usb: misc: onboard_dev: add support for non-hub devices Message-ID: References: <20240220-onboard_xvf3500-v4-0-dc1617cc5dd4@wolfvision.net> <20240220-onboard_xvf3500-v4-2-dc1617cc5dd4@wolfvision.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240220-onboard_xvf3500-v4-2-dc1617cc5dd4@wolfvision.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_112416_193322_76CCF3ED X-CRM114-Status: GOOD ( 23.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 20, 2024 at 03:05:46PM +0100, Javier Carrasco wrote: > Most of the functionality this driver provides can be used by non-hub > devices as well. > > To account for the hub-specific code, add a flag to the device data > structure and check its value for hub-specific code. Please mention that the driver doesn't power off non-hub devices during system suspend. > Signed-off-by: Javier Carrasco > --- > drivers/usb/misc/onboard_usb_dev.c | 3 ++- > drivers/usb/misc/onboard_usb_dev.h | 10 ++++++++++ > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c > index 2103af2cb2a6..f43130a6786f 100644 > --- a/drivers/usb/misc/onboard_usb_dev.c > +++ b/drivers/usb/misc/onboard_usb_dev.c > @@ -129,7 +129,8 @@ static int __maybe_unused onboard_dev_suspend(struct device *dev) > if (!device_may_wakeup(node->udev->bus->controller)) > continue; > > - if (usb_wakeup_enabled_descendants(node->udev)) { > + if (usb_wakeup_enabled_descendants(node->udev) || > + !onboard_dev->pdata->is_hub) { This check isn't dependent on characteristics of the USB devices processed in this loop, therefore it can be performed at function entry. Please combine it with the check of 'always_powered_in_suspend'. It's also an option to omit the check completely, 'always_powered_in_suspend' will never be set for non-hub devices (assuming the sysfs attribute isn't added). > power_off = false; > break; > } Without code context: please omit the creation of the 'always_powered_in_suspend' attribute for non-hub devices. As per above we don't plan to hone it, so it shouldn't exist. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel