Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp568912lqp; Fri, 5 Apr 2024 02:17:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGXYdmx65dqYsUP5XJCgj3Mn13HCD6+1MIeDX9noxf52TbxGtxzR6IfRbAb/Q6ug9PYUAfF/UY1ryU5KOo4rhNb87djAXwxq5eLUwctw== X-Google-Smtp-Source: AGHT+IF14+KgNH+nux40ZdWcWR1hPH9OCzLPdkxIMvrSbwLbR2beCrSduUR3tc+Eif9Zv+pUkVvD X-Received: by 2002:a05:6808:2b06:b0:3c5:dbcb:2349 with SMTP id fe6-20020a0568082b0600b003c5dbcb2349mr901314oib.8.1712308636929; Fri, 05 Apr 2024 02:17:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712308636; cv=pass; d=google.com; s=arc-20160816; b=Yswhz30bCCapw0hdLvAm+Bt3KQSPdQ4OG3q7BBjMvW0uesb1xGoJS+jDCyqSSoFb8r DwY0Ox2MBKQUvHFApZeRvraOodIccipcjX0FJlHRzEr6OZ0qTG7xAwgWioloMM5gSGeC tM2Z/e8oUFBh9TDSzIr5qRhITvOr421SMfBQLxSHtGpn53CWyOaEEQNoRjLs7Ag6/7vn eT78ghZxaSnT8z/qkcTvJa8XOTXurAUl4Ogq2dhAPGDyP4OeebTPP5V7//9VSHRbkHkZ j0CJ9d2p1FcMGbiKLx3MPjIOYoMmq53hPV3c6IPnlNg4TKaQOZa44Y+T1YTpiXNu6zsk DJmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CnEGOqkNb3byWk5BBfWHwfF90LheiXFTN5Np6Rh2GQU=; fh=AK7V7lfYWbMt6zzVpvXEFidBqafRZjeQPDtYxGV5KIw=; b=q65ymWPhxtxmt1Z/+fRBA6ieid0FKjBzoK44/2MaEQ6XfMA7Np1H7DOKTO9SNVmcFB GVx2E6qrau+t+BkvUGkmBZM4vUXx9aOKQPeOQtNpAJRBEdasTXE1hAcxVY137FdDBuoc GMY/I/9wT6B2LfjhoH44Mi/iNMRQp5R+9fM7l19sU5Q47awnr5HU2S/yZz09tCLtWApx k+pLENBUVmKLGROkgj8mGInT4kWsv02mfVeVgZgGGeMryRyQuu9KiotN8kSolmk4jDCU db/4MToYjT+sFdmF7hmZD7kYuscHpenmMV/Rpy0fnmMj8A3zGbCreriR9P59viwFzyN7 +f3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GcN9OhNq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-132494-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bn21-20020a05620a2ad500b0078a0f5becb0si1297777qkb.568.2024.04.05.02.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 02:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132494-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=@intel.com header.s=Intel header.b=GcN9OhNq; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-132494-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 031171C21D1F for ; Fri, 5 Apr 2024 06:50:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 917BD28E39; Fri, 5 Apr 2024 06:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GcN9OhNq" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 F10BC2557A; Fri, 5 Apr 2024 06:49:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712299797; cv=none; b=fVX5ugiaR7j81W/eO0ovqlNiAqP3z+3KjohzhysxRQEk00XT5A41RuBLAZWOdciEsIRO1CFXkoGQuQBEOJg3PDByhEmsWZ5xOX2EYK5jUfGeiSYxC1No31ueRP/aKuEfq5WCm1NDyM27WRi3YfIgGROvIRxn59XqXu1iB4/ctYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712299797; c=relaxed/simple; bh=pM5eyZ6ngQNS72PsWbWA/pEt9fJ2yCxrs53GYxHbrvI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cQj7HaPvW5sGllPkXQ51inXjCb+vxVaE9o/H4FNtgb2GJeo434oSTywjbd9wN4bcICvbunW9nyZyw6wrFa3hfdK/q6YqP/sFAQlslVfVN2ZUzBNhP13o1JyPP9OaOcnQ41yUVeQB6rRrMRGOKDbeLuoOXcy29BMC127+GWCS5ek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GcN9OhNq; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712299796; x=1743835796; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pM5eyZ6ngQNS72PsWbWA/pEt9fJ2yCxrs53GYxHbrvI=; b=GcN9OhNq/TZ5ZMoxa4x86i7JO6ewKpJpQEHWdxuQ29tmxyp5qDDbWgYj NAvg/+JVd/9gUq4EAPGcZMVk3sxd3KNfnSQaM9psI9SuM0FBq33oXIYOv QaXiXqIsptyDKTLgQentGNM539HaWHUuhdhU1v6I62FBzo0wVL6HYc4kG NcUqMpd959JVbQMjFty8er9xfimn3kVgMshAd/Iu+ZFq5QB19JVfH1naZ GcqFpBaPWXpv6A+AyB/LtcX5DomE3HDQr0Beew2+5BHJECEZoeGwGzJaa 7ZyfDss7H4vy9zfAAaCBVOKQY8anZ2D2JLg5qLiShSSXQzkSiiF3iSBOE w==; X-CSE-ConnectionGUID: kYLUhW6QTPimlfPCOXGN5Q== X-CSE-MsgGUID: M+i4ae5VQ+Ssl51iDt6ObQ== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="30090098" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="30090098" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 23:49:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="937087429" X-IronPort-AV: E=Sophos;i="6.07,180,1708416000"; d="scan'208";a="937087429" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 04 Apr 2024 23:49:52 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 05 Apr 2024 09:49:51 +0300 Date: Fri, 5 Apr 2024 09:49:51 +0300 From: Heikki Krogerus To: Javier Carrasco Cc: Greg Kroah-Hartman , Abdel Alkuor , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH RESEND 2/2] usb: typec: tipd: fix event checking for tps6598x Message-ID: References: <20240328-tps6598x_fix_event_handling-v1-0-502721ff705b@wolfvision.net> <20240328-tps6598x_fix_event_handling-v1-2-502721ff705b@wolfvision.net> 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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Apr 03, 2024 at 10:55:29AM +0200, Javier Carrasco wrote: > >> - ret = tps6598x_read64(tps, TPS_REG_INT_EVENT1, &event1); > >> - ret |= tps6598x_read64(tps, TPS_REG_INT_EVENT2, &event2); > >> + ret = tps6598x_block_read(tps, TPS_REG_INT_EVENT1, event1, 11); > > > > This is not going to work with the older TI PD controllers. > > > > The lenght of these registers is 8 bytes on the older TI PD > > controllers (TPS65981, TPS65982, etc.). I think we need to split this > > function. > > > > That is a good point. I had a look at the older TI PD controllers and I > agree with you that we should split the function to cover both register > lengths separately. > > I was thinking about adding a new compatible for the newer PD > controllers (tps65987 and tps65988), keeping the current tps6598x for > the older ones as well as backwards compatibility. But backwards > compatibility would also mean that flags beyond the first 8 bytes would > be ignored. > > On the other hand, the upper flags are only relevant for firmware > updates, so we could check those (i.e. read 11 bytes) if a firmware was > provided via "firmware-name", and ignore them (i.e. read 8 bytes) otherwise. > > Other ideas or improvements to mine are more than welcome. I don't have any good ideas. On ACPI platforms the same device ID may be used with all of these, so we should actually try to figure out the version from registers like VID, DID and Version (if they are available). thanks, -- heikki