From patchwork Tue Dec 5 23:05:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13480861 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gr/ak7Rf" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF33109 for ; Tue, 5 Dec 2023 15:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701817517; 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=g9g0AqQltjx9HVi2PVmhYskrOtwbSdqnOJIb+sPsbDU=; b=Gr/ak7RfTzJXIw0ZA+ZvHAcw42TQe3kEaR3jft156DdaFQCRLEz2WHc7tNEAby92jmYzgh zp6rdPLy7QrBOgPMYLJIzsjNi3Q7LS3yI3rmTiV7/rh2AXNTClOXFJYzdOqA73UgvlOfq9 yMEWl34USXC1XmaA4lY1ZyJZUKzBlUM= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-Zx1pwjlXN0a1akbniN_-tw-1; Tue, 05 Dec 2023 18:05:13 -0500 X-MC-Unique: Zx1pwjlXN0a1akbniN_-tw-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-423f4f5f586so2436141cf.0 for ; Tue, 05 Dec 2023 15:05:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701817513; x=1702422313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g9g0AqQltjx9HVi2PVmhYskrOtwbSdqnOJIb+sPsbDU=; b=axqoE6NsDCaUIB0pRRXFi0O9QsX6IAtikBHan24C/9aI8sk37x9lfDLp8NS0lFmKrC thmbIA9DdqBCSTV0xcx6EGtJ99VASEY8gyXG049gAdY3eKJ45RipLJP1lcp3xPyOD9eQ xSIa8WfXHBzq+mFcxYiBs7+DH9GeSw5ks8JSSF8UzR5ILXXMyzknY//8MSlrjmPRIid3 jPOUZ5O5bin6j27JA8efMCXB636jAWujXeqXQrs/XFUOPuFECYsprZ7b/kTeI2+X8GCQ mahsrwoTbZZq/9P5j/MYJu0lyCzAiDkqiRpGv+iX/BboSnQ55wt22T+gMw9tzIfWM4SS kwqQ== X-Gm-Message-State: AOJu0YzYwcW8vejj+n6RofMxu8pad9HTeOHblPXEFyM02CrBu72/dtxB Sy1o0s4mEuV/mJMi8Ophl/Ul2t8RSHYe+HetX7kil1suNa3LISg3sl3OhC5wjoeirFydclOq4gz gsFmpz2Rx8yI7EoyLSaadquouwA== X-Received: by 2002:ac8:7d8c:0:b0:425:4043:5f1b with SMTP id c12-20020ac87d8c000000b0042540435f1bmr2507690qtd.89.1701817513291; Tue, 05 Dec 2023 15:05:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjtHacZ3EDCaJIyW6TtCHW6exbpgEh/YaVRvf97hFBjQsptkQMAzP6q1I3JbKbcJd7uc8Aqg== X-Received: by 2002:ac8:7d8c:0:b0:425:4043:5f1b with SMTP id c12-20020ac87d8c000000b0042540435f1bmr2507679qtd.89.1701817513069; Tue, 05 Dec 2023 15:05:13 -0800 (PST) Received: from [192.168.1.164] ([2600:1700:1ff0:d0e0::47]) by smtp.gmail.com with ESMTPSA id df15-20020a05622a0ecf00b00423da75b0f4sm5504430qtb.71.2023.12.05.15.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 15:05:11 -0800 (PST) From: Andrew Halaney Date: Tue, 05 Dec 2023 17:05:09 -0600 Subject: [PATCH 1/3] soc: qcom: pmic_pdcharger_ulog: Search current directory for headers Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231205-pmicpdcharger-ulog-fixups-v1-1-71c95162cb84@redhat.com> References: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> In-Reply-To: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 As specified in samples/trace_events/Makefile: If you include a trace header outside of include/trace/events then the file that does the #define CREATE_TRACE_POINTS must have that tracer file in its main search path. This is because define_trace.h will include it, and must be able to find it from the include/trace directory. Without this the following compilation error is seen: CC drivers/soc/qcom/pmic_pdcharger_ulog.o In file included from drivers/soc/qcom/pmic_pdcharger_ulog.h:36, from drivers/soc/qcom/pmic_pdcharger_ulog.c:15: ./include/trace/define_trace.h:95:42: fatal error: ./pmic_pdcharger_ulog.h: No such file or directory 95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ^ compilation terminated. Fixes: 086fdb48bc65 ("soc: qcom: add ADSP PDCharger ULOG driver") Signed-off-by: Andrew Halaney Reviewed-by: Neil Armstrong --- drivers/soc/qcom/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 110108e23669..05b3d54e8dc9 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink.o obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink_altmode.o obj-$(CONFIG_QCOM_PMIC_PDCHARGER_ULOG) += pmic_pdcharger_ulog.o +CFLAGS_pmic_pdcharger_ulog.o := -I$(src) obj-$(CONFIG_QCOM_QMI_HELPERS) += qmi_helpers.o qmi_helpers-y += qmi_encdec.o qmi_interface.o obj-$(CONFIG_QCOM_RAMP_CTRL) += ramp_controller.o From patchwork Tue Dec 5 23:05:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13480868 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WVMlxF7G" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B35120 for ; Tue, 5 Dec 2023 15:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701817816; 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=zI2EQGzuy4/i38sKyTTPT4IeppHHa6FP6X9uU+Zh4lQ=; b=WVMlxF7GfcUGrnIugATVYJNl9u/bL7ewEK4eMa6YXkJqhSFgStrMFBMsCPY+NlWG0mXRbv iaFBA2i3pqqwNHejISzx8hh2fIwmY7ou5ytSsn1tdG9R52/3eEohGBK37IEoWABh4pvuRl kwbWl8WwmQLhbfWeq/sRqB27Vx6UA+s= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-KPE9UeTtNDeojrkU6GQAzw-1; Tue, 05 Dec 2023 18:10:15 -0500 X-MC-Unique: KPE9UeTtNDeojrkU6GQAzw-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-4254d3c7d5dso1998531cf.2 for ; Tue, 05 Dec 2023 15:10:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701817514; x=1702422314; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zI2EQGzuy4/i38sKyTTPT4IeppHHa6FP6X9uU+Zh4lQ=; b=VARckVHEZCqsTNGqYnv4C8YHmDuAswAFbbsnK9h6YjVV9UKH7p2PbwBknEoTuBlx0K sBgm1WOgHWTw5Lapcju21wbP8mDZffmp0wwHWAwR0HIgoCsY4Tg2qYb9Emf+25Q9NDaj ts1nDxiKnBRBdOKaV7VG+zg2GxvnhX71hjTVaC9h4ntM/Loqwo52gcdCFZc+gdm6wcd9 oQ+s9r+/GJRA9BHPXadY2itv10KSrrgkNOvOf1nCkWgel6R3kEYrQZbi74MvfbMY3K3G mjnfYUF1aKDvJ+fwNR8MnhHt+CYENMKdJri+R0GbFXxuFrOj6hz/ajBKMG1Lg4ix6xos WJVQ== X-Gm-Message-State: AOJu0YyoJeFLO3v9yTQN6Yfx4tcMRechgYQqwpc0wOwecro+Q8S7wGOU PqvKJAI3Iyph1BGgsLcSMOzml22BfUICen3YCHMdHmszm6tbgDhK+VmKCxPN0RKjaVyLhOnTnNB nKiMLqllItSAdp7ZInXfg1zVAVA== X-Received: by 2002:a05:622a:86:b0:425:4043:29f0 with SMTP id o6-20020a05622a008600b00425404329f0mr2448051qtw.107.1701817514113; Tue, 05 Dec 2023 15:05:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUSJuhRYxsGAPkig1kIfC+X2795y9odDvO7Hg/W6OVnwyPHPYbjuRFxQWNgF7b5jamRX1D4w== X-Received: by 2002:a05:622a:86:b0:425:4043:29f0 with SMTP id o6-20020a05622a008600b00425404329f0mr2448032qtw.107.1701817513875; Tue, 05 Dec 2023 15:05:13 -0800 (PST) Received: from [192.168.1.164] ([2600:1700:1ff0:d0e0::47]) by smtp.gmail.com with ESMTPSA id df15-20020a05622a0ecf00b00423da75b0f4sm5504430qtb.71.2023.12.05.15.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 15:05:13 -0800 (PST) From: Andrew Halaney Date: Tue, 05 Dec 2023 17:05:10 -0600 Subject: [PATCH 2/3] soc: qcom: pmic_pdcharger_ulog: Move TRACE_SYSTEM out of #if protection Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231205-pmicpdcharger-ulog-fixups-v1-2-71c95162cb84@redhat.com> References: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> In-Reply-To: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 As specified in samples/trace_events/trace-events-sample.h: * Notice that TRACE_SYSTEM should be defined outside of #if * protection, just like TRACE_INCLUDE_FILE. Fixes: 086fdb48bc65 ("soc: qcom: add ADSP PDCharger ULOG driver") Signed-off-by: Andrew Halaney Reviewed-by: Neil Armstrong --- drivers/soc/qcom/pmic_pdcharger_ulog.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/pmic_pdcharger_ulog.h b/drivers/soc/qcom/pmic_pdcharger_ulog.h index 9d5d9af4fbe4..152e3a6b5480 100644 --- a/drivers/soc/qcom/pmic_pdcharger_ulog.h +++ b/drivers/soc/qcom/pmic_pdcharger_ulog.h @@ -3,14 +3,14 @@ * Copyright (c) 2023, Linaro Ltd */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM pmic_pdcharger_ulog + #if !defined(_TRACE_PMIC_PDCHARGER_ULOG_H) || defined(TRACE_HEADER_MULTI_READ) #define _TRACE_PMIC_PDCHARGER_ULOG_H #include -#undef TRACE_SYSTEM -#define TRACE_SYSTEM pmic_pdcharger_ulog - TRACE_EVENT(pmic_pdcharger_ulog_msg, TP_PROTO(char *msg), TP_ARGS(msg), From patchwork Tue Dec 5 23:05:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13480862 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BHzUkluf" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90AED1B5 for ; Tue, 5 Dec 2023 15:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701817518; 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=KP09DeLuYz+Og6dlZ9z2Kp7En1LOdjS8AGaZ+gDsxfo=; b=BHzUklufT9IgonPTwvPnuIUSY+DCd2KsQS7XnPWIE6/Kxyg96mCfkLmKsyoosqViwnSom9 FB0uLzWi+qAYXpOgm3C6opXngfdOma0YF9G2AivhFMLNbzFr6X+fcJlfuZoKz16J3IOASA RbUn1u4rn2cmTVx8KfMgw1ri+91m9Jk= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-eT3_0_KXOMeZDYhNW61h8A-1; Tue, 05 Dec 2023 18:05:17 -0500 X-MC-Unique: eT3_0_KXOMeZDYhNW61h8A-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-423f4f5f586so2436841cf.0 for ; Tue, 05 Dec 2023 15:05:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701817516; x=1702422316; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KP09DeLuYz+Og6dlZ9z2Kp7En1LOdjS8AGaZ+gDsxfo=; b=Yr37GsucHoqY0GaN4xtsKv+8D2mrb2m+p70rjOAErZw61r2hzY6d00ReOHrPtT5KUT SxC/zNmu+5WBPHX91gPIEh3ezagqvJj8+pTgrBmX8KUbtFW5cdJUbVNztoHdGdOIurSz gcnP5aJ1naKb8NiKcFfuONrCcV53F4BZzwVB+pGsYPaXsqZ58/V8Nl4c/z4uuMd4HHG1 RiJyeUaXvurqCtZRtBgTpTAJcWL3ckNjSKATZbyFVOF2Jl3ZuUlNkGSk0P3I1XLSSpxW 6s7pfkpZatJj2LkO8gYI6gxOFZix+qxot0Vnsn2IOiainDgoHLPA4eTxrRrxq7gxfdvi ilYg== X-Gm-Message-State: AOJu0YwzVr2ePtuWiUkwHKICi3cza3sEqDURAAlRv323RKLazHEyReZq 2lTuTk5wzjkbdzlXLFYs6Gct+6qOXTAQTKLkB/lI3f2FW3SSUqLQvcZjgL5S9eC6zN3/fCa3mh3 wBhg8nWQRyMX8wSkn+bprqKEYkFsjnmxjGQ== X-Received: by 2002:a05:622a:152:b0:425:4043:5f33 with SMTP id v18-20020a05622a015200b0042540435f33mr2451720qtw.113.1701817516312; Tue, 05 Dec 2023 15:05:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoR/p1qLBUmIC26RDY0jJlDmdE0eOUVOk9yZxWq7JR6p+2pg3EgP1rRlHHZVJRhc5vwUPNdQ== X-Received: by 2002:a05:622a:152:b0:425:4043:5f33 with SMTP id v18-20020a05622a015200b0042540435f33mr2451705qtw.113.1701817516092; Tue, 05 Dec 2023 15:05:16 -0800 (PST) Received: from [192.168.1.164] ([2600:1700:1ff0:d0e0::47]) by smtp.gmail.com with ESMTPSA id df15-20020a05622a0ecf00b00423da75b0f4sm5504430qtb.71.2023.12.05.15.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 15:05:14 -0800 (PST) From: Andrew Halaney Date: Tue, 05 Dec 2023 17:05:11 -0600 Subject: [PATCH 3/3] soc: qcom: pmic_pdcharger_ulog: Fix hypothetical ulog request message endianess Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231205-pmicpdcharger-ulog-fixups-v1-3-71c95162cb84@redhat.com> References: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> In-Reply-To: <20231205-pmicpdcharger-ulog-fixups-v1-0-71c95162cb84@redhat.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , Neil Armstrong Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Halaney , kernel test robot X-Mailer: b4 0.12.3 Sparse reports the following: % ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make C=2 W=1 drivers/soc/qcom/pmic_pdcharger_ulog.o ... CC drivers/soc/qcom/pmic_pdcharger_ulog.o CHECK drivers/soc/qcom/pmic_pdcharger_ulog.c drivers/soc/qcom/pmic_pdcharger_ulog.c:57:34: warning: incorrect type in initializer (different base types) drivers/soc/qcom/pmic_pdcharger_ulog.c:57:34: expected restricted __le32 [usertype] owner drivers/soc/qcom/pmic_pdcharger_ulog.c:57:34: got int drivers/soc/qcom/pmic_pdcharger_ulog.c:58:33: warning: incorrect type in initializer (different base types) drivers/soc/qcom/pmic_pdcharger_ulog.c:58:33: expected restricted __le32 [usertype] type drivers/soc/qcom/pmic_pdcharger_ulog.c:58:33: got int drivers/soc/qcom/pmic_pdcharger_ulog.c:59:35: warning: incorrect type in initializer (different base types) drivers/soc/qcom/pmic_pdcharger_ulog.c:59:35: expected restricted __le32 [usertype] opcode drivers/soc/qcom/pmic_pdcharger_ulog.c:59:35: got int Let's deal with endianness conversion in the rare case this ever runs on a big-endian machine (and to quiet down sparse for this file). Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312060355.M0eJtq4X-lkp@intel.com/ Fixes: 086fdb48bc65 ("soc: qcom: add ADSP PDCharger ULOG driver") Signed-off-by: Andrew Halaney Reviewed-by: Neil Armstrong --- drivers/soc/qcom/pmic_pdcharger_ulog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/pmic_pdcharger_ulog.c b/drivers/soc/qcom/pmic_pdcharger_ulog.c index f1aaacf05005..238cd38589dc 100644 --- a/drivers/soc/qcom/pmic_pdcharger_ulog.c +++ b/drivers/soc/qcom/pmic_pdcharger_ulog.c @@ -54,9 +54,9 @@ static int pmic_pdcharger_ulog_request(struct pmic_pdcharger_ulog *pg) { struct get_ulog_req_msg req_msg = { .hdr = { - .owner = MSG_OWNER_CHG_ULOG, - .type = MSG_TYPE_REQ_RESP, - .opcode = GET_CHG_ULOG_REQ + .owner = cpu_to_le32(MSG_OWNER_CHG_ULOG), + .type = cpu_to_le32(MSG_TYPE_REQ_RESP), + .opcode = cpu_to_le32(GET_CHG_ULOG_REQ) }, .log_size = MAX_ULOG_SIZE };