Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2681309rwd; Mon, 22 May 2023 02:37:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KpABwmIcKzjGIueGenIHsLH6JAKYw5T4gns+6Ui33IlcOB9nc5Lb1sAXS5Lu+RCh09Bzr X-Received: by 2002:a05:6a20:54a4:b0:10b:2203:6ab1 with SMTP id i36-20020a056a2054a400b0010b22036ab1mr4374824pzk.4.1684748255793; Mon, 22 May 2023 02:37:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684748255; cv=pass; d=google.com; s=arc-20160816; b=t6eTDVd3Fsp3ETzog/bMehoy0ja+Rcnx8n2BJxiYHaAV4omlvNWoA4NmhTuA4RbBmS Y6+p5SjULJ0wJd2uKsT7zqS2z2IIeRuSPzc1B2U70qSsR+8OO0Oauip9vY+inZrfx35o CFru+Sq/QGJOpEt6aYmK88oBd7EdHlHZDzkwgGOnjN2g6uyOLUZwAg726B2kc8CFNgRy ozwqQzVTcZ3rK0QQk59rW+QB0RBSabiCrJtu7DdiU+mV9fTd4uBqh4J4iHDcuTLpSVaZ pGZ2uZ642jnZPxxgMmfk7pvEcwz6cUjy0pMvIycFyOFVwfC7VrCTUC9mU67mFaVsRoQ0 qGzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=gME1iF7kjz+Hdzye0yRQsLtOaFAf2L1sKo2CgAtTJqY=; b=qWoSLn/+gLgGnll6AVZlmnYn3ALL3RMi6qDV86Piy1uWSPtWRVY0YdTy5CCcJlcFsH hW5fZKotg544WcAKBw9QD7t0wz9o97Az/w2HfwJ0402RLbMtjtlktIG1E7PLSCdKeoUt X8ZPmguzcLStqjxYogLOauPmf06MxsX6/TpThE3Fe/LMMDZjTRa8g1+5uVRR5ZyLSHH1 EAo36YjJfJBqfRV0/qfe1qqoecPR4Y+aNl3Tim+ZGwusR2WPz+o8uL2jJm6lGjvmkO2M 7rcTSZrs4aDq05sPABpgkL09fg7E/npi+NCRyH9fXxnyELfaH/PIbEgaeCTtiKH2dVmh F1Xg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=ny3sjSb3; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x21-20020aa79575000000b0063f18073138si4541245pfq.99.2023.05.22.02.37.23; Mon, 22 May 2023 02:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=ny3sjSb3; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231665AbjEVJg0 (ORCPT + 99 others); Mon, 22 May 2023 05:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbjEVJgZ (ORCPT ); Mon, 22 May 2023 05:36:25 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2073.outbound.protection.outlook.com [40.107.8.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A659D; Mon, 22 May 2023 02:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QXR8EVb49UwgivwA/RChv5I0TG7fR7AGkN5V5cXuqVMeX9WyG1UM8qH6G0RSssQMBp/REcM4uqWLOsTRA2I2whGUP40Qg6vGxubzFiYGWllIa2+MhMaw2J5cNb3ArDx0uY2ocLmyp8OasUUuZ2SNUEcAFSzyCFsi0Ol+EF5QidXdkIQavZlNwBFWeuHnN7f8EIYMhotwxvQZ62Eq4CYetx6CYeR52LEG8KWkdxHKV89ntW53Tf55XZNjuwiLJnqukyChUpyuSpURIifw/p6yPj+hYeb4SCPJtWBkwQWwVdAgH3AWodthDyRUNTzXb/TU2npRnaDKXQxqz9IN28nQsQ== 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=gME1iF7kjz+Hdzye0yRQsLtOaFAf2L1sKo2CgAtTJqY=; b=ghWoEwvHgPRBwu7kQ0gtj949+Sx3V257RSODiB4LZSwYGgHaBPZSmN1l8DP0bknzdoYl4EuBdyac/W+9v+0D8b+gRB48YMTiOmMnxv0XH32WQxCeo6UlPGPSgIdJCw/rb08SRkmzYiz9sRr8qEOpCPNUR8EV5yjCPf7kc/4YUb5aEKMTG0V52JC/OkWh71UaCHXGGN9vnvpe9SqA+LV74ggmTOApO61VcbDwPevOR1yc6IzbzOD+tmiE2YdXSe7jPOqozR/goi1EqU55TqaXoyavinqAMKGEqdPFdapNEHua0lBZbcIFR6ryG6FuMPA1UklJIQguhBAlHblPZTPxZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gME1iF7kjz+Hdzye0yRQsLtOaFAf2L1sKo2CgAtTJqY=; b=ny3sjSb3endfhjx+kxsSErKDoUI6pY4jdBi9mza/jWvK6YBWJs+qw7LyyNO0KEp/BXZT4UIBWbR+XcrY+pT8MVFIBss21ra935RvAyjbGZcsNWpyFYMFCLYEfs+7wGrc29cuHuI5qhV0/sXbnVbKg/ptNXGdBNSDr3S/wBwZO/zvz3bJbg4XCPQWh7THacyrLITY0i2O+9e1ib0EegftrI6mhQbJL3rGf95pDqSGdoip8aXGRQEvtknro/ewyiSQUpK00+gMEb5mt7YLI8/ST/twutsIuQloTCz5CsbHsx2PReVXxsID8Jp1qGX4+wRtM6jqr90Y/E+IXQOizggQsw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB7104.eurprd04.prod.outlook.com (2603:10a6:800:126::9) by PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Mon, 22 May 2023 09:36:18 +0000 Received: from VI1PR04MB7104.eurprd04.prod.outlook.com ([fe80::6c14:307b:6fd3:3bfc]) by VI1PR04MB7104.eurprd04.prod.outlook.com ([fe80::6c14:307b:6fd3:3bfc%7]) with mapi id 15.20.6411.028; Mon, 22 May 2023 09:36:18 +0000 Message-ID: Date: Mon, 22 May 2023 11:36:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v8 2/6] usb: ljca: Add transport interfaces for sub-module drivers Content-Language: en-US To: Ye Xiang , Greg Kroah-Hartman , Arnd Bergmann , Matthias Kaehlcke , Lee Jones , Wolfram Sang , Tyrone Ting , Mark Brown , Linus Walleij , Marc Zyngier , Bartosz Golaszewski , linux-usb@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org Cc: srinivas.pandruvada@intel.com, heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, sakari.ailus@linux.intel.com, zhifeng.wang@intel.com, wentong.wu@intel.com, lixu.zhang@intel.com References: <20230511175844.185070-1-xiang.ye@intel.com> <20230511175844.185070-3-xiang.ye@intel.com> From: Oliver Neukum In-Reply-To: <20230511175844.185070-3-xiang.ye@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0057.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::14) To VI1PR04MB7104.eurprd04.prod.outlook.com (2603:10a6:800:126::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB7104:EE_|PAXPR04MB9328:EE_ X-MS-Office365-Filtering-Correlation-Id: 0dc111c1-330a-4b0d-9c7c-08db5aa7fe96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fXZSOrf8aYfXr3djmpWaxG2Kdajv0xirQEv5vvfYscopPpH1RYAWxe7nsxVjoo372KLogpJmemuhpONLepnOZ73KkMTSWaQQ2tG2ib/emMKqWpFz/XRwmLtEgfWK/bHeCU50OQeiUDuCwQb0vLQci5IsCDABKUJl1SQWtCSar6QqNiarKEzlUEqOMYEU+iyaWZksljDOnhm4m0wym5Vir/TvjeySt+wtnoFWVYWRX7cBV0t0vruvDpIxOhjQ7wUmwqZy2kR89z0+GB1yrYS/yPMtQAv9kQpgRpPFphjQ71xYeKFYqc6h8p74ILAp1B1uExnk0YsJ1DIkH47llcBncVvrngqajjV346q8d5R7jv3zm5IXBGo1aH5AMDS1gxHTH9eDeFrz/y4zJC1mN4WCdtryMycZ7onC0rc8LLXZwV5iLhxm/KYxJtMjIlP3Fngc1mbPY/79k3fnB84ZAp+mnlWrcXT9vioXhgmp5sRIzgdNG0z2T+uAhRLH6gnPO4RYbJjqqGrYMnKROROOmC6tMUATkHs57aEiHcRKeYxgrr+fU/Z+E1IWuMoLabAX/u0ZWkgQXQSVR1112L2oQfi64qbPynA4NLhk8j4uIzPp+rmtPDuuCDzKG1nNg8Xd8EucdZXbCnx9Gf5QKgqgl2qhBglCOSqG0lQXpw94I0lqJaY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB7104.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(346002)(396003)(366004)(376002)(136003)(451199021)(478600001)(41300700001)(66476007)(66946007)(4326008)(66556008)(31696002)(6666004)(110136005)(6486002)(316002)(31686004)(8936002)(8676002)(5660300002)(7416002)(86362001)(83380400001)(36756003)(921005)(38100700002)(2906002)(2616005)(6506007)(6512007)(53546011)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S0RHM3RWZURPNGN0ZXNhdU1LSEY5amlCRFVMOERxZk5mZEtoQTZRQWU4aUg2?= =?utf-8?B?NXI0aGFFcWVpbnRId3RFUlplMkxjZHZwcGM3VVJBUlN1bFJOOFJYbEUzTHVx?= =?utf-8?B?WWxEZURrSHhOQ1hDYlNEcVMwNk9vSURUNmxVa0pKSUVMakxvYlRLSS8xbHlZ?= =?utf-8?B?UG1CczAwS3ByQ1Y4YldEbFdrRTR4OGczanNtcVhVa2pkcThjS3I0dEQ4emhx?= =?utf-8?B?N20xNj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HVlo3TjlxL0Iz?= =?utf-8?B?RklUUmh1TERiSXJEeDJFTVlqRW15d1A1cXVSTzRsRE9waVlJQ0RGMDlsc3dq?= =?utf-8?B?SlZyMVJMSzRlU0lpdDdqbWlhdXUzV2ZSUnE2UW1KOHZTRXBScFRyRjFkWStx?= =?utf-8?Q?b7ydWdyONScxxR4H8h7K0/4=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dc111c1-330a-4b0d-9c7c-08db5aa7fe96 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB7104.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 09:36:18.3075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3NY92DKcYR8oKDNd+kfynyf5ln9pXxIJPqlsQJEBb0zkYYbk+OZ5xyvk+peBvmVBn0JjbaFXV7Y1NOODE6+lwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9328 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.05.23 19:58, Ye Xiang wrote: > Adds the transport interfaces for various LJCA sub-module drivers > to communicate with LJCA hardware. The sub-modules of LJCA can use > ljca_transfer() to issue a transfer between host and hardware. And > ljca_register_event_cb is exported to LJCA sub-module drivers for > hardware event subscription. > > Signed-off-by: Ye Xiang > --- > + > +int ljca_register_event_cb(struct ljca *ljca, ljca_event_cb_t event_cb, void *context) > +{ > + struct ljca_event_cb_entry *entry, *iter; > + struct ljca_stub *stub; > + unsigned long flags; > + int ret; Uninitialized variable > + > + stub = ljca_stub_find(ljca->dev, ljca->type); > + if (IS_ERR(stub)) > + return PTR_ERR(stub); > + > + entry = kzalloc(sizeof(*entry), GFP_KERNEL); > + if (!entry) > + return -ENOMEM; > + > + entry->notify = event_cb; > + entry->context = context; > + entry->id = ljca->id; > + > + spin_lock_irqsave(&stub->event_cb_lock, flags); You are using GFP_KERNEL a few lines earlier. No need for irqsave > + > + list_for_each_entry(iter, &stub->event_entrys, list) { > + if (iter->id == ljca->id) { > + ret = -EBUSY; > + break; > + } > + } > + > + if (!ret) > + list_add_tail(&entry->list, &stub->event_entrys); > + > + spin_unlock_irqrestore(&stub->event_cb_lock, flags); > + > + if (ret) > + kfree(entry); > + > + return ret; > +} > +EXPORT_SYMBOL_NS_GPL(ljca_register_event_cb, LJCA); Regards Oliver