isci updates for 3.1
Subsystems (2)
cover isci updates for 3.1
James, please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git master
...to receive primarily a collection of fixes. The first two are tagged for -stable.
We still have ATAPI and SGPIO support in the works.
The SGPIO support is awaiting your response on the interface from libsas to the driver for locally attached sgpio operation [1]. I think we can solve the sysfs representation of these initiators at a later date. For now this just allows the driver to capture the smp sgpio request.
ATAPI support is not ready for prime time, but the initial implementation is available on the 'testing' branch [2], and we are aiming to get it finalized for 3.1.
[1]: http://marc.info/?l=linux-scsi&m=130876728404136&w=2
[2]: git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git testing
Dan Williams (5):
isci: fix sata response handling
isci: fix 32-bit operation when CONFIG_HIGHMEM64G=n
isci: dynamic interrupt coalescing
isci: fix event-get pointer increment
isci: add version number
Dave Jiang (2):
isci: Update MAINTAINERS entry for the isci driver
isci: Adding documentation to API change and fixup sysfs registration
Jeff Skirvin (1):
isci: Leave requests alone if already terminating.
Marcin Tomczak (1):
isci: change sas phy timeouts from 54us to 59us
Documentation/ABI/testing/sysfs-class-scsi_host | 13 ++++++ MAINTAINERS | 11 +++++ drivers/scsi/isci/host.c | 13 ++++++- drivers/scsi/isci/host.h | 3 + drivers/scsi/isci/init.c | 47 +++++++++++++--------- drivers/scsi/isci/phy.c | 13 ++++++ drivers/scsi/isci/registers.h | 12 ++++++ drivers/scsi/isci/request.c | 30 ++++++++------- drivers/scsi/isci/unsolicited_frame_control.c | 2 +- drivers/scsi/isci/unsolicited_frame_control.h | 2 +- 10 files changed, 110 insertions(+), 36 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-scsi_host
PATCH 1/9 isci: fix sata response handling
A bug (likely copy/paste) that has been carried from the original implementation. The unsolicited frame handling structure returns the d2h fis in the isci_request.stp.rsp buffer.
--- drivers/scsi/isci/request.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-)
drivers/scsi/isci/request.c +6 -12
@@ -2399,22 +2399,19 @@ static void isci_task_save_for_upper_layer_completion( } } -static void isci_request_process_stp_response (struct sas_task *task, -void *response_buffer) +static void isci_process_stp_response (struct sas_task *task,struct dev_to_host_fis *fis) { -struct dev_to_host_fis *d2h_reg_fis = response_buffer;struct task_status_struct *ts = &task->task_status;struct ata_task_resp *resp = (void *)&ts->buf[0 ]; - resp->frame_len =le16_to_cpu (*(__le16 *)(response_buffer +6 )); -memcpy (&resp->ending_fis[0 ], response_buffer +16 ,24 ); + resp->frame_len =sizeof (*fis); +memcpy (resp->ending_fis, fis,sizeof (*fis)); ts->buf_valid_size =sizeof (*resp); -/** -* If the device fault bit is set in the status register, then +/* If the device fault bit is set in the status register, then * set the sense data and return. */ -if (d2h_reg_fis->status &ATA_DF ) +if (fis->status &ATA_DF ) ts->stat =SAS_PROTO_RESPONSE ;else ts->stat =SAM_STAT_GOOD ;
@@ -2428,7 +2425,6 @@ static void isci_request_io_request_complete(struct isci_host *ihost, {struct sas_task *task =isci_request_access_task (request);struct ssp_response_iu *resp_iu; -void *resp_buf;unsigned long task_flags;struct isci_remote_device *idev =isci_lookup_device (task->dev);enum service_response response =SAS_TASK_UNDELIVERED ;
@@ -2565,9 +2561,7 @@ static void isci_request_io_request_complete(struct isci_host *ihost, task);if (sas_protocol_ata (task->task_proto)) { - resp_buf = &request->stp.rsp; -isci_request_process_stp_response (task, - resp_buf); +isci_process_stp_response (task, &request->stp.rsp); }else if (SAS_PROTOCOL_SSP == task->task_proto) {/* crack the iu response buffer. */
PATCH 2/9 isci: fix 32-bit operation when CONFIG_HIGHMEM64G=n
In reply to Dan WilliamsThe unsolicited frame control infrastructure requires a table of dma addresses for the hardware to lookup the frame buffer location by an index. The hardware expects the elements of this table to be 64-bit quantities, so we cannot reference these elements as dma_addr_t. All unsolicited frame protocols are affected, particularly SATA-PIO and SMP which prevented direct-attached SATA drives and expander-attached drives to not be discovered.
--- drivers/scsi/isci/unsolicited_frame_control.c | 2 +- drivers/scsi/isci/unsolicited_frame_control.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/isci/unsolicited_frame_control.c +1 -1
@@ -72,7 +72,7 @@ int sci_unsolicited_frame_control_construct(struct isci_host *ihost)*/ buf_len =SCU_MAX_UNSOLICITED_FRAMES *SCU_UNSOLICITED_FRAME_BUFFER_SIZE ; header_len =SCU_MAX_UNSOLICITED_FRAMES *sizeof (struct scu_unsolicited_frame_header ); - size = buf_len + header_len +SCU_MAX_UNSOLICITED_FRAMES *sizeof (dma_addr_t); + size = buf_len + header_len +SCU_MAX_UNSOLICITED_FRAMES *sizeof (uf_control->address_table.array[0 ]);/* * The Unsolicited Frame buffers are set at the start of the UF
drivers/scsi/isci/unsolicited_frame_control.h +1 -1
@@ -214,7 +214,7 @@ struct sci_uf_address_table_array {* starting address of the UF address table. * 64-bit pointers are required by the hardware. */ -dma_addr_t *array; +u64 *array;/** * This field specifies the physical address location for the UF
PATCH 3/9 isci: change sas phy timeouts from 54us to 59us
In reply to Dan WilliamsFrom: Marcin Tomczak <[email protected]>
Need the following workaround in the driver for interoperability with the older Intel SSD drives and any other SATA drive that may exhibit the same behavior. This is a corner case where SCU speed is limited to either 3G or 1.5G and the drive has a period of DC idle when it switches speed during SATA speed negotiation. Workaround :change PHYTOV[31:24] from 0x36 to 0x3B.
--- drivers/scsi/isci/phy.c | 13 +++++++++++++ drivers/scsi/isci/registers.h | 12 ++++++++++++ 2 files changed, 25 insertions(+), 0 deletions(-)
drivers/scsi/isci/phy.c +13 -0
@@ -104,6 +104,7 @@ sci_phy_link_layer_initialization(struct isci_phy *iphy,u32 parity_count =0 ;u32 llctl, link_rate;u32 clksm_value =0 ; +u32 sp_timeouts =0 ; iphy->link_layer_registers = reg;
@@ -211,6 +212,18 @@ sci_phy_link_layer_initialization(struct isci_phy *iphy, llctl |=SCU_SAS_LLCTL_GEN_VAL (MAX_LINK_RATE , link_rate);writel (llctl, &iphy->link_layer_registers->link_layer_control); + sp_timeouts =readl (&iphy->link_layer_registers->sas_phy_timeouts); + +/* Clear the default 0x36 (54us) RATE_CHANGE timeout value. */ + sp_timeouts &= ~SCU_SAS_PHYTOV_GEN_VAL (RATE_CHANGE ,0xFF ); + +/* Set RATE_CHANGE timeout value to 0x3B (59us). This ensures SCU can +* lock with 3Gb drive when SCU max rate is set to 1.5Gb. +*/ + sp_timeouts |=SCU_SAS_PHYTOV_GEN_VAL (RATE_CHANGE ,0x3B ); + +writel (sp_timeouts, &iphy->link_layer_registers->sas_phy_timeouts); +if (is_a2 (ihost->pdev)) {/* Program the max ARB time for the PHY to 700us so we inter-operate with * the PMC expander which shuts down PHYs if the expander PHY generates too
drivers/scsi/isci/registers.h +12 -0
@@ -1299,6 +1299,18 @@ struct scu_transport_layer_registers {#define SCU_AFE_XCVRCR_OFFSET 0x00DC#define SCU_AFE_LUTCR_OFFSET 0x00E0 +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_ALIGN_DETECTION_SHIFT (0UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_ALIGN_DETECTION_MASK (0x000000FFUL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_HOT_PLUG_SHIFT (8UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_HOT_PLUG_MASK (0x0000FF00UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_COMSAS_DETECTION_SHIFT (16UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_COMSAS_DETECTION_MASK (0x00FF0000UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_RATE_CHANGE_SHIFT (24UL) +#define SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_RATE_CHANGE_MASK (0xFF000000UL) + +#define SCU_SAS_PHYTOV_GEN_VAL (name, value) \ + SCU_GEN_VALUE(SCU_SAS_PHY_TIMER_TIMEOUT_VALUES_##name, value) +#define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_SHIFT (0)#define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_MASK (0x00000003)#define SCU_SAS_LINK_LAYER_CONTROL_MAX_LINK_RATE_GEN1 (0)
PATCH 4/9 isci: Update MAINTAINERS entry for the isci driver
In reply to Dan WilliamsFrom: Dave Jiang <[email protected]>
--- MAINTAINERS | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
MAINTAINERS +11 -0
@@ -3240,6 +3240,17 @@ F: Documentation/input/multi-touch-protocol.txt F: drivers/input/input-mt.c K: \b(ABS|SYN)_MT_ +INTEL C600 SERIES SAS CONTROLLER DRIVER +M: Intel SCU Linux support <[email protected]> +M: Dan Williams <[email protected]> +M: Dave Jiang <[email protected]> +M: Ed Nadolski <[email protected]> +L: [email protected] +T: git git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git +S: Maintained +F: drivers/scsi/isci/ +F: firmware/isci/ + INTEL IDLE DRIVER M: Len Brown <[email protected]> L: [email protected]
PATCH 5/9 isci: Adding documentation to API change and fixup sysfs registration
In reply to Dan WilliamsFrom: Dave Jiang <[email protected]>
Adding API update for adding isci_id entry scsi_host sysfs entry. Also fixing up the sysfs registration to the scsi_host template
--- Documentation/ABI/testing/sysfs-class-scsi_host | 13 ++++++++ drivers/scsi/isci/init.c | 36 ++++++++++++----------- 2 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-scsi_host
Documentation/ABI/testing/sysfs-class-scsi_host new file +13 -0
@@ -0,0 +1,13 @@ +What: /sys/class/scsi_host/hostX/isci_id +Date: June 2011 +Contact: Dave Jiang <[email protected]> +Description: + This file contains the enumerated host ID for the Intel + SCU controller. The Intel(R) C600 Series Chipset SATA/SAS + Storage Control Unit embeds up to two 4-port controllers in + a single PCI device. The controllers are enumerated in order + which usually means the lowest number scsi_host corresponds + with the first controller, but this association is not + guaranteed. The 'isci_id' attribute unambiguously identifies + the controller index: '0' for the first controller, + '1' for the second.
drivers/scsi/isci/init.c +18 -18
@@ -59,6 +59,7 @@#include <linux/firmware.h> #include <linux/efi.h> #include <asm/string.h> +#include <scsi/scsi_host.h> #include "isci.h" #include "task.h" #include "probe_roms.h"
@@ -113,6 +114,22 @@ unsigned char max_concurr_spinup = 1;module_param (max_concurr_spinup, byte,0 );MODULE_PARM_DESC (max_concurr_spinup,"Max concurrent device spinup" ); +static ssize_t isci_show_id (struct device *dev,struct device_attribute *attr,char *buf) +{ +struct Scsi_Host *shost =container_of (dev,typeof (*shost), shost_dev); +struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost); +struct isci_host *ihost =container_of (sas_ha,typeof (*ihost), sas_ha); + +return snprintf (buf,PAGE_SIZE ,"%d\n" , ihost->id); +} + +static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL); + +struct device_attribute *isci_host_attrs[] = { + &dev_attr_isci_id, +NULL +}; +static struct scsi_host_template isci_sht = { .module =THIS_MODULE ,
@@ -138,6 +155,7 @@ static struct scsi_host_template isci_sht = { .slave_alloc = sas_slave_alloc, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, + .shost_attrs = isci_host_attrs, };static struct sas_domain_function_template isci_transport_ops = {
@@ -232,17 +250,6 @@ static int isci_register_sas_ha(struct isci_host *isci_host)return 0 ; } -static ssize_t isci_show_id (struct device *dev,struct device_attribute *attr,char *buf) -{ -struct Scsi_Host *shost =container_of (dev,typeof (*shost), shost_dev); -struct sas_ha_struct *sas_ha =SHOST_TO_SAS_HA (shost); -struct isci_host *ihost =container_of (sas_ha,typeof (*ihost), sas_ha); - -return snprintf (buf,PAGE_SIZE ,"%d\n" , ihost->id); -} - -static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL); -static void isci_unregister (struct isci_host *isci_host) {struct Scsi_Host *shost;
@@ -251,7 +258,6 @@ static void isci_unregister(struct isci_host *isci_host)return ; shost = isci_host->shost; -device_remove_file (&shost->shost_dev, &dev_attr_isci_id);sas_unregister_ha (&isci_host->sas_ha);
@@ -415,14 +421,8 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)if (err) goto err_shost_remove; - err =device_create_file (&shost->shost_dev, &dev_attr_isci_id); -if (err) - goto err_unregister_ha; -return isci_host; - err_unregister_ha: -sas_unregister_ha (&(isci_host->sas_ha)); err_shost_remove:scsi_remove_host (shost); err_shost:
PATCH 6/9 isci: Leave requests alone if already terminating.
In reply to Dan WilliamsFrom: Jeff Skirvin <[email protected]>
Instead of immediately completing any request that has a second termination call made on it, wait for the TC done/abort HW event.
--- drivers/scsi/isci/request.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/scsi/isci/request.c +10 -2
@@ -732,12 +732,20 @@ sci_io_request_terminate(struct isci_request *ireq)sci_change_state (&ireq->sm,SCI_REQ_ABORTING );return SCI_SUCCESS ;case SCI_REQ_TASK_WAIT_TC_RESP : +/* The task frame was already confirmed to have been +* sent by the SCU HW. Since the state machine is +* now only waiting for the task response itself, +* abort the request and complete it immediately +* and don't wait for the task response. +*/ sci_change_state (&ireq->sm,SCI_REQ_ABORTING );sci_change_state (&ireq->sm,SCI_REQ_COMPLETED );return SCI_SUCCESS ;case SCI_REQ_ABORTING : -sci_change_state (&ireq->sm,SCI_REQ_COMPLETED ); -return SCI_SUCCESS ; +/* If a request has a termination requested twice, return +* a failure indication, since HW confirmation of the first +* abort is still outstanding. +*/ case SCI_REQ_COMPLETED :default : dev_warn(&ireq->owning_controller->pdev->dev,
PATCH 7/9 isci: dynamic interrupt coalescing
In reply to Dan WilliamsHardware allows both an outstanding number commands and a timeout value (whichever occurs first) as a gate to the next interrupt generation. This scheme at completion time looks at the remaining number of outstanding tasks and sets the timeout to maximize small transaction operation. If transactions are large (take more than a few 10s of microseconds to complete) then performance is not interrupt processing bound, so the small timeouts this scheme generates are overridden by the time it takes for a completion to arrive.
--- drivers/scsi/isci/host.c | 10 +++++++++- drivers/scsi/isci/host.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletions(-)
drivers/scsi/isci/host.c +9 -1
@@ -1091,6 +1091,7 @@ static void isci_host_completion_routine(unsigned long data)struct isci_request *request;struct isci_request *next_request;struct sas_task *task; +u16 active;INIT_LIST_HEAD (&completed_request_list);INIT_LIST_HEAD (&errored_request_list);
@@ -1181,6 +1182,13 @@ static void isci_host_completion_routine(unsigned long data) } } +/* the coalesence timeout doubles at each encoding step, so +* update it based on the ilog2 value of the outstanding requests +*/ + active =isci_tci_active (ihost); +writel (SMU_ICC_GEN_VAL (NUMBER , active) | +SMU_ICC_GEN_VAL (TIMER ,ISCI_COALESCE_BASE +ilog2 (active)), + &ihost->smu_registers->interrupt_coalesce_control); }/**
@@ -1471,7 +1479,7 @@ static void sci_controller_ready_state_enter(struct sci_base_state_machine *sm)struct isci_host *ihost =container_of (sm,typeof (*ihost), sm);/* set the default interrupt coalescence number and timeout value. */ -sci_controller_set_interrupt_coalescence (ihost,0x10 ,250 ); +sci_controller_set_interrupt_coalescence (ihost,0 ,0 ); }static void sci_controller_ready_state_exit (struct sci_base_state_machine *sm)
drivers/scsi/isci/host.h +3 -0
@@ -369,6 +369,9 @@ static inline struct isci_host *dev_to_ihost(struct domain_device *dev)#define ISCI_TAG_SEQ (tag) (((tag) >> 12) & (SCI_MAX_SEQ-1))#define ISCI_TAG_TCI (tag) ((tag) & (SCI_MAX_IO_REQUESTS-1)) +/* interrupt coalescing baseline: 9 == 3 to 5us interrupt delay per command */ +#define ISCI_COALESCE_BASE 9 +/* expander attached sata devices require 3 rnc slots */ static inline int sci_remote_device_node_count (struct isci_remote_device *idev) {
PATCH 8/9 isci: fix event-get pointer increment
In reply to Dan WilliamsHardware only increments the put pointer on event types >= 4. Do not increment the get pointer for event type 3.
--- drivers/scsi/isci/host.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/scsi/isci/host.c +3 -0
@@ -531,6 +531,9 @@ static void sci_controller_process_completions(struct isci_host *ihost)break ;case SCU_COMPLETION_TYPE_EVENT : +sci_controller_event_completion (ihost, ent); +break ; +case SCU_COMPLETION_TYPE_NOTIFY : { event_cycle ^= ((event_get+1 ) &SCU_MAX_EVENTS ) << (SMU_COMPLETION_QUEUE_GET_EVENT_CYCLE_BIT_SHIFT -SCU_MAX_EVENTS_SHIFT );
PATCH 9/9 isci: add version number
In reply to Dan Williams--- drivers/scsi/isci/init.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
drivers/scsi/isci/init.c +10 -1
@@ -64,6 +64,14 @@#include "task.h" #include "probe_roms.h" +#define MAJ 1 +#define MIN 0 +#define BUILD 0 +#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ + __stringify(BUILD) + +MODULE_VERSION (DRV_VERSION ); +static struct scsi_transport_template *isci_transport_template;static DEFINE_PCI_DEVICE_TABLE (isci_id_table) = {
@@ -540,7 +548,8 @@ static __init int isci_init(void) {int err; -pr_info ("%s: Intel(R) C600 SAS Controller Driver\n" ,DRV_NAME ); +pr_info ("%s: Intel(R) C600 SAS Controller Driver - version %s\n" , +DRV_NAME ,DRV_VERSION ); isci_transport_template =sas_domain_attach_transport (&isci_transport_ops);if (!isci_transport_template)
Re: [PATCH 9/9] isci: add version number
drivers/scsi/isci/init.c static __init int isci_init(void) · line 552
Quoted 7 lines · On Jul 29 Dan Williams wrote:
drivers/scsi/isci/init.c +2
-1@@ -540,7 +548,8 @@ static __init int isci_init(void) {int err; -pr_info ("%s: Intel(R) C600 SAS Controller Driver\n" ,DRV_NAME ); +pr_info ("%s: Intel(R) C600 SAS Controller Driver - version %s\n" , +DRV_NAME ,DRV_VERSION );
Why? There is already a version number. Like 2.6.39, 3.0, 3.1.
Besides, just
- pr_info("%s: Intel(R) C600 SAS Controller Driver\n", DRV_NAME);
would be the most correct thing to do here.
Signature · 3 lines
Stefan Richter -=====-==-== -=== ====- http://arcgraph.de/sr/
Re: [PATCH 9/9] isci: add version number
Quoted 10 lines · Stefan Richter
drivers/scsi/isci/init.c static __init int isci_init(void) · line 552
Quoted 7 lines · On Jul 29 Dan Williams wrote:
drivers/scsi/isci/init.c +2
-1@@ -540,7 +548,8 @@ static __init int isci_init(void) { int err; - pr_info("%s: Intel(R) C600 SAS Controller Driver\n", DRV_NAME); + pr_info("%s: Intel(R) C600 SAS Controller Driver - version %s\n", + DRV_NAME, DRV_VERSION);Why? There is already a version number. Like 2.6.39, 3.0, 3.1.
This is for tracking driver versions across distributions and driver update packages as they sync with upstream on different cadences. --
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 9/9] isci: add version number
Quoted 7 lines · On Aug 01 Dan Williams wrote:
Quoted 5 lines · Stefan Richter
Quoted 4 lines · On Jul 29 Dan Williams wrote:
drivers/scsi/isci/init.c +0
-0@@ -540,7 +548,8 @@ static __init int isci_init(void) { int err;
Quoted 8 lines
Quoted 5 lines
drivers/scsi/isci/init.c static __init int isci_init(void) · line 552
Quoted 3 lines
drivers/scsi/isci/init.c +2
-1- pr_info("%s: Intel(R) C600 SAS Controller Driver\n", DRV_NAME); + pr_info("%s: Intel(R) C600 SAS Controller Driver - version %s\n", + DRV_NAME, DRV_VERSION);Why? There is already a version number. Like 2.6.39, 3.0, 3.1.
This is for tracking driver versions across distributions and driver update packages as they sync with upstream on different cadences.
If they "synced with upstream", they had just the kernel version number. You mean they "backport new drivers from current upstream into their branch with an old core".
The mainline doesn't generally carry stubs and macros that are only there for backporting. Well, I guess SCSI drivers are different in that regard.
Signature · 7 lines
Stefan Richter -=====-==-== =--- ----= http://arcgraph.de/sr/ -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
James Bottomley
maintainerRe: [PATCH 9/9] isci: add version number
Quoted 14 lines · Stefan Richter
Quoted 13 lines · On Aug 01 Dan Williams wrote:
Quoted 10 lines · Stefan Richter
drivers/scsi/isci/init.c static __init int isci_init(void) · line 552
Quoted 7 lines · On Jul 29 Dan Williams wrote:
drivers/scsi/isci/init.c +2
-1@@ -540,7 +548,8 @@ static __init int isci_init(void) {int err; -pr_info ("%s: Intel(R) C600 SAS Controller Driver\n" ,DRV_NAME ); +pr_info ("%s: Intel(R) C600 SAS Controller Driver - version %s\n" , +DRV_NAME ,DRV_VERSION );Why? There is already a version number. Like 2.6.39, 3.0, 3.1.
Quoted 6 lines
Quoted 2 lines
This is for tracking driver versions across distributions and driver update packages as they sync with upstream on different cadences.
If they "synced with upstream", they had just the kernel version number. You mean they "backport new drivers from current upstream into their branch with an old core".
This isn't good enough for distros, who often pretend to be on one kernel version yet have the driver backported from another.
Quoted 2 lines
The mainline doesn't generally carry stubs and macros that are only there for backporting. Well, I guess SCSI drivers are different in that regard.
This is hardly a stub for a backport. It's a printk printing the version. At least 25% of drivers seem to do this (not that I entirely approve ... it does tend to clutter the boot sequence a bit)
The whole reason for MODULE_VERSION() is to mark this correctly.
James
Re: [PATCH 9/9] isci: add version number
Quoted 6 lines · On Aug 01 James Bottomley wrote:
Quoted 2 lines · Stefan Richter
The mainline doesn't generally carry stubs and macros that are only there for backporting. Well, I guess SCSI drivers are different in that regard.
This is hardly a stub for a backport. It's a printk printing the version.
It is a printk printing a version that is only of interest in conjuction with backports. And even in that context a "major.minor.build" naming scheme for a device driver is quite naive. For example, a backport of a driver which directly or indirectly uses the workqueue infrastructure back into a kernel from before concurrency managed workqueues will behave quite differently, regardless what its local version numbers say.
Quoted 2 lines
At least 25% of drivers seem to do this (not that I entirely approve ... it does tend to clutter the boot sequence a bit)
25% of SCSI drivers perhaps (surely more than that if we consider only SCSI drivers). My random sample of 46 loaded modules on a desktop PC contains 3 drivers whose modinfo | grep -E '^version' is nonempty (pata_atiixp, sg, r8169).
However, what 25% or 85% of all drivers do is not quite relevant to a new driver.
Quoted 1 line
The whole reason for
MODULE_VERSION()is to mark this correctly.
If you (the author, the subsystem maintainer) prefer to have a driver version, consider to omit the driver init()'s printk at least. It is redundant with lsmod, modinfo, or /sys/module/*{,/version}.
Signature · 3 lines
Stefan Richter -=====-==-== =--- ----= http://arcgraph.de/sr/
Re: [PATCH 9/9] isci: add version number
Quoted 3 lines · On Aug 01 Stefan Richter wrote:
My random sample of 46 loaded modules on a desktop PC contains 3 drivers whose modinfo | grep -E '^version' is nonempty (
pata_atiixp, sg, r8169).
With compiled-in drivers: 6 out of 77 feature a /sys/module/*/version (ahci, libata, pata_atiixp, r8169, sg, tcp_cubic; calling themselves 3.0, 3.00, 0.4.6, 2.3LK-NAPI, 3.5.34, 2.3 although they are all at version 3.0).
Signature · 3 lines
Stefan Richter -=====-==-== =--- ----= http://arcgraph.de/sr/