linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: James Bottomley <jejb@linux.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	Michael Schmitz <schmitzmic@gmail.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Christoph Hellwig <hch@lst.de>,
	linux-ide@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
	linux-kernel@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v4 03/27] ata: make SATA_PMP option selectable only if any SATA host driver is enabled
Date: Thu, 19 Mar 2020 17:15:07 +0100	[thread overview]
Message-ID: <8b77928f-5985-046c-f760-b50625dbeeb4@samsung.com> (raw)
In-Reply-To: <1584456957.4545.7.camel@linux.ibm.com>


On 3/17/20 3:55 PM, James Bottomley wrote:
> On Tue, 2020-03-17 at 15:43 +0100, Bartlomiej Zolnierkiewicz wrote:
>> There is no reason to expose SATA_PMP config option when no SATA
>> host drivers are enabled. To fix it add SATA_HOST config option,
>> make all SATA host drivers select it and finally make SATA_PMP
>> config options depend on it.
>>
>> This also serves as preparation for the future changes which
>> optimize libata core code size on PATA only setups.
>>
>> CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
>> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # for
>> SCSI bits
>> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>> ---
>>  drivers/ata/Kconfig         | 40
>> +++++++++++++++++++++++++++++++++++++
>>  drivers/scsi/Kconfig        |  1 +
>>  drivers/scsi/libsas/Kconfig |  1 +
>>  3 files changed, 42 insertions(+)
>>
>> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
>> index a6beb2c5a692..ad7760656f71 100644
>> --- a/drivers/ata/Kconfig
>> +++ b/drivers/ata/Kconfig
>> @@ -34,6 +34,9 @@ if ATA
>>  config ATA_NONSTANDARD
>>         bool
>>  
>> +config SATA_HOST
>> +	bool
>> +
>>  config ATA_VERBOSE_ERROR
>>  	bool "Verbose ATA error reporting"
>>  	default y
>> @@ -73,6 +76,7 @@ config SATA_ZPODD
>>  
>>  config SATA_PMP
>>  	bool "SATA Port Multiplier support"
>> +	depends on SATA_HOST
>>  	default y
>>  	help
>>  	  This option adds support for SATA Port Multipliers
>> @@ -85,6 +89,7 @@ comment "Controllers with non-SFF native interface"
>>  config SATA_AHCI
>>  	tristate "AHCI SATA support"
>>  	depends on PCI
>> +	select SATA_HOST
>>  	help
>>  	  This option enables support for AHCI Serial ATA.
> 
> This is a bit fragile and not the way Kconfig should be done.  The
> fragility comes because anyone adding a new host has also to remember
> to add the select, and there will be no real consequences for not doing

People adding the new host driver usually look at the existing Kconfig
entries before introducing the new one (most probably just copy and then
modify existing entry) so they should notice that the existing entries
contain the select.

Also we shouldn't have problem in catching potential select omissions
during the code review.

Not to mention that the addition of the new ATA host driver is quite
a rare event nowadays.. ;)

> so.  The way to get rid of the fragility is to make SATA_HOST a
> menuconfig option enclosing all the hosts, which makes the patch much
> smaller as well.  The hint implies you want to separate out all the
> PATA drivers, which also makes a menuconfig sound like the better
> option.
SATA_HOST is not for grouping SATA hosts, it is for core libata
code to enable SATA support (please see patches #13-26 for details,
maybe it should have been named ATA_SATA?) and menuconfig usage in
this case is problematic:

- we have host drivers supporting both SATA and PATA (i.e. ata_piix)

- we have currently host drivers sorted in Kconfig by different 
  criteria than SATA or PATA support

- I would prefer to avoid making users to have explicitly select
  SATA_HOST option (right now it gets auto-selected when needed)

- SCSI_SAS_ATA (which also needs to select SATA_HOST) lives in
  drivers/scsi/libsas/Kconfig so menuconfig will not cover it

> I've also got to say that the problem doesn't seem to be one ... even
> if some raving lunatic disables all SATA hosts and then enables PMP it
> doesn't cause any problems does it?

