From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2080.outbound.protection.outlook.com [40.107.94.80]) (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 CEAA417C21B for ; Wed, 21 May 2025 14:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.80 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747838775; cv=fail; b=WzdX2cqWxjNaTy/WiRHN4x7uD6QIhBogYYdS6jkE8daA60nuHxAjdBy7ySRSWwWKtwnMnRq8DE9GAayhMmkHmFgwRXO7z3Xf7+3i7V/CJJOS/m5I71Cv0FB7s8g5UISdrsBgAMpbtbq1FwI8KL9ur9kB5BuiziQqap5XC6tp5KA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747838775; c=relaxed/simple; bh=CfvXDNQa+y7HGm+EJJX88NAA782jORG3/+M613lVVpI=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=Xo380CHAZQkn6aNrATKsa2fMUwjYItqVZ7ryZmovm+vjrIBJQTgPW1FEXVdhrzukj3/9JEjq9rOqMS49wD8wSSN7dzqzQsA+etRhh3vM4koTyj7BinJ4t4HqKASI5cZwoSRwJ2Ixmmb6g5ZYgSqdr9tK2WFcFSMQOO9vQXiUnNI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Oxv1i8Yk; arc=fail smtp.client-ip=40.107.94.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Oxv1i8Yk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GEHnHPi4bNTP890vXRXtWCUQPKQZ2LMs5Jzn5A5GU+WiIlnM//DbpkMgWsYBXD++L/G3s0Rcg9uzLbqNFMoNXQNd0O1L2u5RoSJluhQFMEWiNSydcFnbcbYMKfV1bLwCNYUnSv8c1VLAlN3pxQ+4NiixnMdNo8gneSp51ihpjzc6ssk3vjcrSMHb1TvTibpZLOZ0GgZ+G1nH+tJcoBelNJR0nVw2MKCsjjVhk4dCnLauZ1pcQEBtV/BoArQGCFtYxyO/Pe+q0Or2zF77Ag2Q6GBWBoYYoggmHOGMjOlplIjpsVV/Eq5mpssXSK354oNIINJYE/Xa5LGheOSyk01RYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9ocD4l7p42o86eDXo3IHMwMQVY0EJ7QdKmqgPH8iQs4=; b=QtoFVzRzvpvHDAEyJlyGl5kIVll3fb+4dPCO5TQbB/4MXyxHk6/Vx4anT35usq813UKvAnc1zoItN4jEoP/YS0kDcUBwVEH/rp2a0IsOqJqtcTGp8Js9GUwP3IexiZN2aqMmvjY/3v7j1rjMNsgadvC0u0JdIAxV2WAOWO4Ctyz6X+X8O6Bk/SYQObdo1vojtI41VrHfQI+2YBa82xIfRnoFlXhF5Z0nELQ3UHfxN+SspKsvRKVJIvnZWcLSnMfe2qjD7GQyaYgTxpt73jemTzqbY8lYErZnJE5zse8tHxT2sPVOaO82EcfT5Cd+gmub4MER9JIpjOjaGB85MowwZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9ocD4l7p42o86eDXo3IHMwMQVY0EJ7QdKmqgPH8iQs4=; b=Oxv1i8Ykj4X2RGTLngqPnBKpanzAGcJIUNRJZ4OQWeupU8xeWTE7h+qYafPkUuH84EGven8Fv4ZAonTAR1TD+fAixD5UwkRT64a3wcp110DuW05Wlnz1VWXm0CyTTpStaoMObOnBcOdLW98nBdjLcGvlLy/LlT4NK7Op32+hulWTL3LsM69LsvyhJ5kdXak8j6YwxYbQLUiDL3YnxngzWjAcLRJUr2LFifPWVPzOz3JEVnJyfCxHHK1Qoqj3sideLiyDcHOsIiSTjwNr2iPxIbLd3RV0uJcBoKVOWSAOCr3zte1Elx2YKmrL42ba0vihlVp6apaM2LNEEc5z5vcqJQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from IA0PR12MB8422.namprd12.prod.outlook.com (2603:10b6:208:3de::8) by DS0PR12MB8296.namprd12.prod.outlook.com (2603:10b6:8:f7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.19; Wed, 21 May 2025 14:46:10 +0000 Received: from IA0PR12MB8422.namprd12.prod.outlook.com ([fe80::50d8:c62d:5338:5650]) by IA0PR12MB8422.namprd12.prod.outlook.com ([fe80::50d8:c62d:5338:5650%4]) with mapi id 15.20.8746.030; Wed, 21 May 2025 14:46:10 +0000 Date: Wed, 21 May 2025 09:46:08 -0500 From: Daniel Dadap To: Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org Subject: Re: [PATCH v2] ALSA: hda - Add new driver for HDA controllers listed via ACPI Message-ID: References: <87r00qx78f.wl-tiwai@suse.de> <87zffdvvj6.wl-tiwai@suse.de> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SA9P221CA0001.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::6) To IA0PR12MB8422.namprd12.prod.outlook.com (2603:10b6:208:3de::8) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR12MB8422:EE_|DS0PR12MB8296:EE_ X-MS-Office365-Filtering-Correlation-Id: 04044c3d-589f-42b1-f321-08dd98763a22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?M/eF+H5uDqWCxwsuUID2G0+DhjEfsgUM6XC3XsgNxsOD/pDGpu45pWiGy0UK?= =?us-ascii?Q?ujmrSEXmbEg2Uc9zPtPbvPSWIMqOKaboD21S4kADMim3/ee1J13d3XexKbJJ?= =?us-ascii?Q?I/W+QWqJruaH7CQDrRwpQyjPrlQo564ud2pW7K39dMBIF5W4ynwOdmNM8KsZ?= =?us-ascii?Q?UY0qb01aVpcccjqZOMqqPDUlzdb0wqdHLuHEyjxmbWus/a0CjcQyyfF7jDi9?= =?us-ascii?Q?6r3Gnb6NnZ6PGWVbxDMvUQ9h4xJyJbe9JsvkYoSx/6lwNXLxzUjBq2Vs8ULF?= =?us-ascii?Q?rXCzi6keUA6/HBWGKqdbhUL4kxjaX3zO61fY6xQ0MHl0VAEKPZbtRoitM5c0?= =?us-ascii?Q?oXOh3RAiI6OuTyGkMMPyrsU11ATrel7kELoMao3q6DKoOqsUx7wWFaIot+ZV?= =?us-ascii?Q?WwHrIC7Zlr2TCXhyzVjnjKeHA+spzy8e03VyOJdJL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4POCFA0UEKLzAK9zUGAHB2k15wIG90EgxsjIl+ZmBa5r8UjEUx9Rf?= =?us-ascii?Q?MvMq898DPHMnxXMW9Aygn/SpMKkWYu+SJTtvVL9sFsTk+xOHsYFZeAsrIzOH?= =?us-ascii?Q?8EX26kpbqpE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8422.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RyaJYc1OzDBNPCxhvqmtqt4TmkvButq7g+zXBkmSo9dXFWznxgU3uAyhWwk5?= =?us-ascii?Q?ZFpFs0+nfmiORLCPbE1HsnAo+FCz1lWnzO1XkAr6EAngToZ5gYAfdxaF8QLo?= =?us-ascii?Q?Jy90zSni8tAJ3TMFgeas0KHUpaaXBaZUk3zRlHlh/RfMle2hrLlaYOS3Rruy?= =?us-ascii?Q?Ps7a5BrISOxtMTtFdG7zap1v5J50sa/1ZdSUQlmMItvpP4JG20jx5552gDZn?= =?us-ascii?Q?KbrLLmMGKbFzsQyz0kmcsmKUhhOP4fA0nr/hYkE+p3yNvYT5ZrWAGj+l8jT2?= =?us-ascii?Q?lZi6R5ZdLFaml8uyIzpo5AwScmSKZcojyxsPVdlyFmhe85N0BpJiqkBsjcPy?= =?us-ascii?Q?WTOdu4jidKvOiZfD1yVjN4Y5mOLDHtj54d+QRct+Y+qMqWQiTH1OQQcmaU0X?= =?us-ascii?Q?vVNpTald9hD7aCP8lTkz8pbEWD932TklfoMHWpNwM7/0/7oV2Ne5WEpNOtmN?= =?us-ascii?Q?IxRj4tTdKmssvfw1mCNCvkqJh5Eujuktt/tKJnK+7ESQiVfQQZccxLQzX3ZE?= =?us-ascii?Q?VuOqf+QQowxx193QfXBoxXcRNIy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N31fpqCG8uOJbdIMTIdtyzmFVfSJXzTMgM/U6eFZhc53aOYN3eo6p4G+?= =?us-ascii?Q?NU2fW21lgUlIkN/LENZ7hALYRdC2XHgwRn7Z+5wzDD8HbCFpdLcDY0A6bN1M?= =?us-ascii?Q?a9sjKaLqIMmyk4N6iT6ltGXrysGfiRdWrXcMZO7A?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04044c3d-589f-42b1-f321-08dd98763a22 X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8422.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2025 14:46:10.8146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9JoRJiAEcLotaofDBN6zso2B/kCkM7qt0bYEjMHN9RQ0uX85RnZphHCq7ZPM0dRO+hYjDh7E2vbCw0u8ZxofKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8296 On Fri, May 16, 2025 at 06:37:21AM -0500, Daniel Dadap wrote: > On Fri, May 16, 2025 at 09:56:13AM +0200, Takashi Iwai wrote: > > On Thu, 15 May 2025 17:47:25 +0200, > > Daniel Dadap wrote: > > > > > > Some systems expose HD-Audio controllers via objects in the ACPI tables > > > which encapsulate the controller's interrupt and the base address for the > > > HDA registers in an ACPI _CRS object, for example, as listed in this ACPI > > > table dump excerpt: > > > > > > Device (HDA0) > > > { > > > Name (_HID, "NVDA2014") // _HID: Hardware ID > > > ... > > > Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings > > > { > > > Memory32Fixed (ReadWrite, > > > 0x36078000, // Address Base > > > 0x00008000, // Address Length > > > ) > > > Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) > > > { > > > 0x0000021E, > > > } > > > }) > > > } > > > > > > Add support for HDA controllers discovered through ACPI, including support > > > for some platforms which expose such HDA controllers on NVIDIA SoCs. This > > > is done with a new driver which uses existing infrastructure for extracting > > > resource information from _CRS objects and plumbs the parsed resource > > > information through to the existing HDA infrastructure to enable HD-Audio > > > functionality on such devices. > > > > > > Although this driver is in the sound/pci/hda/ directory, it targets devices > > > which are not actually enumerated on the PCI bus. This is because it depends > > > upon the Intel "Azalia" infrastructure which has traditionally been used for > > > PCI-based devices. > > > > > > Signed-off-by: Daniel Dadap > > > > Thanks. Now I checked with checkpatch, and it complained a few > > things: > > > > Thanks, Takashi. I forgot to ran checkpatch. I addressed the ones you called > out, and a few more that you ignored (I think on purpose), except for this: > > > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? > > I can add myself as maintainer for this file if you like, but figured it > could also just fall into the default maintainership of the directory (you). > Let me know if you think it's worth changing it. > > > WARNING: Block comments use a trailing */ on a separate line > > #168: FILE: sound/pci/hda/hda_acpi.c:79: > > + * devm_platform_get_and_ioremap_resource() */ > > > > ERROR: code indent should use tabs where possible > > #182: FILE: sound/pci/hda/hda_acpi.c:93: > > +^I IRQF_SHARED, KBUILD_MODNAME, azx);$ > > > > ERROR: code indent should use tabs where possible > > #308: FILE: sound/pci/hda/hda_acpi.c:219: > > +^I THIS_MODULE, 0, &hda->card);$ > > I disagree with the above two, but I changed it anyway because it's easier > to do that than to argue with checkpatch. These are both continuations of > long lines, and the single hard tab matches the actual indentation level of > the code itself, with the subsequent spaces serving to aesthetically align > the continuation. If someone is viewing the file with the tabstop set to > anything other than 8, using hard tabs for the alignment portion will break > the intended alignment, whereas using spaces will keep things aligned well > regardless of the tabstop size, since the single initial tab will resize > consistently with the tabstop. > > Perhaps this style point has been discussed before, and the policy that is > enforced by checkpatch is intentional for reasons I don't understand (I did > not check), but if this behavior is unintentional, and using spaces for > aligning continuations of long lines is supposed to be okay, I can look at > updating checkpatch to allow it. But for now I'll go with the recommended > indentation since that seems to be the style followed by other files here. > > > > > WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure th) > > #405: FILE: sound/pci/hda/hda_acpi.c:316: > > +MODULE_LICENSE("GPL v2"); > > > > Care to address those and resubmit? > > > > Sure, I'll send a v4 shortly. I also took the opportunity to address an > issue I noticed while cleaning up, by adding the following: Hi Takashi, In the meantime I noticed the recent commits in the sound tree to convert some string copies to use strscpy() with two arguments, so I sent a patch v5 to also use the two-argument variant in the new driver. I also sent a separate patch to update hda_tegra to use the new signature. > > hda->data = acpi_device_get_match_data(&pdev->dev); > + > + /* Fall back to defaults if the table didn't have a *struct hda_data */ > + if (!hda->data) > + hda->data = devm_kzalloc(&pdev->dev, sizeof(*hda->data), > + GFP_KERNEL); > + if (!hda->data) > + return -ENOMEM; > + > err = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, > > My intention was to allow entries in the match table to omit supplying the > pointer to a struct hda_data if they were fine with the defaults (hence use > of the language "may be stored" in the comment describing the struct), but > without the above the driver will dereference NULL if this is actually done. > > > > > thanks, > > > > Takashi