Message ID | 20240202095636.868578-2-saravanak@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-49624-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp318808dyc; Fri, 2 Feb 2024 01:57:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBGig81oAAlp28ELJO2ps71iaveJhAfSwWwOJtK3KGlHYuF6mC8VCT7/6zEgB3QDPLLmxc X-Received: by 2002:a05:622a:4c9:b0:42b:ef48:23f with SMTP id q9-20020a05622a04c900b0042bef48023fmr2662162qtx.4.1706867853646; Fri, 02 Feb 2024 01:57:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706867853; cv=pass; d=google.com; s=arc-20160816; b=ay6P+HLSAaI+eCNPz9uiMHIxBByeUvQRlI0+p4JulgJ2UutTmRVxKghvbAMynCjv9h NYDLkTaLqnLbUxNYH3qzhlywmXnlIf+nMx2F8W+hxYx1uXKqgIvEqvymItoFCiOEVScX h6hLXnc1OaUay61A8WWeZYD2jloFAkP3Yrctiq/1URqa46bAGlVinH5Yfuj7vkm8iafH CJ10jXYEWyOhkHPIV+jmLnbDOmYy/N+RIryEkhvAdQRoSbMhskjUiu/9p6YAcrqYmklw BNj5xHyX4NzhxqkMHIFsNh7NC57rgt9EsC3oqX9VjMtY8fNKNrfmkPHOQxpgKo2Pcse/ dSxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=in2Ntwtloha/e+ZMm1Ao4y84QzaZLhLUFFn+wIIPR3U=; fh=+ppQAKEoqHIztm9xcEkzp1zz6k6MG6ykd/lzLOkAqz8=; b=R9bk3BIXFNQH8nGCAoEDuLiLnnF8GoCJDx9qxeqsjg30w7bRpFiwR3CjI00aPaCg8r //6dY65YrVjx1I8GqqAKriTMdHwxivSSanwWsc4UFDvefP6X9dGfMaUTOYWeUrui+ndx w29n3yxQ4eCUVzB9XgWnC/Gnxag1gxSojgkEEEZNEIpv9hEAA+20miLcYEiE2j4kfSb2 GTRZxE3QIp47HE1vsPt6mD5wnZy1wms+ojivE+AyxakDsXDc1WjmxDcfilFf3GmmT6dK 7AoTF6HczZAW6lHVG7LMCZ5w6F0K7nsnivl7YvhtwcZEWfLww9VFvg5qlLhSrMhXJior sp/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UCHawdzG; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49624-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49624-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCXIVY/RXeURYx5ydmy2Yd8Ivl7HMVZNQJeUK8p8IxbNEEsvL6W7VmuzL3rQw94mhaRqPhUeK3QgtCX26FPyj+d4eZEkuA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m12-20020a05622a054c00b0042aaa58fd44si1565322qtx.261.2024.02.02.01.57.33 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 01:57:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49624-ouuuleilei=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=@google.com header.s=20230601 header.b=UCHawdzG; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-49624-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49624-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 542DB1C2464F for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 09:57:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC0917C0B2; Fri, 2 Feb 2024 09:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UCHawdzG" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 9539377F3E for <linux-kernel@vger.kernel.org>; Fri, 2 Feb 2024 09:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706867805; cv=none; b=Dng3jsrFqI2YXG7kJ+yr3nvkjfYHdDy3ZgltdxOpMKWK9qDeEi4dGYJByzb/UCfLvngngloB2MBfzOM6uHJO5w2P7H1opNVLc4c5NGNk3jg3RBm0GDC9bdqnUuoVfsZKIwLAwJNMRnmlUYqkH0Nqv2l10T8v1Ew4+d/Qoh259Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706867805; c=relaxed/simple; bh=DPOMrDg4rKNH1QTC6aQIG7HRKerQiIwxkdnyzWqM6hg=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=cnwo6EYcZ7tvbGLQE7EIpKX5KtQdtLWP5ri4SuNWit48UNXZORt07/1ycZdyYtOWoDhubg3I060DxDyWnK0n8BVUvA6oNmM5h0V/nG15UQABoNWhh7SGJK0yFumKeOE1vq3jU/ixXXHxu7PvBO2OiyOaT3H0xlVpgzY8DjwNe2A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UCHawdzG; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6040f058d3fso41224887b3.3 for <linux-kernel@vger.kernel.org>; Fri, 02 Feb 2024 01:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706867802; x=1707472602; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=in2Ntwtloha/e+ZMm1Ao4y84QzaZLhLUFFn+wIIPR3U=; b=UCHawdzGbDfYJi+G5OUFfFOrGC4H4lD3CsT4/RiN1VY/my2gkK4crhCtHFCgTcNTCe iJ08cEkzyAqF4p97AAVxjeP2kNcLLge6Jl3m0IMtlM0/DO2oCM2ayjj94D3oacTqxmUH LUZJWnRMu9eRVeCaRvZYqHUf6o+weWeFerjFzOVoFLAE3cki+/HcAjhUu8vpBlcu/sHk GsSn2DejuJLgPfb7M6T7Ugqb+C+kDDsUt4vLnCEvwvsoM+5Ujzbi0SizfAUySOx2emch 0+8pkrkUTw+XTF8y1lD5T4iP4QmwlQ09bbl65prOh2GvpS9aOE+GT5LXJRTZi4kuKnQU TmPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706867802; x=1707472602; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=in2Ntwtloha/e+ZMm1Ao4y84QzaZLhLUFFn+wIIPR3U=; b=qdySg4vAlznN1eNmmZ7T9gBv7HEk/WVo3K5DRSyawPdeTM9EfWdnLbyLfMEyfFzD4b oWuzGvhFYyzWlYayPVeQvMv6jLMcKe3OpY1ElblUugkFkYmsYun9gf5+37hWwHQet9Z4 hEYimk88vhb+XnktftGjl1ABZYG89eptNJvfR+bLePGVoWrMytsPUVjcHM59s49gRw0E kedmUeSh/3lneOhg1QR2PXO6DpOKvZdT0JC/HqbuzjmkWAS9KR6UnePa64BACGUl/nNl k++UxX+Oe220HbXIEWVMsRry8Uq+Z6ZlrMMj3z9/N8pEdPKXGOlrOzgsUaSh7DN7j4Fj H4kg== X-Gm-Message-State: AOJu0YyIPtk+Ze6zANvt6e7jlxhj1eDvAMBl3j+PVHioWWGqVLjp/En0 fSvjzrO+/U6DTmy1uG2Nu8q5ccBg3+Enq1txdiARSQ0Yv9VpaTKzhWgD2dqp8nYHU7GxrQTy1OJ unkjVO2qwy+ZdDw== X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:6f0:da10:9cb3:5b3]) (user=saravanak job=sendgmr) by 2002:a05:6902:218f:b0:dc6:1a1c:6a12 with SMTP id dl15-20020a056902218f00b00dc61a1c6a12mr460305ybb.5.1706867802529; Fri, 02 Feb 2024 01:56:42 -0800 (PST) Date: Fri, 2 Feb 2024 01:56:33 -0800 In-Reply-To: <20240202095636.868578-1-saravanak@google.com> Message-Id: <20240202095636.868578-2-saravanak@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 References: <20240202095636.868578-1-saravanak@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Subject: [PATCH v2 1/3] driver core: Fix device_link_flag_is_sync_state_only() From: Saravana Kannan <saravanak@google.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Saravana Kannan <saravanak@google.com> Cc: Xu Yang <xu.yang_2@nxp.com>, kernel-team@android.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789780666418069250 X-GMAIL-MSGID: 1789780666418069250 |
Series |
fw_devlink overlapping cycles fix
|
|
Commit Message
Saravana Kannan
Feb. 2, 2024, 9:56 a.m. UTC
device_link_flag_is_sync_state_only() correctly returns true on the flags
of an existing device link that only implements sync_state() functionality.
However, it incorrectly and confusingly returns false if it's called with
DL_FLAG_SYNC_STATE_ONLY.
This bug doesn't manifest in any of the existing calls to this function,
but fix this confusing behavior to avoid future bugs.
Fixes: 67cad5c67019 ("driver core: fw_devlink: Add DL_FLAG_CYCLE support to device links")
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/base/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c index 14d46af40f9a..52215c4c7209 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -284,10 +284,12 @@ static bool device_is_ancestor(struct device *dev, struct device *target) return false; } +#define DL_MARKER_FLAGS (DL_FLAG_INFERRED | \ + DL_FLAG_CYCLE | \ + DL_FLAG_MANAGED) static inline bool device_link_flag_is_sync_state_only(u32 flags) { - return (flags & ~(DL_FLAG_INFERRED | DL_FLAG_CYCLE)) == - (DL_FLAG_SYNC_STATE_ONLY | DL_FLAG_MANAGED); + return (flags & ~DL_MARKER_FLAGS) == DL_FLAG_SYNC_STATE_ONLY; } /**