Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp66841lqt; Wed, 5 Jun 2024 17:42:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDImPHdbVTPUlltHSXwutNik/TiNiOFlebES1QGU9urH3bqTOSuGJZPHNKU6+W9skvA3nrpw77ZKJOi1VUvrr1T4x4q8s0vjsFAwOE3w== X-Google-Smtp-Source: AGHT+IFp9k4Ko/2U+B6ofPpSIofhz2zsdS2hDF/y5YPyXiGW+x8YtKh1OlGeOBX6vdgHIA/fTRDM X-Received: by 2002:a50:d61b:0:b0:57a:7633:9634 with SMTP id 4fb4d7f45d1cf-57a8b6a4d23mr2970214a12.11.1717634547794; Wed, 05 Jun 2024 17:42:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717634547; cv=pass; d=google.com; s=arc-20160816; b=jSWCg+JqO4bl+hrPkac5Oskhm0R3C3ScbtE7jFENJ3eMM2YYKg7GXSCZIRon735ZB9 MRhKMq2Feo8NjOFJ6zG7AskvhUgmPi1qccc4uUd8RmU+uzSHLTfV/Xfqzfwklro81ay3 8OlGJKSuWKGtcD/CDSx0lt0LGBxE5W8cyCM4oi6v5WW/K5Eknyh3Au1G6dy1YfXn0MLh GO/JKIdgm45wMrsbjIgGpybwN1gN1XOTc7mSstZPQMFvP6JeMVb3DGNH71xcVMta30il og1JqGLs9JDjcl0UhwSyqhXsBDsu1npBoecBME2fJrBEDj3DrzSZhALYvvJF9gYVw32V l5ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pRHWIqKrogA88n9Tkj9zJquUR76xLrOnJBRrvpKpqgM=; fh=09sh4kwaBtjBwo39XnYsnUcFOcTuN3yIYeynz6PnEf4=; b=ZXtLKmETNYoBXaJzl7DxCZAB1OalxdCZdUc1fsFvDq6ltq41WlF9TRRIWgaGkMAlfd BroDopkVwH6wlEGBo2SGhrZx0kgklyJTvguZsn5PTSJoub5ekikmechIxNzms3q8NEMT AV2Yriw1lqB34dpRcylogPuk+tmEoM1z+AHhjca/SXz0iwzX6cBkT+YO+TQ+pXsVGoAr HsDXQXs8PMIjlrX5xONqqncLxfsksHFrrjNzyg0QGiUsFrFwhTVjUOhx6xFceEmmaCHf sbrDFh43b9oCto+M7sFCKts5gSNbywNJ3X3UYob5qC4+QSy4kgG0e+FPDn7Jfr+4H/HO rn1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OaZqeNHq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae1fdaa2si103335a12.220.2024.06.05.17.42.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 17:42:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OaZqeNHq; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203464-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 807971F249F3 for ; Thu, 6 Jun 2024 00:42:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AC8BC8C0; Thu, 6 Jun 2024 00:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OaZqeNHq" Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (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 41CFF646 for ; Thu, 6 Jun 2024 00:42:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717634539; cv=none; b=b/zxkT33H2+bFF6xD+OJ8X1Rhjw/AwPD3wjYroHrK5gmwX0OFEWxoVfxqsgkdjfmurKUM74/R2d3+SEtnTOFdnL7joeC3ccfMJFV9v/1IaCgo2na93jUU6ogL6utsmtiUu/IPZ1yPa2dTccrcmFaIMZUcqH3CwhixEvL2AYc3qo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717634539; c=relaxed/simple; bh=H97UUkxz43bfwlw7MPZnzFwcHWU9V5Gq9lHVpnzJ0L0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TIIAeU/iR6o24NQkULc5SXewsEhPeDV6F9FNOoEqSL+TCyGhIqv4CDNCq3FmIHL9s8cTWBLIZ4r4aJdXfL+mRUm5cL1xavu5sJ+xIm9OOWeoo4nxwAMGAUFs2RWyqlvF/40HCG1v/EjFU2jJmqkSxhZIUlD0hJzBCg7UbVK8wII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OaZqeNHq; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-62a087c0638so416897b3.2 for ; Wed, 05 Jun 2024 17:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717634537; x=1718239337; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pRHWIqKrogA88n9Tkj9zJquUR76xLrOnJBRrvpKpqgM=; b=OaZqeNHq0CeyRSWNx47YyC5Wjoj7T0yHkfnwoZjswUg28ilurEIE+F7Ap7DnbPaKPH AhwsStgJblTuEOOVi2RW3TMWVBjy2Ye5GLTyR3gxobbvqcUguzYsAQsaoWK1A+3iJlSy dqCAhM5Qdu7jaA4r1qbhqOnwv3F5jO+wE05G27nA5WSHt6gNOSMElf1aQOmMY15oP3oI gEjtpwqDuvOPQk7Cerzllqu2ArLneQnosgx80I7uAYY4CED2MSkd/6AC9eDzWcJ7J9z8 BzFaWhCQrS60jtLf9DNESJiVVP4nQvfIjsn9Zx052eECWMbycADFnww0KT5lcXM9aAQl pWdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717634537; x=1718239337; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRHWIqKrogA88n9Tkj9zJquUR76xLrOnJBRrvpKpqgM=; b=RjKl5osfBxSQti+kdKFcx5jqwy+pz2RFPGh3uODA56Wg+jcobKgrn/8SUUrYb5iVAH ouCUw8clbbinnMGt4GV+zSCuPzGNxPlbSshn+Iy9lQ/RTRbWwSByHV77IJMqDdt6nYKS 66ZKozqegfw2pNjzPpODJPL6fuQF13BnKSJ+NqbFvKgLi07+hIM4wDlLZ7Hq7zyK9TRG 6BpvTEQP31hIYW7aUmHA06dI8dAjzbRvbfbKg4dujoTtIXvCZxT5Hnb6USg0IS6WosE5 F5W2IekmxFy6R+iuzZoF+l6Y8QX44x9b9/WCf7N8qfcKRaHGT/dXoTxY36omx6SBtzyL 19Lw== X-Forwarded-Encrypted: i=1; AJvYcCWAJHS0VHjiMq7bBAHO1fqep4L7gqGbYejpSXgsWZfqCaFctdZMvJhXLxDIzWf6oNtW/GKBytVxuB5jCwFK9Vzc9zN6NdF9gr3z4sfF X-Gm-Message-State: AOJu0Yw0n/EoQT9Lo25AOYqXS0BRkYJHpDpIhY98rd/pNRT1UadATWtv z5IGEI2uDPK+ALWtZ+JioAinDZrMRNN9icqT0sUIvoxHlPNm9WvtMrdrQUDLZ0d9WB//WUD8BZo GbSvyRpHDxDb+fcYxqY1zC1m7OPA= X-Received: by 2002:a05:690c:660c:b0:627:a25d:6e76 with SMTP id 00721157ae682-62cbb4c9685mr40711377b3.2.1717634536103; Wed, 05 Jun 2024 17:42:16 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605212840.3227774-1-olvaffe@gmail.com> In-Reply-To: From: Chia-I Wu Date: Wed, 5 Jun 2024 17:42:05 -0700 Message-ID: Subject: Re: [PATCH v4] resource: add a simple test for walk_iomem_res_desc() To: Andy Shevchenko Cc: Greg Kroah-Hartman , Dan Williams , AKASHI Takahiro , Dave Jiang , Alison Schofield , Baoquan He , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 5, 2024 at 4:36=E2=80=AFPM Andy Shevchenko wrote: > > On Wed, Jun 05, 2024 at 03:52:26PM -0700, Chia-I Wu wrote: > > On Wed, Jun 5, 2024 at 3:10=E2=80=AFPM Andy Shevchenko > > wrote: > > > On Wed, Jun 05, 2024 at 02:28:26PM -0700, Chia-I Wu wrote: > > > > This mainly tests that find_next_iomem_res() does not miss resource= s. > > ... > > > > > + /* build the resource tree */ > > > > + res[0] =3D DEFINE_RES_NAMED(root.start + 0x0000, 0x1000, "SYS= RAM 1", > > > > + IORESOURCE_SYSTEM_RAM); > > > > + res[1] =3D DEFINE_RES_NAMED(root.start + 0x1000, 0x1000, "OTH= ER", 0); > > > > + > > > > + res[2] =3D DEFINE_RES_NAMED(root.start + 0x3000, 0x1000, "NES= TED", 0); > > > > + res[3] =3D DEFINE_RES_NAMED(root.start + 0x3800, 0x0400, "SYS= RAM 2", > > > > + IORESOURCE_SYSTEM_RAM); > > > > > > ...here is overlap with the previous resource. > > > > > > And here is the gap to the next one, in case we make that overlapping= gone. > > > > > > > + res[4] =3D DEFINE_RES_NAMED(root.start + 0x4000, 0x1000, "SYS= RAM 3", > > > > + IORESOURCE_SYSTEM_RAM); > > > > > > It wasn't the case in previous data. Please, elaborate what's going o= n here? > > The test data is chosen to be > > > > first interval: a matching resource (res[0]) > > second interval: a non-matching resource (res[1]) > > third interval: a hole > > fourth interval: a matching resource (res[3]) nested in a > > non-matching resource (res[2]) > > fifth interval: a matching resource (res[4]) > > > > The idea hasn't changed between revisions. > > > > res[3] went from a half of res[2] to a quarter of res[2] in v4. I > > guess it causes confusion if it is not viewed as a nested resource. > > Okay, so far it's correct data from testing p.o.v. > > Maybe you can add a comment on top explaining this layout? Done in v5. I also added negative tests for all holes in the test data. Hope it's better now. > > ... > > > > And rather sending one version per 12h, take your time and think more= about > > > test data. What are we testing? Are the testing data correct? Shouldn= 't we also > > > have negative test cases? > > The current choice of test data covers the most common patterns. Do > > you have other patterns you want to cover? I am new to the resource > > code and that's why I am largely reactive to review feedback. > > Nope, seems okay to have what is there for the starter. Later on we might= add > more if required. Just got confused. > > -- > With Best Regards, > Andy Shevchenko > >