It doesn't cause any real problems (just some dead code being present
in the kernel image) but this patch is a prerequisite for patches #13-26
(patch description mentions that this change is needed for the future
changes which optimize libata core code size on PATA only setups).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

  reply	other threads:[~2020-03-19 16:15 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200317144340eucas1p1f6f7a6fbd27cbfeaab2ea97fbccb2836@eucas1p1.samsung.com>
2020-03-17 14:43 ` [PATCH v4 00/27] ata: optimize core code size on PATA only setups Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144341eucas1p2f76d3656e5d787e000b25da8f0d3b7c2@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 01/27] ata: remove stale maintainership information from core code Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144341eucas1p1b9caa7264b35b23e78fcaeb78d865255@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 02/27] ata: expose ncq_enable_prio sysfs attribute only on NCQ capable hosts Bartlomiej Zolnierkiewicz
2020-03-26  9:45       ` Christoph Hellwig
     [not found]   ` <CGME20200317144342eucas1p2d73deadcdb4cee860dd610f9f8e26bda@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 03/27] ata: make SATA_PMP option selectable only if any SATA host driver is enabled Bartlomiej Zolnierkiewicz
2020-03-17 14:55       ` James Bottomley
2020-03-19 16:15         ` Bartlomiej Zolnierkiewicz [this message]
2020-03-26  9:46       ` Christoph Hellwig
     [not found]   ` <CGME20200317144342eucas1p2fd5c2e6ff69f8e10496d0468f01f5601@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 04/27] sata_promise: use ata_cable_sata() Bartlomiej Zolnierkiewicz
2020-03-26  9:46       ` Christoph Hellwig
     [not found]   ` <CGME20200317144343eucas1p2aeb55b3deca6702b7c7128fe7775b708@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 05/27] ata: simplify ata_scsiop_inq_89() Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144343eucas1p2eb0fa17c0130d3be0b994110979e6a87@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 06/27] ata: use COMMAND_LINE_SIZE for ata_force_param_buf[] size Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144344eucas1p12dbd070e54e16a364b58b1c591216ebd@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 07/27] ata: optimize struct ata_force_param size Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144345eucas1p1e67d48caa8629fedb301e776e34dc0c1@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 08/27] ata: optimize ata_scsi_rbuf[] size Bartlomiej Zolnierkiewicz
2020-03-26  9:48       ` Christoph Hellwig
     [not found]   ` <CGME20200317144345eucas1p209f6a96605af02cc451786051ebab395@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 09/27] ata: move EXPORT_SYMBOL_GPL()s close to exported code Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144346eucas1p2d1e330410bd3482ce01c98db40d5612b@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 10/27] ata: remove EXPORT_SYMBOL_GPL()s not used by modules Bartlomiej Zolnierkiewicz
     [not found]   ` <CGME20200317144346eucas1p201a88e2eb094f1a246d0eb541541131f@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 11/27] ata: fix CodingStyle issues in PATA timings code Bartlomiej Zolnierkiewicz
2020-03-26  9:49       ` Christoph Hellwig
     [not found]   ` <CGME20200317144347eucas1p103561521def960afc46a2531076e18df@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 12/27] ata: separate PATA timings code from libata-core.c Bartlomiej Zolnierkiewicz
2020-03-26  9:49       ` Christoph Hellwig
     [not found]   ` <CGME20200317144347eucas1p293ab462ec3d4990f380f9d652195cdb4@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 13/27] ata: add CONFIG_SATA_HOST=n version of ata_ncq_enabled() Bartlomiej Zolnierkiewicz
2020-03-26  9:50       ` Christoph Hellwig
     [not found]   ` <CGME20200317144348eucas1p14ad861316b19edaf885a52f9beb5dd2a@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 14/27] ata: let compiler optimize out ata_dev_config_ncq() on non-SATA hosts Bartlomiej Zolnierkiewicz
2020-03-26  9:50       ` Christoph Hellwig
     [not found]   ` <CGME20200317144348eucas1p2cce1c6e1ce8bafc0e68dec04655f1932@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 15/27] ata: let compiler optimize out ata_eh_set_lpm() " Bartlomiej Zolnierkiewicz
