Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1414026pxv; Sat, 10 Jul 2021 03:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9Cnfep+hussnE4L9m2PtYRgyYd5fx0hGm6AKKm/D5lLSAt7Az/JaJgLJ0+CpvC4o0ttYF X-Received: by 2002:a05:6402:270f:: with SMTP id y15mr53120388edd.117.1625913571688; Sat, 10 Jul 2021 03:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625913571; cv=none; d=google.com; s=arc-20160816; b=YpPdDAtZYc+ZiLOuD/negz0d8roAOxydnEYaB28X9m0tJh/ee5cAVmeSB9J5L9w8Xq 8JAf6tImfocGS0HJAwQ3ywZQnSQ0tKnQ+uVYVVhOzloVoaxeoZTJlPrbhxEDazuKKqZE DXv3Urgw6bOsCBIyevsuoyYtsBsja5P6wRtiuJI6cG/R8YJmVZb6b0nLpN+WdtJ2T8et tJQjVYN0Pw7mAwuKAabCXzv8VRCIbtlxZanPtsbhs/so2cUoPByLk1vA9o9NFCRvu3YE d2v8HW3dC029XlN/dTiSrBP66sfx8uheBUPJqXtvlO8GvMHlBNRVv30QEW0DCsvgKod/ FXig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:message-id:date:subject:cc:to:from; bh=0+FTTclyYDgtRC9972CRfZ1cH0RdpbrdvoDa1wjZjiI=; b=TIdJohGTD/wQJY+akGS/nOINbSSOYd0rh6TTElu+hGXh/c1YcfJbApZPqNf4aYhiaY iJyH0sfHL/9CE+QY3HTzwpVcfy5qY3RlSwdVukQhUup4FCUcBbpA1icy565NFnafNFby pJ/Llh8Kr8LgE1bRewVFkK9j5ZfK+zVDyOFztpXIuDWJOe+MYFzA9hfi8CEcNIbMgFxv BugLFgnNAGSj75Kig3KwMyjXm+wslopuSJ0+c2I8cStENMuFAQawFXPgJ4NYWYakOACh og10UocvFcvvNXGsKMpJc6aZ8RIUDjOQEYmYtMEVSYYYsfAXgu7D/BEwvkYF6Io4kkvj agEw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si12671679ejc.454.2021.07.10.03.39.08; Sat, 10 Jul 2021 03:39:31 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232523AbhGJKk5 (ORCPT + 99 others); Sat, 10 Jul 2021 06:40:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:34009 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbhGJKk4 (ORCPT ); Sat, 10 Jul 2021 06:40:56 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10040"; a="209638432" X-IronPort-AV: E=Sophos;i="5.84,229,1620716400"; d="scan'208";a="209638432" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2021 03:38:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,229,1620716400"; d="scan'208";a="429090400" Received: from ahunter-desktop.fi.intel.com ([10.237.72.79]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2021 03:38:06 -0700 From: Adrian Hunter To: "Rafael J . Wysocki" Cc: Greg Kroah-Hartman , Saravana Kannan , "Martin K . Petersen" , "James E . J . Bottomley" , linux-scsi@vger.kernel.org, Avri Altman , Bean Huo , Can Guo , Asutosh Das , Bart Van Assche , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 0/3] driver core: Add ability to delete device links of unregistered devices Date: Sat, 10 Jul 2021 13:38:16 +0300 Message-Id: <20210710103819.12532-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi There is an issue with the SCSI UFS driver when the optional BOOT well-known LUN fails to probe, which is not a fatal error. The issue is that the device and its "managed" device link do not then get deleted. The device because the device link has a reference to it. The device link because it can only be deleted by device_del(), but device_add() was never called, so device_del() never will be either. Since V2, these patches fix the issue by amending device link removal to accept removal of a link with an unregistered consumer device, as suggested by Rafael. Changes in V3: driver core: Prevent warning when removing a device link from unregistered consumer New patch split from "driver core: Add ability to delete device links of unregistered devices" except first chunk from that patch dropped as unnecessary driver core: Add ability to delete device links of unregistered devices Move warning fix to separate patch. Changes in V2: Take approach suggested by Rafael Adrian Hunter (3): driver core: Prevent warning when removing a device link from unregistered consumer driver core: Add ability to delete device links of unregistered devices scsi: ufshcd: Fix device links when BOOT WLUN fails to probe drivers/base/core.c | 8 ++++++-- drivers/scsi/ufs/ufshcd.c | 23 +++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) Regards Adrian