Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp206976rdb; Mon, 22 Jan 2024 17:53:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBQAWdixdYF7fAjgQjSkGv8XYCJUFnXmtJO0n93R0ZGc7r0XIU+w+qhhRGk7qkc57iM9k2 X-Received: by 2002:a05:620a:2983:b0:783:a117:130f with SMTP id r3-20020a05620a298300b00783a117130fmr2490893qkp.19.1705974781289; Mon, 22 Jan 2024 17:53:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705974781; cv=pass; d=google.com; s=arc-20160816; b=eUcYGkh1MDGaf4kI9j9z4aPNEc1APgIEa3F3FRF1feSEOYZHSz8BgIOSzgm0TW+ljj 37N9B05EwztbRwyhQ03bR+4dY9/by/Pg31dedZmOqz0xZDDBrxAv9EN9zSIWfz5C/J8W miel6N3iq0vCgjWCUlpM1gcWaZ2hrgifA9pRsnVCv43DZRvQKju/VGlSRkq2lFgkb+xR Mb2vG5aP/Gu9a3Mc0dghgVp7eBb8yvE+XBipnckeKTSWzqKZTXLp9y8itrVjNfUdvhcG j9Gu+kgiNdjBAL+rDyY8aeiUSqyJktJ1p9yYTAFWMslgSnk5jxtJ0L+XYeQ/1El8Wx61 0TXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=1amB/L7gOBoM9TVvcIEb8QCr/e1Osy+QoThWNMN1a/Y=; fh=bxdMU1m4vMyiQq3bBZiW+3NZ0bDyzRlzZdJiO4OmdNA=; b=jU4dKvLkZpe+xPYGJHeI1c1gkFP/oSDESvmw3CdBZ/cJ0EAEBkn+Nuh746N6XbIVLl HZ//7aCm22elaIHd42CkcqIRRXi/KRIHUm4ABtT+JxBe1YPaOVBBODegF2y86rLZ35rI jPRbccQH1VJHYvGbr8oQuqpvmN4BEMnO7khgth03KB0bRsWZpy+1ti692/+cbe70rhq3 VqNvlygCE5EW6e7Xr/9cUetS+99oggMQTk0Brx9e0E8Xx/HQcZwjg07huYaxgaDShOrF 7fZPcEp3OySrZV1Jk/3OfG3yUIdyqBQUQUkQGkeAbJ/C5PxpEqGRU4HP4Ewksbig/9d2 OarQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=KbR41SM5; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-34557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n11-20020a05620a222b00b00783792339f5si6638531qkh.50.2024.01.22.17.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 17:53:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=KbR41SM5; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-34557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.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 11C5A1C281EA for ; Tue, 23 Jan 2024 01:53:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E5AE633F0; Tue, 23 Jan 2024 00:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b="KbR41SM5" Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9E20627E3; Tue, 23 Jan 2024 00:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.193.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705971175; cv=none; b=WgMi2mYvS2BiuOnb56KucsdcvTD1itGdP3V0C7wL/9pgYsdVHcW9NT1bVTLRYCitrq13PD+TdhBYWyzs4VWYrGnl7FtjZT2oL4l0JdCZdg+I/R4atAYeFY5/4fa+wcQlBJB3rxH6R/IBY7laHz5/SHVfhzX5p4sYObQ1Ve+mhBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705971175; c=relaxed/simple; bh=IHHAkhaPD/VxLEfCh4L6KUuwb5xEYZxbqYfBzxCDqiE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=czN8NZpG9iLUOPo7XqFNJyVSjIF9bBOCPavPUCxzwxKAHFEZRSqOnIqSD7Jl6z0wFFIz1EuEDKI4PkTwyyCp2MOtwPX02D9VurfbASzTR2W/bh9zTpU5nJYPG7+gh/yIuYBMcNbkO3Ckx2BRbD2edQ0O0mpF0qUUHmsYwPDc2lk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org; spf=pass smtp.mailfrom=peacevolution.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b=KbR41SM5; arc=none smtp.client-ip=206.189.193.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peacevolution.org Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 7CD0F450F1; Tue, 23 Jan 2024 00:52:46 +0000 (UTC) Date: Mon, 22 Jan 2024 19:52:44 -0500 From: Aren To: Chen-Yu Tsai Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Aidan MacDonald , =?utf-8?Q?Ond=C5=99ej?= Jirman , Sebastian Reichel , Hans de Goede Subject: Re: Re: [PATCH 1/3] power: supply: axp20x_usb_power: add input current limit Message-ID: <2dkeq46flco2xukggii3ljlw2zo7wjwuiutha7jlxozmf63swd@xnirwnfvvvcv> References: <20240121014057.1042466-1-aren@peacevolution.org> <20240121014057.1042466-3-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spamd-Bar: / Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1705971167; h=from:subject:date:message-id:to:cc:mime-version:content-type:content-transfer-encoding:in-reply-to:references; bh=1amB/L7gOBoM9TVvcIEb8QCr/e1Osy+QoThWNMN1a/Y=; b=KbR41SM5eVxA1weRH7IkSPrSd9EVRgpemzguutoPd3732qEfAgt8MG+HSPZqcsdik4MsAy 3DdF5oM18yQ+mcwwDS0G9FRhx5OyMSPxCsFg7mrMVkD3CI3co8f6rtQuDT6T4y6r36SLHe u0JpMpBF9BIudl/WQ0pT7y3RCENjB2c= On Sun, Jan 21, 2024 at 11:25:04PM +0800, Chen-Yu Tsai wrote: > Hi, > > +CC Hans de Goede since the AXP288 is similar to the later AXPs in the USB > power section. > > On Sun, Jan 21, 2024 at 9:54 AM Aren Moynihan wrote: > > > > Add properties for setting the maximum current that will be drawn from > > the usb connection. > > > > These changes don't apply to all axp20x chips, so we need to add new > > power_desc and power supply property objects for axp813 specifically. > > These are copied from the axp22x variants that were used before, with > > extra fields added. > > > > Also add a dev field to the axp20x_usb_power struct, so we can use > > dev_dbg and dev_err in more places. > > I think this patch highlights some errors in the driver. > > 1. We are likely misusing POWER_SUPPLY_PROP_CURRENT_MAX. Based on the > ABI docs, this is supposed to be a read only property. The correct > way would be to use POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT as you did. I think so, yes. I was hesitant to touch that because I wasn't sure if current_max was relied on anywhere. I'll do some grepping to confirm that it'll be safe. > 2. For AXP288 and AXP803/AXP813/AXP818, we are setting the current limit > for when BC detection finishes in register 0x30, not the actual active > limit in register 0x35. This should be fixed. > > 3. BC detection race condition > > Could you maybe respin the patches to address them separately instead? Sure, that sounds like a better way to split it up. - Aren > Thanks > ChenYu