From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 148712FD7A3 for ; Fri, 19 Dec 2025 10:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766141262; cv=none; b=np0PJUYoeYNWW3nfz32IdwvWSF5AjwZc1+S5xwgpx7rqrYluLJovRAIwsRYR+boAKCJIciHJ0qbGa9frddXbeGtzntots5JpCxwH7rhhBrfo3p6iAKHigGYhxQrnu/4tFW5mvlkJ4c1/G9VSnvJ6eEa9KmViEsj7SX3w0RtLnSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766141262; c=relaxed/simple; bh=jcSLquhQd9vs3yycLTlkV962wYyg0ao0gWX1c4mC+3s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UNeDrz3SkOxST3+CPkK5fQfsP5+va2lSa+XeeGjNVRaBxkUactFEp6Cmw3Pr3BsUX6FexPOuKolDJWVAJCRKKCLwYYLFBBkt3fvDoSxcCu83U5vr1wUsf2GUmiabhReynUPN60f7SK+MvVsO/EIUfbltCJvPeUW+IIOMekVEhf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YshFO/DK; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=W85dJSdC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YshFO/DK"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="W85dJSdC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766141259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ohuBcRpV8beJcWGlYizxYN54dm2bkbetXdev9n84fy4=; b=YshFO/DKiy9AbFNrPQik6amngc68vAJyBqAW/ZlTD9Fy9YdKsmJaxjJH0JAhz+S17GIiSx B0pZEalSsJnozKH6XttLzEgFwk3UxWaIA3yeqk0w7rr2FnxvcvYoWqix5LTPb8xKrLqRAt NRbADj9NT6nMTzM/AtlwvxgRkpR78Nw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-9qOvYI0SOKuQgd8Ri22mgw-1; Fri, 19 Dec 2025 05:47:38 -0500 X-MC-Unique: 9qOvYI0SOKuQgd8Ri22mgw-1 X-Mimecast-MFC-AGG-ID: 9qOvYI0SOKuQgd8Ri22mgw_1766141257 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-477c49f273fso20609955e9.3 for ; Fri, 19 Dec 2025 02:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766141257; x=1766746057; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ohuBcRpV8beJcWGlYizxYN54dm2bkbetXdev9n84fy4=; b=W85dJSdCdFD6JVFUmAqhLnihdvGPpZ4tMn7CDu137xrdRcOk7Bph5Sv3i66Ciy9iQF PiCjgcDoHKhf13Dj5NBdMrTRa6EVK5Y1kW65Tlhij1Va+58pSb/8gnC5Rs0jpacQb00B Qmn7oCc+yVccaVHI4tcZ5n3w9irw6NGPrBJPTFPXrauu6QeZCTw0CEeZlhOV6Pv7uoA5 uBBhb3wSThhsjUIq+kbnzKbDiahCJAfSV1aBnBvsKDOzlRbSSvIhVCRVOospUFRTVKgG O/nrY5d8XqbbUb1HB431lr1BXg/Cru88EWSAlpMyDjwOqS5uRFh27wKIxdV3f/T6cY8T eYMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766141257; x=1766746057; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ohuBcRpV8beJcWGlYizxYN54dm2bkbetXdev9n84fy4=; b=paH1qvQFV/gmNQ6WxH0H3lUbMb2ZGVzBURkYCCLvSUFY0HxHilt/hTrzuDEpG5UWOE 06CRSJeRTIcM3N/zo9hs7UMEKuIhgpmtorbpT6NqJuDzj6zU5fO2sbxmk841R64qCFoe 3t8vbfVOOn7ZNwTaI2sECxDH/QOyB/wVH6aKEYk4nHGmgrwZ9eJGdb4VW4H9AU1L4Yuj XkqDYtq++eeYpV3XK8DWELF1DAEJbHD8R6Hh29WPGfDKrGKqITWbBc5E3j8voSvE5LdP yBQsOC8uQ0ih31XiVQ3wF7Krv6SsppjuQO9tSprskJp4PzqQ/1h+NR9tIXTDBlgpGD5Z qTlQ== X-Forwarded-Encrypted: i=1; AJvYcCUmqC86YP7PShGqQOS8+OAONyE7jkWfhPzgIB4qPADpBNh7fHrvWH+iNvlFRriBh8D7Iiu7zyKDsYW8F7M=@vger.kernel.org X-Gm-Message-State: AOJu0YxrJflOeXIhKrc/eKADeUUP3zJ7yHzFiIRVR0yhsHyGVYcqnoRC iPTk/Zqvj3799tR3s23sMR6K+NIPthkLowf1b6fQeeoRmjhfRZt+e6JMLcCxtUYxrQG1SqVxMqQ mXwAweHR2/clsfUxNafEIrfxqyQO1sm8HJQa7fAO2UipFKml3bBusfm53YnyRJ1ZRaA== X-Gm-Gg: AY/fxX6hz+R5kO41lq2NVa/WvLompcZTd8R1RSKZFb7AIIkhaj7vk+xvpyiVfrZT2F9 9D9BKne6x5hbvwMEtUyeA19gzqy5soVDWDvDdniJYOy5b+q48wJRvkTVmLIVD7HvCz5Q1o7qI1T ADFbj0MuZF/kq2LMv1Y9cGu/RgJ+pMVjXHMZBQGU5sBR+kwngsZ1q/JyZkPaJD1C9oTj9S7YVrF GknN0hx6YI6mJOoUlTrtcQRRMhuNMHp1WmJCIWWcH2RHqtyGjOBJbMPtg8V6Odscbr9l9AVBqJU XSReagnRoVDxXSmiNdWKwIMrLsEOHBCqwxJy/cv73AvhkfJhNMarCjvfMkayhq762WLYvvblFDb vIaWYZEM06Su+ X-Received: by 2002:a05:600c:6812:b0:477:63b5:7148 with SMTP id 5b1f17b1804b1-47d1955b97cmr21387355e9.6.1766141252213; Fri, 19 Dec 2025 02:47:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0haeKdz6e1wVUfU68PetlUVJ262uD0U3xuzOT7CFHMjUWuxjHWC2bHGvwH3+5rKwg5RCnYg== X-Received: by 2002:a05:600c:6812:b0:477:63b5:7148 with SMTP id 5b1f17b1804b1-47d1955b97cmr21387045e9.6.1766141251798; Fri, 19 Dec 2025 02:47:31 -0800 (PST) Received: from [192.168.88.32] ([216.128.11.227]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47be273f147sm92155575e9.7.2025.12.19.02.47.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Dec 2025 02:47:31 -0800 (PST) Message-ID: Date: Fri, 19 Dec 2025 11:47:28 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] net: qrtr: Drop the MHI auto_queue feature for IPCR DL channels To: manivannan.sadhasivam@oss.qualcomm.com, Jeff Hugo , Carl Vanderlip , Oded Gabbay , Manivannan Sadhasivam , Jeff Johnson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Simon Horman , Greg Kroah-Hartman , Loic Poulain , Maxim Kochetkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, netdev@vger.kernel.org, Bjorn Andersson , Johan Hovold , Chris Lew , stable@vger.kernel.org References: <20251218-qrtr-fix-v2-0-c7499bfcfbe0@oss.qualcomm.com> <20251218-qrtr-fix-v2-1-c7499bfcfbe0@oss.qualcomm.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20251218-qrtr-fix-v2-1-c7499bfcfbe0@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/18/25 5:51 PM, Manivannan Sadhasivam via B4 Relay wrote: > From: Manivannan Sadhasivam > > MHI stack offers the 'auto_queue' feature, which allows the MHI stack to > auto queue the buffers for the RX path (DL channel). Though this feature > simplifies the client driver design, it introduces race between the client > drivers and the MHI stack. For instance, with auto_queue, the 'dl_callback' > for the DL channel may get called before the client driver is fully probed. > This means, by the time the dl_callback gets called, the client driver's > structures might not be initialized, leading to NULL ptr dereference. > > Currently, the drivers have to workaround this issue by initializing the > internal structures before calling mhi_prepare_for_transfer_autoqueue(). > But even so, there is a chance that the client driver's internal code path > may call the MHI queue APIs before mhi_prepare_for_transfer_autoqueue() is > called, leading to similar NULL ptr dereference. This issue has been > reported on the Qcom X1E80100 CRD machines affecting boot. > > So to properly fix all these races, drop the MHI 'auto_queue' feature > altogether and let the client driver (QRTR) manage the RX buffers manually. > In the QRTR driver, queue the RX buffers based on the ring length during > probe and recycle the buffers in 'dl_callback' once they are consumed. This > also warrants removing the setting of 'auto_queue' flag from controller > drivers. > > Currently, this 'auto_queue' feature is only enabled for IPCR DL channel. > So only the QRTR client driver requires the modification. > > Fixes: 227fee5fc99e ("bus: mhi: core: Add an API for auto queueing buffers for DL channel") > Fixes: 68a838b84eff ("net: qrtr: start MHI channel after endpoit creation") > Reported-by: Johan Hovold > Closes: https://lore.kernel.org/linux-arm-msm/ZyTtVdkCCES0lkl4@hovoldconsulting.com > Suggested-by: Chris Lew > Acked-by: Jeff Johnson # drivers/net/wireless/ath/... > Cc: stable@vger.kernel.org > Signed-off-by: Manivannan Sadhasivam For net/... Acked-by: Paolo Abeni even if I don't see anything network specific there. /P