2020-03-26  9:50       ` Christoph Hellwig
     [not found]   ` <CGME20200317144349eucas1p1921dee3dcd097f695ba708c54325f226@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 16/27] ata: start separating SATA specific code from libata-core.c Bartlomiej Zolnierkiewicz
2020-03-26  9:51       ` Christoph Hellwig
     [not found]   ` <CGME20200317144349eucas1p1a2e79758cbdf36c747c8a82cd4ddbd74@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 17/27] ata: move sata_scr_*() to libata-sata.c Bartlomiej Zolnierkiewicz
2020-03-26  9:52       ` Christoph Hellwig
     [not found]   ` <CGME20200317144350eucas1p2caf23e8366434ef2c9954cd4d52f30f1@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 18/27] ata: move *sata_set_spd*() " Bartlomiej Zolnierkiewicz
2020-03-26  9:52       ` Christoph Hellwig
     [not found]   ` <CGME20200317144350eucas1p2270ca7a1757769b238be42c2811172a1@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 19/27] ata: move sata_link_{debounce,resume}() " Bartlomiej Zolnierkiewicz
2020-03-26  9:55       ` Christoph Hellwig
     [not found]   ` <CGME20200317144350eucas1p157dd88ee3f766ec4fd209172635369aa@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 20/27] ata: move sata_link_hardreset() " Bartlomiej Zolnierkiewicz
2020-03-26  9:57       ` Christoph Hellwig
     [not found]   ` <CGME20200317144351eucas1p1d8d18236e6729d0bf21737a4296f56d7@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 21/27] ata: move ata_qc_complete_multiple() " Bartlomiej Zolnierkiewicz
2020-03-26  9:57       ` Christoph Hellwig
     [not found]   ` <CGME20200317144351eucas1p2020714aa775f0ab3aaea870d25f7fb92@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 22/27] ata: move sata_deb_timing_*() " Bartlomiej Zolnierkiewicz
2020-03-26  9:58       ` Christoph Hellwig
     [not found]   ` <CGME20200317144352eucas1p1ddb279cb52e2ae6f5189878912581162@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 23/27] ata: start separating SATA specific code from libata-scsi.c Bartlomiej Zolnierkiewicz
2020-03-26  9:59       ` Christoph Hellwig
     [not found]   ` <CGME20200317144353eucas1p163ca190ee937e771b4a583408500070a@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 24/27] ata: move ata_sas_*() to libata-sata.c Bartlomiej Zolnierkiewicz
2020-03-26 10:00       ` Christoph Hellwig
     [not found]   ` <CGME20200317144353eucas1p22a8a5d4a9c920db90387720159a26c90@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 25/27] ata: start separating SATA specific code from libata-eh.c Bartlomiej Zolnierkiewicz
2020-03-26 10:00       ` Christoph Hellwig
     [not found]   ` <CGME20200317144353eucas1p120a8f1a0fa5c293ada61b8d06f7aa9ec@eucas1p1.samsung.com>
2020-03-17 14:43     ` [PATCH v4 26/27] ata: move ata_eh_analyze_ncq_error() & co. to libata-sata.c Bartlomiej Zolnierkiewicz
2020-03-26 10:00       ` Christoph Hellwig
     [not found]   ` <CGME20200317144354eucas1p250e3fc557c00a80eda42b3332984f078@eucas1p2.samsung.com>
2020-03-17 14:43     ` [PATCH v4 27/27] ata: make "libata.force" kernel parameter optional Bartlomiej Zolnierkiewicz
2020-03-26 10:01       ` Christoph Hellwig
2020-03-26 15:16   ` [PATCH v4 00/27] ata: optimize core code size on PATA only setups Jens Axboe
2020-03-26 16:17     ` Bartlomiej Zolnierkiewicz

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=8b77928f-5985-046c-f760-b50625dbeeb4@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=geert@linux-m68k.org \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=martin.petersen@oracle.com \
    --cc=schmitzmic@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).