All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Jaegeuk Kim <jaegeuk@kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Avri Altman <avri.altman@wdc.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Can Guo <cang@codeaurora.org>,
	Asutosh Das <asutoshd@codeaurora.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Bean Huo <beanhuo@micron.com>,
	Kiwoong Kim <kwmad.kim@samsung.com>
Subject: [PATCH v2 03/19] scsi: ufs: Only include power management code if necessary
Date: Fri,  9 Jul 2021 13:26:22 -0700	[thread overview]
Message-ID: <20210709202638.9480-5-bvanassche@acm.org> (raw)
In-Reply-To: <20210709202638.9480-1-bvanassche@acm.org>

This patch slightly reduces the UFS driver size if built with power
management support disabled.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Can Guo <cang@codeaurora.org>
Cc: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufshcd.c | 8 ++++++++
 drivers/scsi/ufs/ufshcd.h | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a34aa6d486c7..37302a8b3937 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8736,6 +8736,7 @@ static void ufshcd_vreg_set_lpm(struct ufs_hba *hba)
 		usleep_range(5000, 5100);
 }
 
+#ifdef CONFIG_PM
 static int ufshcd_vreg_set_hpm(struct ufs_hba *hba)
 {
 	int ret = 0;
@@ -8763,6 +8764,7 @@ static int ufshcd_vreg_set_hpm(struct ufs_hba *hba)
 out:
 	return ret;
 }
+#endif /* CONFIG_PM */
 
 static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba)
 {
@@ -9165,6 +9167,7 @@ static int ufshcd_suspend(struct ufs_hba *hba)
 	return ret;
 }
 
+#ifdef CONFIG_PM
 /**
  * ufshcd_resume - helper function for resume operations
  * @hba: per adapter instance
@@ -9202,7 +9205,9 @@ static int ufshcd_resume(struct ufs_hba *hba)
 		ufshcd_update_evt_hist(hba, UFS_EVT_RESUME_ERR, (u32)ret);
 	return ret;
 }
+#endif /* CONFIG_PM */
 
+#ifdef CONFIG_PM_SLEEP
 /**
  * ufshcd_system_suspend - system suspend callback
  * @dev: Device associated with the UFS controller.
@@ -9258,7 +9263,9 @@ int ufshcd_system_resume(struct device *dev)
 	return ret;
 }
 EXPORT_SYMBOL(ufshcd_system_resume);
+#endif /* CONFIG_PM_SLEEP */
 
+#ifdef CONFIG_PM
 /**
  * ufshcd_runtime_suspend - runtime suspend callback
  * @dev: Device associated with the UFS controller.
@@ -9306,6 +9313,7 @@ int ufshcd_runtime_resume(struct device *dev)
 	return ret;
 }
 EXPORT_SYMBOL(ufshcd_runtime_resume);
+#endif /* CONFIG_PM */
 
 /**
  * ufshcd_shutdown - shutdown routine
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index dc75426c609f..79f6c261dfff 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -1009,10 +1009,14 @@ static inline u8 ufshcd_wb_get_query_index(struct ufs_hba *hba)
 	return 0;
 }
 
+#ifdef CONFIG_PM
 extern int ufshcd_runtime_suspend(struct device *dev);
 extern int ufshcd_runtime_resume(struct device *dev);
+#endif
+#ifdef CONFIG_PM_SLEEP
 extern int ufshcd_system_suspend(struct device *dev);
 extern int ufshcd_system_resume(struct device *dev);
+#endif
 extern int ufshcd_shutdown(struct ufs_hba *hba);
 extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
 				      int agreed_gear,

  parent reply	other threads:[~2021-07-09 20:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 20:26 [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 00/19] UFS patches for kernel v5.15 Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 01/19] scsi: Fix the documentation of the scsi_execute() time parameter Bart Van Assche
2021-07-10  8:17   ` Hannes Reinecke
2021-07-13  1:40   ` Martin K. Petersen
2021-07-09 20:26 ` [PATCH v2 02/19] scsi: ufs: Reduce power management code duplication Bart Van Assche
2021-07-14  9:24   ` Bean Huo
2021-07-09 20:26 ` Bart Van Assche [this message]
2021-07-14 20:38   ` [PATCH v2 03/19] scsi: ufs: Only include power management code if necessary Bean Huo
2021-07-09 20:26 ` [PATCH v2 04/19] scsi: ufs: Rename the second ufshcd_probe_hba() argument Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 05/19] scsi: ufs: Use DECLARE_COMPLETION_ONSTACK() where appropriate Bart Van Assche
2021-07-14 20:40   ` Bean Huo
2021-07-09 20:26 ` [PATCH v2 06/19] scsi: ufs: Remove ufshcd_valid_tag() Bart Van Assche
2021-07-14 21:10   ` Bean Huo
2021-07-09 20:26 ` [PATCH v2 07/19] scsi: ufs: Verify UIC locking requirements at runtime Bart Van Assche
2021-07-14 21:14   ` Bean Huo
2021-07-09 20:26 ` [PATCH v2 08/19] scsi: ufs: Improve static type checking for the host controller state Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 09/19] scsi: ufs: Remove several wmb() calls Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 10/19] scsi: ufs: Inline ufshcd_outstanding_req_clear() Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 11/19] scsi: ufs: Rename __ufshcd_transfer_req_compl() Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 12/19] scsi: ufs: Remove a local variable Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 13/19] scsi: ufs: Fix a race in the completion path Bart Van Assche
2021-07-11 12:29   ` Avri Altman
2021-07-11 12:37     ` Avri Altman
2021-07-13 16:49     ` Bart Van Assche
2021-07-13 23:26       ` Bart Van Assche
2021-07-16 12:39         ` Avri Altman
2021-07-16 16:26           ` Asutosh Das (asd)
2021-07-16 16:54             ` Bart Van Assche
2021-07-16 17:51               ` Bart Van Assche
2021-07-16 16:50           ` Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 14/19] scsi: ufs: Use the doorbell register instead of the UTRLCNR register Bart Van Assche
2021-07-16  8:59   ` Avri Altman
2021-07-09 20:26 ` [PATCH v2 15/19] scsi: ufs: Fix the SCSI abort handler Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 16/19] scsi: ufs: Request sense data asynchronously Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 17/19] scsi: ufs: Synchronize SCSI and UFS error handling Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 18/19] scsi: ufs: Retry aborted SCSI commands instead of completing these successfully Bart Van Assche
2021-07-09 20:26 ` [PATCH v2 19/19] scsi: ufs: Add fault injection support Bart Van Assche
2021-07-09 21:56   ` Randy Dunlap
2021-07-09 22:45     ` Bart Van Assche
2021-07-09 20:32 ` [PATCH] fault-inject: Declare the second argument of setup_fault_attr() const Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210709202638.9480-5-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=adrian.hunter@intel.com \
    --cc=akinobu.mita@gmail.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.