Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp453023lqi; Thu, 7 Mar 2024 02:07:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDxkDoCRlTwljpYv7WB9BAsh0GPGK7tAzvMcjCHKy1PH5mm5kVCUxcdtXTZhbpSYUzIPsNYOiLu5ROTH3UhdtAm3aMpn7inPgYlKHUKA== X-Google-Smtp-Source: AGHT+IEV8iivOZ1b75nsq8gKUA3m5Aoun+dA4+t8j/Gm6EPdILbib+FPO8I0InXWmsafe01jbI3e X-Received: by 2002:a05:6359:4587:b0:17b:b559:2ba3 with SMTP id no7-20020a056359458700b0017bb5592ba3mr8184999rwb.11.1709806057535; Thu, 07 Mar 2024 02:07:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709806057; cv=pass; d=google.com; s=arc-20160816; b=NgHBt2PCpmOtFnHgyBhOezPqr+e9AI0sciv8Vhyujlo8+stNGiCU59MXLWu5NagTbM BPo/MQLgm2UeUV5aPnuykB4hkro78MNM6xVFFQekm0XvInQw9uSSQYZz+niQCYcBmcdN +Me97Wzy9yA4a5m5WZEosr9yVNEV5ZUSjyoMU86Q1q0qUPz//1gbZnOF4vrwEVf7MPGX 47KifCg95Ls/BoUhXiwri3Hwdm0jEEgapALT1MI7VcjMvBuAqbm+GOHogvz213b+2O4i /+NAYdijHEoNnF6iCtwJbEgz0Abuk7wigGwrTW+Dj3gfJpFz0/EPDPahGY+aR6P4c/ab er6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=qyIQAGdttLWJE5dmHv7lEFyOysIlQJZF4NtHIZb++L0=; fh=e39MkECzTNFZnAQqKmugJzOM7fSwrGG353VKeWYhvqE=; b=KQsqi2cTHJnlL6TkbTMMszHW3qI2WoFw/ynVdIWzq30eAujT7//w6QofxGfEnVFjgl VlOJ5Am0nJ+azw3rKJMchAigZvnCd2E5vvPKoWUVz9OZq1hTRpnEtfXRJnXR62fY2EB9 7oCtkhqtpsEIjMPlq2i3o16yyWwanxBCmmlumP7J9ce8+W/F+N5MZtyL4uvO/gWW75yP pmRwtmTu7GiciuiSPXk0fr+4C7gZIrJPkc934sx17LkWQZPtkeGffLF6Pm1ECIRep/mG UJ/aAIEFnQ15fr9pdlyLMTbSLVkLKcKEzttD4bsl7bJAU+/6qmfXFwp7Q5Q+wH1poGRZ LFjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XQtsZgcJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-95294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gw2-20020a0562140f0200b0068f5ba650bdsi16504534qvb.238.2024.03.07.02.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 02:07:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XQtsZgcJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-95294-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 077ED1C22EC4 for ; Thu, 7 Mar 2024 10:07:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D897B1292DC; Thu, 7 Mar 2024 10:03:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="XQtsZgcJ" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 7FB70127B69; Thu, 7 Mar 2024 10:03:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805796; cv=none; b=dlZ2drj3siaDlWrj8DhliA4BXNgrbFKzGJ6lQ/RoQyLbEQidovxCDbdzAs6o8Ec7YVVEKEJtcJw3RNxdKP6LLKFslfkrNlkMvjY/JHbl1wIcC43MwNOjhrOJKuU6bT0cLtT9GRWHU7/kJgphUxznJ44SOdJvBXavB+HmCUMR+iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709805796; c=relaxed/simple; bh=zJyo4bnZGLxCdnY9Pzpotz8jl2H6vBOxOn7RieSQHoI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=sHvXvMHu/6T15F1wFtarzkk1znOc2gTtLVzeg4jRpwzeD22bpRe24sxSLEFqsAf2F4zcNWCgFSMY9GtGcIVd+75Oc18YfIuBoaqQXsNQndqRMO6o0AY0dd1Td+3HPPl9QtnfDnJf3I9+lijktbTJtPhxvcSk+N4+6fnAAGINxNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=XQtsZgcJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4279PBub030562; Thu, 7 Mar 2024 10:03:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=qyIQAGdttLWJE5dmHv7lEFyOysIlQJZF4NtHIZb++L0=; b=XQ tsZgcJCnZCI7yv/QAViXLFGkSJP2iVEhQNWRkSRtvlLanl9rZMcwcCKY4uErZCJ/ +KfoEeI+3i+j1CTGS5931hqqiAeF+pgAS6xuNCrnOKKIqg476jIVp9PTdU/Eta8/ Cw+y5iCqafvS0vnptXop+Om7iTVeIdx6QUMLDU9niPNSUyglPvnvajieWhYUzrpB 5IJWj0N15xAikZcbDh8ZgrUEAXkqbt0SBU0SRDqzxU9/NgLq+uUETaIGkw4qW0oG FYBwFfM2to9ILH8/+cm1LwTrPnqV9SjmvOQRewstu0PfIyG68++3ZVMLl277Giwa RqiIyDUA/Bct/4b7QAew== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wqaxd02m5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Mar 2024 10:03:10 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 427A3Axv018481 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 7 Mar 2024 10:03:10 GMT Received: from [10.216.46.193] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 7 Mar 2024 02:03:04 -0800 Message-ID: <9769c51f-a672-4ec9-b1c8-d8022f1988f5@quicinc.com> Date: Thu, 7 Mar 2024 15:32:59 +0530 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 v1] i2c: i2c-qcom-geni: Parse Error correctly in i2c GSI mode Content-Language: en-US To: Andi Shyti CC: , , , , , , , , References: <20240301112638.990045-1-quic_msavaliy@quicinc.com> <2wala6lz4vanhvfx6jtpdexnpohabuvhzt4i7kt2xvmlfrapq4@tmvl37npj7jy> From: Mukesh Kumar Savaliya In-Reply-To: <2wala6lz4vanhvfx6jtpdexnpohabuvhzt4i7kt2xvmlfrapq4@tmvl37npj7jy> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: LFmIAbC4mhK5uPI_FFbzuPwYzrryFWn3 X-Proofpoint-ORIG-GUID: LFmIAbC4mhK5uPI_FFbzuPwYzrryFWn3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-07_06,2024-03-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403070073 On 3/2/2024 12:14 AM, Andi Shyti wrote: > Hi Mukesh, > > (I'm sorry for the noise but my mail server has marked this mail > as spam and put the spam tag in front of the subject. Therefore, > my reply might have been marked as spam.) > > I'm going to send a new e-mail with the old answers. > Sure, no problem. Sorry for the late reply. > On Fri, Mar 01, 2024 at 04:56:38PM +0530, Mukesh Kumar Savaliya wrote: >> we are seeing protocol errors like NACK as transfer failure but > > /we/We/ > Done >> ideally it should report exact error like NACK, BUS_PROTO or ARB_LOST. >> >> Hence we are adding such error support in GSI mode and reporting it >> accordingly by adding respective error logs. >> >> geni_i2c_gpi_xfer() needed to allocate heap based memory instead of > > Please use the imperative form. > Thanks. New patch uploaded which doesn't need memory allocation dynamically. >> stack memory to handle and store the geni_i2c_dev handle. >> >> Copy event status from GSI driver to the i2c device status and parse >> error when callback comes from gsi driver to the i2c driver. In the >> gpi.c, we need to store callback param into i2c config data structure >> so that inside the i2c driver, we can check what exactly the error is >> and parse it accordingly. >> >> Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") > > What bug are you fixing here? The description doesn't talk about > fixes rather than support added. > Updated commit log in a latest patch. Basically we are getting simple transfer error which ideally should be NACK error. This happens while running scan test for devices. > ... > >> - config.peripheral_config = &peripheral; >> - config.peripheral_size = sizeof(peripheral); >> + peripheral = devm_kzalloc(gi2c->se.dev, sizeof(*peripheral), GFP_KERNEL); >> + if (!peripheral) >> + return -ENOMEM; > > This is a massive leak. Why are you deciding to make the > allocation dynamic? > Agree, It's a memory leak. Thanks for catching BUG. Considered other approach which doesn't need new structure and dynamic memory allocation. > Thanks, > Andi >