From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.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 74C7F2E88AE for ; Fri, 6 Feb 2026 10:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770372384; cv=none; b=HjokKbQAuNZNcCGlbbTyX0lXoaoVPjZHdowI/ZH3Wp4lmuC5+MyLax58DCflPsMhWiG0CE7xL7pWTRhuRtSvPxxQ0A4ywE6FDs51xz10qNjdWWumquyhCgUqLBw5XFkRlhPuO2PNtoiEMmRvY3LVp0rVDG6Etb6haeqqpIUrohA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770372384; c=relaxed/simple; bh=XwRCkcfM+4+oYjL+NXA+SsT26tupvieIfp7i+FX7i28=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=UtFLHh6GfL/il7Inr+LvvwOkXH8BAVXDEaNhUw/+5fBETyPgBSOKyTW1C4qZNunoXwXZuscARnTYllaW+s+1QFi0A/cZu1iQMpun8tRnhIdCdv42vzEiQjo9j+UJ5Fv7UAaO1EqvUFEYUaC4Toc4iXE+Ekko6765cjMlyIa+X+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joonwonkang.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=on47QQVW; arc=none smtp.client-ip=209.85.214.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--joonwonkang.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="on47QQVW" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2a7701b6328so54961885ad.2 for ; Fri, 06 Feb 2026 02:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770372384; x=1770977184; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=XwRCkcfM+4+oYjL+NXA+SsT26tupvieIfp7i+FX7i28=; b=on47QQVWOO9/rKbzyoubHrTUHF/2N0svA9/oqNxo9qOJXdXzuEWRNVhwx/OH9rq8KG rqNAdoNfKEQeUeC1ve8JnGFdhgiZ/xb79lCZhtl5Vws/ms605bm7a/ohf9tXiuhBMIJL omjNlGqIfOJG6F/17IXyioHtMJYRJP4IkE3i0uvklifhOxSSnKAuvaLUNlfeMbSXN6m+ Sjt1Nf7FSGJ3SqlsdyHk13hXFQ8h6GddfbeV7RGpbWSj+F9cjeYrT6vrwwTMV4lafM9W MGPyTRp+1LHpYFsm239uW0/fwVo2PqTHlmktup2J6uObPXW/1tfN5kBghJcq62KQQkwL ShkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770372384; x=1770977184; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XwRCkcfM+4+oYjL+NXA+SsT26tupvieIfp7i+FX7i28=; b=iP3RI0CZ1JfH5/fU7EOhoMOVaW/tYO8MX6D1Q4J8/pwVj/4+MCrpulkr+CmEWB/rRJ 1pEMOvgOs/sbgeDmoXGWE6R+TvdpQ8Wx5ZVhcKsHfx4P1JK6tt/6Z++8+V2WnUKhyupc +qwev37eYwN5NkGLvHQcbDJN45aZTWz0wv1LvcccFljvVtKttSmawiI7bUHIWMojMRGr i5IAc1zvBQcN6iRLHKi3YtGJs6ggaM6/shA+peOhDpJ8XAUw8gp2+Uj/OitLUODZ6SU2 bQhq86BJeUztdFaXBlzJBTQ22Esc/7VaFg8QNDjF23bDstvI0UsqPfgml8ZsIX4ww23m c0rA== X-Forwarded-Encrypted: i=1; AJvYcCXxJqQw8qW5Iz0XfRRggfierS3z3pf7g5e8zgFTMrRtpDQT7A9TcrHhdgBGJBc2QqGpToQm5fDOuIYQGHY=@vger.kernel.org X-Gm-Message-State: AOJu0YyuEROn9qiTftIPFvKrZCNp8Rwv7yiJLoWIMtyI8bTrcYu76M8e uak1eSJDeBxXEf0jdsU0/2fWSiOZTUGTmQu+XeLk4CKwYpt5EgwW2c+bjogAYLNvyc1W1yerBf1 vSDtvR9udcGduRp19hSY3H3XGgg== X-Received: from plbja17.prod.google.com ([2002:a17:902:efd1:b0:29f:1bbb:de14]) (user=joonwonkang job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2448:b0:298:2afa:796d with SMTP id d9443c01a7336-2a951a02e0fmr22236495ad.61.1770372383805; Fri, 06 Feb 2026 02:06:23 -0800 (PST) Date: Fri, 6 Feb 2026 10:06:22 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.53.0.rc2.204.g2597b5adb4-goog Message-ID: <20260206100622.4166528-1-joonwonkang@google.com> Subject: Re: [PATCH 2/2 RESEND] mailbox: Make mbox_send_message() return error From: Joonwon Kang To: jassisinghbrar@gmail.com Cc: joonwonkang@google.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, lee@kernel.org Content-Type: text/plain; charset="UTF-8" > > Previously, when the mailbox controller failed transmitting message, the > > error code was only passed to the client's tx done handler and not to > > mbox_send_message(). For this reason, the function could return a false > > success. This commit resolves the issue by introducing the tx status and > > checking it before mbox_send_message() returns. > > > A client submitted the message, and that client gets the actual > status. mbox_send_message does not (can not) tell if the message was > successfully sent or not. For example, consider non-blocking mode when > mbox_send_message() immediately returns after simply placing the > message in the fifo. It returns 0, but still the message transmission > may fail when its turn comes. So I think it is fine as is. When it comes to non-blocking send function, the common expectation is that users of the function do not expect the final send result in its return value of the non-blocking function. And it makes sense for users to register a callback to collect the final send result. It is a common practice for non- blocking function. For blocking send function, however, it will be quite unexpected behavior if the blocking send function returns no error code but it actually has failed. Also, it will be uncommon if users of the blocking send function have to register additional callback just to collect the final send result. If that is the case, the blocking function requires of users both blocking and callback, which is redundant. Overall, I think it will be better if we return error code in blocking mode if it has actually failed transmiting the request. How do you think?