Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp629123rdb; Thu, 21 Dec 2023 23:16:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3/vfnCMCkbVeu1n77zb7epVUzyGBWF94w43NUtoLx372SBlp3K51HI6QIRMBjl8JWqepe X-Received: by 2002:a50:cdc3:0:b0:552:fd38:a9fa with SMTP id h3-20020a50cdc3000000b00552fd38a9famr324784edj.8.1703229365533; Thu, 21 Dec 2023 23:16:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703229365; cv=pass; d=google.com; s=arc-20160816; b=MOCdfWaBv2a0WL/Tc1pB6HlpGoR6Gzc/qYjiYpx4U6Vn38jhcUawBlKkvG4JPFyE4E KCs8jAZ9BYo2NO2mqGL6mZNP9rHw+defasSQd39DW+rbdBmqLT6RFJ1R7eQE12wJH3TB LlLYRv788lHJh/WLVJk5eHBFFqu3NXcRh8mCFcourCDq1NS63W1GX2CE9Gw2uR79J5Al X0MDgYS5zr/EkJ50rhV53ZFephmUPRzCih9n6WLXq7HZAUC8JuGOPZF12MrRTCacUmat lKDxZTXqFcLKZrjaGvvoHnmfVB2gsH1inspjpgHBn1lGwVfMh5GSUGYUq27p4W2tn1IZ t8ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:date:message-id:dkim-signature; bh=g5kWAewovdbWQRiFe1FNF9iBMdp6ElGMe82bAV10PhU=; fh=K4O4j+nwpEtGKHELtZfrjXRyRG9xcc0ym936gXJTU0s=; b=BgJ7iEZJYCn8PgX6v5Uv41lyiH3/OOb+am+/KKJphtFqfRWPFNR2a48Nw9eBsgGBRJ blhZ4zvlje1WPrRr7uXq0vAbPmOF5q0Oh5E2ULE32k3S8ic+mgjeppZyUttNMo9mNq6e pAHq3OOmKs52eqYohc/tpFy+beIt0wQ2L0L0g/YyyGt2T0up2Y2GxXGK4esy+dfGk1jF Of72LLefWJliW+GEcGDAHdQn4kICK4OnAFgqFiA5w3uu3lKBySk8OFd16QsAgp3B/Gbk gF3PXosvArpmPPrbm/3BrMeCJAt60dPISuP6BuLFYSU1BUHP+NL4rW2fF47cPLbKb3rj Gfjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AUJxz5Yp; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-9435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m21-20020a50d7d5000000b00550e4e75bf5si1568145edj.34.2023.12.21.23.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 23:16:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AUJxz5Yp; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-9435-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9435-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 254131F2521C for ; Fri, 22 Dec 2023 07:16:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 886EC944D; Fri, 22 Dec 2023 07:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="AUJxz5Yp" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) (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 265FA9449 for ; Fri, 22 Dec 2023 07:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KIKCXxWCrC61tIYQZtWe8hjB/OJnxWTiI73x/3vwCj+hgjPbPKERioL5U+Msd4i4YfyOOYfsl4ny9Gpt5cn2dBj3oxNYZDv1OWBGCUvYZLTBJjMKc1BKCgpnGXa0SOF59OryOdBUqD3Dy2iNbuwI1s6eorpQLahgBZahl0JSdxptNirDUNzVjfbDRzRlMqZCqNrw+07MmZ4r7qPXirxkwQv0C9Sn5rKswo3Sd/rPi/mEb3W53N8mI2xOoxAxX9a3An+61k+alPMxiB+UkZaHRzpwFvP7lDonp+SQyn89hlg0Dh62L0i+3gcrA9U8FPYC0NDL4u486Tvh/a5QR0Nr2A== 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=g5kWAewovdbWQRiFe1FNF9iBMdp6ElGMe82bAV10PhU=; b=jUH4vSpQozS3ocE3C2LPmvsI7a2Zy69w162DJSAMT0l5bGB+0XS9vvLxkrkHRgT2mgjcWGu136Bl5prQxNBDswoLaU1bPWlBi8VqNUgjotejuBvXnU9Da8VzMMMFdXrjkiayfUz2xZ/kSeL/7wjX585b1vC9lmHEc+/TBmMyKzmjTrvg7Zyrp1dzxdZAchbUyv3PAklCkl/AQe5N69AoFJqPmhVh7OktgkhGyWJ0GEVjkowuftwO5fm+awFscWeUnVLNpyejoT1mjHhNpgLzLSy0kQmikmn8F4EGwMQVS2b7/KmnXgE5k5lT2WkMrdLQUCe2T+VpiNyjhEo53iVp3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=g5kWAewovdbWQRiFe1FNF9iBMdp6ElGMe82bAV10PhU=; b=AUJxz5YpWIfN4GvvfbtOmgorP8F3EhEQzZQHawyhZ5LGzpIUI/6qhMaiBaEsJznZ5gCf0Ea+1nhFRI7/5DREhZIoIE8EvvDdFa8unSt6S/1eyS37Kgboq42pocU7RY2BTkvwfmVA1V5yG5UZGeImPPaQEZFV0QSo06jqXFcJdhk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) by DM4PR12MB7695.namprd12.prod.outlook.com (2603:10b6:8:101::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.21; Fri, 22 Dec 2023 07:15:53 +0000 Received: from DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::59d1:c9f5:2c67:1da6]) by DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::59d1:c9f5:2c67:1da6%4]) with mapi id 15.20.7113.019; Fri, 22 Dec 2023 07:15:53 +0000 Message-ID: <6d98c43d-fb90-4cfa-a22e-8fd6d5a6eb50@amd.com> Date: Fri, 22 Dec 2023 12:45:43 +0530 User-Agent: Mozilla Thunderbird From: "Mukunda,Vijendar" Subject: Re: [PATCH 04/12] drivers: soundwire: refactor soundwire pads enable To: Vinod Koul Cc: broonie@kernel.org, alsa-devel@alsa-project.org, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, pierre-louis.bossart@linux.intel.com, vinod.koul@intel.com, venkataprasad.potturu@amd.com, Bard Liao , Sanyog Kale , open list References: <20231221073558.3181911-1-Vijendar.Mukunda@amd.com> <20231221073558.3181911-5-Vijendar.Mukunda@amd.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0250.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:21a::15) To DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4123:EE_|DM4PR12MB7695:EE_ X-MS-Office365-Filtering-Correlation-Id: d196acb4-e138-406f-30df-08dc02bdd541 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PZFVSo+gBltqMw+bauUr9cVMPQk7+m9dDRuNLBeQx6i2yH8YUMthcI2QqKK1ta/udi5Rbmx649OTZJ3BnFy/ozB1Vz7UeMWnEQJX+0rTj4NrOpkRuh/xLlVriVpleACEEpgAlLPbvoE5iUR+Mh187Th0Fl8aF2Pei4+oKMs12REWu2IMpWLRixKBgfjl7NCY0m9/1/czhzsJ8gl12Eh6FVmkMjwKRYBwjqis0UMj67Z2+qkvzUMr3ETxHPkqq9ujKcCvckfJb2eyR6horQ71N8jcQ/nXSb5Kzi96Ra1k8/XI9si2OVp0KpqjmkFrSdcZ+OYzY4tvrrHr6ryY43+/kCMmHxlp6LGsKtx9rCu+pqQT7+ThLa2G8jtu0KIBeCMUneop7MgAQr86cPUvLNfBvLVE9ytfnqMtwvTR+Pk2lv7S0d7wxjXpaDfAmTVoXqv3XwDptvBsdk5JZXohd2uAsbw8pEp4A+xpE+ozV2fdx9XZwBbTDFbuYj1TIXOlpyCbLCBg1mNp8GBGZIcP2t3KeUXWJiYSNaB/keplGEhdJoRJU85vYAu19Iw/IH/PtlTFI9fVPzAkNKLCD2Z2JVIQZU7xZ16tIaNKTo2JFPxc0676n7P+hq8gDpCFLqxf9EgbCeVO5BssYRCzuHKWrxgo9g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4123.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(136003)(366004)(396003)(376002)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(53546011)(6506007)(6512007)(5660300002)(478600001)(6666004)(6486002)(26005)(31686004)(83380400001)(2616005)(54906003)(316002)(6916009)(66476007)(66946007)(66556008)(8676002)(8936002)(4326008)(41300700001)(2906002)(31696002)(86362001)(36756003)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SGdPVTN0THhBOTYrNkVzemh3VWJURWlIM3hKNnp1ZFJqcHhmVnY0ZVhCakZm?= =?utf-8?B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yUWZkTjdUWW9tZVh2VXNzcnJTRVNuVXFn?= =?utf-8?B?RnpWOWdwd2FUM2ZmalJwTnd5UXhMSkxCRUFCVmt3bjV2ZmlvTGRRYlVNakd6?= =?utf-8?B?YTFGUWdZZHNnWERsUm90blpueURvVzA3bWZXNG5TU0ZBS0RFRThHSVpNWE0r?= =?utf-8?B?SDVVbnU5MFI0S2lJL2JVRDFKa0pJYWZRR29ud2syR2Jvc1R6cFk4bnNOUkxI?= =?utf-8?B?ZXF6UlhOUldmaDNZU0dSa0pOdU95VzUvYjFOdDRhNzZKM0dVYmZhZ0l2NGp1?= =?utf-8?Q?DkmIogSVTAj0vhGmB+WiZKfnG?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d196acb4-e138-406f-30df-08dc02bdd541 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4123.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2023 07:15:53.3118 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yQYcV21fH46mD2fYXbJVMTZu4OWcMVWMiqmVVR03OlKcjkP9zoAPDn8WqGHyGV53YlyVzTB06eiG5zrSBWcVlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7695 On 21/12/23 22:08, Vinod Koul wrote: > On 21-12-23, 13:05, Vijendar Mukunda wrote: >> As sdw pads enable sequence is executed only once, invoke it >> from probe sequence. >> >> Program required pads for both manager instances >> based on link_mask during probe sequence. This will avoid >> acquiring mutex lock. > something wrong with your editor to have this formatting, you can use > upto 80 chars here! Will check. >> Remove unnecessary delay after programming ACP_SW_PAD_KEEPER_EN >> register. >> >> Signed-off-by: Vijendar Mukunda >> --- >> drivers/soundwire/amd_init.c | 45 +++++++++++++++++++++++++++++++++ >> drivers/soundwire/amd_manager.c | 18 ------------- >> 2 files changed, 45 insertions(+), 18 deletions(-) >> >> diff --git a/drivers/soundwire/amd_init.c b/drivers/soundwire/amd_init.c >> index 5c9569d9ad01..b3b3c7266384 100644 >> --- a/drivers/soundwire/amd_init.c >> +++ b/drivers/soundwire/amd_init.c >> @@ -15,6 +15,47 @@ >> >> #include "amd_init.h" >> >> +#define ACP_PAD_PULLDOWN_CTRL 0x0001448 >> +#define ACP_SW_PAD_KEEPER_EN 0x0001454 >> +#define AMD_SDW_PAD_PULLDOWN_CTRL_ENABLE_MASK 0x7f9a >> +#define AMD_SDW0_PAD_PULLDOWN_CTRL_ENABLE_MASK 0x7f9f >> +#define AMD_SDW1_PAD_PULLDOWN_CTRL_ENABLE_MASK 0x7ffa >> +#define AMD_SDW0_PAD_EN_MASK 1 >> +#define AMD_SDW1_PAD_EN_MASK 0x10 >> +#define AMD_SDW_PAD_EN_MASK (AMD_SDW0_PAD_EN_MASK | AMD_SDW1_PAD_EN_MASK) >> + >> +static int amd_enable_sdw_pads(void __iomem *mmio, u32 link_mask, struct device *dev) >> +{ >> + u32 val; >> + u32 pad_keeper_en_mask, pad_pulldown_ctrl_mask; >> + >> + switch (link_mask) { >> + case 1: >> + pad_keeper_en_mask = AMD_SDW0_PAD_EN_MASK; >> + pad_pulldown_ctrl_mask = AMD_SDW0_PAD_PULLDOWN_CTRL_ENABLE_MASK; >> + break; >> + case 2: >> + pad_keeper_en_mask = AMD_SDW1_PAD_EN_MASK; >> + pad_pulldown_ctrl_mask = AMD_SDW1_PAD_PULLDOWN_CTRL_ENABLE_MASK; >> + break; >> + case 3: >> + pad_keeper_en_mask = AMD_SDW_PAD_EN_MASK; >> + pad_pulldown_ctrl_mask = AMD_SDW_PAD_PULLDOWN_CTRL_ENABLE_MASK; >> + break; >> + default: >> + dev_err(dev, "No SDW Links are enabled\n"); >> + return -ENODEV; >> + } >> + >> + val = readl(mmio + ACP_SW_PAD_KEEPER_EN); >> + val |= pad_keeper_en_mask; >> + writel(val, mmio + ACP_SW_PAD_KEEPER_EN); >> + val = readl(mmio + ACP_PAD_PULLDOWN_CTRL); >> + val &= pad_pulldown_ctrl_mask; >> + writel(val, mmio + ACP_PAD_PULLDOWN_CTRL); > updatel() local macro? We have identified similar update() inline function should be used in other parts of the code with different mmio base address. We will push it as a separate patch. >> + return 0; >> +} >> + >> static int sdw_amd_cleanup(struct sdw_amd_ctx *ctx) >> { >> int i; >> @@ -37,6 +78,7 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res) >> struct platform_device_info pdevinfo[2]; >> u32 link_mask; >> int count, index; >> + int ret; >> >> if (!res) >> return NULL; >> @@ -50,6 +92,9 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res) >> >> count = res->count; >> dev_dbg(&adev->dev, "Creating %d SDW Link devices\n", count); >> + ret = amd_enable_sdw_pads(res->mmio_base, res->link_mask, res->parent); >> + if (ret) >> + return NULL; >> >> /* >> * we need to alloc/free memory manually and can't use devm: >> diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c >> index c27b0b0f33a6..1427cccfc309 100644 >> --- a/drivers/soundwire/amd_manager.c >> +++ b/drivers/soundwire/amd_manager.c >> @@ -26,23 +26,6 @@ >> >> #define to_amd_sdw(b) container_of(b, struct amd_sdw_manager, bus) >> >> -static void amd_enable_sdw_pads(struct amd_sdw_manager *amd_manager) >> -{ >> - u32 sw_pad_pulldown_val; >> - u32 val; >> - >> - mutex_lock(amd_manager->acp_sdw_lock); >> - val = readl(amd_manager->acp_mmio + ACP_SW_PAD_KEEPER_EN); >> - val |= amd_manager->reg_mask->sw_pad_enable_mask; >> - writel(val, amd_manager->acp_mmio + ACP_SW_PAD_KEEPER_EN); >> - usleep_range(1000, 1500); >> - >> - sw_pad_pulldown_val = readl(amd_manager->acp_mmio + ACP_PAD_PULLDOWN_CTRL); >> - sw_pad_pulldown_val &= amd_manager->reg_mask->sw_pad_pulldown_mask; >> - writel(sw_pad_pulldown_val, amd_manager->acp_mmio + ACP_PAD_PULLDOWN_CTRL); >> - mutex_unlock(amd_manager->acp_sdw_lock); > so the code is copied from a GPL declared file to now and GPL + BSD one! > Have you had lawyers look into this... why change one file license ? As per recommendations from our legal team, we have updated the license as dual one for amd_init.c file. We have also observed that license terms should be updated for other files as well (amd_manager.c, amd_manager.h & sdw_amd.h) as dual one, which we have planned to submit as a supplement patch. >> -} >> - >> static int amd_init_sdw_manager(struct amd_sdw_manager *amd_manager) >> { >> u32 val; >> @@ -872,7 +855,6 @@ int amd_sdw_manager_start(struct amd_sdw_manager *amd_manager) >> >> prop = &amd_manager->bus.prop; >> if (!prop->hw_disabled) { >> - amd_enable_sdw_pads(amd_manager); >> ret = amd_init_sdw_manager(amd_manager); >> if (ret) >> return ret; >> -- >> 2.34.1