Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4381646pxj; Wed, 12 May 2021 04:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg0m4/O+VeEndw3/cykoQs4ODxUFSHCAD8v0eOI7bRvuVUGK/I3giFt+ZkYIfXD/i/UMDv X-Received: by 2002:a02:9663:: with SMTP id c90mr31357408jai.76.1620819196884; Wed, 12 May 2021 04:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620819196; cv=none; d=google.com; s=arc-20160816; b=jZamjI6HFh8XFTfYzHa76dViTFZi6dWBR3tNXxP5b2syxdpZS2Kde9ZALhJtHwFYEt jRG6tPORBPGO3xuHsiW9VnHIk/RY6YqBn4Q/isma+yyuhvPrhE2mlOB3wcsEErRKFuBI kY4yrSo4COgpl0m/z1t7gurdqosvM9FcwnRkFrVzQyH6maBgV7foqOFlcUz0Ph1kWHWl psQsvOsaGfa5rqtLqrvzR3BZO9Xmr/DalL1KNb8C9IxLrO9YXfPeeJ6L28waKSvGsUWB OQKXQmH7hKsPMo36zW9zeL+BzUsjPxyqgOBbGi/QvEiGwNz5mnLyR7/2Frv/azXQlzMN CSxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=V2ju9+ojkSTDJQBwgSscuL9ZbQgrRBMumx4KhsSIeck=; b=IqJQAKFHtYS5NNtNoMH7DgrLhT2Jk4iRZR3dxT2D1TvUgTVIYCaFNts4vbZTlzXNeH xCNK5LQHRxnhEeabABI9VDR1vKQOY+C7HAodyPl89tgwzl4uvbtT8Dh2AyCIwmu50zJi PsSR7oN0gvSBsQQOY9CPlfMhY8dTD1aBmAv4tKgPIoIe8fSEWY+I3Sp/39FuH+S4SL7R 5rrMITFpAtrTNffWic8WcGTQ1GwfEKgq+dtHdjbS3SmTWWMsDzpvLKAjXkvRim8RiL5+ jhuePZKBQYA8gz0EXKsVRX7NpdDW3L32GoNa2cR29VCJb+Hf60c+lgjp5+Q99CQiOP9a hQvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si14374696jas.76.2021.05.12.04.33.03; Wed, 12 May 2021 04:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbhELLdl (ORCPT + 99 others); Wed, 12 May 2021 07:33:41 -0400 Received: from mail-ot1-f45.google.com ([209.85.210.45]:46661 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbhELLdl (ORCPT ); Wed, 12 May 2021 07:33:41 -0400 Received: by mail-ot1-f45.google.com with SMTP id d3-20020a9d29030000b029027e8019067fso20196989otb.13; Wed, 12 May 2021 04:32:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V2ju9+ojkSTDJQBwgSscuL9ZbQgrRBMumx4KhsSIeck=; b=TInRVi4W15pVDBlOpe+EgNUki8f56HFiiyOltwuhTFX1EP0vahzcuPF/j2a5Z94DqM I9S8s72p6FlF4YRm3M5lbS0pNqKIfHwcZeRKsTdbaOSWvFaqgWaMpeTtppYVX9gwemc2 kVeWgwWlb558aG71Q13cK2dWn8BUiqG4qVnKS/I/pRbQePrntsjwImcNaJkT7hDyY7L7 C8BVvHvWD+OV+smX5f75x+pqOH9QjWS9m1VgjdNO49bpxRxzJpSAKB1BTYkigN/PY6Xd S4UoxSrTB4h88l/c/1yRj1GeSmbPTtErpM4EPuS9q0QIJ7Lnu6fHUQeKvZ05181kYg4k 8hSw== X-Gm-Message-State: AOAM531+UIDUlGhkR4KZO7vwChPWItLBdahn6mAy+vyHaN1X4B39GFm2 68jZHwGJPaDqyuLaQDLZ1m15h2CQe7GJqEP+LnE= X-Received: by 2002:a9d:3bcb:: with SMTP id k69mr31357903otc.206.1620819152814; Wed, 12 May 2021 04:32:32 -0700 (PDT) MIME-Version: 1.0 References: <3c88cf35-6725-1bfa-9e1e-8e9d69147e3b@hisilicon.com> <2149723.iZASKD2KPV@kreacher> <20210512063542.3079-1-hdanton@sina.com> In-Reply-To: <20210512063542.3079-1-hdanton@sina.com> From: "Rafael J. Wysocki" Date: Wed, 12 May 2021 13:32:21 +0200 Message-ID: Subject: Re: Qestion about device link To: Hillf Danton Cc: "Rafael J. Wysocki" , Saravana Kannan , "Rafael J. Wysocki" , "chenxiang (M)" , "Rafael J. Wysocki" , John Garry , "scsi list : TARGET SUBSYSTEM" , linux-kernel , Linux PM , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 8:38 AM Hillf Danton wrote: > > On Tue, 11 May 2021 21:43:40 Rafael J. Wysocki wrote: > > > #ifdef CONFIG_SRCU > > > +static void __device_link_free_fn(struct work_struct *work) > > > +{ > > > + device_link_free(container_of(work, struct device_link, srcu.work)); > > > +} > > > + > > > static void __device_link_free_srcu(struct rcu_head *rhead) > > > { > > > - device_link_free(container_of(rhead, struct device_link, rcu_head)); > > > + struct device_link *link = container_of(rhead, struct device_link, > > > + srcu.rhead); > > > + struct work_struct *work = &link->srcu.work; > > > + > > > + /* > > > + * Because device_link_free() may sleep in some cases, schedule the > > > + * execution of it instead of invoking it directly. > > > + */ > > > + INIT_WORK(work, __device_link_free_fn); > > > + schedule_work(work); > > > } > > Nope, you need something like queue_work(system_unbound_wq, work); instead > because of the blocking wq callback. system_long_wq rather, as it really doesn't matter when it gets completed.