From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 A328D2BEC43 for ; Tue, 24 Feb 2026 08:03:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771920240; cv=none; b=Qbyi5niDwAdnVmiWqUFgIg1N4SVm19UhCXofO1Gl1ISJOTh9y03gxtJF7iO3M494Z43kQj6LbEmuMuWmNyz8acxL8vK+dxmnjk1SonubFhG9YpId8iFp+qHpgOytWbNSqbuG5YkveRustRaj4wpW2PKjfTFjRzKThmJxiTxnfpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771920240; c=relaxed/simple; bh=S12rUZ1OBoMA05J/q6ecWZX+yIVp4hnup0a2gHYSYhA=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZdmJFQ5ySS3gaYZK9pyUOtuOILMk1yVKmXRf4IBFpPTZAsU+lzkMCM3MQefAkJe6SdNNR49tLZNOY/wKy2QcfMRivKGM2sWwoTNT4tLBlR6EqW6D1q3u583aoFTo3LfnA3Qaja/flXIAepYBAqpogXvjxuWOukpdksuMlxHL/vk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=IZp9iUME; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="IZp9iUME" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1771920238; x=1803456238; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=S12rUZ1OBoMA05J/q6ecWZX+yIVp4hnup0a2gHYSYhA=; b=IZp9iUMElzh8abaciY9gqpKybJz4Mpm4ftUIfkHsWdO6QvrMtKvNOVCD dId8EDfyHl/olL3CGZoE0bf0Uki65j9/CdHJ/XZ/bG93muocugqUYp8Qj SvuvVbywTlFW7vdt+IwjIncjC0i6ONb5WBAjKe1FwrlRHwv3c5e1RZKjL sT/tFwsxzCaaKCG5cSm7YW/I3zh9+C8BcFDJQ9qBy8iDN20DwzmyFj0qG y9cy+YaQAZOp3CMiQGi/4fR8OxuspalmIm6LLxTeONWqBMEgzTiToikIw d9ObNZJWp/n/09ybEZwnME5JHuO+VBLES7aj+xsLz44/kZkBd4DvfSigS g==; X-CSE-ConnectionGUID: osBqseBoTuOAuxCjcpvPYg== X-CSE-MsgGUID: f0dLiblbSyi+eNuDA+dhpQ== X-IronPort-AV: E=Sophos;i="6.21,308,1763449200"; d="asc'?scan'208";a="221046075" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 01:03:52 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.87.151) by chn-vm-ex1.mchp-main.com (10.10.87.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.35; Tue, 24 Feb 2026 01:03:32 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58 via Frontend Transport; Tue, 24 Feb 2026 01:03:31 -0700 Date: Tue, 24 Feb 2026 08:03:13 +0000 From: Conor Dooley To: Himanshu Chauhan CC: , , , , , , Subject: Re: [PATCH v3 1/2] riscv: Introduce support for hardware break/watchpoints Message-ID: <20260224-likewise-rimless-151f6a12b092@wendy> References: <20260223044918.1359983-1-himanshu.chauhan@oss.qualcomm.com> <20260223044918.1359983-2-himanshu.chauhan@oss.qualcomm.com> <20260223-mouth-plated-50294c7a6ac0@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9Buf9mfA6ccW6Des" Content-Disposition: inline In-Reply-To: --9Buf9mfA6ccW6Des Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 24, 2026 at 09:30:24AM +0530, Himanshu Chauhan wrote: > Hi, >=20 > On Mon, Feb 23, 2026 at 3:55=E2=80=AFPM Conor Dooley wrote: > > > > On Mon, Feb 23, 2026 at 10:19:17AM +0530, Himanshu Chauhan wrote: > > > +static void init_sbi_dbtr(void) > > > +{ > > > + unsigned long tdata1; > > > + struct sbiret ret; > > > + > > > + if (sbi_probe_extension(SBI_EXT_DBTR) <=3D 0) { > > > + pr_warn("%s: SBI_EXT_DBTR is not supported\n", __func__= ); > > > > This is going to run an all systems, right? A pr_warn() seems > > inappropriate, given that not supporting this extension isn't a problem. > > If you want to produce warnings, only do it for < 0 return values and > > maybe print the actual error code too? >=20 > It's correct that the absence of the extension is not a problem but an > informational message can be helpful. > So, I can use pr_info or pr_info_once for this with proper error code. Ok? IMO, you shouldn't be printing unless there's an actual error. If every extension we had support for in the kernel printed a message when it was absent, our logs would be saturated. >=20 > Regards > Himanshu Did you miss the comment at the end about the remaining TODOs? Cheers, Conor. >=20 > > > > > + dbtr_total_num =3D 0; > > > + goto done; > > > + } > > > + > > > + ret =3D sbi_ecall(SBI_EXT_DBTR, SBI_EXT_DBTR_NUM_TRIGGERS, > > > + 0, 0, 0, 0, 0, 0); > > > + if (ret.error) { > > > + pr_warn("%s: Failed to detect triggers\n", __func__); > > > + dbtr_total_num =3D 0; > > > + goto done; > > > + } > > > + > > > + tdata1 =3D 0; > > > + tdata1 =3D RV_DBTR_SET_TDATA1_TYPE(tdata1, RV_DBTR_TRIG_MCONTRO= L6); > > > + > > > + ret =3D sbi_ecall(SBI_EXT_DBTR, SBI_EXT_DBTR_NUM_TRIGGERS, > > > + tdata1, 0, 0, 0, 0, 0); > > > + if (ret.error) { > > > + pr_warn("%s: failed to detect mcontrol6 triggers\n", __= func__); > > > + } else if (!ret.value) { > > > + pr_warn("%s: type 6 triggers not available\n", __func__= ); > > > + } else { > > > + dbtr_total_num =3D ret.value; > > > + dbtr_type =3D RV_DBTR_TRIG_MCONTROL6; > > > + pr_warn("%s: mcontrol6 trigger available.\n", __func__); > > > + goto done; > > > + } > > > + > > > + /* fallback to type 2 triggers if type 6 is not available */ > > > + > > > + tdata1 =3D 0; > > > + tdata1 =3D RV_DBTR_SET_TDATA1_TYPE(tdata1, RV_DBTR_TRIG_MCONTRO= L); > > > + > > > + ret =3D sbi_ecall(SBI_EXT_DBTR, SBI_EXT_DBTR_NUM_TRIGGERS, > > > + tdata1, 0, 0, 0, 0, 0); > > > + if (ret.error) { > > > + pr_warn("%s: failed to detect mcontrol triggers\n", __f= unc__); > > > + } else if (!ret.value) { > > > + pr_warn("%s: type 2 triggers not available\n", __func__= ); > > > + } else { > > > + dbtr_total_num =3D ret.value; > > > + dbtr_type =3D RV_DBTR_TRIG_MCONTROL; > > > + goto done; > > > + } > > > + > > > +done: > > > + dbtr_init =3D 1; > > > +} > > > > > + > > > +void hw_breakpoint_pmu_read(struct perf_event *bp) > > > +{ > > > + /* TODO */ > > > +} > > > + > > > +void clear_ptrace_hw_breakpoint(struct task_struct *tsk) > > > +{ > > > + /* TODO */ > > > +} > > > + > > > +void flush_ptrace_hw_breakpoint(struct task_struct *tsk) > > > +{ > > > + /* TODO */ > > > +} > > > > This isn't an RFC, why does it have TODOs? --9Buf9mfA6ccW6Des Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCaZ1bPQAKCRB4tDGHoIJi 0n5nAQDpiu6Vi9GMCaV7UxE0x6rMqnDSBkCTO6wGsAL/WP7HyQD+ICmNuzAKjy55 EC3gXLPhW63Ko/VgYZXsdw+06KTJJwY= =IEkN -----END PGP SIGNATURE----- --9Buf9mfA6ccW6Des--