Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2235288lqo; Sun, 19 May 2024 21:38:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1jd7wakfsuQ5r6WoNwUHzJw0DjjCXGbEBjEXCDhIeoiGXf3pLF+VOAI6bER7la45TZytcWi18Wz6ojbKq7LsAtU9BLPNw4qp1pX3ggg== X-Google-Smtp-Source: AGHT+IFsn1PCIic+rcEik845BQEyNuGJ7NhaxGXE+0groidD5aRsoCFi/bwUIAvDTRt4MvfCsyfi X-Received: by 2002:ac8:598a:0:b0:43a:f2be:6ce with SMTP id d75a77b69052e-43dfdd6a4f9mr339840491cf.60.1716179885080; Sun, 19 May 2024 21:38:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716179885; cv=pass; d=google.com; s=arc-20160816; b=mHVooTMAb9jih8/lYer4AzcVx3ZEcbxw10C/5rv7lXZFGFbQ1ngU1cyoI5gPKFtp4C yODuNXNt3tHuHogK9pY9z3Kfq3iu9GrBLoiP4GZ8ZrjcU0SAKze31Gtfm2NQx8RQLJaB QhGT3yKQc3ipRMYM/nVHGpU7gLhm9iDbkTeRrWP0JRqtr/0nwVKEOLSGbSM8XGS8V3N9 CQgTcoYsVY1aOo5FUzggRNMtAi9KQr5HkBPeZMHcUjhLwFoMqH3myVUiu4VXxCU2OfnM PVBBqGLF61LpPzAwZyzZ28CvldsUc0rtTaK0ZXXqSO70YVEZ4Cm915qaZGXvQVue1K8Q nq8A== 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=S0f+/sC1hlJDtL613xR4Daj4Invc3ArCKO0sG2n+HKc=; fh=mMe7PHk7m5jttOUCQV4Xjb+bs6H+TjH5Dhg/WuEtmT8=; b=YsLWedJk8WFbpoboIMRT7LiBvcRWpZZMH2ccCGJjFPy+fCEsKdWpkTGPF8jczUUkxp iZZjTsYEOSSQ84Jr8vzdAbI40+1cs1A3meC26Ldj7NZIO88szunAKM/ByEhldfcL6af5 HyHlGjQIBwNref2TNXtI3s7BDfbZUPRtzmZL5VKPvA8Sqvq7PePeP7+oR3sBRFCnuzlv h3+g4BNlSf67wxJ8xkSAcE9am6gy0ymJmZ2zG4RqMoqqDAbQJJ+RUe1qBDyyxjjL287i jUCioXtC8EXgDGVpWUXWLxNAmCg7MPNBFOe4IdfWkl42GJXIH+2hUwnUxig2NQI4JHMw i7Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=haioVuSD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-183410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183410-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e4bce0677si57458161cf.29.2024.05.19.21.38.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 21:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183410-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=@intel.com header.s=Intel header.b=haioVuSD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-183410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183410-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 CA2921C2109D for ; Mon, 20 May 2024 04:38:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 135CF12E6A; Mon, 20 May 2024 04:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="haioVuSD" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 2D950468E; Mon, 20 May 2024 04:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716179876; cv=none; b=UrkrMVkN1qo/K8dSIqo+1l8MBZueGlv0oEeMo0RiDFxAhlzkjIcQXU0kwqBYUsHIjCp+ng6xkh1am7/Ipf2A7phierv9VP2qsb6e4cMUNgI/0oD2hsIK1vVoHblgz9XmLFHSSCURUy17IXZhKu8QiMx28fDE1Y8uX8GRriynbMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716179876; c=relaxed/simple; bh=2YAnCqrREP/hJDbqr7chrj4LIgZjefs5gj8e5cVBzIQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d0RcQewxWKgvPyg4MrxuNhJrdnWvE0cRQQ5ABXj8mvbNye3h2xFhQtbLwBsWlh8Zzp0FHec860UNXa+Njf/360PDgvcqyMHFIyFKa9nVN5qyEmFXVSyK5Cv3GjDLQVLY0E9hjw4lqhU2LqA/tCDIxgHEuSBcOumIdfxDoo3lUMU= 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=haioVuSD; arc=none smtp.client-ip=198.175.65.14 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=1716179875; x=1747715875; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=2YAnCqrREP/hJDbqr7chrj4LIgZjefs5gj8e5cVBzIQ=; b=haioVuSDGKTr4cf24fmI7M2y5ljVi6siZX7365F+PoMNB9///osAk1i+ Z0l2hgswYqu+eVeHojqBXe9WLurtjdtn5SONBnxUa+FB8LXNLzhY4P6xp ZipWEZolzeMwcA398VdG6YAZuBgAhxfkUObyGIvSq2YlUz6eUhlPt5bAm Jtwl8bZY+7qHZYCTJ4tGC8U4lfcJAjnshIcPJePGkBpMEn24Nrv9llyrm J//oX0eTq9Oc2leoYXAOq4cI7sPrTI0pLBy54cNSAnvSGDYwQk15b/XTo GIRIbYZbrB2hlDqcpgH/xwBL2PF80mtp5KkUCXyLBfEZZUewlvb4OtPF/ w==; X-CSE-ConnectionGUID: D/bIB6QuSHO6VQ4TijWdGg== X-CSE-MsgGUID: WICmLBEYTIyrnvBaVxv2Xg== X-IronPort-AV: E=McAfee;i="6600,9927,11077"; a="16116490" X-IronPort-AV: E=Sophos;i="6.08,174,1712646000"; d="scan'208";a="16116490" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2024 21:37:55 -0700 X-CSE-ConnectionGUID: oMFfpQaRSVOQnyfAVkcMwA== X-CSE-MsgGUID: aCR+5qLdTjawS+XI7LU1/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,174,1712646000"; d="scan'208";a="33009876" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 19 May 2024 21:37:51 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id B0519193; Mon, 20 May 2024 07:37:49 +0300 (EEST) Date: Mon, 20 May 2024 07:37:49 +0300 From: Mika Westerberg To: Devyn Liu Cc: linus.walleij@linaro.org, brgl@bgdev.pl, f.fangjian@huawei.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-acpi@vger.kernel.org, jonathan.cameron@huawei.com, yangyicong@huawei.com, yisen.zhuang@huawei.com, kong.kongxinwei@hisilicon.com Subject: Re: [PATCH] gpiolib: acpi: Fix failed in acpi_gpiochip_find() by adding parent node match Message-ID: <20240520043749.GH1421138@black.fi.intel.com> References: <20240513075901.2030293-1-liudingyuan@huawei.com> 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 In-Reply-To: <20240513075901.2030293-1-liudingyuan@huawei.com> On Mon, May 13, 2024 at 03:59:01PM +0800, Devyn Liu wrote: > Previous patch modified the standard used by acpi_gpiochip_find() > to match device nodes. Using the device node set in gc->gpiodev->d- > ev instead of gc->parent. > > However, there is a situation in gpio-dwapb where the GPIO device > driver will set gc->fwnode for each port corresponding to a child > node under a GPIO device, so gc->gpiodev->dev will be assigned the > value of each child node in gpiochip_add_data(). > > gpio-dwapb.c: > 128,31 static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, > struct dwapb_port_property *pp, > unsigned int offs); > port->gc.fwnode = pp->fwnode; > > 693,39 static int dwapb_gpio_probe; > err = dwapb_gpio_add_port(gpio, &pdata->properties[i], i); > > When other drivers request GPIO pin resources through the GPIO device > node provided by ACPI (corresponding to the parent node), the change > of the matching object to gc->gpiodev->dev in acpi_gpiochip_find() > only allows finding the value of each port (child node), resulting > in a failed request. > > Reapply the condition of using gc->parent for match in acpi_gpio- > chip_find() in the code can compatible with the problem of gpio-dwapb, > and will not affect the two cases mentioned in the patch: > 1. There is no setting for gc->fwnode. > 2. The case that depends on using gc->fwnode for match. > > Fixes: 5062e4c14b75 ("gpiolib: acpi: use the fwnode in acpi_gpiochip_find()") > Fixes: 067dbc1ea5ce ("gpiolib: acpi: Don't use GPIO chip fwnode in acpi_gpiochip_find()") > Signed-off-by: Devyn Liu Reviewed-by: Mika Westerberg