From mboxrd@z Thu Jan 1 00:00:00 1970 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 0C53B1E834B for ; Sun, 28 Dec 2025 00:42:59 +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=1766882581; cv=none; b=mnZCd5ny9tNghJYWTiaFOH9rBqFwk9hdthyWJ6qqVqZ4q/W8DRcT4A1T4s97UXP1YZGNmAgCX613RMD60B5u1H677PyAGUFe8Mz3y4FRCMNZP4a4UuiXX8gWB7M6wMDam3GsMotXIq0ABjPxsnYS7mBXSZGOPLyFNjojsvMHnb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766882581; c=relaxed/simple; bh=I/NRGNwB9UgcD2l6EIAjGQuseMXjDZYSzJ6ijrVYqFI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=H8+OrOR3ReNxcU/ajsYAKcSvVlxqOk3gInk2CYU2Cfe1+UjzmnyqbefZDGs2eoc0zzDxhzX/UFfl9HbcQdGRBy15nY3bZhL4mxlQl1eoO9w0WOQWUl0tLFXiFPZ+2R+rij/sJLb3abA4hfQbbCciszhLi9wPIwkvrd0izmFJ8ws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=cr0pGOdP; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="cr0pGOdP" Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-7900ab67562so17396347b3.0 for ; Sat, 27 Dec 2025 16:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1766882579; x=1767487379; 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=zwhU6tz2IAJuOhbctHFHYJBwk5gc+cswNffBuQKQ3CU=; b=cr0pGOdPyYmNCvkRh2D8Pqhvnr70JqKohViM8o3VCGRSW67IY950R/sZ9W9fvyFLy6 doX0s51KtcMiFWPaCRrsQig1srE2ij2NJ85f0gR7hlYyY0VZ+Vz42R96OatQ2xBUjMns YwrhrudFlHw3oXPPTfTrg9xjQN7hVUT6oKp6vuxlxowg7dop7IWmbNtrEGlbDqN60QYi TMPv5uKTUtMaIOo+UNSsXL1wrdEUue2xB3uG86fqDS5V7kgl7Xo57S8fVhm3XJORmrVB cAkB74xFRz+N/L2dIOl9rch2gFpMV4GZiamr+UCFwV4J64fMD71wLFPN+4yKC0OGoSlu brWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766882579; x=1767487379; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zwhU6tz2IAJuOhbctHFHYJBwk5gc+cswNffBuQKQ3CU=; b=DRKA0oTDhZpRruUHc8+fBPeXRzj4P66FaC8pft2HbUoznOfabceGuDCzFJh8UdqSw6 uE1TE056iHtjfyE5tJLh1DewQCervY7qNjZK5yii3SbNpFkNRrMbG47viR6qj+LTM9Qf 9B6x4cjyS7yml6kxaKtDJYBBFaS75dyN9Kcvo9N9wkiqgboCJs3eR1XYjdMGeu5DWAMH XqSZ7A6Rf75tr/reZ0V9y9uhS2ii8/FJafPqjYP4wuVtrxYQe7DCitoJubdKTq01/X+4 z0QftvLSoWX/oYXYfdjTjW8T9svFoiEt95PUEqn69K80/K4+SvpMHPAiR2mpXqdO10MM WRaA== X-Forwarded-Encrypted: i=1; AJvYcCUnFBs+p9G6JAL/bMzWEt/02CVPQgSEd7lbvfx5kipkYPKpqspqbWW/selGcnQD6hk5boGqkUMbABZzsdg=@vger.kernel.org X-Gm-Message-State: AOJu0YzcFIjWjNLBiw241db9p3IpZv2jr4zljRC/eaEbjtwuGGEXt5Ly WYMcRAdkWRL22JNZhhig/Jehct77mBaue85nYuB65t08PyM+3czq58/DGXd74ezu7pL7OW0DbrW 0XzpBHjrDxey+73OyG52XfSemd9MWTzGYLNvCxJOGCQ== X-Gm-Gg: AY/fxX6BDLoAtHsV3Q105IFQQiYnFQcSpxbL9c+KCFj8tsj71Zzv3qIdXbpxDOsnF05 HQLa3SVbTiWD5EkldorvNFo4JXK+qgT7HxbsHp/fxeLcwrJNl+K1zaYomzoGvQQHoGaGVHmjFuo moNvtT59mVHQynOpBODz1QwUu/SzGcWByo2JoP0yHPOSs/qedIDG8bE5e3t4/wtZiAA1+5dJtKy 78jQtJJtcJUZjtvs4E9vs45muFAaHqx8kVyPioM6Jxt/D7X1BJ+qVXkVqRKnfW6xYlaEnr3GQGh OdSlgRJ0c/448CHCGRBJoe43qm/mdgwtjOjeha8o/f6J9YxzrCz/Uzk= X-Google-Smtp-Source: AGHT+IErlcXBgMih7zxAEH5xWwRllR/TKu/x3r4n41MRYEc1IKi6ZvbVG+UxUtBlusdkfkmh4FvWruwadgCeYqiXZ8Y= X-Received: by 2002:a53:b178:0:b0:644:7712:ed72 with SMTP id 956f58d0204a3-6466a874977mr19597372d50.43.1766882578983; Sat, 27 Dec 2025 16:42:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20251219-i2c-reset-v2-0-ad201a602e74@gmail.com> <20251219-i2c-reset-v2-2-ad201a602e74@gmail.com> <2dmrli7yzznpurg74wet4oidhljjf3csdjly2dwpyvyndhrec3@uc6ke7mep6fv> In-Reply-To: From: Guodong Xu Date: Sun, 28 Dec 2025 08:42:47 +0800 X-Gm-Features: AQt7F2opxPHnMSK_AxzmQeemtfy8x4nXYU2M7Wsw2w8qZ6_eughd9bfR4C5SjDk Message-ID: Subject: Re: [PATCH v2 2/3] i2c: k1: add reset support To: Andi Shyti Cc: Encrow Thorne , Troy Mitchell , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Troy Mitchell , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Andi On Sun, Dec 28, 2025 at 3:26=E2=80=AFAM Andi Shyti = wrote: > > Hi Guodong, > > On Fri, Dec 26, 2025 at 07:38:22AM +0800, Guodong Xu wrote: > > On Fri, Dec 26, 2025 at 5:01=E2=80=AFAM Andi Shyti wrote: > > > > + rst =3D devm_reset_control_get_optional_exclusive_deasserted(= dev, NULL); > > > > + if (IS_ERR(rst)) > > > > + return dev_err_probe(dev, PTR_ERR(rst), > > > > + "failed to acquire deasserted re= set\n"); > > > > > > If this is optional, why are we returning with error? > > > > > > > According to include/linux/reset.h, if the requested reset is not > > specified in the device tree, this function returns NULL instead of > > an error. Therefore, IS_ERR(rst) will only be true for actual > > errors (e.g probe deferral). > > And this is quite obvious, but you haven't answered my qestion. > > Why do we care of internal failures in reset? If reset fails on > an optional reset control function why should we kill our driver? Thanks for the clarification. I see your point now. My reasoning is that if the resets property is explicitly listed in the Device Tree, the driver must respect it. If the property is present but we encounter an error (like -EPROBE_DEFER), ignoring that failure could put the hardware in an undefined or dirty state. > Just ignore the error and move forward as we have done until now. I want to double-check what you mean. I checked other drivers in drivers/i2c/busses (e.g. i2c-riic.c, i2c-mv64xxx= .c, i2c-designware-platdrv.c), and they seem to follow this pattern of returnin= g errors even for optional resets. BR, Guodong > > If the kernel is suffering from internal failures (say ENOMEM), > it will fail anyway or, with some luck, recover. > > Andi