From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 08FA13D47C5 for ; Fri, 5 Jun 2026 05:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780638792; cv=none; b=KOTesni+8tKPTgT1EuGEoeunhBX7QtarZnzBq6n5fl2QBgKspQ9XiLgzXjeY6o4/EtyDwuIC1UVGc0+/Vt8vIbq4nnLrxcnpoV5Pu9Lt3mamomXaNbDUWmJ7BNwkvcfLTyty4oyfThD92APSssGD3N94hZJ5IXCftlhauNlCS2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780638792; c=relaxed/simple; bh=oM5tbTUmqZhOv7RleMhmgKJFWIU/VH2CRz6vFmk4EdE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qvE05PYb/CuBrqGy0dFfAaxedQ8wQUx/LsCedZWe5+V7V7u+UYt7JoyCDiW3FBxeRbv+21j+DwbesYQEtuATT38Umc1wrvPUSg3i8EAHl4Ds9s3jm1ZC3rY+DgyFimKNlHHr5G0ZzbK28b4EjPj/Hpb407Dv2BqB0I6voQb1Z6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OtMVVztP; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OtMVVztP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780638791; x=1812174791; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=oM5tbTUmqZhOv7RleMhmgKJFWIU/VH2CRz6vFmk4EdE=; b=OtMVVztPmhytJIzS5SXBevqbFX4mLsh/plJ2/E1BAtvmZKHlDMYdKTeo 8UdGLxMDAAsIzF7MHmS7rqBP6FIhTHAj6BT4dS/rAYfe2LDkdYKIrdoI5 krqAdP5+dmW2j4Giczt56Bmuqaz40v7QiMtH5BDvW6mOI58d/jVkqMCsh uxBbkU6no49I12Rjlhys5ouVY03NBMYZiHgItZi5c+LPeoPgv8QLQPPIh ytvfQHePPeGxKWUcaqAlx5QySw4BBEIqnLEUkuXIn54KYe22ITzK4yYks MYBDJgwt0TMP45gtFOii/H2CcQQqTIU5Bd4SSF8fnDsnng7nl0Lsok01r A==; X-CSE-ConnectionGUID: 6cOr05eoTAmkIG+AzHy/4g== X-CSE-MsgGUID: G5Bfzj5fTNu4vauyX7pYtw== X-IronPort-AV: E=McAfee;i="6800,10657,11807"; a="80608263" X-IronPort-AV: E=Sophos;i="6.24,188,1774335600"; d="scan'208";a="80608263" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2026 22:53:10 -0700 X-CSE-ConnectionGUID: KCriVMHfTj2OHm9MHPFcAg== X-CSE-MsgGUID: p06IA1HjTlCLau18uhzRHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,188,1774335600"; d="scan'208";a="240569851" Received: from ettammin-mobl2.ger.corp.intel.com (HELO localhost) ([10.245.245.178]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2026 22:53:07 -0700 Date: Fri, 5 Jun 2026 08:53:05 +0300 From: Andy Shevchenko To: Bitterblue Smith Cc: Minu Jin , gregkh@linuxfoundation.org, dan.carpenter@linaro.org, abrahamadekunle50@gmail.com, zxcv2569763104@gmail.com, milospuric856@gmail.com, karanja99erick@gmail.com, weibu@redadmin.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 0/2] staging: rtl8723bs: Fix error handling in _rtw_pktfile_read() Message-ID: References: <20260127153811.1592900-1-s9430939@naver.com> <853404cd-cd0d-4562-82bf-2272240df785@gmail.com> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <853404cd-cd0d-4562-82bf-2272240df785@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Jun 05, 2026 at 12:47:59AM +0300, Bitterblue Smith wrote: > On 03/06/2026 17:06, Andy Shevchenko wrote: > > On Wed, Jun 03, 2026 at 04:40:45PM +0300, Bitterblue Smith wrote: > >> On 03/06/2026 03:48, Andy Shevchenko wrote: > >>> On Sun, May 24, 2026 at 09:30:01PM +0300, Bitterblue Smith wrote: > >>>> On 27/01/2026 17:38, Minu Jin wrote: > >>>>> This series improves error handling in _rtw_pktfile_read() and cleans up > >>>>> the code style to comply with kernel standards. > >>>>> > >>>>> 1. The first patch combines the logic change and caller updates. > >>>>> The function change and the caller updates must be in the same > >>>>> patch. If they are separated, the code will not work correctly > >>>>> or will cause errors at that specific point in the history. > >>>>> > >>>>> 2. The second patch focuses purely on code style cleanup (changing uint > >>>>> to unsigned int) as requested by Andy Shevchenko. > >>>>> > >>>>> Regarding the logic change in _rtw_pktfile_read(): > >>>>> > >>>>> The original code used a ternary operator to read whatever data was > >>>>> available, even if it was less than requested. This could lead to > >>>>> callers processing incomplete data without knowing it. > >>>>> > >>>>> I have changed this to return -EINVAL when the remaining data is insufficient. > >>>>> This is safer because most callers expect the exact amount of data and > >>>>> should not proceed with a partial read. > >>>>> > >>>>> Testing and Verification: > >>>>> > >>>>> I do not have access to the physical RTL8723BS hardware. However, I have > >>>>> performed a rigorous manual audit of the data path and verified the > >>>>> changes using Smatch static analysis. The analysis confirmed that no > >>>>> new warnings or logical regressions were introduced in the modified files. > >>>> > >>>> I have some bad news: > >>>> > >>>> https://bbs.archlinux.org/viewtopic.php?id=313401 > >>> > >>> It's unclear that this patch made it happen. See below. > >> > >> It looks pretty clear to me, but okay. I forwarded your request for bisection. > > > > I don't know how it does. There is no information about from which kernel one > > upgrades to which. I assumed someone bumps from v7.0 to v7.0.3, but there no > > such patch. If we take v6.19..v7.0.3 range, there are dozens of patches. > > > > I.o.w. it is semi-poorly written bug report: some of useful information and > > some crucial that is missing... > > > > The new message "coalesce failed with error -22" is printed when > rtw_xmitframe_coalesce() returns -EINVAL. This is the only recent patch > which touched rtw_xmitframe_coalesce(). Fair enough. The quick fix is to replace return -EINVAL; with rlen = rtw_remainder_len(pfile); in drivers/staging/rtl8723bs/os_dep/xmit_linux.c::_rtw_pktfile_read(). There might be a better fix to understand why the requested length in that case is bigger than remainder in the device. > >>>> [quote] > >>>> > >>>> I recently upgraded my system, and now I’m having a strange issue with my > >>>> WiFi (Realtek RTL8723BS). > >>>> > >>>> now I can no longer connect to any WiFi networks as a client. however, > >>>> creating an Access Point (AP) still works fine, but whenever I try to connect > >>>> to an existing network, the connection fails. > >>>> > >>>> dmesg logs: > >>>> Every time I attempt a connection, dmesg gets spammed with this error: > >>>> > >>>> [ 1083.925640] rtl8723bs mmc0:0001:1 wlan0: xmit_xmitframes: coalesce failed with error -22 > >>>> [ 1084.921217] rtl8723bs mmc0:0001:1 wlan0: xmit_xmitframes: coalesce failed with error -22 > >>>> [ 1085.921434] rtl8723bs mmc0:0001:1 wlan0: xmit_xmitframes: coalesce failed with error -22 > >>>> [ 1086.922320] rtl8723bs mmc0:0001:1 wlan0: xmit_xmitframes: coalesce failed with error -22 > >>>> .... > >>>> > >>>> Has anyone encountered this specific "coalesce" error with the rtl8723bs > >>>> driver? I'm looking for advice on whether this is a known bug in recent > >>>> kernels or if there's a specific module parameter I should try to bypass > >>>> this. > >>>> > >>>> System Info: > >>>> > >>>> Chipset: RTL8723BS (SDIO) > >>>> > >>>> Kernel version: 7.0.3-zen1-2-zen > >>>> > >>>> update: I fixed the issue after kernel downgrade > >>>> > >>>> [/quote] > >>> > >>> That guy should bisect and find the culprit. It will help a lot to understand > >>> what's going on. -- With Best Regards, Andy Shevchenko