Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2934334lqz; Wed, 3 Apr 2024 12:51:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8g4zveHdqcA4rqIL15Jxxng99piccA6Boid96agtESom1AeeYlLBjvqoYJJmYnXUn0r1o/5cGECqFGuji7dZttMJ9TjegtZI1SOHvdw== X-Google-Smtp-Source: AGHT+IHQB3GC/F9Y2R1AzcTVdZekzI9VAIY72eKeG1Pp0rlg3tbfpDFCMjc3+R5btaeEHEqWGP+y X-Received: by 2002:a50:d75e:0:b0:56b:986b:b4e7 with SMTP id i30-20020a50d75e000000b0056b986bb4e7mr311430edj.27.1712173888761; Wed, 03 Apr 2024 12:51:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712173888; cv=pass; d=google.com; s=arc-20160816; b=Oll+UDuMeGoMDWtkz6fUU5SmZJRff47qBKWk9m/Lf3QDx/f/a3fA0YWuFNr+3WL8VZ 6HlD34FQajDuQlZhk+vwibDBEVC/xboyWKLGY6bgkv8+1KmzefjmoP20j60s3xNEO3gS PhBFKaZDiozJePftIWBKw3IfEAOKTZfnWnT2nQNEqK1ViHMNGPIt739Xl4Ygb5BqHixX 91bnIQo8fK808zo3wnF9O97lPLjV7vL50yqdxI5VrwC19pgsCC4qi6RiQvVDexSQnASt r9rTFJ3uuVBQ60NUXrNJMMr1dFjMuzRSPhAM9eUWCkin1dPpc8p7PBXpHIp99YeP9CZU GFDw== 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:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1phUTDbfylHa3sQ5MHcHfed+HSDjIxNRONsghxGdFbM=; fh=Vg7un74Kjd9IqloiGonVFEwEy4qdLAWR8AwluAPyMKk=; b=dCI7JHb17+Cjr6/3GsXhjt+Dr78tMn4fK7xkfDB48Ql8/tZrwvIaFp1h8iYjBdBegT ZwuXPUlFLGsl8pBGO90QkJN5SVTqpU9wyhvv3MRimF2R38Iz3VFWWLU2uugJmUlhv72V 3wnJupN65DjKwpzfmGMwN+5P1AQHrZHsOdOWLLf8U+7plxyEU/ir4bLfDs2v/CDsGhLJ rQ/uStLcU4nqBs26kAw8v2eb/NbSk9kiZPbO0P7hiSBnSItytqXLwGc1F5cW7UQL7zk+ +6h7Cbnlm0EHs9BMIfG5/iPIcnUMGi5nb7Si7eXZDfb/EteRjrd0AaY2yaEWhMA0thpX s5KA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bZ6BTSBk; 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-wireless+bounces-5851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h18-20020a056402281200b0056c169a23a1si7028466ede.427.2024.04.03.12.51.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 12:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bZ6BTSBk; 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-wireless+bounces-5851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5851-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 451801F24158 for ; Wed, 3 Apr 2024 19:51:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72439155310; Wed, 3 Apr 2024 19:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bZ6BTSBk" X-Original-To: linux-wireless@vger.kernel.org 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 57D56154BE8 for ; Wed, 3 Apr 2024 19:51:22 +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=1712173884; cv=none; b=NqcxxGRPdgBx/8E6kHpe7AEtx0Et1PyoPkbFKftMUhW3mEM4+QDcuxkcvFE1g3cTcN84sLK8eGGrLAfG0UcEXJwBAUxGXO5CHa7l18KeByn+IADekgw5BYLDNBirNbO4pzW11raFhqWqV1vqysJyM+q9zsJlhciL9xcKLx8zc9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712173884; c=relaxed/simple; bh=RrFf8tgMvkUuSER+/9/+RNfKhDPNUFoP352FLbE8Eps=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=lvx0alpHX4KVNlYIsA6GRg8UWlnD4UpuDDWYhTSqmxs1sHQo/s0w3/7tg9053ka0jsEWn6DM/rz8IC1+43QXgZ1xceyRF11cIM7WEWzHDykTpncVpI3s4UwCuGCd9BI5MkMRr88F+hfzUo8n90KoPw/YZmEqtHxMq1Pinc6EuAc= 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=bZ6BTSBk; 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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 433JKxmv027920; Wed, 3 Apr 2024 19:51:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=1phUTDbfylHa3sQ5MHcHfed+HSDjIxNRONsghxGdFbM=; b=bZ 6BTSBk89i86ekec8U7ZPtut8rJsxxDp1OSdHQivtiy4y4d7TI5TyTCCf9ikzFh2O 3tSSAVbqeQn0sm5LCYpHB87n2vaDh+rGkQ2z5wGaO49d/e5hGOEbnna/hKBe2UHN lbvqHy1NGccb/KM+d1HeENgD6UH4meSz/vfWukk/yBdD3dnlmTKBLA6HzV4dCuqy ddEDD71mxn3S3vOOCC7hbJJpm7r9XyBVTyD8t3XdOOfAh/0mAlSLdoC4tAXQGXrS uw/2rJWXmLp7BZWUpdwUIhFgptjobv5TIx/Sj7M1OH2GeQupH8+kBUDo6dW0eNEc XwkUQyVY6vgRPlSMPVPA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x993u0q8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Apr 2024 19:51:19 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 433JpI2w004799 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 3 Apr 2024 19:51:18 GMT Received: from [10.227.110.203] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 3 Apr 2024 12:51:17 -0700 Message-ID: <335bba80-addd-4443-b67e-d3de114b91ba@quicinc.com> Date: Wed, 3 Apr 2024 12:51:17 -0700 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/13] wifi: mt76: mt7915: add fallback in case of missing precal data Content-Language: en-US To: Felix Fietkau , References: <20240403103032.54823-1-nbd@nbd.name> <20240403103032.54823-11-nbd@nbd.name> From: Jeff Johnson In-Reply-To: <20240403103032.54823-11-nbd@nbd.name> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: wx5Ptr_US_K-9Zb4ed3fpljSmz65W4Cx X-Proofpoint-ORIG-GUID: wx5Ptr_US_K-9Zb4ed3fpljSmz65W4Cx 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-04-03_21,2024-04-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 clxscore=1011 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2404030134 On 4/3/2024 3:30 AM, Felix Fietkau wrote: > When pre-calibration data is missing, do not fail the driver probe. > Instead, just print a warning and fall back to regular calibration. > > Signed-off-by: Felix Fietkau > --- > .../net/wireless/mediatek/mt76/mt7915/eeprom.c | 15 ++++++++++----- > drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- > drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +- > 3 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > index 5fdcbb521ff7..bfdbc15abaa9 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > @@ -28,7 +28,15 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev) > if (!ret) > return ret; > > - return mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", size); > + ret = mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", size); > + if (!ret) > + return ret; > + > + dev_warn(mdev->dev, "missing precal data, size=%d\n", size); > + devm_kfree(mdev->dev, dev->cal); if you are going to devm_kfree the memory for this case, why not also for the mt76_get_of_data_from_mtd() failure case? > + dev->cal = NULL; > + > + return ret; > } > > static int mt7915_check_eeprom(struct mt7915_dev *dev) > @@ -254,10 +262,7 @@ int mt7915_eeprom_init(struct mt7915_dev *dev) > return ret; > } > > - ret = mt7915_eeprom_load_precal(dev); > - if (ret) > - return ret; > - > + mt7915_eeprom_load_precal(dev); if you're not going to check the status, why not make it a void function?