Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA2B4C433FE for ; Fri, 7 Oct 2022 06:34:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 524B684E51; Fri, 7 Oct 2022 08:34:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="h/HnUc76"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE83C84E59; Fri, 7 Oct 2022 08:34:37 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2040.outbound.protection.outlook.com [40.107.94.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A7F4840FB for ; Fri, 7 Oct 2022 08:34:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VpgyMcXBcKmsl7y+4jBTi6aWwhXt1ic/65VpViPwKgHs+eX1sgP23AyE+CnMyy/Z1rItZeJ9+PmyHRBxKIzcdgts3jH+ERg5dl5WeqEpmaU0LqbVS9d+RevZ824Jy4RQ/xiJXW3IdJ4VDTvzb4oe7Ucyzqvrn6b6mDj/++yDmPjmo2wey0QllCZcs4LCSYJfZhjg0eGyYHxMg2rhtxnsNTubQosXX4FlmOcBx3jS4B1s0pohzOWkcXbKtFzmODNGERIvhd+QQpfCIehUPdXMi1Se/d3mx8KnCz5GvO9CqurMdfcb1qAh6i07tgn5necN9+mDveTml81p89/aEo6MrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KY5OpGq6LTURD+9JjP2FEpGKokCCZXWZQXIc+PYDZ9M=; b=BPMFs+KMgmDeLs73RvhKm9b8nz/V3aDv042u4NwjyEQIu6JENqShkkp+KEe/BR1SJyKLgN+f07c7r+oDLdOen7m29M/KFsCKv2ZcSY4tyNZ8dicgTl6aewC4VSpItIgev6YxT4v/AUP9yceThtlxSzJZCgtmYWaFHbCTkdzz9Lkk17yg3be4YSjGQDoKvtrOY6mc4VPrCe4pB62VKSMveGNh5P6Nf3eZifVCqgr6F+DZDFgdkCmZfu42aQ1L7TguxlpFTEubIyIQFaqvbmSmRlodSAyGrfqpKpwnr233Xk0gP4ci1FDaPGRA8Q61ov6vF91XCTDxZBgFpyp0/yoBbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=thorsis.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KY5OpGq6LTURD+9JjP2FEpGKokCCZXWZQXIc+PYDZ9M=; b=h/HnUc76BZj12J/5qXTI1ps1Y4Te81lncWecgGCxUtAghvGJZa7Kk4Rf1Z/xNfMXOkng5VGCCOXBJ1ptQB9hwDvFEH+Xk3R4gxMz/fNOgyFCGUB6bPd1nNnyOSvKAK2y4RpvnVFKrvdZpIfN5AGuEkD1TxJti8jrnOOuMS330Ks= Received: from BN8PR16CA0026.namprd16.prod.outlook.com (2603:10b6:408:4c::39) by DM6PR12MB4170.namprd12.prod.outlook.com (2603:10b6:5:219::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Fri, 7 Oct 2022 06:34:30 +0000 Received: from BL02EPF0000C408.namprd05.prod.outlook.com (2603:10b6:408:4c:cafe::bc) by BN8PR16CA0026.outlook.office365.com (2603:10b6:408:4c::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31 via Frontend Transport; Fri, 7 Oct 2022 06:34:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000C408.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 7 Oct 2022 06:34:30 +0000 Received: from [10.254.241.52] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 7 Oct 2022 01:34:27 -0500 Message-ID: Date: Fri, 7 Oct 2022 08:34:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v3 0/8] Use logging feature instead of FPGA_DEBUG Content-Language: en-US To: Alexander Dahl CC: References: <20221005114421.24340-1-ada@thorsis.com> <5f7a9b48-8cb0-795f-464d-d91f87f69905@amd.com> <2373162.YMkKv9AQid@ada> From: Michal Simek In-Reply-To: <2373162.YMkKv9AQid@ada> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C408:EE_|DM6PR12MB4170:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c991781-2d7f-4e4e-1f37-08daa82dfd43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vbbdzxxo3T7gPoQiBk1sHiqL9Oc5AqBjE1ee3ttMX9eAzqGQ5YlavzNd/NpVBVm0PYWV2rVcVwVYfZe6UrQ6DfuVqDiZ20NBIrWY6Wg9uEZSQjfDSy4GKOXewTBOn+Y5TPrxOnPo0pA2n+NonlnCJPw0HvZjIsCvQ0/0L56j4h6XymBwQ3+UROYZgO9B2qHToJWDPqijx/w4CYmaAY4ast77LnvVpuJ6fZMhRE+EuBgeiQD5nd+H2IxWXN+A1S1hzW6rK2zz01l5ZmBN6dNh0Y81kI+J2w/O5RLh64gRXLPobW20xThs/fe10pXoVlfSJvb030ZbftH+Fb1vOFl5QvzIb2C5DajGXKQcm9vD8TUl1yCt445PaXoQc6qeMGsgWA+jE+F/iEHRxd5Nf4/FehMSulFXjpxnV7uYDJ6XmbjZjZpTsCixTSndN1fHv4UbJ98RYhnK7U5sfh7mgcF77AsfpqhSrdXJ9TKu9zF09nrnZ/6DhUIx7Knol9n5q0fcvCKHgLOGZRHyEeWj7Wgle0/tsek7F3AOBg8vw+IoEVyYSI0K9cK2os3K88dH3o0DLwCNRRjTi4YqEF1QfeMZja20v+ist64T8y7cK/h0uO79zX677Ehhz3kHvCvep73mmGNhjZ7fSaW4OZGwFG/GgMghGksOLgB58bI4gEL96KiHpk+LsLj6ji175ek8YwSFC2n2l0AEg2LGmZSrdZLksT92K9VoNfbl0YKDQE7MM2eN5iQFLIilXO1JSUzilFn/EeuQGkfFXwc97b7EPK1bH7F4oqDiXjtm8/roQLvHb/UJ3iwnO/t0stDYS5zX7sP+9mZYtYDg91wWkqLYGUHdFkAS+LKJHLAqza4eul4mSSc= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199015)(40470700004)(46966006)(36840700001)(82310400005)(36756003)(31686004)(44832011)(5660300002)(86362001)(8936002)(41300700001)(426003)(336012)(40460700003)(47076005)(186003)(16526019)(2616005)(356005)(4326008)(8676002)(83380400001)(81166007)(2906002)(70206006)(70586007)(40480700001)(36860700001)(31696002)(82740400003)(6666004)(53546011)(478600001)(966005)(26005)(16576012)(6916009)(316002)(43740500002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2022 06:34:30.1750 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c991781-2d7f-4e4e-1f37-08daa82dfd43 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000C408.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4170 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi, On 10/6/22 16:56, Alexander Dahl wrote: > Hello Michal, > > Am Donnerstag, 6. Oktober 2022, 16:44:29 CEST schrieb Michal Simek: >> Hi, >> >> On 10/5/22 13:44, Alexander Dahl wrote: >>> Hei hei, >>> >>> while working on FPGA support for a new device I discovered debug >>> logging in some FPGA drivers is still done as in the old days. Bring >>> that to what I thougt would be the currently preferred approach. >>> >>> Notes: Adding those Kconfig symbols in patch 3 is just to be able to >>> build those two old drivers. >>> >>> All drivers touched were build tested with sandbox_defconfig and GCC 8 >>> on Debian GNU/Linux 10 (buster). >>> >>> Lines with other possibly questionable output were not touched, only >>> what seemed to be designated debug output, and only for FPGA drivers >>> having that ancient FPGA_DEBUG / PRINTF macros, so there's room for >>> future improvements. >>> >>> Changelog: >>> >>> v2 -> v3: >>> - Patch introducing FPGA uclass was completely reworked, sent >>> >>> independently from this series, and applied already, thus removed >>> >>> - Because requiring that new FPGA uclass changes, rebased on Michal's >>> >>> microblaze branch '20221005' >>> >>> - Removed '"%s …", __func__' and '"%d …", __line__' from log messages, >>> >>> because log framework can add those (enabled by CONFIG_LOGF_FUNC and >>> CONFIG_LOGF_LINE) >>> >>> v1 -> v2: >>> - Rebased on master >>> - Added patch to introduce new FPGA uclass in front of the other patches >>> - Use that new uclass as log category >>> - Slightly reworded cover letter >>> >>> Greets >>> Alex >>> >>> Cc: Michal Simek >>> >>> Alexander Dahl (7): >>> fpga: altera: Use logging feature instead of FPGA_DEBUG >>> fpga: cyclon2: Use logging feature instead of FPGA_DEBUG >>> fpga: Add missing Kconfig symbols for old FPGA drivers >>> fpga: ACEX1K: Use logging feature instead of FPGA_DEBUG >>> fpga: spartan2: Use logging feature instead of FPGA_DEBUG >>> fpga: spartan3: Use logging feature instead of FPGA_DEBUG >>> fpga: virtex2: Use logging feature instead of FPGA_DEBUG >>> >>> drivers/fpga/ACEX1K.c | 37 +++++++++---------- >>> drivers/fpga/Kconfig | 12 +++++++ >>> drivers/fpga/altera.c | 11 +++--- >>> drivers/fpga/cyclon2.c | 38 +++++++++----------- >>> drivers/fpga/spartan2.c | 80 +++++++++++++++++++---------------------- >>> drivers/fpga/spartan3.c | 80 +++++++++++++++++++---------------------- >>> drivers/fpga/virtex2.c | 69 ++++++++++++++++------------------- >>> 7 files changed, 152 insertions(+), 175 deletions(-) >> >> I pushed it to CI loop and got failure. >> >> https://source.denx.de/u-boot/custodians/u-boot-microblaze/-/jobs/508906 >> >> Building current source for 136 boards (64 threads, 1 job per thread) >> m68k: + astro_mcf5373l >> +In file included from include/linux/printk.h:4, >> + from include/common.h:20, >> + from drivers/fpga/spartan3.c:14: >> +drivers/fpga/spartan3.c: In function 'spartan3_sp_load': >> +drivers/fpga/spartan3.c:112:27: error: too many arguments for format >> [-Werror=format-extra-args] >> + 112 | log_debug("Function Table:\n" >> + | ^~~~~~~~~~~~~~~~~~~ >> +include/log.h:220:24: note: in definition of macro 'log' >> + 220 | printf(_fmt, ##_args); \ >> + | ^~~~ >> +drivers/fpga/spartan3.c:112:17: note: in expansion of macro 'log_debug' >> + | ^~~~~~~~~ >> +cc1: all warnings being treated as errors >> +make[3]: *** [scripts/Makefile.build:258: drivers/fpga/spartan3.o] Error 1 >> +make[2]: *** [scripts/Makefile.build:398: drivers/fpga] Error 2 >> +make[1]: *** [Makefile:1883: drivers] Error 2 >> >> Please fix it up. > > Not sure if those warnings were present before on the old PRINTF calls, but we > got them now. However the underlying problem was there before: putting to > much things in one printf/log line. I can go split it up like in 'drivers/ > fpga/virtex2.c' already, where you have the following comment: > > /* Gotta split this one up (so the stack won't blow??) */ > > Not sure however if debug printing all function pointers in those function > tables has any value at all? Maybe that can just be dropped? No idea if this is useful or not. But it is there and I would split it as it is done in virtex2. Please do it in separate patch with mentioning virtex2 to have the same change. Thanks, Michal